@expo/ui 57.0.18 → 57.0.20

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 (72) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/ui/HostView.kt +6 -4
  4. package/build/jetpack-compose/colors.d.ts.map +1 -1
  5. package/build/swift-ui/NavigationSplitView/index.d.ts +76 -0
  6. package/build/swift-ui/NavigationSplitView/index.d.ts.map +1 -0
  7. package/build/swift-ui/Toolbar/index.d.ts +50 -0
  8. package/build/swift-ui/Toolbar/index.d.ts.map +1 -1
  9. package/build/swift-ui/index.d.ts +1 -0
  10. package/build/swift-ui/index.d.ts.map +1 -1
  11. package/build/swift-ui/modifiers/index.d.ts +16 -1
  12. package/build/swift-ui/modifiers/index.d.ts.map +1 -1
  13. package/build/swift-ui/modifiers/navigationModifiers.d.ts +28 -0
  14. package/build/swift-ui/modifiers/navigationModifiers.d.ts.map +1 -0
  15. package/expo-module.config.json +1 -1
  16. package/ios/Convertibles/ToolbarItemPlacementOptions.swift +110 -0
  17. package/ios/Convertibles/ToolbarItemVisibilityPriorityOptions.swift +35 -0
  18. package/ios/ExpoUIModule.swift +1 -0
  19. package/ios/Modifiers/NavigationModifiers.swift +44 -0
  20. package/ios/Modifiers/ScrollEdgeEffectStyleModifier.swift +34 -0
  21. package/ios/Modifiers/ViewModifierRegistry.swift +12 -0
  22. package/ios/NavigationSplitViewView.swift +180 -0
  23. package/ios/ToolbarView.swift +88 -4
  24. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.18/expo.modules.ui-57.0.18-sources.jar → 57.0.20/expo.modules.ui-57.0.20-sources.jar} +0 -0
  25. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20-sources.jar.md5 +1 -0
  26. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20-sources.jar.sha1 +1 -0
  27. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20-sources.jar.sha256 +1 -0
  28. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20-sources.jar.sha512 +1 -0
  29. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.aar +0 -0
  30. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.aar.md5 +1 -0
  31. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.aar.sha1 +1 -0
  32. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.aar.sha256 +1 -0
  33. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.aar.sha512 +1 -0
  34. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.18/expo.modules.ui-57.0.18.module → 57.0.20/expo.modules.ui-57.0.20.module} +22 -22
  35. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.module.md5 +1 -0
  36. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.module.sha1 +1 -0
  37. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.module.sha256 +1 -0
  38. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.module.sha512 +1 -0
  39. package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.18/expo.modules.ui-57.0.18.pom → 57.0.20/expo.modules.ui-57.0.20.pom} +1 -1
  40. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.pom.md5 +1 -0
  41. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.pom.sha1 +1 -0
  42. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.pom.sha256 +1 -0
  43. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.20/expo.modules.ui-57.0.20.pom.sha512 +1 -0
  44. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
  45. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
  46. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
  47. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
  48. package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
  49. package/package.json +4 -4
  50. package/src/jetpack-compose/colors.ts +23 -1
  51. package/src/swift-ui/NavigationSplitView/index.tsx +122 -0
  52. package/src/swift-ui/Toolbar/index.tsx +79 -0
  53. package/src/swift-ui/index.tsx +1 -0
  54. package/src/swift-ui/modifiers/index.ts +20 -0
  55. package/src/swift-ui/modifiers/navigationModifiers.ts +42 -0
  56. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18-sources.jar.md5 +0 -1
  57. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18-sources.jar.sha1 +0 -1
  58. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18-sources.jar.sha256 +0 -1
  59. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18-sources.jar.sha512 +0 -1
  60. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.aar +0 -0
  61. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.aar.md5 +0 -1
  62. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.aar.sha1 +0 -1
  63. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.aar.sha256 +0 -1
  64. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.aar.sha512 +0 -1
  65. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.module.md5 +0 -1
  66. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.module.sha1 +0 -1
  67. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.module.sha256 +0 -1
  68. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.module.sha512 +0 -1
  69. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.pom.md5 +0 -1
  70. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.pom.sha1 +0 -1
  71. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.pom.sha256 +0 -1
  72. package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.18/expo.modules.ui-57.0.18.pom.sha512 +0 -1
