@expo/ui 57.0.22 → 57.0.23

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 (91) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +35 -2
  4. package/android/src/main/java/expo/modules/ui/DateRangePickerView.kt +35 -2
  5. package/android/src/main/java/expo/modules/ui/HostView.kt +21 -0
  6. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +2 -2
  7. package/android/src/main/java/expo/modules/ui/RNHostView.kt +124 -17
  8. package/build/community/bottom-sheet/BottomSheet.ios.d.ts.map +1 -1
  9. package/build/community/datetime-picker/DateTimePicker.android.d.ts.map +1 -1
  10. package/build/jetpack-compose/DatePicker/index.d.ts +38 -0
  11. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  12. package/build/jetpack-compose/RNHostView/index.d.ts +6 -1
  13. package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
  14. package/build/swift-ui/Chart/index.d.ts +10 -0
  15. package/build/swift-ui/Chart/index.d.ts.map +1 -1
  16. package/build/swift-ui/RNHostView.d.ts +7 -2
  17. package/build/swift-ui/RNHostView.d.ts.map +1 -1
  18. package/build/swift-ui/modifiers/index.d.ts +1 -0
  19. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  20. package/build/swift-ui/modifiers/presentationModifiers.d.ts +17 -1
  21. package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
  22. package/build/swift-ui/modifiers/searchable.d.ts +84 -0
  23. package/build/swift-ui/modifiers/searchable.d.ts.map +1 -0
  24. package/build/universal/RNHostView/index.d.ts.map +1 -1
  25. package/build/universal/RNHostView/types.d.ts +9 -4
  26. package/build/universal/RNHostView/types.d.ts.map +1 -1
  27. package/build/utils/matchContents.d.ts +11 -0
  28. package/build/utils/matchContents.d.ts.map +1 -0
  29. package/expo-module.config.json +1 -1
  30. package/ios/ChartView.swift +15 -10
  31. package/ios/Modifiers/PresentationModifiers.swift +20 -4
  32. package/ios/Modifiers/SearchToolbarBehaviorModifier.swift +35 -0
  33. package/ios/Modifiers/SearchableModifier.swift +94 -0
  34. package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
  35. package/ios/Picker/PickerView.swift +9 -7
  36. package/ios/RNHostView.swift +55 -9
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.22/expo.modules.ui-57.0.22-sources.jar → 57.0.23/expo.modules.ui-57.0.23-sources.jar} +0 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.md5 +1 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha1 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha256 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha512 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar +0 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.md5 +1 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha1 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha256 +1 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha512 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.22/expo.modules.ui-57.0.22.module → 57.0.23/expo.modules.ui-57.0.23.module} +22 -22
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.md5 +1 -0
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha1 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha256 +1 -0
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha512 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.22/expo.modules.ui-57.0.22.pom → 57.0.23/expo.modules.ui-57.0.23.pom} +1 -1
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.md5 +1 -0
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.sha1 +1 -0
  55. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.sha256 +1 -0
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.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 +3 -3
  63. package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -6
  64. package/src/community/datetime-picker/DateTimePicker.android.tsx +4 -0
  65. package/src/jetpack-compose/DatePicker/index.tsx +38 -0
  66. package/src/jetpack-compose/RNHostView/index.tsx +17 -6
  67. package/src/swift-ui/Chart/index.tsx +10 -0
  68. package/src/swift-ui/RNHostView.tsx +11 -4
  69. package/src/swift-ui/modifiers/index.ts +1 -0
  70. package/src/swift-ui/modifiers/presentationModifiers.ts +18 -2
  71. package/src/swift-ui/modifiers/searchable.ts +107 -0
  72. package/src/universal/RNHostView/index.tsx +9 -4
  73. package/src/universal/RNHostView/types.ts +6 -4
  74. package/src/utils/matchContents.ts +14 -0
  75. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22-sources.jar.md5 +0 -1
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22-sources.jar.sha1 +0 -1
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22-sources.jar.sha256 +0 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22-sources.jar.sha512 +0 -1
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.aar +0 -0
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.aar.md5 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.aar.sha1 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.aar.sha256 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.aar.sha512 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.module.md5 +0 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.module.sha1 +0 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.module.sha256 +0 -1
  87. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.module.sha512 +0 -1
  88. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.pom.md5 +0 -1
  89. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.pom.sha1 +0 -1
  90. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.pom.sha256 +0 -1
  91. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.22/expo.modules.ui-57.0.22.pom.sha512 +0 -1
