@expo/ui 58.0.9 → 58.0.10

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 (82) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/RNHostView.kt +65 -16
  4. package/build/community/picker/Picker.android.js +7 -0
  5. package/build/community/picker/Picker.android.js.map +1 -1
  6. package/build/jetpack-compose/RNHostView/index.d.ts +6 -1
  7. package/build/jetpack-compose/RNHostView/index.js +9 -4
  8. package/build/jetpack-compose/RNHostView/index.js.map +1 -1
  9. package/build/swift-ui/RNHostView.d.ts +7 -2
  10. package/build/swift-ui/RNHostView.js +7 -3
  11. package/build/swift-ui/RNHostView.js.map +1 -1
  12. package/build/swift-ui/modifiers/containerBackground.d.ts +2 -2
  13. package/build/swift-ui/modifiers/containerBackground.js +2 -2
  14. package/build/swift-ui/modifiers/index.d.ts +9 -1
  15. package/build/swift-ui/modifiers/index.js +9 -0
  16. package/build/swift-ui/modifiers/index.js.map +1 -1
  17. package/build/universal/ListItem/ListItem.js +11 -2
  18. package/build/universal/ListItem/ListItem.js.map +1 -1
  19. package/build/universal/RNHostView/index.js +12 -5
  20. package/build/universal/RNHostView/index.js.map +1 -1
  21. package/build/universal/RNHostView/types.d.ts +9 -4
  22. package/build/universal/RNHostView/types.js.map +1 -1
  23. package/build/utils/matchContents.d.ts +10 -0
  24. package/build/utils/matchContents.js +16 -0
  25. package/build/utils/matchContents.js.map +1 -0
  26. package/ios/ExpoUIModule.swift +0 -1
  27. package/ios/Modifiers/ContainerBackgroundModifier.swift +23 -16
  28. package/ios/Modifiers/PreferredColorSchemeModifier.swift +12 -0
  29. package/ios/Modifiers/View+ModifierArray.swift +3 -3
  30. package/ios/Modifiers/ViewModifierRegistry.swift +11 -9
  31. package/ios/Modifiers/WidgetKitModifiers.swift +13 -0
  32. package/ios/RNHostView.swift +55 -9
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.9/expo.modules.ui-58.0.9-sources.jar → 58.0.10/expo.modules.ui-58.0.10-sources.jar} +0 -0
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.md5 +1 -0
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha1 +1 -0
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha256 +1 -0
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10-sources.jar.sha512 +1 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.9/expo.modules.ui-58.0.9.aar → 58.0.10/expo.modules.ui-58.0.10.aar} +0 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.md5 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha1 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha256 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.aar.sha512 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.9/expo.modules.ui-58.0.9.module → 58.0.10/expo.modules.ui-58.0.10.module} +22 -22
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.md5 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha1 +1 -0
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha256 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.module.sha512 +1 -0
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.9/expo.modules.ui-58.0.9.pom → 58.0.10/expo.modules.ui-58.0.10.pom} +1 -1
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.md5 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha1 +1 -0
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha256 +1 -0
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.10/expo.modules.ui-58.0.10.pom.sha512 +1 -0
  53. package/package.json +1 -1
  54. package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
  55. package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
  56. package/src/community/picker/Picker.android.tsx +5 -0
  57. package/src/jetpack-compose/RNHostView/index.tsx +17 -6
  58. package/src/swift-ui/RNHostView.tsx +11 -4
  59. package/src/swift-ui/modifiers/containerBackground.ts +2 -2
  60. package/src/swift-ui/modifiers/index.ts +11 -0
  61. package/src/universal/ListItem/ListItem.tsx +10 -1
  62. package/src/universal/RNHostView/index.tsx +8 -3
  63. package/src/universal/RNHostView/types.ts +6 -4
  64. package/src/utils/matchContents.ts +14 -0
  65. package/ios/AccessoryWidgetBackgroundView.swift +0 -27
  66. package/ios/Modifiers/WidgetModifiers.swift +0 -70
  67. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.md5 +0 -1
  68. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha1 +0 -1
  69. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha256 +0 -1
  70. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9-sources.jar.sha512 +0 -1
  71. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.md5 +0 -1
  72. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha1 +0 -1
  73. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha256 +0 -1
  74. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.aar.sha512 +0 -1
  75. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.md5 +0 -1
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha1 +0 -1
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha256 +0 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.module.sha512 +0 -1
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.md5 +0 -1
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.sha1 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.sha256 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.9/expo.modules.ui-58.0.9.pom.sha512 +0 -1
@@ -826,6 +826,16 @@ export const scrollDismissesKeyboard = (
826
826
  export const scrollDisabled = (disabled: boolean = true) =>
827
827
  createModifier('scrollDisabled', { disabled });
828
828
 
829
+ /**
830
+ * Sets the preferred color scheme for the nearest enclosing presentation, such as a `BottomSheet`,
831
+ * including its background. The value overrides the device's light or dark appearance for that
832
+ * presentation.
833
+ * @param colorScheme - The preferred color scheme, or `null` to indicate no preference.
834
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/preferredcolorscheme(_:)).
835
+ */
836
+ export const preferredColorScheme = (colorScheme: 'light' | 'dark' | null) =>
837
+ createModifier('preferredColorScheme', { colorScheme });
838
+
829
839
  /**
830
840
  * Disables or enables clipping of a scrollable view's content to its bounds.
831
841
  * Content drawn outside those bounds, such as a shadow or a view scaled up past the edge, is
@@ -1839,6 +1849,7 @@ export type BuiltInModifier =
1839
1849
  | ReturnType<typeof containerRelativeFrame>
1840
1850
  | ReturnType<typeof scrollContentBackground>
1841
1851
  | ReturnType<typeof scrollDisabled>
1852
+ | ReturnType<typeof preferredColorScheme>
1842
1853
  | ReturnType<typeof scrollClipDisabled>
1843
1854
  | ReturnType<typeof scrollIndicators>
1844
1855
  | ReturnType<typeof scrollEdgeEffectStyle>
@@ -33,7 +33,10 @@ export function ListItem(props: ListItemProps) {
33
33
  const supporting = slots.supporting ?? supportingText;
34
34
 
35
35
  return (
36
- <Pressable onPress={onPress} style={styles.row} testID={testID}>
36
+ <Pressable
37
+ onPress={onPress}
38
+ style={[styles.row, onPress != null ? styles.rowIsPressable : styles.rowIsStatic]}
39
+ testID={testID}>
37
40
  {leading != null ? <View style={styles.slot}>{leading}</View> : null}
38
41
  <View style={styles.main}>
39
42
  <Text style={isDark && styles.darkText}>{slots.headline}</Text>
@@ -52,8 +55,14 @@ const styles = StyleSheet.create({
52
55
  width: '100%',
53
56
  paddingVertical: 12,
54
57
  paddingHorizontal: 16,
58
+ },
59
+ // Pressable defaults to cursor: pointer; override it when not pressable.
60
+ rowIsPressable: {
55
61
  cursor: 'pointer',
56
62
  },
63
+ rowIsStatic: {
64
+ cursor: 'auto',
65
+ },
57
66
  main: {
58
67
  flexDirection: 'column',
59
68
  gap: 2,
@@ -1,11 +1,14 @@
1
1
  import { StyleSheet, View } from 'react-native';
2
2
 
3
+ import { resolveMatchContents } from '../../utils/matchContents';
3
4
  import { useUniversalLifecycle } from '../hooks';
4
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,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
- }
@@ -1,70 +0,0 @@
1
- // Copyright 2015-present 650 Industries. All rights reserved.
2
-
3
- import ExpoModulesCore
4
- import SwiftUI
5
- #if !os(tvOS)
6
- import WidgetKit
7
- #endif
8
-
9
- internal enum WidgetAccentedRenderingModeOptions: String, Enumerable {
10
- case accented
11
- case desaturated
12
- case accentedDesaturated
13
- case fullColor
14
-
15
- #if !os(tvOS)
16
- @available(iOS 18.0, macOS 15.0, *)
17
- var toWidgetAccentedRenderingMode: WidgetAccentedRenderingMode {
18
- switch self {
19
- case .accented: return .accented
20
- case .accentedDesaturated: return .accentedDesaturated
21
- case .desaturated: return .desaturated
22
- case .fullColor: return .fullColor
23
- }
24
- }
25
- #endif
26
- }
27
-
28
- /**
29
- * This is a unique modifier that exists only on Image, but returns some View, and for this reason it cannot be a ViewModifier.
30
- */
31
- internal struct WidgetAccentedRenderingModeModifier: Record {
32
- @Field var renderingMode: WidgetAccentedRenderingModeOptions?
33
-
34
- @ViewBuilder
35
- func apply(to image: Image) -> some View {
36
- #if !os(tvOS)
37
- if #available(iOS 18.0, macOS 15.0, *), renderingMode != nil {
38
- image.widgetAccentedRenderingMode(renderingMode?.toWidgetAccentedRenderingMode)
39
- } else {
40
- image
41
- }
42
- #else
43
- image
44
- #endif
45
- }
46
- }
47
-
48
- internal struct WidgetURLModifier: ViewModifier, Record {
49
- @Field var url: URL?
50
-
51
- func body(content: Content) -> some View {
52
- #if !os(tvOS)
53
- content.widgetURL(url)
54
- #else
55
- content
56
- #endif
57
- }
58
- }
59
-
60
- internal struct ActivityBackgroundTintModifier: ViewModifier, Record {
61
- @Field var color: Color?
62
-
63
- func body(content: Content) -> some View {
64
- #if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst)
65
- content.activityBackgroundTint(color)
66
- #else
67
- content
68
- #endif
69
- }
70
- }
@@ -1 +0,0 @@
1
- a5da15def1d399f452a19c62651e73a942d873ec
@@ -1 +0,0 @@
1
- 73965c56280c334bb29231b9523362401285d6609ef8b75839f1c89b6a3aa4f7
@@ -1 +0,0 @@
1
- d1b747e78264dad3ee7a5322811ff5d079433fa34a32ebb5ae5c29c5c3ef412746a8c10d3e22937037b45a4b909783329deebf92b09e5c1ef486807a5978ffc6
@@ -1 +0,0 @@
1
- 03491dfb69ff8c25616d5f8ca35be94a
@@ -1 +0,0 @@
1
- 518280855fc0ebe67334a36edceffbfbce55f947
@@ -1 +0,0 @@
1
- a88a20a3df6e5cfd20d54e45c597425a5e052a5b8ba95a41d6b5a92aa8c02fc6
@@ -1 +0,0 @@
1
- 1c0e1676d8ed6f47450bb5e7f28d486d275a7e0264893ea78bac3cacc0341aa3e0097f5c033fb601eac07fc8482498005a51f27b8bffcc7249366b34b14b40f5
@@ -1 +0,0 @@
1
- 10a6ee8c177a62ee345887c2bed3646fcdf2bcd2
@@ -1 +0,0 @@
1
- bb9ec229a95ef7d1d0de7c04bd74d4b6bdbf3edefc4fd79ff981bf59eb9ad7c5
@@ -1 +0,0 @@
1
- 230bb0ac3f5f59bd76471e8b3f81c13e307783067b67697d2f986d4124fa867b93dc6889fbfeea2742adf374356352c4b389681a789b0d49f374e24dea8d966a
@@ -1 +0,0 @@
1
- ae57212338708f66ac952ed7f3f02404
@@ -1 +0,0 @@
1
- 3ac2c204accfb124d9f79698c682e6ba02ca29cd
@@ -1 +0,0 @@
1
- 4c1e29b3da7ef0b39b38098eae7b5825d72b6e25656f8de8bc81d1f69ee27212
@@ -1 +0,0 @@
1
- bd9a114fb2bdac0e64ebc684918b6ee54e0ea6afc248716449dd9c5c2df5751328cca2033951d3b3aef8df411f8efaa9c0876c790a5fba751f93cd6e83939e4c