@expo/ui 1.0.0-canary-20250305-0af9ad2 → 1.0.0-canary-20250320-7a205d3

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 (53) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +4 -0
  3. package/android/src/main/java/expo/modules/ui/PickerView.kt +3 -0
  4. package/android/src/main/java/expo/modules/ui/TextInputView.kt +75 -0
  5. package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +7 -3
  6. package/build/components/BottomSheet/index.d.ts +9 -0
  7. package/build/components/BottomSheet/index.d.ts.map +1 -0
  8. package/build/components/BottomSheet/index.ios.d.ts +11 -0
  9. package/build/components/BottomSheet/index.ios.d.ts.map +1 -0
  10. package/build/components/Button/index.d.ts +25 -8
  11. package/build/components/Button/index.d.ts.map +1 -1
  12. package/build/components/ContextMenu/index.android.d.ts +23 -0
  13. package/build/components/ContextMenu/index.android.d.ts.map +1 -0
  14. package/build/components/ContextMenu/index.d.ts +62 -19
  15. package/build/components/ContextMenu/index.d.ts.map +1 -1
  16. package/build/components/DatePicker/index.d.ts +8 -9
  17. package/build/components/DatePicker/index.d.ts.map +1 -1
  18. package/build/components/Picker/index.d.ts +30 -19
  19. package/build/components/Picker/index.d.ts.map +1 -1
  20. package/build/components/Progress/index.d.ts +1 -1
  21. package/build/components/Section/index.d.ts +6 -1
  22. package/build/components/Section/index.d.ts.map +1 -1
  23. package/build/components/Slider/index.d.ts +18 -10
  24. package/build/components/Slider/index.d.ts.map +1 -1
  25. package/build/components/Switch/index.d.ts +18 -36
  26. package/build/components/Switch/index.d.ts.map +1 -1
  27. package/build/components/TextInput/index.d.ts +25 -2
  28. package/build/components/TextInput/index.d.ts.map +1 -1
  29. package/build/src/types.d.ts +13 -0
  30. package/build/src/types.d.ts.map +1 -0
  31. package/components/BottomSheet/index.ios.tsx +34 -0
  32. package/components/BottomSheet/index.tsx +12 -0
  33. package/components/Button/index.tsx +26 -8
  34. package/components/ContextMenu/index.android.tsx +72 -0
  35. package/components/ContextMenu/index.tsx +73 -30
  36. package/components/DatePicker/index.tsx +7 -8
  37. package/components/Picker/index.tsx +32 -19
  38. package/components/Progress/index.tsx +1 -1
  39. package/components/Section/index.tsx +6 -1
  40. package/components/Slider/index.tsx +19 -10
  41. package/components/Switch/index.tsx +37 -54
  42. package/components/TextInput/index.tsx +31 -4
  43. package/ios/BottomSheetView.swift +82 -0
  44. package/ios/ContextMenu/ContextMenu.swift +65 -2
  45. package/ios/ContextMenu/ContextMenuRecords.swift +6 -0
  46. package/ios/ExpoUIModule.swift +3 -0
  47. package/ios/PickerView.swift +32 -27
  48. package/package.json +3 -6
  49. package/src/types.ts +16 -0
  50. package/tsconfig.json +1 -1
  51. package/build/src/index.d.ts +0 -13
  52. package/build/src/index.d.ts.map +0 -1
  53. package/src/index.ts +0 -22
package/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@
8
8
 
9
9
  ### 🎉 New features
10
10
 
