@expo/ui 55.0.5 → 55.0.6

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 (92) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/AlertDialogView.kt +56 -28
  4. package/android/src/main/java/expo/modules/ui/BasicAlertDialogView.kt +9 -1
  5. package/android/src/main/java/expo/modules/ui/DividerView.kt +21 -2
  6. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +15 -15
  7. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +6 -0
  8. package/android/src/main/java/expo/modules/ui/PullToRefreshBoxView.kt +20 -3
  9. package/android/src/main/java/expo/modules/ui/SlotView.kt +8 -0
  10. package/android/src/main/java/expo/modules/ui/SurfaceView.kt +88 -11
  11. package/android/src/main/java/expo/modules/ui/TextInputView.kt +15 -3
  12. package/android/src/main/java/expo/modules/ui/TextView.kt +145 -12
  13. package/build/jetpack-compose/AlertDialog/index.d.ts +72 -36
  14. package/build/jetpack-compose/AlertDialog/index.d.ts.map +1 -1
  15. package/build/jetpack-compose/BasicAlertDialog/index.d.ts +7 -2
  16. package/build/jetpack-compose/BasicAlertDialog/index.d.ts.map +1 -1
  17. package/build/jetpack-compose/Card/index.d.ts.map +1 -1
  18. package/build/jetpack-compose/Divider/index.d.ts +20 -5
  19. package/build/jetpack-compose/Divider/index.d.ts.map +1 -1
  20. package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
  21. package/build/jetpack-compose/PullToRefreshBox/index.d.ts +34 -9
  22. package/build/jetpack-compose/PullToRefreshBox/index.d.ts.map +1 -1
  23. package/build/jetpack-compose/Surface/index.d.ts +52 -2
  24. package/build/jetpack-compose/Surface/index.d.ts.map +1 -1
  25. package/build/jetpack-compose/Text/index.d.ts +77 -89
  26. package/build/jetpack-compose/Text/index.d.ts.map +1 -1
  27. package/build/jetpack-compose/TextInput/index.d.ts +18 -3
  28. package/build/jetpack-compose/TextInput/index.d.ts.map +1 -1
  29. package/build/jetpack-compose/index.d.ts +2 -2
  30. package/build/jetpack-compose/index.d.ts.map +1 -1
  31. package/build/jetpack-compose/modifiers/index.d.ts +5 -0
  32. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  33. package/build/swift-ui/modifiers/index.d.ts +1 -1
  34. package/build/types.d.ts +26 -0
  35. package/build/types.d.ts.map +1 -1
  36. package/expo-module.config.json +1 -1
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.5/expo.modules.ui-55.0.5-sources.jar → 55.0.6/expo.modules.ui-55.0.6-sources.jar} +0 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6-sources.jar.md5 +1 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6-sources.jar.sha1 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6-sources.jar.sha256 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6-sources.jar.sha512 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.aar +0 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.aar.md5 +1 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.aar.sha1 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.aar.sha256 +1 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.aar.sha512 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.5/expo.modules.ui-55.0.5.module → 55.0.6/expo.modules.ui-55.0.6.module} +22 -22
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.module.md5 +1 -0
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.module.sha1 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.module.sha256 +1 -0
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.module.sha512 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.5/expo.modules.ui-55.0.5.pom → 55.0.6/expo.modules.ui-55.0.6.pom} +1 -1
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.pom.md5 +1 -0
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.pom.sha1 +1 -0
  55. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.pom.sha256 +1 -0
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.6/expo.modules.ui-55.0.6.pom.sha512 +1 -0
  57. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  58. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  59. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  60. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  61. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  62. package/package.json +2 -2
  63. package/src/jetpack-compose/AlertDialog/index.tsx +94 -41
  64. package/src/jetpack-compose/BasicAlertDialog/index.tsx +9 -2
  65. package/src/jetpack-compose/Card/index.tsx +4 -2
  66. package/src/jetpack-compose/Divider/index.tsx +34 -14
  67. package/src/jetpack-compose/Progress/index.tsx +4 -2
  68. package/src/jetpack-compose/PullToRefreshBox/index.tsx +35 -18
  69. package/src/jetpack-compose/Surface/index.tsx +75 -4
  70. package/src/jetpack-compose/Text/index.tsx +171 -101
  71. package/src/jetpack-compose/TextInput/index.tsx +38 -8
  72. package/src/jetpack-compose/index.ts +2 -2
  73. package/src/jetpack-compose/modifiers/index.ts +10 -0
  74. package/src/swift-ui/modifiers/index.ts +1 -1
  75. package/src/types.ts +27 -0
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5-sources.jar.md5 +0 -1
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5-sources.jar.sha1 +0 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5-sources.jar.sha256 +0 -1
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5-sources.jar.sha512 +0 -1
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.aar +0 -0
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.aar.md5 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.aar.sha1 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.aar.sha256 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.aar.sha512 +0 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.module.md5 +0 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.module.sha1 +0 -1
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.module.sha256 +0 -1
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.module.sha512 +0 -1
  89. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.pom.md5 +0 -1
  90. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.pom.sha1 +0 -1
  91. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.pom.sha256 +0 -1
  92. package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.5/expo.modules.ui-55.0.5.pom.sha512 +0 -1