@@ -0,0 +1,122 @@
1
+ import { requireNativeView } from 'expo';
2
+
3
+ import { Slot } from '../SlotView';
4
+ import { createViewModifierEventListener } from '../modifiers/utils';
5
+ import { type CommonViewModifierProps } from '../types';
6
+
7
+ export type NavigationSplitViewVisibility = 'automatic' | 'all' | 'doubleColumn' | 'detailOnly';
8
+
9
+ /**
10
+ * The column shown when the split view collapses into a single column.
11
+ */
12
+ export type NavigationSplitViewColumn = 'sidebar' | 'content' | 'detail';
13
+
14
+ export interface NavigationSplitViewProps extends CommonViewModifierProps {
15
+ /**
16
+ * The columns of the split view. Provide `NavigationSplitView.Sidebar` and
17
+ * `NavigationSplitView.Detail`, and add `NavigationSplitView.Content` for a
18
+ * three-column layout.
19
+ */
20
+ children: React.ReactNode;
21
+ /**
22
+ * The columns to show. Setting it makes the value controlled: pass the value from
23
+ * `onColumnVisibilityChange` back in, otherwise dragging the divider has no effect.
24
+ * Leave it unset to let the split view manage its own columns.
25
+ * @default 'automatic'
26
+ */
27
+ columnVisibility?: NavigationSplitViewVisibility;
28
+ /**
29
+ * Called when the visible columns change, including when the user drags the sidebar.
30
+ */
31
+ onColumnVisibilityChange?: (visibility: NavigationSplitViewVisibility) => void;
32
+ /**
33
+ * The column to show when the split view collapses to a single column, for example
34
+ * in a narrow window. Setting it makes the value controlled in the same way as
35
+ * `columnVisibility`.
36
+ * @default 'sidebar'
37
+ * @platform ios 17.0+
38
+ */
39
+ preferredCompactColumn?: NavigationSplitViewColumn;
40
+ /**
41
+ * Called when the collapsed column changes.
42
+ * @platform ios 17.0+
43
+ */
44
+ onPreferredCompactColumnChange?: (column: NavigationSplitViewColumn) => void;
45
+ }
46
+
47
+ type NativeNavigationSplitViewProps = Omit<
48
+ NavigationSplitViewProps,
49
+ 'onColumnVisibilityChange' | 'onPreferredCompactColumnChange'
50
+ > & {
51
+ onColumnVisibilityChange?: (event: {
52
+ nativeEvent: { visibility: NavigationSplitViewVisibility };
53
+ }) => void;
54
+ onPreferredCompactColumnChange?: (event: {
55
+ nativeEvent: { column: NavigationSplitViewColumn };
56
+ }) => void;
57
+ };
58
+
59
+ const NavigationSplitViewNativeView: React.ComponentType<NativeNavigationSplitViewProps> =
60
+ requireNativeView('ExpoUI', 'NavigationSplitViewView');
61
+
62
+ function NavigationSplitViewSidebar(props: { children: React.ReactNode }) {
63
+ return <Slot name="sidebar">{props.children}</Slot>;
64
+ }
65
+
66
+ function NavigationSplitViewContent(props: { children: React.ReactNode }) {
67
+ return <Slot name="content">{props.children}</Slot>;
68
+ }
69
+
70
+ function NavigationSplitViewDetail(props: { children: React.ReactNode }) {
71
+ return <Slot name="detail">{props.children}</Slot>;
72
+ }
73
+
74
+ NavigationSplitView.Sidebar = NavigationSplitViewSidebar;
75
+ NavigationSplitView.Content = NavigationSplitViewContent;
76
+ NavigationSplitView.Detail = NavigationSplitViewDetail;
77
+
78
+ /**
79
+ * NavigationSplitView uses the native [NavigationSplitView](https://developer.apple.com/documentation/swiftui/navigationsplitview) view.
80
+ *
81
+ * It presents a collection, a selection and a detail in one hierarchy: side by side
82
+ * when there is room, and stacked when there is not.
83
+ * @example
84
+ * ```tsx
85
+ * <Host style={{ flex: 1 }}>
86
+ * <NavigationSplitView>
87
+ * <NavigationSplitView.Sidebar>
88
+ * <List>{items}</List>
89
+ * </NavigationSplitView.Sidebar>
90
+ * <NavigationSplitView.Detail>
91
+ * <ItemDetail item={selectedItem} />
92
+ * </NavigationSplitView.Detail>
93
+ * </NavigationSplitView>
94
+ * </Host>
95
+ * ```
96
+ * @platform ios 16.0+
97
+ * @platform tvos 16.0+
98
+ */
99
+ export function NavigationSplitView(props: NavigationSplitViewProps) {
100
+ const {
101
+ modifiers,
102
+ children,
103
+ onColumnVisibilityChange,
104
+ onPreferredCompactColumnChange,
105
+ ...restProps
106
+ } = props;
107
+
108
+ return (
109
+ <NavigationSplitViewNativeView
110
+ modifiers={modifiers}
111
+ {...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
112
+ onColumnVisibilityChange={({ nativeEvent: { visibility } }) =>
113
+ onColumnVisibilityChange?.(visibility)
114
+ }
115
+ onPreferredCompactColumnChange={({ nativeEvent: { column } }) =>
116
+ onPreferredCompactColumnChange?.(column)
117
+ }
118
+ {...restProps}>
119
+ {children}
120
+ </NavigationSplitViewNativeView>
121
+ );
122
+ }
@@ -18,6 +18,55 @@ export interface ToolbarContentProps {
18
18
  children: React.ReactNode;
19
19
  }
20
20
 
21
+ /**
22
+ * Where an item sits in the toolbar. A placement the current platform or OS version does not
23
+ * offer falls back to `automatic`.
24
+ *
25
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/toolbaritemplacement).
26
+ */
27
+ export type ToolbarItemPlacement =
28
+ | 'automatic'
29
+ | 'principal'
30
+ | 'navigation'
31
+ | 'primaryAction'
32
+ | 'secondaryAction'
33
+ | 'status'
34
+ | 'confirmationAction'
35
+ | 'cancellationAction'
36
+ | 'destructiveAction'
37
+ | 'keyboard'
38
+ | 'topBarLeading'
39
+ | 'topBarTrailing'
40
+ | 'topBarPinnedTrailing'
41
+ | 'largeTitle'
42
+ | 'bottomBar';
43
+
44
+ /**
45
+ * How readily a toolbar item gives up its place when the toolbar runs out of room.
46
+ *
47
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/toolbaritemvisibilitypriority).
48
+ */
49
+ export type ToolbarItemVisibilityPriority = 'automatic' | 'low' | 'high';
50
+
51
+ export interface ToolbarItemProps {
52
+ /**
53
+ * The semantic placement of the item within the toolbar.
54
+ * @default 'automatic'
55
+ */
56
+ placement?: ToolbarItemPlacement;
57
+ /**
58
+ * How readily the item gives up its place. Items overflow lowest priority first. `low` and
59
+ * `high` apply on iOS and macOS.
60
+ * @default 'automatic'
61
+ * @platform ios 27.0+
62
+ */
63
+ visibilityPriority?: ToolbarItemVisibilityPriority;
64
+ /**
65
+ * The content of the item.
66
+ */
67
+ children: React.ReactNode;
68
+ }
69
+
21
70
  const ToolbarNativeView: React.ComponentType<ToolbarProps> = requireNativeView(
22
71
  'ExpoUI',
23
72
  'ToolbarView'
@@ -30,6 +79,36 @@ function ToolbarContent(props: ToolbarContentProps) {
30
79
  return <Slot name="content">{props.children}</Slot>;
31
80
  }
32
81
 
82
+ /**
83
+ * A single item in a toolbar, matching SwiftUI's `ToolbarItem`. Place it inside `Toolbar.Content`
84
+ * to control where the item appears.
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * <Toolbar>
89
+ * <Text>Bird description</Text>
90
+ * <Toolbar.Content>
91
+ * <ToolbarItem placement="topBarTrailing">
92
+ * <Button systemImage="square.and.arrow.up" onPress={share} />
93
+ * </ToolbarItem>
94
+ * </Toolbar.Content>
95
+ * </Toolbar>
96
+ * ```
97
+ *
98
+ * @platform ios
99
+ */
100
+ export function ToolbarItem({
101
+ placement = 'automatic',
102
+ visibilityPriority = 'automatic',
103
+ children,
104
+ }: ToolbarItemProps) {
105
+ return (
106
+ <Slot name="item" extraProps={{ placement, visibilityPriority }}>
107
+ {children}
108
+ </Slot>
109
+ );
110
+ }
111
+
33
112
  /**
34
113
  * Adds a toolbar to the view it wraps, matching SwiftUI's `toolbar(content:)`.
35
114
  *
@@ -27,6 +27,7 @@ export * from './List';
27
27
  export * from './Menu';
28
28
  export * from './NavigationDestination';
29
29
  export * from './NavigationLink';
30
+ export * from './NavigationSplitView';
30
31
  export * from './NavigationStack';
31
32
  export * from './Picker';
32
33
  export * from './ProgressView';
@@ -816,6 +816,24 @@ export const scrollIndicators = (
816
816
  axes: 'vertical' | 'horizontal' | 'both' = 'both'
817
817
  ) => createModifier('scrollIndicators', { visibility, axes });
818
818
 
819
+ /**
820
+ * Sets the style of the scroll edge effect that a scrollable view shows where its content meets
821
+ * a bar, such as a navigation bar or a toolbar.
822
+ * Mirrors SwiftUI's `scrollEdgeEffectStyle(_:for:)` modifier. On versions before iOS 26 it does
823
+ * nothing.
824
+ * @param style - The style of the effect:
825
+ * - `'automatic'`: the system picks the style.
826
+ * - `'hard'`: a bar with a defined edge separates the content.
827
+ * - `'soft'`: the content fades out gradually, without a defined edge.
828
+ * @param edges - The edges where the style applies. Defaults to `'all'`.
829
+ * @platform ios 26.0+
830
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/scrolledgeeffectstyle(_:for:)).
831
+ */
832
+ export const scrollEdgeEffectStyle = (
833
+ style: 'automatic' | 'hard' | 'soft',
834
+ edges: 'all' | 'top' | 'bottom' | 'leading' | 'trailing' | 'horizontal' | 'vertical' = 'all'
835
+ ) => createModifier('scrollEdgeEffectStyle', { style, edges });
836
+
819
837
  export type UnitPointValue =
820
838
  | 'zero'
821
839
  | 'topLeading'
@@ -1783,6 +1801,7 @@ export type BuiltInModifier =
1783
1801
  | ReturnType<typeof scrollDisabled>
1784
1802
  | ReturnType<typeof scrollClipDisabled>
1785
1803
  | ReturnType<typeof scrollIndicators>
1804
+ | ReturnType<typeof scrollEdgeEffectStyle>
1786
1805
  | ReturnType<typeof defaultScrollAnchor>
1787
1806
  | ReturnType<typeof defaultScrollAnchorForRole>
1788
1807
  | ReturnType<typeof scrollTargetBehavior>
@@ -1881,6 +1900,7 @@ export * from './tag';
1881
1900
  export * from './pickerStyle';
1882
1901
  export * from './menuOrder';
1883
1902
  export * from './tabViewModifiers';
1903
+ export * from './navigationModifiers';
1884
1904
  export * from './datePickerStyle';
1885
1905
  export * from './progressViewStyle';
1886
1906
  export * from './gaugeStyle';
@@ -0,0 +1,42 @@
1
+ import { createModifier } from './createModifier';
2
+
3
+ export type NavigationSplitViewStyle = 'automatic' | 'balanced' | 'prominentDetail';
4
+
5
+ /**
6
+ * Sets the style of a `NavigationSplitView`.
7
+ * @param style - The style to apply.
8
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/navigationsplitviewstyle(_:)).
9
+ */
10
+ export const navigationSplitViewStyle = (style: NavigationSplitViewStyle) =>
11
+ createModifier('navigationSplitViewStyle', { style });
12
+
13
+ /**
14
+ * The resizable form of `navigationSplitViewColumnWidth`.
15
+ */
16
+ export type NavigationSplitViewColumnWidthParams = {
17
+ min?: number;
18
+ ideal: number;
19
+ max?: number;
20
+ };
21
+
22
+ /**
23
+ * Sets the width of a column of a `NavigationSplitView`.
24
+ *
25
+ * Pass a number for a fixed column, or an `ideal` width with optional `min` and `max` for a
26
+ * column that resizes with the window. Prefer the resizable form: a hardcoded sidebar width
27
+ * does not survive every window size.
28
+ *
29
+ * @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/navigationsplitviewcolumnwidth(_:)).
30
+ */
31
+ export function navigationSplitViewColumnWidth(width: number): ReturnType<typeof createModifier>;
32
+ export function navigationSplitViewColumnWidth(
33
+ params: NavigationSplitViewColumnWidthParams
34
+ ): ReturnType<typeof createModifier>;
35
+ export function navigationSplitViewColumnWidth(
36
+ widthOrParams: number | NavigationSplitViewColumnWidthParams
37
+ ) {
38
+ return createModifier(
39
+ 'navigationSplitViewColumnWidth',
40
+ typeof widthOrParams === 'number' ? { width: widthOrParams } : widthOrParams
41
+ );
42
+ }
@@ -1 +0,0 @@
1
- 6b806f321f975d6caff272f29bc91464e74acbb2
@@ -1 +0,0 @@
1
- 6b32ef025930afd41b632295e3d20bed5d52b29001680721148abc18b7dbf3c8
@@ -1 +0,0 @@
1
- 5cdf850cb3e0dd28112d6a77eead05862cd9d3e5a75b0e1da56a032b872378b05770bc5640f69fc904bd58383e1c4c24933da4702029e6f8dba9f9ab000ef4ac
@@ -1 +0,0 @@
1
- aad7ad5ee2eae34a4143404fa774449f0dc7f6a0
@@ -1 +0,0 @@
1
- 69f99c64824f782c36b1e44617e59fd5f5ddb13f92d906007918534cc8a29dfe
@@ -1 +0,0 @@
1
- d1c36be4bda31ef4d9df2b222c12ab6ee240523984bb7c550ede0186ac99aebb95f31695f76b74a8ad68c34615fa3c0d5ef15ee8c5f58c5e8e90e766a6f4d1d2
@@ -1 +0,0 @@
1
- bb161f9b1ed6f40ef52b0fbf499f220b2f2dcaae
@@ -1 +0,0 @@
1
- b3959c1ffa53081a1d1dc78b91d28066f74a30ee4f0c5e636bb889f793c3f7b0
@@ -1 +0,0 @@
1
- 4bb668ea7d90ee112845564638ba91737dc20fb020ad3373d90ab0a1ba4cf3c680720d652e17dcf9910c119f3d1b48342a3fe089c00e3a0cbe165fd303eb3fd6
@@ -1 +0,0 @@
1
- 9d0123bf63bf3c0e42c4a611dc594003f9edf46f
@@ -1 +0,0 @@
1
- 50edde22ac9a6cd2659ebedca41486469824fb3ab8c860ee75ac75f3b5b1dd3f
@@ -1 +0,0 @@
1
- 5482643787bed8dcb3a4b658a91225aa6ac54173443c93f7f30a393c082cf33c7ef6af5b26bfc353380da41e59072cb6908d65a04ced73c620f067b1361e4ae7