11
+ - [iOS] Add bottom sheet. ([#35455](https://github.com/expo/expo/pull/35455) by [@aleqsio](https://github.com/aleqsio))
12
+ - [iOS] Add support for `pallete` and `inline` pickers. ([#35435](https://github.com/expo/expo/pull/35435) by [@aleqsio](https://github.com/aleqsio))
13
+ - Add TextInput for Android. ([#35228](https://github.com/expo/expo/pull/35228) by [@aleqsio](https://github.com/aleqsio))
14
+ - Add context menu previews. ([#35369](https://github.com/expo/expo/pull/35369) by [@aleqsio](https://github.com/aleqsio)).
11
15
  - Add TextInput for iOS. ([#35098](https://github.com/expo/expo/pull/35098) by [@aleqsio](https://github.com/aleqsio))
12
16
  - Add `disabled` button prop. ([#35115](https://github.com/expo/expo/pull/35115) by [@andrew-levy](https://github.com/andrew-levy))
13
17
  - Add Radio option to Picker Component for Android. ([#34629](https://github.com/expo/expo/pull/34629)) by [@benjaminkomen](https://github.com/benjaminkomen)
@@ -24,6 +28,7 @@
24
28
 
25
29
  - Drop section polyfill for Android ([#35305](https://github.com/expo/expo/pull/35305) by [@aleqsio](https://github.com/aleqsio))
26
30
  - Standardize platform key ordering in `expo-module.config.json`. ([#35003](https://github.com/expo/expo/pull/35003) by [@reichhartd](https://github.com/reichhartd))
31
+ - Dismiss context menu when a menu item is tapped on Android ([#35365](https://github.com/expo/expo/pull/35365) by [@fobos531](https://github.com/fobos531))
27
32
 
28
33
  ## 0.0.2 — 2025-02-11
29
34
 
@@ -45,6 +50,7 @@
45
50
 
46
51
  ### 💡 Others
47
52
 
53
+ - Add docs ([#34808](https://github.com/expo/expo/pull/34808) by [@aleqsio](https://github.com/aleqsio))
48
54
  - [apple] Migrate remaining `expo-module.config.json` to unified platform syntax. ([#34445](https://github.com/expo/expo/pull/34445) by [@reichhartd](https://github.com/reichhartd))
49
55
  - Rename the events for the `Switch` component. ([#34577](https://github.com/expo/expo/pull/34577) by [@behenate](https://github.com/behenate))
50
56
 
@@ -40,5 +40,9 @@ class ExpoUIModule : Module() {
40
40
  }
41
41
 
42
42
  View(ProgressView::class)
43
+
44
+ View(TextInputView::class) {
45
+ Events("onValueChanged")
46
+ }
43
47
  }
44
48
  }
@@ -161,6 +161,9 @@ class PickerView(context: Context, appContext: AppContext) : ExpoComposeView<Pic
161
161
  SegmentedComposable()
162
162
  } else if (variant == "radio") {
163
163
  RadioComposable()
164
+ } else {
165
+ // Default to segmented picker
166
+ SegmentedComposable()
164
167
  }
165
168
  }
166
169
  }
@@ -0,0 +1,75 @@
1
+ package expo.modules.ui
2
+
3
+ import android.content.Context
4
+ import androidx.compose.foundation.text.KeyboardOptions
5
+
6
+ import expo.modules.kotlin.viewevent.EventDispatcher
7
+ import expo.modules.kotlin.views.ExpoComposeView
8
+
9
+ import androidx.compose.material3.Text
10
+ import androidx.compose.material3.TextField
11
+ import androidx.compose.runtime.MutableState
12
+ import androidx.compose.runtime.mutableStateOf
13
+
14
+ import expo.modules.kotlin.AppContext
15
+ import expo.modules.kotlin.views.ComposeProps
16
+
17
+ import androidx.compose.runtime.getValue
18
+ import androidx.compose.runtime.remember
19
+ import androidx.compose.runtime.setValue
20
+ import androidx.compose.ui.text.input.KeyboardType
21
+ import expo.modules.kotlin.views.AutoSizingComposable
22
+ import expo.modules.kotlin.views.Direction
23
+ import java.util.EnumSet
24
+
25
+
26
+ data class TextInputProps(
27
+ val defaultValue: MutableState<String> = mutableStateOf(""),
28
+ val placeholder: MutableState<String> = mutableStateOf(""),
29
+ val multiline: MutableState<Boolean> = mutableStateOf(false),
30
+ val numberOfLines: MutableState<Int?> = mutableStateOf(null),
31
+ val keyboardType: MutableState<String> = mutableStateOf("default"),
32
+ val autocorrection: MutableState<Boolean> = mutableStateOf(true),
33
+ ) : ComposeProps
34
+
35
+ fun String.keyboardType(): KeyboardType {
36
+ return when (this) {
37
+ "default" -> KeyboardType.Text
38
+ "numeric" -> KeyboardType.Number
39
+ "email-address" -> KeyboardType.Email
40
+ "phone-pad" -> KeyboardType.Phone
41
+ "decimal-pad" -> KeyboardType.Decimal
42
+ "password" -> KeyboardType.Password
43
+ "ascii-capable" -> KeyboardType.Ascii
44
+ "url" -> KeyboardType.Uri
45
+ "number-password" -> KeyboardType.NumberPassword
46
+ else -> KeyboardType.Text
47
+ }
48
+ }
49
+
50
+ class TextInputView(context: Context, appContext: AppContext) : ExpoComposeView<TextInputProps>(context, appContext) {
51
+ override val props = TextInputProps()
52
+ private val onValueChanged by EventDispatcher()
53
+
54
+ init {
55
+ setContent {
56
+ var value by remember { props.defaultValue }
57
+ AutoSizingComposable(shadowNodeProxy, axis = EnumSet.of(Direction.VERTICAL)) {
58
+ TextField(
59
+ value = value,
60
+ onValueChange = {
61
+ value = it
62
+ onValueChanged(mapOf("value" to it))
63
+ },
64
+ placeholder = { Text(props.placeholder.value) },
65
+ maxLines = if (props.multiline.value) props.numberOfLines.value ?: Int.MAX_VALUE else 1,
66
+ singleLine = !props.multiline.value,
67
+ keyboardOptions = KeyboardOptions.Default.copy(
68
+ keyboardType = props.keyboardType.value.keyboardType(),
69
+ autoCorrectEnabled = props.autocorrection.value,
70
+ ),
71
+ )
72
+ }
73
+ }
74
+ }
75
+ }
@@ -20,6 +20,7 @@ import expo.modules.kotlin.views.ExpoComposeView
20
20
  import androidx.compose.material3.Text
21
21
  import androidx.compose.runtime.Composable
22
22
  import androidx.compose.runtime.getValue
23
+ import androidx.compose.runtime.MutableState
23
24
  import androidx.compose.runtime.mutableStateOf
24
25
  import androidx.compose.runtime.remember
25
26
  import androidx.compose.ui.unit.dp
@@ -47,7 +48,7 @@ private fun SectionTitle(text: String) {
47
48
  }
48
49
 
49
50
  @Composable
50
- fun FlatMenu(elements: Array<ContextMenuElement>, sectionTitle: String?, dispatchers: ContextMenuDispatchers) {
51
+ fun FlatMenu(elements: Array<ContextMenuElement>, sectionTitle: String?, dispatchers: ContextMenuDispatchers, expanded: MutableState<Boolean>) {
51
52
  sectionTitle?.takeIf { !it.isEmpty() }?.let {
52
53
  SectionTitle(it)
53
54
  }
@@ -68,6 +69,7 @@ fun FlatMenu(elements: Array<ContextMenuElement>, sectionTitle: String?, dispatc
68
69
  text = { Text(it.text) },
69
70
  onClick = {
70
71
  dispatchers.buttonPressed(ContextMenuButtonPressedEvent(id))
72
+ expanded.value = false
71
73
  }
72
74
  )
73
75
  }
@@ -95,13 +97,14 @@ fun FlatMenu(elements: Array<ContextMenuElement>, sectionTitle: String?, dispatc
95
97
  dispatchers.switchCheckedChanged(
96
98
  ContextMenuSwitchValueChangeEvent(!it.value, id)
97
99
  )
100
+ expanded.value = false
98
101
  }
99
102
  )
100
103
  }
101
104
 
102
105
  element.submenu?.let {
103
106
  HorizontalDivider()
104
- FlatMenu(it.elements, it.button.text, dispatchers)
107
+ FlatMenu(it.elements, it.button.text, dispatchers, expanded)
105
108
  }
106
109
  }
107
110
  }
@@ -163,7 +166,8 @@ class ContextMenu(context: Context, appContext: AppContext) : ExpoComposeView<Co
163
166
  dispatchers = ContextMenuDispatchers(
164
167
  buttonPressed = onContextMenuButtonPressed,
165
168
  switchCheckedChanged = onContextMenuSwitchValueChanged
166
- )
169
+ ),
170
+ expanded = expanded
167
171
  )
168
172
  }
169
173
  }
@@ -0,0 +1,9 @@
1
+ import { StyleProp, ViewStyle } from 'react-native';
2
+ export type BottomSheetProps = {
3
+ style?: StyleProp<ViewStyle>;
4
+ children: any;
5
+ isOpened: boolean;
6
+ onIsOpenedChange: (isOpened: boolean) => void;
7
+ };
8
+ export declare function BottomSheet({ children }: BottomSheetProps): any;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/BottomSheet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,OAEzD"}
@@ -0,0 +1,11 @@
1
+ import { NativeSyntheticEvent } from 'react-native';
2
+ import { BottomSheetProps } from '.';
3
+ type NativeBottomSheetProps = Omit<BottomSheetProps, 'onIsOpenedChange'> & {
4
+ onIsOpenedChange: (event: NativeSyntheticEvent<{
5
+ isOpened: boolean;
6
+ }>) => void;
7
+ };
8
+ export declare function transformBottomSheetProps(props: BottomSheetProps): NativeBottomSheetProps;
9
+ export declare function BottomSheet(props: BottomSheetProps): import("react").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=index.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../components/BottomSheet/index.ios.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,oBAAoB,EAAQ,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAErC,KAAK,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAAG;IACzE,gBAAgB,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;CAChF,CAAC;AAOF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,sBAAsB,CAOzF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAUlD"}
@@ -1,6 +1,6 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
2
  import { MaterialIcon } from './types';
3
- import { ViewEvent } from '../../src';
3
+ import { ViewEvent } from '../../src/types';
4
4
  /**
5
5
  * The role of the button.
6
6
  * - `default` - The default button role.
@@ -11,10 +11,12 @@ import { ViewEvent } from '../../src';
11
11
  export type ButtonRole = 'default' | 'cancel' | 'destructive';
12
12
  /**
13
13
  * The built-in button styles available on iOS and Android.
14
+ *
14
15
  * Common styles:
15
16
  * - `default` - The default system button style.
16
17
  * - `bordered` - A button with a light fill. On Android equivalent to `FilledTonalButton`.
17
18
  * - `borderless` - A button with no background or border. On Android equivalent to `TextButton`.
19
+ *
18
20
  * Apple-only styles:
19
21
  * - `borderedProminent` - A bordered button with a prominent appearance.
20
22
  * - `plain` - A button with no border or background and a less prominent text.
@@ -23,11 +25,22 @@ export type ButtonRole = 'default' | 'cancel' | 'destructive';
23
25
  * - `accessoryBarAction` - A button style for accessory bar actions.
24
26
  * - `card` - A button style for cards.
25
27
  * - `link` - A button style for links.
28
+ *
26
29
  * Android-only styles:
27
30
  * - `outlined` - A button with an outline.
28
31
  * - `elevated` - A filled button with a shadow.
29
32
  */
30
33
  export type ButtonVariant = 'default' | 'bordered' | 'plain' | 'borderedProminent' | 'borderless' | 'accessoryBar' | 'accessoryBarAction' | 'card' | 'link' | 'outlined' | 'elevated';
34
+ /**
35
+ * Colors for button's core elements.
36
+ * @platform android
37
+ */
38
+ export type ButtonElementColors = {
39
+ containerColor?: string;
40
+ contentColor?: string;
41
+ disabledContainerColor?: string;
42
+ disabledContentColor?: string;
43
+ };
31
44
  export type ButtonProps = {
32
45
  /**
33
46
  * A callback that is called when the button is pressed.
@@ -35,7 +48,7 @@ export type ButtonProps = {
35
48
  onPress?: () => void;
36
49
  /**
37
50
  * A string describing the system image to display in the button.
38
- * Uses SF Symbols on iOS and Material Icons on Android.
51
+ * Uses Material Icons on Android and SF Symbols on iOS.
39
52
  */
40
53
  systemImage?: {
41
54
  ios?: string;
@@ -62,12 +75,7 @@ export type ButtonProps = {
62
75
  * Colors for button's core elements.
63
76
  * @platform android
64
77
  */
65
- elementColors?: {
66
- containerColor?: string;
67
- contentColor?: string;
68
- disabledContainerColor?: string;
69
- disabledContentColor?: string;
70
- };
78
+ elementColors?: ButtonElementColors;
71
79
  /**
72
80
  * Button color.
73
81
  */
@@ -77,11 +85,20 @@ export type ButtonProps = {
77
85
  */
78
86
  disabled?: boolean;
79
87
  };
88
+ /**
89
+ * @hidden
90
+ */
80
91
  export type NativeButtonProps = Omit<ButtonProps, 'role' | 'onPress' | 'children' | 'systemImage'> & {
81
92
  buttonRole?: ButtonRole;
82
93
  text: string;
83
94
  systemImage?: string;
84
95
  } & ViewEvent<'onButtonPressed', void>;
96
+ /**
97
+ * @hidden
98
+ */
85
99
  export declare function transformButtonProps(props: ButtonProps): NativeButtonProps;
100
+ /**
101
+ * Displays a native button component.
102
+ */
86
103
  export declare function Button(props: ButtonProps): import("react").JSX.Element;
87
104
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO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ACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAChD,GAAG;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAQvC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAgB1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAWxC"}
@@ -0,0 +1,23 @@
1
+ import { ContextMenuProps } from '.';
2
+ export declare function Submenu(): import("react").JSX.Element;
3
+ export declare function Items(): import("react").JSX.Element;
4
+ export declare namespace Items {
5
+ var tag: string;
6
+ }
7
+ export declare function Trigger(props: {
8
+ children: React.ReactNode;
9
+ }): import("react").JSX.Element;
10
+ export declare namespace Trigger {
11
+ var tag: string;
12
+ }
13
+ export declare function Preview(props: {
14
+ children: React.ReactNode;
15
+ }): import("react").JSX.Element;
16
+ declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
17
+ declare namespace ContextMenu {
18
+ var Trigger: typeof import("./index.android").Trigger;
19
+ var Preview: typeof import("./index.android").Preview;
20
+ var Items: typeof import("./index.android").Items;
21
+ }
22
+ export { ContextMenu };
23
+ //# sourceMappingURL=index.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../components/ContextMenu/index.android.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAkC,MAAM,GAAG,CAAC;AAQrE,wBAAgB,OAAO,gCAEtB;AAED,wBAAgB,KAAK,gCAEpB;yBAFe,KAAK;;;AAKrB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;yBAFe,OAAO;;;AAKvB,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAE3D;AAED,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAmC3C;kBAnCQ,WAAW;;;;;AAyCpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,18 +1,20 @@
1
- import React, { ReactElement, ReactNode } from 'react';
1
+ import { ReactElement, ReactNode } from 'react';
2
2
  import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
3
+ import { MenuElement } from './utils';
3
4
  import { ButtonProps } from '../Button';
4
5
  import { PickerProps } from '../Picker';
5
6
  import { SwitchProps } from '../Switch';
6
7
  type SubmenuElement = ReactElement<ButtonProps> | ReactElement<SwitchProps> | ReactElement<PickerProps> | ReactElement<SubmenuProps>;
7
- type ContentChildren = SubmenuElement | SubmenuElement[];
8
8
  export type ContextMenuContentProps = {
9
- children: ContentChildren;
10
- };
11
- export type EventHandlers = {
12
- [key: string]: {
13
- [key: string]: (event: NativeSyntheticEvent<any>) => void;
14
- };
9
+ children: SubmenuElement | SubmenuElement[];
15
10
  };
11
+ /**
12
+ * @hidden
13
+ */
14
+ export type EventHandlers = Record<string, Record<string, (event: NativeSyntheticEvent<any>) => void>>;
15
+ /**
16
+ * @hidden
17
+ */
16
18
  export type ContextMenuElementBase = {
17
19
  contextMenuElementID: string;
18
20
  };
@@ -26,12 +28,6 @@ export type ActivationMethod = 'singlePress' | 'longPress';
26
28
  * Props of the `ContextMenu` component.
27
29
  */
28
30
  export type ContextMenuProps = {
29
- /**
30
- * Items visible inside the context menu. The items should be wrapped in a `React.Fragment`.
31
- * `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
32
- * The `Picker` component is supported only on iOS. Remember to use components from the `@expo/ui` library.
33
- */
34
- Items: React.ReactElement<ContextMenuContentProps>;
35
31
  /**
36
32
  * Determines how the context menu will be activated.
37
33
  *
@@ -61,17 +57,59 @@ export type SubmenuProps = {
61
57
  /**
62
58
  * The button that will be used to expand the submenu. On Android the `text` prop of the `Button` will be used as a section title.
63
59
  */
64
- button: React.ReactElement<ButtonProps>;
60
+ button: ReactElement<ButtonProps>;
65
61
  /**
66
62
  * Children of the submenu. Only `Button`, `Switch`, `Picker` and `Submenu` elements should be used.
67
63
  */
68
- children: React.ReactNode;
64
+ children: ReactNode;
65
+ };
66
+ /**
67
+ * @hidden
68
+ */
69
+ export type NativeMenuProps = ContextMenuProps & {
70
+ elements: MenuElement[];
71
+ onContextMenuButtonPressed: (event: NativeSyntheticEvent<{
72
+ contextMenuElementID: string;
73
+ }>) => void;
74
+ onContextMenuSwitchValueChanged: (event: NativeSyntheticEvent<{
75
+ contextMenuElementID: string;
76
+ value: boolean;
77
+ }>) => void;
78
+ onContextMenuPickerOptionSelected: (event: NativeSyntheticEvent<{
79
+ index: number;
80
+ label: string;
81
+ contextMenuElementID: string;
82
+ }>) => void;
69
83
  };
70
84
  /**
71
85
  * The `Submenu` component is used to create a nested context menu. Submenus can be infinitely nested.
72
86
  * Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple titled sections.
73
87
  */
74
- export declare function Submenu(props: SubmenuProps): React.JSX.Element;
88
+ export declare function Submenu(props: SubmenuProps): import("react").JSX.Element;
89
+ /**
90
+ * Items visible inside the context menu. Pass input components as immidiate children of the tag.
91
+ * `Button`, `Switch` and `Submenu` components are supported on both Android and iOS.
92
+ * The `Picker` component is supported only on iOS. Remember to use components from the `@expo/ui` library.
93
+ */
94
+ export declare function Items(props: {
95
+ children: React.ReactNode;
96
+ }): import("react").JSX.Element;
97
+ export declare namespace Items {
98
+ var tag: string;
99
+ }
100
+ /**
101
+ * The component visible all the time that triggers the menu when tapped or long-pressed.
102
+ */
103
+ export declare function Trigger(props: {
104
+ children: React.ReactNode;
105
+ }): import("react").JSX.Element;
106
+ /**
107
+ * The component visible above the menu when it is opened.
108
+ * @platform ios
109
+ */
110
+ export declare function Preview(props: {
111
+ children: React.ReactNode;
112
+ }): import("react").JSX.Element;
75
113
  /**
76
114
  * `ContextMenu` allows you to create a context menu, which can be used to provide additional options to the user.
77
115
  *
@@ -81,6 +119,11 @@ export declare function Submenu(props: SubmenuProps): React.JSX.Element;
81
119
  * - Android does not support nesting in the context menu. All the submenus will be flat-mapped into a single level with multiple sections. The `title` prop of the `Button`, which opens the submenu on iOS will be used as a section title.
82
120
  * - Android does not support showing a `Picker` element in the context menu.
83
121
  */
84
- export declare function ContextMenu(props: ContextMenuProps): React.JSX.Element;
85
- export {};
122
+ declare function ContextMenu(props: ContextMenuProps): import("react").JSX.Element;
123
+ declare namespace ContextMenu {
124
+ var Trigger: typeof import(".").Trigger;
125
+ var Preview: typeof import(".").Preview;
126
+ var Items: typeof import(".").Items;
127
+ }
128
+ export { ContextMenu };
86
129
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/ContextMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,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GAQG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BA4B3C;kBA5BQ,WAAW;;;;;AAkCpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import { StyleProp, ViewStyle } from 'react-native';
3
- import { ViewEvent } from '../../src';
2
+ import { ViewEvent } from '../../src/types';
4
3
  type AndroidVariant = 'picker' | 'input';
5
4
  type IOSVariant = 'wheel' | 'automatic' | 'graphical' | 'compact';
6
5
  type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';
@@ -9,12 +8,12 @@ type DisplayedComponents = 'date' | 'hourAndMinute' | 'dateAndTime';
9
8
  */
10
9
  export type DatePickerProps = {
11
10
  /**
12
- * The intial date to display on the picker.
11
+ * The initial date to display on the picker.
13
12
  */
14
13
  initialDate?: string | null;
15
14
  /**
16
15
  * A title displayed on the picker on iOS.
17
- * @platform iOS
16
+ * @platform ios
18
17
  */
19
18
  title?: string;
20
19
  /**
@@ -23,7 +22,7 @@ export type DatePickerProps = {
23
22
  onDateSelected?: (date: Date) => void;
24
23
  /**
25
24
  * The variant of the picker, which determines its appearance and behavior.
26
- * @platform iOS
25
+ * @platform ios
27
26
  * @default 'automatic'
28
27
  */
29
28
  iosVariant?: IOSVariant;
@@ -36,15 +35,15 @@ export type DatePickerProps = {
36
35
  /**
37
36
  * Show to button to toggle between variants on Android.
38
37
  * @platform android
39
- * @default 'true'
38
+ * @default true
40
39
  */
41
40
  showVariantToggle?: boolean;
42
41
  /**
43
42
  * The components that the picker should display.
44
- * On iOS, you can have a picker that selects both date and time.
45
43
  * On Android, you can have a picker that selects just the date or just the time.
46
44
  * `dateAndTime` is only available on iOS and will result in a date picker on Android.
47
- * @default ['date']
45
+ * On iOS, you can have a picker that selects both date and time.
46
+ * @default 'date'
48
47
  */
49
48
  displayedComponents?: DisplayedComponents;
50
49
  /**
@@ -68,6 +67,6 @@ type NativeDatePickerProps = Omit<DatePickerProps, 'iosVariant' | 'androidVarian
68
67
  date: Date;
69
68
  }>;
70
69
  export declare function transformDatePickerProps(props: DatePickerProps): NativeDatePickerProps;
71
- export declare function DateTimePicker(props: DatePickerProps): React.JSX.Element;
70
+ export declare function DateTimePicker(props: DatePickerProps): import("react").JSX.Element;
72
71
  export {};
73
72
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,KAAK,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzC,KAAK,UAAU,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAElE,KAAK,mBAAmB,GAAG,MAAM,GAAG,eAAe,GAAG,aAAa,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CA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,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAC/B,eAAe,EACf,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,CACnD,GAAG;IACF,OAAO,CAAC,EAAE,UAAU,GAAG,cAAc,CAAC;CACvC,GAAG,SAAS,CAAC,gBAAgB,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAEhD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,eAAe,GAAG,qBAAqB,CAStF;AAOD,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,+BAEpD"}
@@ -1,4 +1,22 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
+ /**
3
+ * Colors for picker's core elements.
4
+ * @platform android
5
+ */
6
+ export type PickerElementColors = {
7
+ activeBorderColor?: string;
8
+ activeContentColor?: string;
9
+ inactiveBorderColor?: string;
10
+ inactiveContentColor?: string;
11
+ disabledActiveBorderColor?: string;
12
+ disabledActiveContentColor?: string;
13
+ disabledInactiveBorderColor?: string;
14
+ disabledInactiveContentColor?: string;
15
+ activeContainerColor?: string;
16
+ inactiveContainerColor?: string;
17
+ disabledActiveContainerColor?: string;
18
+ disabledInactiveContainerColor?: string;
19
+ };
2
20
  /**
3
21
  * Props for the Picker component.
4
22
  */
@@ -12,8 +30,8 @@ export type PickerProps = {
12
30
  */
13
31
  selectedIndex: number | null;
14
32
  /**
15
- * A label displayed on the picker when in `menu` variant inside a form section on iOS.
16
- * @platform iOS
33
+ * A label displayed on the picker when in `'menu'` variant inside a form section on iOS.
34
+ * @platform ios
17
35
  */
18
36
  label?: string;
19
37
  /**
@@ -27,10 +45,10 @@ export type PickerProps = {
27
45
  }) => void;
28
46
  /**
29
47
  * The variant of the picker, which determines its appearance and behavior.
30
- * The 'wheel' and 'menu' variants are iOS only, the 'radio' variant is Android only.
48
+ * The `'wheel'`, `'inline'`, `'palette'` and `'menu'` variants are iOS only, the `'radio'` variant is Android only. The `'inline'` variant can only be used inside sections or lists. The `'palette'` variant displays differently inside menus.
31
49
  * @default 'segmented'
32
50
  */
33
- variant?: 'wheel' | 'segmented' | 'menu' | 'radio';
51
+ variant?: 'wheel' | 'segmented' | 'menu' | 'radio' | 'inline' | 'palette';
34
52
  /**
35
53
  * Optional style to apply to the picker component.
36
54
  */
@@ -39,27 +57,20 @@ export type PickerProps = {
39
57
  * Colors for picker's core elements.
40
58
  * @platform android
41
59
  */
42
- elementColors?: {
43
- activeBorderColor?: string;
44
- activeContentColor?: string;
45
- inactiveBorderColor?: string;
46
- inactiveContentColor?: string;
47
- disabledActiveBorderColor?: string;
48
- disabledActiveContentColor?: string;
49
- disabledInactiveBorderColor?: string;
50
- disabledInactiveContentColor?: string;
51
- activeContainerColor?: string;
52
- inactiveContainerColor?: string;
53
- disabledActiveContainerColor?: string;
54
- disabledInactiveContainerColor?: string;
55
- };
60
+ elementColors?: PickerElementColors;
56
61
  /**
57
- * Picker color. On iOS it only applies to the `menu` variant.
62
+ * Picker color. On iOS it only applies to the `'menu'` variant.
58
63
  */
59
64
  color?: string;
60
65
  };
61
66
  type NativePickerProps = PickerProps;
67
+ /**
68
+ * @hidden
69
+ */
62
70
  export declare function transformPickerProps(props: PickerProps): NativePickerProps;
71
+ /**
72
+ * Displays a native picker component. Depending on the variant it can be a segmented button, an inline picker, a list of choices or a radio button.
73
+ */
63
74
  export declare function Picker(props: PickerProps): import("react").JSX.Element;
64
75
  export {};
65
76
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Picker/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,W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mBAAmB,CAAC;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAOF,KAAK,iBAAiB,GAAG,WAAW,CAAC;AAErC;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAa1E;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,+BAExC"}
@@ -13,7 +13,7 @@ export type ProgressProps = {
13
13
  */
14
14
  style?: StyleProp<ViewStyle>;
15
15
  /**
16
- * The current progress value of the slider. This is a number between 0 and 1.
16
+ * The current progress value of the slider. This is a number between `0` and `1`.
17
17
  */
18
18
  progress?: number | null;
19
19
  /**
@@ -1,8 +1,13 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
2
  export type SectionProps = {
3
3
  style?: StyleProp<ViewStyle>;
4
- title: string;
4
+ title?: string;
5
5
  children: any;
6
6
  };
7
+ /**
8
+ * Section component uses the native [Section](https://developer.apple.com/documentation/swiftui/section) component.
9
+ * It has no intrinsic dimensions, so it needs explicit height or flex set to display content (like ScrollView).
10
+ * @platform ios
11
+ */
7
12
  export declare function Section({ children }: SectionProps): any;
8
13
  //# sourceMappingURL=index.d.ts.map