@@ -0,0 +1,107 @@
1
+ import { createModifier, createModifierWithEventListener } from './createModifier';
2
+ import { getStateId, type ObservableState } from '../../State';
3
+
4
+ /**
5
+ * The placement of a search field in a view hierarchy.
6
+ *
7
+ * - `automatic`: SwiftUI places the search field automatically.
8
+ * - `toolbar`: The search field appears in the toolbar. Falls back to `automatic` on tvOS.
9
+ * - `sidebar`: The search field appears in the sidebar of a navigation view. Falls back to
10
+ * `automatic` on tvOS.
11
+ * - `navigationBarDrawer`: The search field appears in the navigation bar. Falls back to
12
+ * `automatic` on macOS and tvOS.
13
+ */
14
+ export type SearchFieldPlacement = 'automatic' | 'toolbar' | 'sidebar' | 'navigationBarDrawer';
15
+
16
+ /**
17
+ * Marks this view as searchable, which configures the display of a search field.
18
+ *
19
+ * @param text - The text to display and edit in the search field. An `ObservableState<string>`
20
+ * created with `useNativeState`.
21
+ * @param options.placement - The preferred placement of the search field within the containing
22
+ * view hierarchy. Defaults to `automatic`.
23
+ * @param options.prompt - The prompt of the search field, which provides users with guidance on
24
+ * what to search for.
25
+ * @param options.onChange - Fires on the JS thread when the user edits or clears the search field.
26
+ * It does not fire for values written from JavaScript.
27
+ *
28
+ * @platform ios
29
+ * @platform tvos
30
+ * @platform macos
31
+ *
32
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchable(text:placement:prompt:)-18a8f).
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * const query = useNativeState('');
37
+ *
38
+ * <Host>
39
+ * <NavigationStack>
40
+ * <List
41
+ * modifiers={[
42
+ * searchable(query, {
43
+ * prompt: 'Search agents',
44
+ * onChange: (text) => setFilter(text),
45
+ * }),
46
+ * ]}>
47
+ * {rows.map((row) => (
48
+ * <Text key={row.id}>{row.name}</Text>
49
+ * ))}
50
+ * </List>
51
+ * </NavigationStack>
52
+ * </Host>
53
+ * ```
54
+ */
55
+ export const searchable = (
56
+ text: ObservableState<string>,
57
+ options?: {
58
+ placement?: SearchFieldPlacement;
59
+ prompt?: string;
60
+ onChange?: (text: string) => void;
61
+ }
62
+ ) => {
63
+ const params = {
64
+ text: getStateId(text),
65
+ placement: options?.placement,
66
+ prompt: options?.prompt,
67
+ };
68
+ const onChange = options?.onChange;
69
+ if (onChange) {
70
+ return createModifierWithEventListener(
71
+ 'searchable',
72
+ (event: { text?: string }) => onChange(event?.text ?? ''),
73
+ params
74
+ );
75
+ }
76
+ return createModifier('searchable', params);
77
+ };
78
+
79
+ /**
80
+ * The behavior of a search field in a toolbar.
81
+ *
82
+ * - `automatic`: The automatic behavior.
83
+ * - `minimize`: A search toolbar behavior that prefers rendering a search field as a button-like
84
+ * control. Falls back to `automatic` on macOS and tvOS.
85
+ */
86
+ export type SearchToolbarBehavior = 'automatic' | 'minimize';
87
+
88
+ /**
89
+ * Configures the behavior for search in the toolbar.
90
+ *
91
+ * On iOS below 26.0, the modifier is a no-op.
92
+ *
93
+ * @param behavior - The search field behavior.
94
+ *
95
+ * @platform ios 26.0+
96
+ * @platform tvos 26.0+
97
+ * @platform macos 26.0+
98
+ *
99
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/searchtoolbarbehavior(_:)).
100
+ *
101
+ * @example
102
+ * ```tsx
103
+ * <List modifiers={[searchable(query), searchToolbarBehavior('minimize')]}>
104
+ * ```
105
+ */
106
+ export const searchToolbarBehavior = (behavior: SearchToolbarBehavior) =>
107
+ createModifier('searchToolbarBehavior', { behavior });
@@ -1,11 +1,14 @@
1
1
  import { StyleSheet, View } from 'react-native';
2
2
 
3
- import type { RNHostViewProps } from './types';
3
+ import { resolveMatchContents } from '../../utils/matchContents';
4
4
  import { useUniversalLifecycle } from '../hooks';
5
+ import type { RNHostViewProps } from './types';
5
6
 
6
7
  const styles = StyleSheet.create({
7
- fillParent: { width: '100%', height: '100%' },
8
- matchContents: { width: 'fit-content', height: 'fit-content' },
8
+ fillWidth: { width: '100%' },
9
+ fillHeight: { height: '100%' },
10
+ fitWidth: { width: 'fit-content' },
11
+ fitHeight: { height: 'fit-content' },
9
12
  hidden: { display: 'none' },
10
13
  });