@@ -1,6 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
+ import * as React from 'react';
2
3
 
3
- import { ExpoModifier } from '../../types';
4
+ import { type ModifierConfig } from '../../types';
4
5
  import { getTextFromChildren } from '../../utils';
5
6
  import { createViewModifierEventListener } from '../modifiers/utils';
6
7
 
@@ -37,9 +38,56 @@ export type TextDecoration = 'none' | 'underline' | 'lineThrough';
37
38
 
38
39
  /**
39
40
  * Text overflow behavior options.
41
+ * - 'clip': Clips the overflowing text to fit its container
42
+ * - 'ellipsis': Uses an ellipsis to indicate that the text has overflowed
43
+ * - 'visible': Renders overflow text outside its container
40
44
  */
41
45
  export type TextOverflow = 'clip' | 'ellipsis' | 'visible';
42
46
 
47
+ /**
48
+ * Line break strategy options.
49
+ * - 'simple': Basic line breaking.
50
+ * - 'heading': Optimized for short text like headings.
51
+ * - 'paragraph': Produces more balanced line lengths for body text.
52
+ */
53
+ export type TextLineBreak = 'simple' | 'heading' | 'paragraph';
54
+
55
+ /**
56
+ * Font family for text styling.
57
+ * Built-in system families: 'default', 'sansSerif', 'serif', 'monospace', 'cursive'.
58
+ * Custom font families loaded via expo-font can be referenced by name (for example, 'Inter-Bold').
59
+ */
60
+ export type TextFontFamily =
61
+ | 'default'
62
+ | 'sansSerif'
63
+ | 'serif'
64
+ | 'monospace'
65
+ | 'cursive'
66
+ | (string & {});
67
+
68
+ /**
69
+ * Text shadow configuration.
70
+ * Corresponds to Jetpack Compose's Shadow class.
71
+ */
72
+ export type TextShadow = {
73
+ /**
74
+ * The color of the shadow.
75
+ */
76
+ color?: string;
77
+ /**
78
+ * The horizontal offset of the shadow in dp.
79
+ */
80
+ offsetX?: number;
81
+ /**
82
+ * The vertical offset of the shadow in dp.
83
+ */
84
+ offsetY?: number;
85
+ /**
86
+ * The blur radius of the shadow in dp.
87
+ */
88
+ blurRadius?: number;
89
+ };
90
+
43
91
  /**
44
92
  * Material 3 Typography scale styles.
45
93
  * Corresponds to MaterialTheme.typography in Jetpack Compose.
@@ -62,23 +110,10 @@ export type TypographyStyle =
62
110
  | 'labelSmall';
63
111
 
64
112
  /**
65
- * Text style properties that can be applied to text.
66
- * Corresponds to Jetpack Compose's TextStyle.
113
+ * Shared span-level style properties used by both `TextStyle` and `TextSpanRecord`.
114
+ * Adding a property here ensures it's available on both parent text and nested spans.
67
115
  */
