@expo/ui 57.0.21 → 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 (128) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +36 -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 +28 -1
  6. package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +23 -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/community/datetime-picker/utils.d.ts +11 -0
  11. package/build/community/datetime-picker/utils.d.ts.map +1 -0
  12. package/build/community/picker/Picker.android.d.ts.map +1 -1
  13. package/build/jetpack-compose/DatePicker/index.d.ts +38 -0
  14. package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
  15. package/build/jetpack-compose/RNHostView/index.d.ts +6 -1
  16. package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
  17. package/build/jetpack-compose/modifiers/index.d.ts +18 -3
  18. package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
  19. package/build/swift-ui/ArrangementView/index.d.ts +49 -0
  20. package/build/swift-ui/ArrangementView/index.d.ts.map +1 -0
  21. package/build/swift-ui/Chart/index.d.ts +10 -0
  22. package/build/swift-ui/Chart/index.d.ts.map +1 -1
  23. package/build/swift-ui/RNHostView.d.ts +7 -2
  24. package/build/swift-ui/RNHostView.d.ts.map +1 -1
  25. package/build/swift-ui/index.d.ts +1 -0
  26. package/build/swift-ui/index.d.ts.map +1 -1
  27. package/build/swift-ui/modifiers/animation/index.d.ts +6 -1
  28. package/build/swift-ui/modifiers/animation/index.d.ts.map +1 -1
  29. package/build/swift-ui/modifiers/animation/types.d.ts +15 -1
  30. package/build/swift-ui/modifiers/animation/types.d.ts.map +1 -1
  31. package/build/swift-ui/modifiers/arrangementModifiers.d.ts +110 -0
  32. package/build/swift-ui/modifiers/arrangementModifiers.d.ts.map +1 -0
  33. package/build/swift-ui/modifiers/containerBackground.d.ts +2 -2
  34. package/build/swift-ui/modifiers/index.d.ts +41 -2
  35. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  36. package/build/swift-ui/modifiers/presentationModifiers.d.ts +17 -1
  37. package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
  38. package/build/swift-ui/modifiers/searchable.d.ts +84 -0
  39. package/build/swift-ui/modifiers/searchable.d.ts.map +1 -0
  40. package/build/universal/RNHostView/index.d.ts.map +1 -1
  41. package/build/universal/RNHostView/types.d.ts +9 -4
  42. package/build/universal/RNHostView/types.d.ts.map +1 -1
  43. package/build/universal/Switch/index.android.d.ts.map +1 -1
  44. package/build/utils/matchContents.d.ts +11 -0
  45. package/build/utils/matchContents.d.ts.map +1 -0
  46. package/expo-module.config.json +1 -1
  47. package/ios/ArrangementViewView.swift +40 -0
  48. package/ios/ChartView.swift +15 -10
  49. package/ios/ExpoUIModule.swift +1 -1
  50. package/ios/Modifiers/AnimationConfig.swift +20 -0
  51. package/ios/Modifiers/ArrangementModifiers.swift +157 -0
  52. package/ios/Modifiers/ContainerBackgroundModifier.swift +26 -13
  53. package/ios/Modifiers/PreferredColorSchemeModifier.swift +12 -0
  54. package/ios/Modifiers/PresentationModifiers.swift +20 -4
  55. package/ios/Modifiers/SearchToolbarBehaviorModifier.swift +35 -0
  56. package/ios/Modifiers/SearchableModifier.swift +94 -0
  57. package/ios/Modifiers/View+ModifierArray.swift +3 -3
  58. package/ios/Modifiers/ViewModifierRegistry.swift +124 -9
  59. package/ios/Modifiers/WidgetKitModifiers.swift +13 -0
  60. package/ios/Picker/PickerView.swift +9 -7
  61. package/ios/RNHostView.swift +55 -9
  62. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.21/expo.modules.ui-57.0.21-sources.jar → 57.0.23/expo.modules.ui-57.0.23-sources.jar} +0 -0
  63. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.md5 +1 -0
  64. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha1 +1 -0
  65. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha256 +1 -0
  66. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23-sources.jar.sha512 +1 -0
  67. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar +0 -0
  68. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.md5 +1 -0
  69. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha1 +1 -0
  70. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha256 +1 -0
  71. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.aar.sha512 +1 -0
  72. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.21/expo.modules.ui-57.0.21.module → 57.0.23/expo.modules.ui-57.0.23.module} +22 -22
  73. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.md5 +1 -0
  74. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha1 +1 -0
  75. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha256 +1 -0
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.module.sha512 +1 -0
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.21/expo.modules.ui-57.0.21.pom → 57.0.23/expo.modules.ui-57.0.23.pom} +1 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.md5 +1 -0
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.sha1 +1 -0
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.sha256 +1 -0
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.23/expo.modules.ui-57.0.23.pom.sha512 +1 -0
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  86. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  87. package/package.json +4 -4
  88. package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -6
  89. package/src/community/datetime-picker/DateTimePicker.android.tsx +18 -4
  90. package/src/community/datetime-picker/utils.ts +21 -0
  91. package/src/community/picker/Picker.android.tsx +5 -0
  92. package/src/jetpack-compose/DatePicker/index.tsx +38 -0
  93. package/src/jetpack-compose/RNHostView/index.tsx +17 -6
  94. package/src/jetpack-compose/modifiers/index.ts +17 -3
  95. package/src/swift-ui/ArrangementView/index.tsx +70 -0
  96. package/src/swift-ui/Chart/index.tsx +10 -0
  97. package/src/swift-ui/RNHostView.tsx +11 -4
  98. package/src/swift-ui/index.tsx +1 -0
  99. package/src/swift-ui/modifiers/animation/index.ts +24 -11
  100. package/src/swift-ui/modifiers/animation/types.ts +18 -0
  101. package/src/swift-ui/modifiers/arrangementModifiers.ts +142 -0
  102. package/src/swift-ui/modifiers/containerBackground.ts +2 -2
  103. package/src/swift-ui/modifiers/index.ts +52 -1
  104. package/src/swift-ui/modifiers/presentationModifiers.ts +18 -2
  105. package/src/swift-ui/modifiers/searchable.ts +107 -0
  106. package/src/universal/RNHostView/index.tsx +9 -4
  107. package/src/universal/RNHostView/types.ts +6 -4
  108. package/src/universal/Switch/index.android.tsx +11 -2
  109. package/src/utils/matchContents.ts +14 -0
  110. package/ios/AccessoryWidgetBackgroundView.swift +0 -27
  111. package/ios/Modifiers/WidgetModifiers.swift +0 -70
  112. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21-sources.jar.md5 +0 -1
  113. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21-sources.jar.sha1 +0 -1
  114. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21-sources.jar.sha256 +0 -1
  115. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21-sources.jar.sha512 +0 -1
  116. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.aar +0 -0
  117. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.aar.md5 +0 -1
  118. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.aar.sha1 +0 -1
  119. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.aar.sha256 +0 -1
  120. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.aar.sha512 +0 -1
  121. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.module.md5 +0 -1
  122. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.module.sha1 +0 -1
  123. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.module.sha256 +0 -1
  124. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.module.sha512 +0 -1
  125. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.pom.md5 +0 -1
  126. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.pom.sha1 +0 -1
  127. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.pom.sha256 +0 -1
  128. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.21/expo.modules.ui-57.0.21.pom.sha512 +0 -1