11
14
 
@@ -23,13 +26,15 @@ export function RNHostView({
23
26
  onLayout,
24
27
  }: RNHostViewProps) {
25
28
  useUniversalLifecycle(onAppear, onDisappear);
29
+ const { horizontal, vertical } = resolveMatchContents(matchContents);
26
30
 
27
31
  return (
28
32
  <View
29
33
  testID={testID}
30
34
  onLayout={onLayout}
31
35
  style={[
32
- matchContents ? styles.matchContents : styles.fillParent,
36
+ horizontal ? styles.fitWidth : styles.fillWidth,
37
+ vertical ? styles.fitHeight : styles.fillHeight,
33
38
  style,
34
39
  hidden && styles.hidden,
35
40
  ]}>
@@ -8,16 +8,18 @@ import type { UniversalBaseProps } from '../types';
8
8
  */
9
9
  export interface RNHostViewProps extends UniversalBaseProps {
10
10
  /**
11
- * When `true`, the host updates its size in the native view tree to match
12
- * the children's size. When `false`, the host uses the size of the parent
13
- * native view.
11
+ * When `true`, the host updates its size in the SwiftUI or Compose view tree to
12
+ * match the children's size. When `false`, the host uses the size of the parent
13
+ * SwiftUI or Compose view. Pass an object to choose per axis. For example,
14
+ * `{ vertical: true }` takes the width from the parent and the height from the
15
+ * children, so text wraps and grows vertically.
14
16
  *
15
17
  * Can only be set once on mount; changing it remounts the component.
16
18
  * @default false
17
19
  * @platform android
18
20
  * @platform ios
19
21
  */
20
- matchContents?: boolean;
22
+ matchContents?: boolean | { vertical?: boolean; horizontal?: boolean };
21
23
 
22
24
  onLayout?: (event: LayoutChangeEvent) => void;
23
25
 
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Resolves `RNHostView`'s `matchContents` prop to one flag per axis.
3
+ */
4
+ export function resolveMatchContents(
5
+ matchContents: boolean | { vertical?: boolean; horizontal?: boolean } | null | undefined
6
+ ): { horizontal: boolean; vertical: boolean } {
7
+ if (matchContents != null && typeof matchContents === 'object') {
8
+ return {
9
+ horizontal: matchContents.horizontal ?? false,
10
+ vertical: matchContents.vertical ?? false,
11
+ };
12
+ }
13
+ return { horizontal: matchContents ?? false, vertical: matchContents ?? false };
14
+ }
@@ -1 +0,0 @@
1
- b9f56fabf01aea58b15172683c4a748b8dc3cf55
@@ -1 +0,0 @@
1
- e1ff6f3760b8699263fd244601e146335a9f853109153f91be6c98d092a9302e
@@ -1 +0,0 @@
1
- 81d467c2d81c5fb4545160a5b5563fcf0f6eb3fbb191a507382ad6b0abde41d6c5506edc2281c1e98dee29eb2c861856f8e34d4208972a2dbf2b547c77143627
@@ -1 +0,0 @@
1
- d581a4836a4dd119bfc57aca7152c5f7a45911b8
@@ -1 +0,0 @@
1
- a869c8586462b852b75439dbfeaa7caef538db6eeff7bac5aee0026215a61a06
@@ -1 +0,0 @@
1
- 34080b16453bc36824a34471ee76e7da22af80c63cc419ea34d8c2e1e562f72f968ce8faefd5672f33a4c899c0cdf85c2e711318d859ba4d4562b7e0a61482d8
@@ -1 +0,0 @@
1
- 14b81e92a813dd3ff42d0b57bc819fe6fe45dbe9
@@ -1 +0,0 @@
1
- 4f7022f3602a1162d857c67860c42f26d80c57f0955e815776e0d69da62a6b89
@@ -1 +0,0 @@
1
- f4323dcdf2bd04112993e148d47b98df0245f0679aedb4965f45646c987da2d513b3a312aba6ca5802a411cc07b8260c3b3a944a30da7e4b9c2d2140e9cc0b78
@@ -1 +0,0 @@
1
- 64719d73cd6c6e4410f220586d1b900553d8636f
@@ -1 +0,0 @@
1
- b1893b9a45c11ca23be9b083040c6c8e42e5dbf2f83388fb2ecb46ebb759ef43
@@ -1 +0,0 @@
1
- 2e7e5260dc6cae8eb8555c1614f8e50394413bd3cc98d8c34ffb9831458a6079516da7c302bac741da5f578dac28c7772d1cf5efd111f007f15639876db47768