@expo/ui 55.0.10 → 55.0.12

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 (89) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +11 -7
  4. package/android/src/main/java/expo/modules/ui/TextFieldView.kt +326 -0
  5. package/build/jetpack-compose/SlotView.d.ts +7 -0
  6. package/build/jetpack-compose/SlotView.d.ts.map +1 -0
  7. package/build/jetpack-compose/TextField/index.d.ts +177 -0
  8. package/build/jetpack-compose/TextField/index.d.ts.map +1 -0
  9. package/build/jetpack-compose/index.d.ts +1 -1
  10. package/build/swift-ui/Overlay/index.d.ts +18 -0
  11. package/build/swift-ui/Overlay/index.d.ts.map +1 -0
  12. package/build/swift-ui/SecureField/index.d.ts +9 -20
  13. package/build/swift-ui/SecureField/index.d.ts.map +1 -1
  14. package/build/swift-ui/TextField/index.d.ts +17 -63
  15. package/build/swift-ui/TextField/index.d.ts.map +1 -1
  16. package/build/swift-ui/ZStack/index.d.ts +2 -2
  17. package/build/swift-ui/ZStack/index.d.ts.map +1 -1
  18. package/build/swift-ui/index.d.ts +2 -1
  19. package/build/swift-ui/index.d.ts.map +1 -1
  20. package/build/swift-ui/modifiers/index.d.ts +35 -4
  21. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  22. package/build/swift-ui/types.d.ts +6 -1
  23. package/build/swift-ui/types.d.ts.map +1 -1
  24. package/expo-module.config.json +1 -1
  25. package/ios/ExpoUIModule.swift +1 -0
  26. package/ios/Modifiers/KeyboardTypeModifier.swift +68 -0
  27. package/ios/Modifiers/LineLimitModifier.swift +29 -0
  28. package/ios/Modifiers/OnSubmitModifier.swift +21 -0
  29. package/ios/Modifiers/ViewModifierRegistry.swift +12 -8
  30. package/ios/OverlayView.swift +34 -0
  31. package/ios/SecureFieldView.swift +5 -12
  32. package/ios/TextFieldView.swift +26 -94
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.10/expo.modules.ui-55.0.10-sources.jar → 55.0.12/expo.modules.ui-55.0.12-sources.jar} +0 -0
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12-sources.jar.md5 +1 -0
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12-sources.jar.sha1 +1 -0
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12-sources.jar.sha256 +1 -0
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12-sources.jar.sha512 +1 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.aar +0 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.aar.md5 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.aar.sha1 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.aar.sha256 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.aar.sha512 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.10/expo.modules.ui-55.0.10.module → 55.0.12/expo.modules.ui-55.0.12.module} +22 -22
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.module.md5 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.module.sha1 +1 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.module.sha256 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.module.sha512 +1 -0
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.10/expo.modules.ui-55.0.10.pom → 55.0.12/expo.modules.ui-55.0.12.pom} +1 -1
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.pom.md5 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.pom.sha1 +1 -0
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.pom.sha256 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.12/expo.modules.ui-55.0.12.pom.sha512 +1 -0
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  55. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  57. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  58. package/package.json +2 -2
  59. package/src/jetpack-compose/SlotView.tsx +15 -0
  60. package/src/jetpack-compose/TextField/index.tsx +276 -0
  61. package/src/jetpack-compose/index.ts +1 -1
  62. package/src/swift-ui/Overlay/index.tsx +37 -0
  63. package/src/swift-ui/SecureField/index.tsx +18 -36
  64. package/src/swift-ui/TextField/index.tsx +30 -91
  65. package/src/swift-ui/ZStack/index.tsx +2 -17
  66. package/src/swift-ui/index.tsx +2 -1
  67. package/src/swift-ui/modifiers/index.ts +63 -3
  68. package/src/swift-ui/types.ts +22 -10
  69. package/android/src/main/java/expo/modules/ui/TextInputView.kt +0 -124
  70. package/build/jetpack-compose/TextInput/index.d.ts +0 -105
  71. package/build/jetpack-compose/TextInput/index.d.ts.map +0 -1
  72. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.md5 +0 -1
  73. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha1 +0 -1
  74. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha256 +0 -1
  75. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10-sources.jar.sha512 +0 -1
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar +0 -0
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.md5 +0 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha1 +0 -1
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha256 +0 -1
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.aar.sha512 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.md5 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha1 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha256 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.module.sha512 +0 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.md5 +0 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha1 +0 -1
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha256 +0 -1
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.10/expo.modules.ui-55.0.10.pom.sha512 +0 -1
  89. package/src/jetpack-compose/TextInput/index.tsx +0 -157