@@ -5,6 +5,7 @@ import type {
5
5
  ChainableAnimationType,
6
6
  InterpolatingSpringAnimationParams,
7
7
  SpringAnimationParams,
8
+ SpringPresetAnimationParams,
8
9
  TimingAnimationParams,
9
10
  } from './types';
10
11
 
@@ -16,6 +17,8 @@ import type {
16
17
  * - `spring` accepts [`SpringAnimationParams`](#springanimationparams).
17
18
  * - `interpolatingSpring` accepts
18
19
  * [`InterpolatingSpringAnimationParams`](#interpolatingspringanimationparams).
20
+ * - Spring presets (`smooth`, `snappy`, `bouncy`) accept
21
+ * [`SpringPresetAnimationParams`](#springpresetanimationparams).
19
22
  * - Chaining returns [`ChainableAnimationType`](#chainableanimationtype).
20
23
  *
21
24
  * @example
@@ -80,23 +83,33 @@ export const Animation = {
80
83
  duration: params?.duration,
81
84
  bounce: params?.bounce,
82
85
  }),
86
+ smooth: (params?: SpringPresetAnimationParams) =>
87
+ ChainableAnimation({
88
+ type: 'smooth',
89
+ duration: params?.duration,
90
+ extraBounce: params?.extraBounce,
91
+ }),
92
+ snappy: (params?: SpringPresetAnimationParams) =>
93
+ ChainableAnimation({
94
+ type: 'snappy',
95
+ duration: params?.duration,
96
+ extraBounce: params?.extraBounce,
97
+ }),
98
+ bouncy: (params?: SpringPresetAnimationParams) =>
99
+ ChainableAnimation({
100
+ type: 'bouncy',
101
+ duration: params?.duration,
102
+ extraBounce: params?.extraBounce,
103
+ }),
83
104
 
84
105
  default: ChainableAnimation({ type: 'default' }),
85
106
  };
86
107
 
87
108
  function ChainableAnimation(animation: AnimationObject): ChainableAnimationType {
88
- let _animation: AnimationObject = animation;
89
-
90
109
  return {
91
- delay: (delay) => {
92
- _animation = { ..._animation, delay };
93
- return ChainableAnimation(_animation);
94
- },
95
- repeat: (params) => {
96
- _animation = { ..._animation, ...params };
97
- return ChainableAnimation(_animation);
98
- },
99
- [VALUE_SYMBOL]: () => _animation,
110
+ delay: (delay) => ChainableAnimation({ ...animation, delay }),
111
+ repeat: (params) => ChainableAnimation({ ...animation, ...params }),
112
+ [VALUE_SYMBOL]: () => animation,
100
113
  };
101
114
  }
102
115
 
@@ -12,6 +12,9 @@ export type AnimationObject = {
12
12
  | 'linear'
13
13
  | 'spring'
14
14
  | 'interpolatingSpring'
15
+ | 'smooth'
16
+ | 'snappy'
17
+ | 'bouncy'
15
18
  | 'default';
16
19
  duration?: number;
17
20
  response?: number;
@@ -22,6 +25,7 @@ export type AnimationObject = {
22
25
  stiffness?: number;
23
26
  damping?: number;
24
27
  initialVelocity?: number;
28
+ extraBounce?: number;
25
29
  delay?: number;
26
30
  repeatCount?: number;
27
31
  autoreverses?: boolean;
@@ -84,6 +88,20 @@ export type InterpolatingSpringAnimationParams = {
84
88
  bounce?: number;
85
89
  };
86
90
 
91
+ export type SpringPresetAnimationParams = {
92
+ /**
93
+ * The perceptual duration, which defines the pace of the spring (in seconds). This is
94
+ * approximately equal to the settling duration, but for very bouncy springs, it is the period of
95
+ * oscillation of the spring.
96
+ */
97
+ duration?: number;
98
+ /**
99
+ * Bounce added to the base bounce of the preset: 0 for `smooth`, 0.15 for `snappy`, and 0.3 for
100
+ * `bouncy`. Keep the total below 1: at 1 and above, the spring oscillates without settling.
101
+ */
102
+ extraBounce?: number;
103
+ };
104
+
87
105
  export type ChainableAnimationType = {
88
106
  /** Adds a delay before the animation starts (in seconds). */
89
107
  delay: (delay: number) => ChainableAnimationType;
@@ -0,0 +1,142 @@
1
+ import { createModifier } from './createModifier';
2
+
3
+ /**
4
+ * A style that configures an `ArrangementView` with an arrangement.
5
+ * - `'automatic'`: The default style, which resolves to `'split'`.
6
+ * - `'split'`: An arrangement view style that places the primary and secondary views side by side along one or more axes.
7
+ * - `'overlay'`: An arrangement view style that layers the primary view over the secondary view in z-order.
8
+ */
9
+ export type ArrangementViewStyle = 'automatic' | 'split' | 'overlay';
10
+
11
+ /**
12
+ * Sets the style for arrangement views within this view.
13
+ * @param style - The style to apply.
14
+ * @param options - The `axes` the arrangement supports. With `'split'`, creates a split arrangement
15
+ * that supports the given axes. With `'overlay'`, creates an overlay arrangement that supports
16
+ * laying out its views along the given axes.
17
+ * @platform ios 27.1+
18
+ * @platform tvos 27.1+
19
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/arrangementviewstyle(_:)).
20
+ */
21
+ export function arrangementViewStyle(style: 'automatic'): ReturnType<typeof createModifier>;
22
+ export function arrangementViewStyle(
23
+ style: 'split' | 'overlay',
24
+ options?: { axes?: 'horizontal' | 'vertical' | 'both' }
25
+ ): ReturnType<typeof createModifier>;
26
+ export function arrangementViewStyle(
27
+ style: ArrangementViewStyle,
28
+ options?: { axes?: 'horizontal' | 'vertical' | 'both' }
29
+ ) {
30
+ return createModifier('arrangementViewStyle', { style, axes: options?.axes });
31
+ }
32
+
33
+ /**
34
+ * The minimum, ideal, and maximum ratios for `splitArrangementLayoutRatio`.
35
+ */
36
+ export type SplitArrangementLayoutRatioParams = {
37
+ minHorizontal?: number;
38
+ idealHorizontal?: number;
39
+ maxHorizontal?: number;
40
+ minVertical?: number;
41
+ idealVertical?: number;
42
+ maxVertical?: number;
43
+ };
44
+
45
+ /**
46
+ * Sets the preferred size ratio for the content of `ArrangementView.Primary` or
47
+ * `ArrangementView.Secondary` in a split arrangement.
48
+ * @platform ios 27.1+
49
+ * @platform tvos 27.1+
50
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/splitarrangementlayoutratio(_:)).
51
+ */
52
+ export function splitArrangementLayoutRatio(ratio: number): ReturnType<typeof createModifier>;
53
+ /**
54
+ * Sets the size ratio for the content of `ArrangementView.Primary` or `ArrangementView.Secondary`
55
+ * in a split arrangement.
56
+ * @platform ios 27.1+
57
+ * @platform tvos 27.1+
58
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/splitarrangementlayoutratio(minhorizontal:idealhorizontal:maxhorizontal:minvertical:idealvertical:maxvertical:)).
59
+ */
60
+ export function splitArrangementLayoutRatio(
61
+ ratios: SplitArrangementLayoutRatioParams
62
+ ): ReturnType<typeof createModifier>;
63
+ export function splitArrangementLayoutRatio(
64
+ ratioOrParams: number | SplitArrangementLayoutRatioParams
65
+ ) {
66
+ return createModifier(
67
+ 'splitArrangementLayoutRatio',
68
+ typeof ratioOrParams === 'number' ? { ratio: ratioOrParams } : ratioOrParams
69
+ );
70
+ }
71
+
72
+ /**
73
+ * The minimum, ideal, and maximum sizes for `splitArrangementLayoutSize`.
74
+ */
75
+ export type SplitArrangementLayoutSizeParams = {
76
+ minWidth?: number;
77
+ idealWidth?: number;
78
+ maxWidth?: number;
79
+ minHeight?: number;
80
+ idealHeight?: number;
81
+ maxHeight?: number;
82
+ };
83
+
84
+ /**
85
+ * Sets the size constraints for the content of `ArrangementView.Primary` or
86
+ * `ArrangementView.Secondary` in a split arrangement.
87
+ * @platform ios 27.1+
88
+ * @platform tvos 27.1+
89
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/splitarrangementlayoutsize(minwidth:idealwidth:maxwidth:minheight:idealheight:maxheight:)).
90
+ */
91
+ export const splitArrangementLayoutSize = (constraints: SplitArrangementLayoutSizeParams) =>
92
+ createModifier('splitArrangementLayoutSize', constraints);
93
+
94
+ /**
95
+ * The split axes on which `splitArrangementFixedLayoutSize` prefers the ideal size of the view.
96
+ */
97
+ export type SplitArrangementFixedLayoutSizeParams = {
98
+ /**
99
+ * Whether to prefer a fixed width for the view in a horizontal split.
100
+ * @default true
101
+ */
102
+ horizontal?: boolean;
103
+ /**
104
+ * Whether to prefer a fixed height for the view in a vertical split.
105
+ * @default true
106
+ */
107
+ vertical?: boolean;
108
+ };
109
+
110
+ /**
111
+ * Sets the preferred size constraint for the content of `ArrangementView.Primary` or
112
+ * `ArrangementView.Secondary` in a split arrangement to the ideal size of the view within its
113
+ * container. The arrangement view prefers this size, but may resize to a smaller size depending on
114
+ * the priority of the view.
115
+ * @platform ios 27.1+
116
+ * @platform tvos 27.1+
117
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/splitarrangementfixedlayoutsize(horizontal:vertical:)).
118
+ */
119
+ export const splitArrangementFixedLayoutSize = (options?: SplitArrangementFixedLayoutSizeParams) =>
120
+ createModifier('splitArrangementFixedLayoutSize', options);
121
+
122
+ /**
123
+ * Sets the horizontal edge that a view in an overlay arrangement occupies when the arrangement
124
+ * transitions to a horizontal layout.
125
+ * @platform ios 27.1+
126
+ * @platform tvos 27.1+
127
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/overlayarrangementedge(_:)).
128
+ */
129
+ export function overlayArrangementEdge(
130
+ edge: 'leading' | 'trailing'
131
+ ): ReturnType<typeof createModifier>;
132
+ /**
133
+ * Sets the vertical edge that a view in an overlay arrangement occupies when the arrangement
134
+ * transitions to a vertical layout.
135
+ * @platform ios 27.1+
136
+ * @platform tvos 27.1+
137
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/overlayarrangementedge(_:)-4tjwn).
138
+ */
139
+ export function overlayArrangementEdge(edge: 'top' | 'bottom'): ReturnType<typeof createModifier>;
140
+ export function overlayArrangementEdge(edge: 'top' | 'bottom' | 'leading' | 'trailing') {
141
+ return createModifier('overlayArrangementEdge', { edge });
142
+ }
@@ -6,8 +6,8 @@ export type ContainerBackgroundPlacement = 'widget' | 'navigation' | 'navigation
6
6
  /**
7
7
  * Sets the container background of the enclosing container.
8
8
  *
9
- * > **Note:** `navigation` and `navigationSplitView` require iOS 18. On iOS 17 they fall back to
10
- * > the `widget` placement.
9
+ * > **Note:** `navigation` and `navigationSplitView` require iOS 18. The `widget` placement works
10
+ * > only in `expo-widgets` widgets, where the other placements fall back to it on iOS 17.
11
11
  *
12
12
  * @param style - Any [`ShapeStyle`](#shapestyle): a color, a hierarchical style, a material, or a gradient.
13
13
  * @param container - The type of container to apply the background to.
@@ -786,6 +786,16 @@ export const scrollDismissesKeyboard = (
786
786
  export const scrollDisabled = (disabled: boolean = true) =>
787
787
  createModifier('scrollDisabled', { disabled });
788
788
 
789
+ /**
790
+ * Sets the preferred color scheme for the nearest enclosing presentation, such as a `BottomSheet`,
791
+ * including its background. The value overrides the device's light or dark appearance for that
792
+ * presentation.
793
+ * @param colorScheme - The preferred color scheme, or `null` to indicate no preference.
794
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/preferredcolorscheme(_:)).
795
+ */
796
+ export const preferredColorScheme = (colorScheme: 'light' | 'dark' | null) =>
797
+ createModifier('preferredColorScheme', { colorScheme });
798
+
789
799
  /**
790
800
  * Disables or enables clipping of a scrollable view's content to its bounds.
791
801
  * Content drawn outside those bounds, such as a shadow or a view scaled up past the edge, is
@@ -1712,6 +1722,41 @@ export const resizable = (
1712
1722
  */
1713
1723
  export const navigationTitle = (title: string) => createModifier('navigationTitle', { title });
1714
1724
 
1725
+ /**
1726
+ * Title display modes for the `navigationBarTitleDisplayMode` modifier.
1727
+ * @platform ios
1728
+ */
1729
+ export type NavigationBarTitleDisplayMode = 'automatic' | 'inline' | 'large';
1730
+
1731
+ /**
1732
+ * Configures the title display mode for a navigation bar.
1733
+ * @param displayMode - The style to use for displaying the navigation bar title.
1734
+ * @platform ios
1735
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/navigationbartitledisplaymode(_:)).
1736
+ */
1737
+ export const navigationBarTitleDisplayMode = (displayMode: NavigationBarTitleDisplayMode) =>
1738
+ createModifier('navigationBarTitleDisplayMode', { displayMode });
1739
+
1740
+ /**
1741
+ * Title display modes for the `toolbarTitleDisplayMode` modifier. On tvOS, `large` and
1742
+ * `inlineLarge` have no effect. On macOS, `large` has no effect.
1743
+ * @platform ios 17.0+
1744
+ * @platform tvos 17.0+
1745
+ * @platform macos 14.0+
1746
+ */
1747
+ export type ToolbarTitleDisplayMode = 'automatic' | 'inline' | 'inlineLarge' | 'large';
1748
+
1749
+ /**
1750
+ * Configures the title display mode for a toolbar.
1751
+ * @param mode - The style to use for displaying the toolbar title.
1752
+ * @platform ios 17.0+
1753
+ * @platform tvos 17.0+
1754
+ * @platform macos 14.0+
1755
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/toolbartitledisplaymode(_:)).
1756
+ */
1757
+ export const toolbarTitleDisplayMode = (mode: ToolbarTitleDisplayMode) =>
1758
+ createModifier('toolbarTitleDisplayMode', { mode });
1759
+
1715
1760
  // =============================================================================
1716
1761
  // Type Definitions
1717
1762
  // =============================================================================
@@ -1799,6 +1844,7 @@ export type BuiltInModifier =
1799
1844
  | ReturnType<typeof containerRelativeFrame>
1800
1845
  | ReturnType<typeof scrollContentBackground>
1801
1846
  | ReturnType<typeof scrollDisabled>
1847
+ | ReturnType<typeof preferredColorScheme>
1802
1848
  | ReturnType<typeof scrollClipDisabled>
1803
1849
  | ReturnType<typeof scrollIndicators>
1804
1850
  | ReturnType<typeof scrollEdgeEffectStyle>
@@ -1857,7 +1903,9 @@ export type BuiltInModifier =
1857
1903
  | ReturnType<typeof widgetURL>
1858
1904
  | ReturnType<typeof activityBackgroundTint>
1859
1905
  | ReturnType<typeof containerBackground>
1860
- | ReturnType<typeof navigationTitle>;
1906
+ | ReturnType<typeof navigationTitle>
1907
+ | ReturnType<typeof navigationBarTitleDisplayMode>
1908
+ | ReturnType<typeof toolbarTitleDisplayMode>;
1861
1909
 
1862
1910
  /**
1863
1911
  * Main ViewModifier type that supports both built-in and 3rd party modifiers.
@@ -1901,6 +1949,7 @@ export * from './pickerStyle';
1901
1949
  export * from './menuOrder';
1902
1950
  export * from './tabViewModifiers';
1903
1951
  export * from './navigationModifiers';
1952
+ export * from './arrangementModifiers';
1904
1953
  export * from './datePickerStyle';
1905
1954
  export * from './progressViewStyle';
1906
1955
  export * from './gaugeStyle';
@@ -1908,6 +1957,7 @@ export * from './presentationModifiers';
1908
1957
  export * from './environment';
1909
1958
  export type { ShapeStyle } from './shapeStyle';
1910
1959
  export * from './scrollPosition';
1960
+ export * from './searchable';
1911
1961
  export * from './symbolEffect';
1912
1962
  export * from './scrollObservation';
1913
1963
  export * from './widgets';
@@ -1915,5 +1965,6 @@ export type {
1915
1965
  TimingAnimationParams,
1916
1966
  SpringAnimationParams,
1917
1967
  InterpolatingSpringAnimationParams,
1968
+ SpringPresetAnimationParams,
1918
1969
  ChainableAnimationType,
1919
1970
  } from './animation/types';
@@ -130,12 +130,28 @@ export const interactiveDismissDisabled = (isDisabled: boolean = true) =>
130
130
  */
131
131
  export type PresentationSizingType = 'automatic' | 'fitted' | 'form' | 'page';
132
132
 
133
+ /**
134
+ * Options for the `presentationSizing` modifier.
135
+ */
136
+ export type PresentationSizingOptions = {
137
+ /**
138
+ * The axes on which the sheet fits its content. An axis that is not set keeps the size from
139
+ * `sizing`. For example, `{ horizontal: false, vertical: true }` fits the height to the content
140
+ * and lets the system choose the width.
141
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/presentationsizing/fitted(horizontal:vertical:)).
142
+ */
143
+ fitted?: { horizontal?: boolean; vertical?: boolean };
144
+ };
145
+
133
146
  /**
134
147
  * Sets the sizing of a sheet presentation.
135
148
  * @param sizing - The sizing behavior to apply.
149
+ * @param options - Additional sizing options.
136
150
  * @platform ios 18.0+
137
151
  * @platform tvos 18.0+
138
152
  * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/presentationsizing(_:)).
139
153
  */
140
- export const presentationSizing = (sizing: PresentationSizingType) =>
141
- createModifier('presentationSizing', { sizing });
154
+ export const presentationSizing = (
155
+ sizing: PresentationSizingType,
156
+ options?: PresentationSizingOptions
157
+ ) => createModifier('presentationSizing', { sizing, ...options });
@@ -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
 
@@ -1,5 +1,11 @@
1
1
  import { Row, Switch as ComposeSwitch, Text } from '@expo/ui/jetpack-compose';
2
- import { testID as testIDModifier, weight } from '@expo/ui/jetpack-compose/modifiers';
2
+ import {
3
+ fillMaxWidth,
4
+ IntrinsicSize,
5
+ testID as testIDModifier,
6
+ weight,
7
+ width,
8
+ } from '@expo/ui/jetpack-compose/modifiers';
3
9
 
4
10
  import type { SwitchProps } from './types';
5
11
 
@@ -16,7 +22,10 @@ export function Switch({ value, onValueChange, label, disabled, testID, modifier
16
22
  if (label == null) return toggle;
17
23
 
18
24
  return (
19
- <Row verticalAlignment="center" horizontalArrangement={{ spacedBy: 8 }}>
25
+ <Row
26
+ verticalAlignment="center"
27
+ horizontalArrangement={{ spacedBy: 8 }}
28
+ modifiers={[fillMaxWidth(), width(IntrinsicSize.Max)]}>
20
29
  <Text modifiers={[weight(1)]}>{label}</Text>
21
30
  {toggle}
22
31
  </Row>
@@ -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,27 +0,0 @@
1
- import SwiftUI
2
- import ExpoModulesCore
3
- #if !os(tvOS)
4
- import WidgetKit
5
- #endif
6
-
7
- public final class AccessoryWidgetBackgroundProps: UIBaseViewProps {}
8
-
9
- public struct AccessoryWidgetBackgroundView: ExpoSwiftUI.View {
10
- @ObservedObject public var props: AccessoryWidgetBackgroundProps
11
-
12
- public init(props: AccessoryWidgetBackgroundProps) {
13
- self.props = props
14
- }
15
-
16
- public var body: some View {
17
- #if !os(tvOS)
18
- if #available(iOS 16.0, *) {
19
- AccessoryWidgetBackground()
20
- } else {
21
- Color.clear
22
- }
23
- #else
24
- EmptyView()
25
- #endif
26
- }
27
- }