@expo/ui 57.0.6 → 57.0.8

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 (85) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/DatePickerView.kt +60 -15
  4. package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +5 -1
  5. package/android/src/main/java/expo/modules/ui/RNHostView.kt +36 -28
  6. package/build/community/bottom-sheet/BottomSheet.ios.d.ts.map +1 -1
  7. package/build/community/menu/MenuView.android.d.ts.map +1 -1
  8. package/build/community/menu/MenuView.ios.d.ts.map +1 -1
  9. package/build/community/menu/types.d.ts +6 -1
  10. package/build/community/menu/types.d.ts.map +1 -1
  11. package/build/jetpack-compose/RNHostView/index.d.ts +1 -3
  12. package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
  13. package/build/swift-ui/BottomSheet/index.d.ts +10 -6
  14. package/build/swift-ui/BottomSheet/index.d.ts.map +1 -1
  15. package/build/swift-ui/Host/index.d.ts +4 -3
  16. package/build/swift-ui/Host/index.d.ts.map +1 -1
  17. package/build/swift-ui/modifiers/index.d.ts +1 -0
  18. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  19. package/build/swift-ui/modifiers/menuOrder.d.ts +10 -0
  20. package/build/swift-ui/modifiers/menuOrder.d.ts.map +1 -0
  21. package/build/swift-ui/modifiers/presentationModifiers.d.ts +19 -0
  22. package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
  23. package/build/universal/Host/types.d.ts +1 -1
  24. package/expo-module.config.json +1 -1
  25. package/ios/BottomSheetView.swift +20 -3
  26. package/ios/Modifiers/MenuOrderModifier.swift +34 -0
  27. package/ios/Modifiers/PresentationModifiers.swift +30 -0
  28. package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
  29. package/ios/TextFieldView.swift +8 -10
  30. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.6/expo.modules.ui-57.0.6-sources.jar → 57.0.8/expo.modules.ui-57.0.8-sources.jar} +0 -0
  31. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8-sources.jar.md5 +1 -0
  32. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8-sources.jar.sha1 +1 -0
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8-sources.jar.sha256 +1 -0
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8-sources.jar.sha512 +1 -0
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.aar +0 -0
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.aar.md5 +1 -0
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.aar.sha1 +1 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.aar.sha256 +1 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.aar.sha512 +1 -0
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.6/expo.modules.ui-57.0.6.module → 57.0.8/expo.modules.ui-57.0.8.module} +22 -22
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.module.md5 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.module.sha1 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.module.sha256 +1 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.module.sha512 +1 -0
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.6/expo.modules.ui-57.0.6.pom → 57.0.8/expo.modules.ui-57.0.8.pom} +1 -1
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.pom.md5 +1 -0
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.pom.sha1 +1 -0
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.pom.sha256 +1 -0
  49. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.8/expo.modules.ui-57.0.8.pom.sha512 +1 -0
  50. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  51. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  52. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  53. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  54. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  55. package/package.json +6 -6
  56. package/src/community/bottom-sheet/BottomSheet.ios.tsx +3 -1
  57. package/src/community/masked-view/MaskedView.ios.tsx +1 -1
  58. package/src/community/menu/MenuView.android.tsx +2 -1
  59. package/src/community/menu/MenuView.ios.tsx +11 -13
  60. package/src/community/menu/types.tsx +12 -1
  61. package/src/community/pager-view/PagerView.ios.tsx +1 -1
  62. package/src/jetpack-compose/RNHostView/index.tsx +7 -4
  63. package/src/swift-ui/BottomSheet/index.tsx +21 -14
  64. package/src/swift-ui/Host/index.tsx +4 -3
  65. package/src/swift-ui/modifiers/index.ts +1 -0
  66. package/src/swift-ui/modifiers/menuOrder.ts +12 -0
  67. package/src/swift-ui/modifiers/presentationModifiers.ts +22 -0
  68. package/src/universal/Host/types.ts +1 -1
  69. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6-sources.jar.md5 +0 -1
  70. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6-sources.jar.sha1 +0 -1
  71. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6-sources.jar.sha256 +0 -1
  72. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6-sources.jar.sha512 +0 -1
  73. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.aar +0 -0
  74. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.aar.md5 +0 -1
  75. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.aar.sha1 +0 -1
  76. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.aar.sha256 +0 -1
  77. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.aar.sha512 +0 -1
  78. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.module.md5 +0 -1
  79. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.module.sha1 +0 -1
  80. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.module.sha256 +0 -1
  81. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.module.sha512 +0 -1
  82. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.pom.md5 +0 -1
  83. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.pom.sha1 +0 -1
  84. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.pom.sha256 +0 -1
  85. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.6/expo.modules.ui-57.0.6.pom.sha512 +0 -1
@@ -1,18 +1,22 @@
1
1
  import { requireNativeView } from 'expo';