@@ -851,11 +851,31 @@ export const textSelection = (value: boolean) => createModifier('textSelection',
851
851
  */
852
852
  export const lineSpacing = (value: number) => createModifier('lineSpacing', { value });
853
853
  /**
854
- * Sets the maximum number of lines that text can occupy in the view.
855
- * @param limit - The maximum number of lines.
854
+ * Sets the line limit for text in the view.
855
+ *
856
+ * Four variants matching SwiftUI:
857
+ * - `lineLimit()` — no line limit (unlimited lines)
858
+ * - `lineLimit(5)` — max 5 lines
859
+ * - `lineLimit(5, { reservesSpace: true })` — max 5 lines, reserves height even when empty (iOS 16+, tvOS 16+)
860
+ * - `lineLimit({ min: 3, max: 8 })` — range of 3 to 8 lines (iOS 16+, tvOS 16+)
861
+ *
856
862
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/linelimit(_:)).
857
863
  */
858
- export const lineLimit = (limit?: number) => createModifier('lineLimit', { limit });
864
+ export function lineLimit(): ModifierConfig;
865
+ export function lineLimit(limit: number, options?: { reservesSpace?: boolean }): ModifierConfig;
866
+ export function lineLimit(range: { min: number; max: number }): ModifierConfig;
867
+ export function lineLimit(
868
+ limitOrRange?: number | { min: number; max: number },
869
+ options?: { reservesSpace?: boolean }
870
+ ): ModifierConfig {
871
+ if (typeof limitOrRange === 'object' && limitOrRange !== null) {
872
+ return createModifier('lineLimit', { min: limitOrRange.min, max: limitOrRange.max });
873
+ }
874
+ return createModifier('lineLimit', {
875
+ limit: limitOrRange,
876
+ reservesSpace: options?.reservesSpace,
877
+ });
878
+ }
859
879
  /**
860
880
  * Sets the header prominence for this view.
861
881
  * @param prominence - The prominence to apply.
@@ -1017,6 +1037,43 @@ export const submitLabel = (
1017
1037
  submitLabel: 'continue' | 'done' | 'go' | 'join' | 'next' | 'return' | 'route' | 'search' | 'send'
1018
1038
  ) => createModifier('submitLabel', { submitLabel });
1019
1039
 
1040
+ /**
1041
+ * Sets the keyboard type for text input views.
1042
+ * @param keyboardType - The type of keyboard to display.
1043
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/keyboardtype(_:)).
1044
+ */
1045
+ export const keyboardType = (
1046
+ keyboardType:
1047
+ | 'default'
1048
+ | 'email-address'
1049
+ | 'numeric'
1050
+ | 'phone-pad'
1051
+ | 'ascii-capable'
1052
+ | 'numbers-and-punctuation'
1053
+ | 'url'
1054
+ | 'name-phone-pad'
1055
+ | 'decimal-pad'
1056
+ | 'twitter'
1057
+ | 'web-search'
1058
+ | 'ascii-capable-number-pad'
1059
+ ) => createModifier('keyboardType', { keyboardType });
1060
+
1061
+ /**
1062
+ * Disables autocorrection for text input views.
1063
+ * @param disabled - Whether autocorrection is disabled. Defaults to `true`.
1064
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/autocorrectiondisabled(_:)).
1065
+ */
1066
+ export const autocorrectionDisabled = (disabled: boolean = true) =>
1067
+ createModifier('autocorrectionDisabled', { disabled });
1068
+
1069
+ /**
1070
+ * Adds an action to perform when the user submits a value to this view (e.g. pressing return in a text field).
1071
+ * @param handler - Function to call on submit.
1072
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/onsubmit(of:_:)).
1073
+ */
1074
+ export const onSubmit = (handler: () => void) =>
1075
+ createModifierWithEventListener('onSubmit', handler);
1076
+
1020
1077
  /**
1021
1078
  * Sets how often the shift key in the keyboard is automatically enabled.
1022
1079
  * @param autocapitalization - The autocapitalization behavior.
@@ -1242,6 +1299,9 @@ export type BuiltInModifier =
1242
1299
  | ReturnType<typeof gridColumnAlignment>
1243
1300
  | ReturnType<typeof gridCellAnchor>
1244
1301
  | ReturnType<typeof submitLabel>
1302
+ | ReturnType<typeof keyboardType>
1303
+ | ReturnType<typeof autocorrectionDisabled>
1304
+ | ReturnType<typeof onSubmit>
1245
1305
  | ReturnType<typeof textInputAutocapitalization>
1246
1306
  | ReturnType<typeof textContentType>
1247
1307
  | ReturnType<typeof datePickerStyle>
@@ -1,3 +1,24 @@
1
+ /**
2
+ * The alignment of content within a container or overlay.
3
+ * Maps to SwiftUI's `Alignment` type.
4
+ */
5
+ export type Alignment =
6
+ | 'center'
7
+ | 'leading'
8
+ | 'trailing'
9
+ | 'top'
10
+ | 'bottom'
11
+ | 'topLeading'
12
+ | 'topTrailing'
13
+ | 'bottomLeading'
14
+ | 'bottomTrailing'
15
+ | 'centerFirstTextBaseline'
16
+ | 'centerLastTextBaseline'
17
+ | 'leadingFirstTextBaseline'
18
+ | 'leadingLastTextBaseline'
19
+ | 'trailingFirstTextBaseline'
20
+ | 'trailingLastTextBaseline';
21
+
1
22
  /**
2
23
  * Common frame properties that can be applied to any view.
3
24
  */
@@ -39,16 +60,7 @@ export interface FrameProps {
39
60
  /**
40
61
  * The alignment of the content within the frame.
41
62
  */
42
- alignment?:
43
- | 'center'
44
- | 'leading'
45
- | 'trailing'
46
- | 'top'
47
- | 'bottom'
48
- | 'topLeading'
49
- | 'topTrailing'
50
- | 'bottomLeading'
51
- | 'bottomTrailing';
63
+ alignment?: Alignment;
52
64
  }
53
65
 
54
66
  /**
@@ -1,124 +0,0 @@
1
- package expo.modules.ui
2
-
3
- import android.annotation.SuppressLint
4
- import android.content.Context
5
- import androidx.compose.foundation.text.KeyboardOptions
6
- import androidx.compose.material3.OutlinedTextField
7
- import androidx.compose.material3.Text
8
- import androidx.compose.material3.TextField
9
- import androidx.compose.runtime.Composable
10
- import androidx.compose.runtime.MutableState
11
- import androidx.compose.runtime.mutableStateOf
12
- import androidx.compose.ui.text.input.KeyboardCapitalization
13
- import androidx.compose.ui.text.input.KeyboardType
14
- import expo.modules.kotlin.AppContext
15
- import expo.modules.kotlin.types.Enumerable
16
- import expo.modules.kotlin.viewevent.EventDispatcher
17
- import expo.modules.kotlin.views.ComposableScope
18
- import expo.modules.kotlin.views.ComposeProps
19
- import expo.modules.kotlin.views.ExpoComposeView
20
-
21
- enum class TextInputViewVariant(val value: String) : Enumerable {
22
- FILLED("filled"),
23
- OUTLINED("outlined"),
24
- }
25
-
26
- data class TextInputProps(
27
- val defaultValue: MutableState<String> = mutableStateOf(""),
28
- val placeholder: MutableState<String> = mutableStateOf(""),
29
- val variant: MutableState<TextInputViewVariant> = mutableStateOf(TextInputViewVariant.FILLED),
30
- val multiline: MutableState<Boolean> = mutableStateOf(false),
31
- val numberOfLines: MutableState<Int?> = mutableStateOf(null),
32
- val keyboardType: MutableState<String> = mutableStateOf("default"),
33
- val autocorrection: MutableState<Boolean> = mutableStateOf(true),
34
- val autoCapitalize: MutableState<String> = mutableStateOf("none"),
35
- val modifiers: MutableState<ModifierList> = mutableStateOf(emptyList()),
36
- ) : ComposeProps
37
-
38
- private fun String.keyboardType(): KeyboardType {
39
- return when (this) {
40
- "default" -> KeyboardType.Text
41
- "numeric" -> KeyboardType.Number
42
- "email-address" -> KeyboardType.Email
43
- "phone-pad" -> KeyboardType.Phone
44
- "decimal-pad" -> KeyboardType.Decimal
45
- "password" -> KeyboardType.Password
46
- "ascii-capable" -> KeyboardType.Ascii
47
- "url" -> KeyboardType.Uri
48
- "number-password" -> KeyboardType.NumberPassword
49
- else -> KeyboardType.Text
50
- }
51
- }
52
-
53
- private fun String.autoCapitalize(): KeyboardCapitalization {
54
- return when (this) {
55
- "characters" -> KeyboardCapitalization.Characters
56
- "none" -> KeyboardCapitalization.None
57
- "sentences" -> KeyboardCapitalization.Sentences
58
- "unspecified" -> KeyboardCapitalization.Unspecified
59
- "words" -> KeyboardCapitalization.Words
60
- else -> KeyboardCapitalization.None
61
- }
62
- }
63
-
64
- @SuppressLint("ViewConstructor")
65
- class TextInputView(context: Context, appContext: AppContext) :
66
- ExpoComposeView<TextInputProps>(context, appContext) {
67
- override val props = TextInputProps()
68
- private val onValueChanged by EventDispatcher()
69
-
70
- private val textState = mutableStateOf<String?>(null)
71
-
72
- var text: String?
73
- get() = textState.value
74
- set(value) {
75
- textState.value = value
76
- onValueChanged(mapOf("value" to (value ?: "")))
77
- }
78
-
79
- @Composable
80
- override fun ComposableScope.Content() {
81
- val value = textState.value ?: props.defaultValue.value
82
- val onValueChange: (String) -> Unit = {
83
- textState.value = it
84
- onValueChanged(mapOf("value" to it))
85
- }
86
- val placeholder: @Composable () -> Unit = { Text(props.placeholder.value) }
87
- val maxLines = if (props.multiline.value) props.numberOfLines.value ?: Int.MAX_VALUE else 1
88
- val singleLine = !props.multiline.value
89
- val keyboardOptions = KeyboardOptions.Default.copy(
90
- keyboardType = props.keyboardType.value.keyboardType(),
91
- autoCorrectEnabled = props.autocorrection.value,
92
- capitalization = props.autoCapitalize.value.autoCapitalize()
93
- )
94
- val labelSlotView = findChildSlotView(this@TextInputView, "label")
95
- val label: (@Composable () -> Unit)? = labelSlotView?.let {
96
- { with(ComposableScope()) { with(it) { Content() } } }
97
- }
98
- val modifier = ModifierRegistry.applyModifiers(props.modifiers.value, appContext, this@Content, globalEventDispatcher)
99
-
100
- if (props.variant.value == TextInputViewVariant.OUTLINED) {
101
- OutlinedTextField(
102
- value = value,
103
- onValueChange = onValueChange,
104
- placeholder = placeholder,
105
- maxLines = maxLines,
106
- singleLine = singleLine,
107
- keyboardOptions = keyboardOptions,
108
- label = label,
109
- modifier = modifier
110
- )
111
- } else {
112
- TextField(
113
- value = value,
114
- onValueChange = onValueChange,
115
- placeholder = placeholder,
116
- maxLines = maxLines,
117
- singleLine = singleLine,
118
- keyboardOptions = keyboardOptions,
119
- label = label,
120
- modifier = modifier
121
- )
122
- }
123
- }
124
- }
@@ -1,105 +0,0 @@
1
- import { Ref } from 'react';
2
- import { ExpoModifier, ViewEvent } from '../../types';
3
- /**
4
- * @hidden Not used anywhere yet.
5
- */
6
- export type TextInputRole = 'default' | 'cancel' | 'destructive';
7
- export type TextInputRef = {
8
- setText: (newText: string) => Promise<void>;
9
- };
10
- export type TextInputVariant = 'filled' | 'outlined';
11
- export type TextInputProps = {
12
- /**
13
- * Can be used for imperatively setting text on the TextInput component.
14
- */
15
- ref?: Ref<TextInputRef>;
16
- /**
17
- * 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.
18
- */
19
- defaultValue?: string;
20
- /**
21
- * The visual style of the text input field.
22
- * - `filled` - A text field with a filled background (default).
23
- * - `outlined` - A text field with a transparent background and a border outline.
24
- * @default filled
25
- * @platform android
26
- */
27
- variant?: TextInputVariant;
28
- /**
29
- * A callback triggered when user types in text into the TextInput.
30
- */
31
- onChangeText: (value: string) => void;
32
- /**
33
- * If true, the text input can be multiple lines.
34
- * While the content will wrap, there's no keyboard button to insert a new line.
35
- */
36
- multiline?: boolean;
37
- /**
38
- * The number of lines to display when `multiline` is set to true.
39
- * If the number of lines in the view is above this number, the view scrolls.
40
- * @default undefined, which means unlimited lines.
41
- */
42
- numberOfLines?: number;
43
- /**
44
- * Determines which keyboard to open. For example, `'numeric'`.
45
- *
46
- * Available options:
47
- * - default
48
- * - numeric
49
- * - email-address
50
- * - phone-pad
51
- * - decimal-pad
52
- * - ascii-capable
53
- * - url
54
- * - password
55
- * - password-numeric
56
- *
57
- * @default default
58
- */
59
- keyboardType?: 'default' | 'email-address' | 'numeric' | 'phone-pad' | 'ascii-capable' | 'url' | 'decimal-pad';
60
- /**
61
- * If true, autocorrection is enabled.
62
- * @default true
63
- */
64
- autocorrection?: boolean;
65
- /**
66
- * Options to request software keyboard to capitalize the text. Applies to languages which has upper-case and lower-case letters.
67
- *
68
- * Available options:
69
- * - `characters`: Capitalize all characters.
70
- * - `none`: Do not auto-capitalize text.
71
- * - `sentences`: Capitalize the first character of each sentence.
72
- * - `unspecified`: Capitalization behavior is not specified.
73
- * - `words`: Capitalize the first character of every word.
74
- * @default none
75
- * @platform android
76
- */
77
- autoCapitalize?: 'characters' | 'none' | 'sentences' | 'unspecified' | 'words';
78
- /**
79
- * Placeholder text shown inside the field when empty and focused.
80
- *
81
- */
82
- placeholder?: string;
83
- /** Modifiers for the component */
84
- modifiers?: ExpoModifier[];
85
- /**
86
- * Slot children (e.g. `TextInput.Label`).
87
- */
88
- children?: React.ReactNode;
89
- };
90
- export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText' | 'children'> & {
91
- children?: React.ReactNode;
92
- } & ViewEvent<'onValueChanged', {
93
- value: string;
94
- }>;
95
- /**
96
- * Renders a `TextInput` component.
97
- */
98
- declare function TextInputComponent(props: TextInputProps): import("react").JSX.Element;
99
- declare namespace TextInputComponent {
100
- var Label: (props: {
101
- children: React.ReactNode;
102
- }) => import("react").JSX.Element;
103
- }
104
- export { TextInputComponent as TextInput };
105
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/jetpack-compose/TextInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAatD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,EACT,SAAS,GACT,eAAe,GACf,SAAS,GACT,WAAW,GACX,eAAe,GACf,KAAK,GACL,aAAa,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,OAAO,CAAC;IAC/E;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG;IACrF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,GAAG,SAAS,CAAC,gBAAgB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AA+BnD;;GAEG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,cAAc,+BAEhD;kBAFQ,kBAAkB;uBAPL;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;AAanD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- 0fb41718cf502bf1bd5bfeefef2497a791ec4067
@@ -1 +0,0 @@
1
- 6f17f489b1f61bda39b7219a16731839a2436678e8e1258f862b6f126229a160
@@ -1 +0,0 @@
1
- d9c690394b14a26e66a9e2520000d48ab9d98163b4495ff3acf0be27d3c285e3f3c11a4e9843c124d9bbf1d8da51064956af5f3fd7f11e4775ef5d6d32a2487b
@@ -1 +0,0 @@
1
- 47a9ad9a4255f9c8a380708a52ffe51ccba93762
@@ -1 +0,0 @@
1
- 0cc100bb063457e6e0be298e51fd87edbe497d86fcf01f7f4e32b83ba71ee443
@@ -1 +0,0 @@
1
- 6eabbcc0f2c5ca30426dc5325e8d02ee5cd43c5c2d3660996b29d5344b609532e4cc79251162be6974dcc54c5722c50b54d59ce0ea8b422db6c1efb5a460c830
@@ -1 +0,0 @@
1
- 6d6684e1477f090289e93eeb36134bef87067815
@@ -1 +0,0 @@
1
- a4367d937fc3d4c24a47dd610db00620480a3ef4788c4c11c42dcc3b318182cd
@@ -1 +0,0 @@
1
- 61e1749ec59eb2f5b91bfd897c2f782fd94351c84c089d9539796d3dd4ff4dccba64432c5c750f378f23c75c0f478bccdeaea13101a91bc69e42bf3273c34331
@@ -1 +0,0 @@
1
- 3f56e5cc5f3650a11784c84f714595c023a99daf
@@ -1 +0,0 @@
1
- 889146699fd5faafc6fc87e3468a2ca4d5d22de6969ea2117a4615dd94f882a7
@@ -1 +0,0 @@
1
- e2ec38ff5380b28bf629f0a1d1c103e7bec3e5985250a2b9a947028d49d515e644f5f44cda6d67002e2b0cf0cc80d57b1d65968dac3c67a7cd1f0d2bd636d4e4
@@ -1,157 +0,0 @@
1
- import { requireNativeView } from 'expo';
2
- import { Ref } from 'react';
3
-
4
- import { ExpoModifier, ViewEvent } from '../../types';
5
- import { createViewModifierEventListener } from '../modifiers/utils';
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
-
17
- /**
18
- * @hidden Not used anywhere yet.
19
- */
20
- export type TextInputRole = 'default' | 'cancel' | 'destructive';
21
-
22
- export type TextInputRef = {
23
- setText: (newText: string) => Promise<void>;
24
- };
25
-
26
- export type TextInputVariant = 'filled' | 'outlined';
27
-
28
- export type TextInputProps = {
29
- /**
30
- * Can be used for imperatively setting text on the TextInput component.
31
- */
32
- ref?: Ref<TextInputRef>;
33
- /**
34
- * 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.
35
- */
36
- defaultValue?: string;
37
- /**
38
- * The visual style of the text input field.
39
- * - `filled` - A text field with a filled background (default).
40
- * - `outlined` - A text field with a transparent background and a border outline.
41
- * @default filled
42
- * @platform android
43
- */
44
- variant?: TextInputVariant;
45
- /**
46
- * A callback triggered when user types in text into the TextInput.
47
- */
48
- onChangeText: (value: string) => void;
49
- /**
50
- * If true, the text input can be multiple lines.
51
- * While the content will wrap, there's no keyboard button to insert a new line.
52
- */
53
- multiline?: boolean;
54
- /**
55
- * The number of lines to display when `multiline` is set to true.
56
- * If the number of lines in the view is above this number, the view scrolls.
57
- * @default undefined, which means unlimited lines.
58
- */
59
- numberOfLines?: number;
60
- /**
61
- * Determines which keyboard to open. For example, `'numeric'`.
62
- *
63
- * Available options:
64
- * - default
65
- * - numeric
66
- * - email-address
67
- * - phone-pad
68
- * - decimal-pad
69
- * - ascii-capable
70
- * - url
71
- * - password
72
- * - password-numeric
73
- *
74
- * @default default
75
- */
76
- keyboardType?:
77
- | 'default'
78
- | 'email-address'
79
- | 'numeric'
80
- | 'phone-pad'
81
- | 'ascii-capable'
82
- | 'url'
83
- | 'decimal-pad';
84
- /**
85
- * If true, autocorrection is enabled.
86
- * @default true
87
- */
88
- autocorrection?: boolean;
89
- /**
90
- * Options to request software keyboard to capitalize the text. Applies to languages which has upper-case and lower-case letters.
91
- *
92
- * Available options:
93
- * - `characters`: Capitalize all characters.
94
- * - `none`: Do not auto-capitalize text.
95
- * - `sentences`: Capitalize the first character of each sentence.
96
- * - `unspecified`: Capitalization behavior is not specified.
97
- * - `words`: Capitalize the first character of every word.
98
- * @default none
99
- * @platform android
100
- */
101
- autoCapitalize?: 'characters' | 'none' | 'sentences' | 'unspecified' | 'words';
102
- /**
103
- * Placeholder text shown inside the field when empty and focused.
104
- *
105
- */
106
- placeholder?: string;
107
- /** Modifiers for the component */
108
- modifiers?: ExpoModifier[];
109
- /**
110
- * Slot children (e.g. `TextInput.Label`).
111
- */
112
- children?: React.ReactNode;
113
- };
114
-
115
- export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText' | 'children'> & {
116
- children?: React.ReactNode;
117
- } & ViewEvent<'onValueChanged', { value: string }>;
118
-
119
- // We have to work around the `role` and `onPress` props being reserved by React Native.
120
- const TextInputNativeView: React.ComponentType<NativeTextInputProps> = requireNativeView(
121
- 'ExpoUI',
122
- 'TextInputView'
123
- );
124
-
125
- function transformTextInputProps(props: TextInputProps): NativeTextInputProps {
126
- const { modifiers, children, ...restProps } = props;
127
- return {
128
- modifiers,
129
- ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
130
- ...restProps,
131
- children,
132
- onValueChanged: (event) => {
133
- props.onChangeText?.(event.nativeEvent.value);
134
- },
135
- };
136
- }
137
-
138
- /**
139
- * A label slot for `TextInput`.
140
- * The label floats above the text field when focused or filled.
141
- *
142
- * @platform android
143
- */
144
- function Label(props: { children: React.ReactNode }) {
145
- return <SlotNativeView slotName="label">{props.children}</SlotNativeView>;
146
- }
147
-
148
- /**
149
- * Renders a `TextInput` component.
150
- */
151
- function TextInputComponent(props: TextInputProps) {
152
- return <TextInputNativeView {...transformTextInputProps(props)} />;
153
- }
154
-
155
- TextInputComponent.Label = Label;
156
-
157
- export { TextInputComponent as TextInput };