68
- export type TextStyle = {
69
- /**
70
- * Material 3 Typography style to use as the base style.
71
- * When specified, applies the predefined Material 3 typography style.
72
- * Other properties in this style object will override specific values from the typography.
73
- *
74
- * @example
75
- * ```tsx
76
- * style={{ typography: "bodyLarge" }}
77
- * style={{ typography: "headlineMedium", fontWeight: "bold" }}
78
- * ```
79
- */
80
- typography?: TypographyStyle;
81
-
116
+ export type TextSpanStyleBase = {
82
117
  /**
83
118
  * The font size in sp (scale-independent pixels).
84
119
  */
@@ -95,9 +130,9 @@ export type TextStyle = {
95
130
  fontStyle?: TextFontStyle;
96
131
 
97
132
  /**
98
- * The text alignment.
133
+ * The font family.
99
134
  */
100
- textAlign?: TextAlign;
135
+ fontFamily?: TextFontFamily;
101
136
 
102
137
  /**
103
138
  * The text decoration.
@@ -109,15 +144,60 @@ export type TextStyle = {
109
144
  */
110
145
  letterSpacing?: number;
111
146
 
147
+ /**
148
+ * The background color behind the text.
149
+ */
150
+ background?: string;
151
+
152
+ /**
153
+ * The shadow applied to the text.
154
+ */
155
+ shadow?: TextShadow;
156
+ };
157
+
158
+ /**
159
+ * Text style properties that can be applied to text.
160
+ * Corresponds to Jetpack Compose's `TextStyle`.
161
+ */
162
+ export type TextStyle = TextSpanStyleBase & {
163
+ /**
164
+ * Material 3 Typography style to use as the base style.
165
+ * When specified, applies the predefined Material 3 typography style.
166
+ * Other properties in this style object will override specific values from the typography.
167
+ */
168
+ typography?: TypographyStyle;
169
+
170
+ /**
171
+ * The text alignment.
172
+ */
173
+ textAlign?: TextAlign;
174
+
112
175
  /**
113
176
  * The line height in sp.
114
177
  */
115
178
  lineHeight?: number;
179
+
180
+ /**
181
+ * The line break strategy.
182
+ */
183
+ lineBreak?: TextLineBreak;
184
+ };
185
+
186
+ /**
187
+ * A record representing a styled text span, sent to the native side.
188
+ * Can be a leaf (has `text`) or a branch (has `children`).
189
+ * Style inheritance is handled natively via nested `withStyle` on the Kotlin side.
190
+ */
191
+ type TextSpanRecord = TextSpanStyleBase & {
192
+ text?: string;
193
+ color?: string;
194
+ children?: TextSpanRecord[];
116
195
  };
117
196
 
118
197
  export type TextProps = {
119
198
  /**
120
- * The text content to display.
199
+ * The text content to display. Can be a string, number, or nested `Text` components
200
+ * for inline styled spans.
121
201
  */
122
202
  children?: React.ReactNode;
123
203
 
@@ -128,9 +208,6 @@ export type TextProps = {
128
208
 
129
209
  /**
130
210
  * How visual overflow should be handled.
131
- * - 'clip': Clips the overflowing text to fix its container
132
- * - 'ellipsis': Uses an ellipsis to indicate that the text has overflowed
133
- * - 'visible': Renders overflow text outside its container
134
211
  */
135
212
  overflow?: TextOverflow;
136
213
 
@@ -160,114 +237,107 @@ export type TextProps = {
160
237
  /**
161
238
  * Modifiers for the component.
162
239
  */
163
- modifiers?: ExpoModifier[];
240
+ modifiers?: ModifierConfig[];
164
241
  };
165
242
 
166
- type NativeTextProps = Omit<TextProps, 'children' | 'style'> & {
167
- text: string;
168
- typography?: TypographyStyle;
169
- fontSize?: number;
170
- fontWeight?: TextFontWeight;
171
- fontStyle?: TextFontStyle;
172
- textAlign?: TextAlign;
173
- textDecoration?: TextDecoration;
174
- letterSpacing?: number;
175
- lineHeight?: number;
176
- };
243
+ type NativeTextProps = Omit<TextProps, 'children' | 'style'> &
244
+ TextSpanStyleBase & {
245
+ text?: string;
246
+ spans?: TextSpanRecord[];
247
+ typography?: TypographyStyle;
248
+ textAlign?: TextAlign;
249
+ lineHeight?: number;
250
+ lineBreak?: TextLineBreak;
251
+ };
177
252
 
178
253
  const TextNativeView: React.ComponentType<NativeTextProps> = requireNativeView(
179
254
  'ExpoUI',
180
255
  'TextView'
181
256
  );
182
257
 
258
+ // Constructs tree of spans from nested Text components
259
+ function collectSpans(children: React.ReactNode): TextSpanRecord[] | null {
260
+ if (children === undefined || children === null) return null;
261
+
262
+ const childArray = React.Children.toArray(children);
263
+ if (childArray.length === 0) return null;
264
+
265
+ const hasNestedText = childArray.some(
266
+ (child) => React.isValidElement(child) && child.type === Text
267
+ );
268
+
269
+ if (!hasNestedText) return null;
270
+
271
+ const spans: TextSpanRecord[] = [];
272
+
273
+ for (const child of childArray) {
274
+ if (typeof child === 'string') {
275
+ spans.push({ text: child });
276
+ } else if (typeof child === 'number') {
277
+ spans.push({ text: String(child) });
278
+ } else if (React.isValidElement(child) && child.type === Text) {
279
+ const childProps = child.props as TextProps;
280
+ const span: TextSpanRecord = {
281
+ color: childProps.color,
282
+ fontSize: childProps.style?.fontSize,
283
+ fontWeight: childProps.style?.fontWeight,
284
+ fontStyle: childProps.style?.fontStyle,
285
+ fontFamily: childProps.style?.fontFamily,
286
+ textDecoration: childProps.style?.textDecoration,
287
+ letterSpacing: childProps.style?.letterSpacing,
288
+ background: childProps.style?.background,
289
+ shadow: childProps.style?.shadow,
290
+ };
291
+
292
+ const nestedSpans = collectSpans(childProps.children);
293
+ if (nestedSpans) {
294
+ span.children = nestedSpans;
295
+ } else {
296
+ span.text = getTextFromChildren(childProps.children) ?? '';
297
+ }
298
+
299
+ spans.push(span);
300
+ } else if (__DEV__ && React.isValidElement(child)) {
301
+ console.warn(
302
+ 'Text: Unsupported child element of type "%s" inside <Text>. Only <Text>, string, and number children are supported.',
303
+ typeof child.type === 'function' ? child.type.name || 'Unknown' : child.type
304
+ );
305
+ }
306
+ }
307
+
308
+ return spans.length > 0 ? spans : null;
309
+ }
310
+
183
311
  function transformTextProps(props: TextProps): NativeTextProps {
184
312
  const { children, modifiers, style, ...restProps } = props;
185
313
 
314
+ const spans = collectSpans(children);
315
+
186
316
  return {
187
317
  modifiers,
188
318
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
189
319
  ...restProps,
190
- text: getTextFromChildren(children) ?? '',
320
+ // When spans are present, use them instead of flat text
321
+ ...(spans ? { spans } : { text: getTextFromChildren(children) ?? '' }),
191
322
  // Extract typography from style (used as base style)
192
323
  typography: style?.typography,
193
324
  // Flatten other style properties (these override the typography style)
194
325
  fontSize: style?.fontSize,
195
326
  fontWeight: style?.fontWeight,
196
327
  fontStyle: style?.fontStyle,
328
+ fontFamily: style?.fontFamily,
197
329
  textAlign: style?.textAlign,
198
330
  textDecoration: style?.textDecoration,
199
331
  letterSpacing: style?.letterSpacing,
200
332
  lineHeight: style?.lineHeight,
333
+ lineBreak: style?.lineBreak,
334
+ background: style?.background,
335
+ shadow: style?.shadow,
201
336
  };
202
337
  }
203
338
 
204
339
  /**
205
340
  * Renders a Text component using Jetpack Compose.
206
- *
207
- * The Text component provides comprehensive text styling capabilities.
208
- * The API is aligned with Jetpack Compose's Text composable, where:
209
- * - Top-level props (color, maxLines, etc.) match Compose's Text parameters
210
- * - `style` object corresponds to TextStyle, including typography, fontSize, fontWeight, textAlign, etc.
211
- * - `style.typography` applies Material 3 typography styles (like MaterialTheme.typography)
212
- *
213
- * @example
214
- * Basic usage:
215
- * ```tsx
216
- * import { Text } from 'expo-ui';
217
- *
218
- * <Text>Hello World</Text>
219
- * ```
220
- *
221
- * @example
222
- * Using Material 3 Typography (matches Jetpack Compose MaterialTheme.typography):
223
- * ```tsx
224
- * <Text style={{ typography: "bodyLarge" }}>Body text</Text>
225
- * <Text style={{ typography: "headlineMedium" }}>Headline</Text>
226
- * <Text style={{ typography: "titleSmall" }}>Small title</Text>
227
- * ```
228
- *
229
- * @example
230
- * Typography with style overrides:
231
- * ```tsx
232
- * <Text
233
- * color="#007AFF"
234
- * style={{
235
- * typography: "bodyLarge",
236
- * fontWeight: "bold" // Override the typography's font weight
237
- * }}
238
- * >
239
- * Custom styled body text
240
- * </Text>
241
- * ```
242
- *
243
- * @example
244
- * With custom style object (matches Jetpack Compose TextStyle):
245
- * ```tsx
246
- * <Text
247
- * color="#007AFF"
248
- * style={{
249
- * fontSize: 18,
250
- * fontWeight: "bold",
251
- * textAlign: "center",
252
- * letterSpacing: 1.2
253
- * }}
254
- * modifiers={[ExpoUI.padding(16)]}
255
- * >
256
- * Styled text
257
- * </Text>
258
- * ```
259
- *
260
- * @example
261
- * Text truncation with ellipsis:
262
- * ```tsx
263
- * <Text
264
- * maxLines={2}
265
- * overflow="ellipsis"
266
- * >
267
- * This is a very long text that will be truncated after two lines
268
- * with an ellipsis at the end to indicate there's more content...
269
- * </Text>
270
- * ```
271
341
  */
272
342
  export function Text(props: TextProps) {
273
343
  return <TextNativeView {...transformTextProps(props)} />;
@@ -4,6 +4,16 @@ import { Ref } from 'react';
4
4
  import { ExpoModifier, 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
18
  * @hidden Not used anywhere yet.
9
19
  */
@@ -89,17 +99,22 @@ export type TextInputProps = {
89
99
  * @platform android
90
100
  */
91
101
  autoCapitalize?: 'characters' | 'none' | 'sentences' | 'unspecified' | 'words';
92
-
93
102
  /**
94
- * Modifiers for the component.
103
+ * Placeholder text shown inside the field when empty and focused.
104
+ *
95
105
  */
106
+ placeholder?: string;
107
+ /** Modifiers for the component */
96
108
  modifiers?: ExpoModifier[];
109
+ /**
110
+ * Slot children (e.g. `TextInput.Label`).
111
+ */
112
+ children?: React.ReactNode;
97
113
  };
98
114
 
99
- export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText'> & {} & ViewEvent<
100
- 'onValueChanged',
101
- { value: string }
102
- >;
115
+ export type NativeTextInputProps = Omit<TextInputProps, 'onChangeText' | 'children'> & {
116
+ children?: React.ReactNode;
117
+ } & ViewEvent<'onValueChanged', { value: string }>;
103
118
 
104
119
  // We have to work around the `role` and `onPress` props being reserved by React Native.
105
120
  const TextInputNativeView: React.ComponentType<NativeTextInputProps> = requireNativeView(
@@ -108,20 +123,35 @@ const TextInputNativeView: React.ComponentType<NativeTextInputProps> = requireNa
108
123
  );
109
124
 
110
125
  function transformTextInputProps(props: TextInputProps): NativeTextInputProps {
111
- const { modifiers, ...restProps } = props;
126
+ const { modifiers, children, ...restProps } = props;
112
127
  return {
113
128
  modifiers,
114
129
  ...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
115
130
  ...restProps,
131
+ children,
116
132
  onValueChanged: (event) => {
117
133
  props.onChangeText?.(event.nativeEvent.value);
118
134
  },
119
135
  };
120
136
  }
121
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
+
122
148
  /**
123
149
  * Renders a `TextInput` component.
124
150
  */
125
- export function TextInput(props: TextInputProps) {
151
+ function TextInputComponent(props: TextInputProps) {
126
152
  return <TextInputNativeView {...transformTextInputProps(props)} />;
127
153
  }
154
+
155
+ TextInputComponent.Label = Label;
156
+
157
+ export { TextInputComponent as TextInput };
@@ -1,7 +1,7 @@
1
1
  import './MaterialSymbolsAssetsTransformer.fx';
2
2
 
3
3
  export * from './AlertDialog';
4
- export * from './BasicAlertDialog';
4
+ export { BasicAlertDialog, type BasicAlertDialogProps } from './BasicAlertDialog';
5
5
  export * from './Card';
6
6
  export * from './Checkbox';
7
7
  export * from './Chip';
@@ -32,7 +32,7 @@ export * from './FloatingActionButton';
32
32
  export * from './PullToRefreshBox';
33
33
  export * from './RadioButton';
34
34
  export * from './Surface';
35
- export * from './Text';
35
+ export { type TextProps, Text } from './Text';
36
36
 
37
37
  export * from './AnimatedVisibility';
38
38
  export * from './Box';
@@ -104,6 +104,16 @@ export const wrapContentWidth = (alignment?: 'start' | 'centerHorizontally' | 'e
104
104
  export const wrapContentHeight = (alignment?: 'top' | 'centerVertically' | 'bottom') =>
105
105
  createModifier('wrapContentHeight', alignment ? { alignment } : {});
106
106
 
107
+ // =============================================================================
108
+ // Inset Modifiers
109
+ // =============================================================================
110
+
111
+ /**
112
+ * Adds padding to avoid the software keyboard (IME).
113
+ * When the keyboard is visible, padding is added to keep content above it.
114
+ */
115
+ export const imePadding = () => createModifier('imePadding');
116
+
107
117
  // =============================================================================
108
118
  // Position Modifiers
109
119
  // =============================================================================
@@ -495,7 +495,7 @@ export const grayscale = (amount: number) => createModifier('grayscale', { amoun
495
495
 
496
496
  /**
497
497
  * Sets the button style for button views.
498
- * @param style - The button style.
498
+ * @param style - The button style. `'glass'` and `'glassProminent'` are available on iOS 26+ and tvOS 26+ only.
499
499
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/buttonstyle(_:)).
500
500
  */
501
501
  export const buttonStyle = (
package/src/types.ts CHANGED
@@ -23,3 +23,30 @@ export interface ModifierConfig {
23
23
  * with JSON Config pattern for better DX and platform consistency.
24
24
  */
25
25
  export type ExpoModifier = ModifierConfig;
26
+
27
+ /**
28
+ * Properties for the dialog window, matching `DialogProperties` in Compose.
29
+ */
30
+ export type DialogProperties = {
31
+ /**
32
+ * Whether the dialog can be dismissed by pressing the back button.
33
+ * @default true
34
+ */
35
+ dismissOnBackPress?: boolean;
36
+ /**
37
+ * Whether the dialog can be dismissed by clicking outside of it.
38
+ * @default true
39
+ */
40
+ dismissOnClickOutside?: boolean;
41
+ /**
42
+ * Whether the dialog should use the platform default width.
43
+ * @default true
44
+ */
45
+ usePlatformDefaultWidth?: boolean;
46
+ /**
47
+ * Whether the dialog's decor fits system windows (status bar, navigation bar, and more).
48
+ * When `true`, the dialog's content will be inset to avoid overlapping with system UI.
49
+ * @default true
50
+ */
51
+ decorFitsSystemWindows?: boolean;
52
+ };
@@ -1 +0,0 @@
1
- a1a203196fb21b6162e5f11497c730d850afd116
@@ -1 +0,0 @@
1
- 7acb8c8af049e49e3f9af27000c01412a43bb971421bf27a59de32a14e59053f
@@ -1 +0,0 @@
1
- c71fbadf5d96e9f5039ea8bb7694af708eee076fcfd37efd54ee4beef8eeedda1114cd15ca256ca10e8fd865ffb08733eabd9608e4ac5b82d29b77a5c1fc733b
@@ -1 +0,0 @@
1
- 7899807b4b76bba12ab5649d1ecca695
@@ -1 +0,0 @@
1
- f04895e7bb6cc7d89b005053ff14287e741bb6fb
@@ -1 +0,0 @@
1
- 0d918c50436945df1df399fbe35f7c065f5c3f2d96d6a423a7f0d8f70f8becd2
@@ -1 +0,0 @@
1
- 9960b6d2dcda9ca028402dd50376be92f3352ac81b6d2a28715aaa2896d48b82cc29605e0c2ed358b52232c22e87ab82bdc5252744746d717c419f95471a0d79
@@ -1 +0,0 @@
1
- d30ff1c605c25bd8d8e0fb80ff49b811971ecbe2
@@ -1 +0,0 @@
1
- 4a1a49797698e0a10a5214ddbb85223f1685408e0f70b9b4dd0fdf9af8938ef0
@@ -1 +0,0 @@
1
- 165be7a4ea9bff60b606481e700c45968635b002f4260c92cd22553bd23a634ebb7681d4ca2a787f8ef4e33c952a3fa1ba55a2083a2520136d33a74d4ec79fbc
@@ -1 +0,0 @@
1
- 2fa92de106669f051d7e9dfcbefdcbc9
@@ -1 +0,0 @@
1
- 3f822c8513e1486f233092aa7005cc745004f34e
@@ -1 +0,0 @@
1
- b19b4026895db6fc291f3c7e82297b8cc05faec53e2b552a97c098bcc5615018
@@ -1 +0,0 @@
1
- 43d30e9917a138c7b219086306814b7c4511a74854b90d939e44efb368b9321059eb951af7578e27e390fa4ae69e7166de360826745d393acaef02890d767f0b