2
- import { useState, type ComponentType } from 'react';
2
+ import { useState, type ComponentType, type ReactNode } from 'react';
3
3
  import { type NativeSyntheticEvent } from 'react-native';
4
4
 
5
+ import { Slot } from '../SlotView';
5
6
  import { createViewModifierEventListener } from '../modifiers/utils';
6
7
  import { type CommonViewModifierProps } from '../types';
7
8
 
8
9
  export interface BottomSheetProps extends CommonViewModifierProps {
9
10
  /**
10
- * The children of the `BottomSheet` component.
11
- * Use `Group` to wrap your content and apply presentation modifiers
12
- * like `presentationDetents`, `presentationDragIndicator`,
13
- * `presentationBackgroundInteraction`, and `interactiveDismissDisabled`.
11
+ * The sheet's content, mounted while presented and unmounted after dismiss. Wrap it in `Group`
12
+ * to apply presentation modifiers.
14
13
  */
15
- children: React.ReactNode;
14
+ children: ReactNode;
15
+ /**
16
+ * A view the sheet is anchored to, for example the `Button` that opens it. Rendered in place and
17
+ * kept mounted, so presenting the sheet doesn't shift surrounding layout. Optional.
18
+ */
19
+ anchor?: ReactNode;
16
20
  /**
17
21
  * Whether the `BottomSheet` is presented.
18
22
  */
@@ -33,7 +37,10 @@ export interface BottomSheetProps extends CommonViewModifierProps {
33
37
  fitToContents?: boolean;
34
38
  }
35
39
 
36
- type NativeBottomSheetProps = Omit<BottomSheetProps, 'onIsPresentedChange' | 'onDismiss'> & {
40
+ type NativeBottomSheetProps = Omit<
41
+ BottomSheetProps,
42
+ 'onIsPresentedChange' | 'onDismiss' | 'anchor'
43
+ > & {
37
44
  onIsPresentedChange: (event: NativeSyntheticEvent<{ isPresented: boolean }>) => void;
38
45
  onDismiss: (event: NativeSyntheticEvent<object>) => void;
39
46
  };
@@ -47,17 +54,15 @@ const BottomSheetNativeView: ComponentType<NativeBottomSheetProps> = requireNati
47
54
  * `BottomSheet` presents content from the bottom of the screen.
48
55
  */
49
56
  function BottomSheet(props: BottomSheetProps) {
50
- const { modifiers, onIsPresentedChange, onDismiss, ...restProps } = props;
57
+ const { modifiers, onIsPresentedChange, onDismiss, anchor, children, ...restProps } = props;
51
58
  const [isMounted, setIsMounted] = useState(props.isPresented);
52
59
 
53
60
  if (props.isPresented && !isMounted) {
54
61
  setIsMounted(true);
55
62
  }
56
63
 
57
- if (!isMounted) {
58
- return null;
59
- }
60
-
64
+ // The anchor stays mounted so it's always visible; the content mounts on present and unmounts
65
+ // after dismiss.
61
66
  return (
62
67
  <BottomSheetNativeView
63
68
  modifiers={modifiers}
@@ -69,8 +74,10 @@ function BottomSheet(props: BottomSheetProps) {
69
74
  onDismiss={() => {
70
75
  setIsMounted(false);
71
76
  onDismiss?.();
72
- }}
73
- />
77
+ }}>
78
+ {anchor != null ? <Slot name="anchor">{anchor}</Slot> : null}
79
+ {isMounted ? children : null}
80
+ </BottomSheetNativeView>
74
81
  );
75
82
  }
76
83
 
@@ -44,11 +44,12 @@ export interface HostProps extends CommonViewModifierProps {
44
44
  layoutDirection?: 'leftToRight' | 'rightToLeft';
45
45
 
46
46
  /**
47
- * Controls which safe area regions the SwiftUI hosting view should ignore. Can only be set once on mount.
48
- * - `'all'`- ignores all safe area insets.
47
+ * Controls which safe area regions the SwiftUI hosting view should ignore.
48
+ * - `'all'` - ignores all safe area insets, including the keyboard.
49
+ * - `'container'` - ignores only the container safe area (notch, home indicator, status and navigation bars). The keyboard safe area still applies.
49
50
  * - `'keyboard'` - ignores only the keyboard safe area.
50
51
  */
51
- ignoreSafeArea?: 'all' | 'keyboard';
52
+ ignoreSafeArea?: 'all' | 'container' | 'keyboard';
52
53
 
53
54
  children: React.ReactNode;
54
55
  style?: StyleProp<ViewStyle>;
@@ -1743,6 +1743,7 @@ export * from './background';
1743
1743
  export type * from './types';
1744
1744
  export * from './tag';
1745
1745
  export * from './pickerStyle';
1746
+ export * from './menuOrder';
1746
1747
  export * from './tabViewModifiers';
1747
1748
  export * from './datePickerStyle';
1748
1749
  export * from './progressViewStyle';
@@ -0,0 +1,12 @@
1
+ import { createModifier } from './createModifier';
2
+
3
+ export type MenuOrderType = 'automatic' | 'fixed' | 'priority';
4
+
5
+ /**
6
+ * Sets the preferred order of items for menus presented from this view.
7
+ * With the default `automatic` order, a menu that opens upward displays its items
8
+ * in reverse. Pass `fixed` to always keep the order the items were provided in.
9
+ * @param order - The preferred menu item ordering.
10
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/menuorder(_:)).
11
+ */
12
+ export const menuOrder = (order: MenuOrderType) => createModifier('menuOrder', { order });
@@ -103,3 +103,25 @@ export const presentationBackground = (color: string) =>
103
103
  */
104
104
  export const interactiveDismissDisabled = (isDisabled: boolean = true) =>
105
105
  createModifier('interactiveDismissDisabled', { isDisabled });
106
+
107
+ /**
108
+ * Sizing behavior for a sheet presentation.
109
+ * - `'automatic'`: The system default sizing.
110
+ * - `'fitted'`: Sizes the sheet to fit its content.
111
+ * - `'form'`: A compact, centered form sheet.
112
+ * - `'page'`: A larger page sheet.
113
+ *
114
+ * @remarks Sizing mainly affects the regular size class (iPad); in a compact size class (iPhone)
115
+ * sheets remain edge-attached and detents drive the height.
116
+ */
117
+ export type PresentationSizingType = 'automatic' | 'fitted' | 'form' | 'page';
118
+
119
+ /**
120
+ * Sets the sizing of a sheet presentation.
121
+ * @param sizing - The sizing behavior to apply.
122
+ * @platform ios 18.0+
123
+ * @platform tvos 18.0+
124
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/presentationsizing(_:)).
125
+ */
126
+ export const presentationSizing = (sizing: PresentationSizingType) =>
127
+ createModifier('presentationSizing', { sizing });
@@ -50,7 +50,7 @@ export interface UniversalHostProps extends ViewProps {
50
50
  layoutDirection?: 'leftToRight' | 'rightToLeft';
51
51
 
52
52
  /**
53
- * Controls which safe area regions the hosting view should ignore. Can only be set once on mount.
53
+ * Controls which safe area regions the hosting view should ignore.
54
54
  * - `'all'`- ignores all safe area insets.
55
55
  * - `'keyboard'` - ignores only the keyboard safe area.
56
56
  *
@@ -1 +0,0 @@
1
- 9ba5e5bed9de674db5f662be12f9eb512a56b8c8
@@ -1 +0,0 @@
1
- 3ae6ff0804edde58e39c544de5113d23211a50f82fde7a641de6b26f6ac06075
@@ -1 +0,0 @@
1
- 7e6b96de61f7409b12ae31a6974f92b0afef2dbfefcd5e98d6791f8f1d34e45b1b58d7aa6aadaee48522558c9c65378aa0c487710abda7b1331209b5fdeee90d
@@ -1 +0,0 @@
1
- 62ecbb7ca6fe51ee7cd44eca4f6e4a04
@@ -1 +0,0 @@
1
- f5f598f75119b559e52d1c8a79e455ed749fb894
@@ -1 +0,0 @@
1
- 4e85b05996d6f8575fd9268d4025cf03cb02c2f0db4b79723b6c7f61962a8706
@@ -1 +0,0 @@
1
- 4972da889a1f4e7625057c1901bc1f59ca90bbeecd94a0733c3eeb4316412d4f4feacee17e68568629a53b091aa12314f1b768f9e88d038cc6ac30dfb1e0f80d
@@ -1 +0,0 @@
1
- 6c4ea9f7cc1a4dc8f4c82c023cbcfd2442bca632
@@ -1 +0,0 @@
1
- f16c5f97fc46e1360a9a4fd8a6d04d596cff81be50b3cdc1abb548567ac60197
@@ -1 +0,0 @@
1
- 706201e1600cb5faec0b6da9083cb09f74a6efa6afc8216a14a47652ac67b1e8a263d40c3b2d037431661f589692e6ccdab200bc3a9a59d3ad65b5a310ad29b6
@@ -1 +0,0 @@
1
- b4566e828d627b3910a037f4b17075cb
@@ -1 +0,0 @@
1
- 4ade34816e79ea572313e90827980afd7f8d5420
@@ -1 +0,0 @@
1
- b7c37df0f47ff2f428d6d995847bdd2477db9f0f51123759104b262e8643d5ed
@@ -1 +0,0 @@
1
- 897d8c5689436e13165ab30d30b2fa586c239677f25f307af65768da226f0c02f347d875096fe8ddd0261194445505b354f9610277ca9fdf98a9c30612ae56a7