@expo/ui 57.0.17 → 57.0.19
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.
- package/CHANGELOG.md +18 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +2 -2
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +2 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +2 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +4 -0
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/index.d.ts +7 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -1
- package/build/swift-ui/Button/index.d.ts +3 -1
- package/build/swift-ui/Button/index.d.ts.map +1 -1
- package/build/swift-ui/NavigationDestination/index.d.ts +30 -0
- package/build/swift-ui/NavigationDestination/index.d.ts.map +1 -0
- package/build/swift-ui/NavigationLink/index.d.ts +32 -0
- package/build/swift-ui/NavigationLink/index.d.ts.map +1 -0
- package/build/swift-ui/NavigationSplitView/index.d.ts +76 -0
- package/build/swift-ui/NavigationSplitView/index.d.ts.map +1 -0
- package/build/swift-ui/NavigationStack/index.d.ts +45 -0
- package/build/swift-ui/NavigationStack/index.d.ts.map +1 -0
- package/build/swift-ui/Toolbar/index.d.ts +40 -0
- package/build/swift-ui/Toolbar/index.d.ts.map +1 -0
- package/build/swift-ui/index.d.ts +5 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +8 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/navigationModifiers.d.ts +28 -0
- package/build/swift-ui/modifiers/navigationModifiers.d.ts.map +1 -0
- package/expo-module.config.json +1 -1
- package/ios/Button/Button.swift +13 -0
- package/ios/Button/ButtonProps.swift +6 -0
- package/ios/ExpoUIModule.swift +5 -0
- package/ios/Modifiers/NavigationModifiers.swift +44 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +25 -0
- package/ios/NavigationLinkView.swift +22 -0
- package/ios/NavigationSplitViewView.swift +180 -0
- package/ios/NavigationStackView.swift +63 -0
- package/ios/SlotView.swift +5 -0
- package/ios/ToolbarView.swift +33 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.17/expo.modules.ui-57.0.17-sources.jar → 57.0.19/expo.modules.ui-57.0.19-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.17/expo.modules.ui-57.0.17.module → 57.0.19/expo.modules.ui-57.0.19.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.17/expo.modules.ui-57.0.17.pom → 57.0.19/expo.modules.ui-57.0.19.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.19/expo.modules.ui-57.0.19.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/jetpack-compose/DatePicker/index.tsx +4 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +9 -0
- package/src/swift-ui/Button/index.tsx +3 -1
- package/src/swift-ui/NavigationDestination/index.tsx +39 -0
- package/src/swift-ui/NavigationLink/index.tsx +51 -0
- package/src/swift-ui/NavigationSplitView/index.tsx +122 -0
- package/src/swift-ui/NavigationStack/index.tsx +75 -0
- package/src/swift-ui/Toolbar/index.tsx +64 -0
- package/src/swift-ui/index.tsx +5 -0
- package/src/swift-ui/modifiers/index.ts +10 -1
- package/src/swift-ui/modifiers/navigationModifiers.ts +42 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha512 +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7562f2859bce818ca579384779636c2664395d27507873aafa8815aca90d8ec71e7cc09a648438eb4d1facd99b9b4aa005b6f8da0f93b85e090356a194a9d8b3
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.19",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.fx.js",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@types/react": "~19.2.0",
|
|
97
97
|
"react-native-reanimated": "4.5.1",
|
|
98
98
|
"react-native-worklets": "0.10.1",
|
|
99
|
-
"expo": "57.0.
|
|
99
|
+
"expo": "57.0.24",
|
|
100
100
|
"expo-module-scripts": "56.0.3"
|
|
101
101
|
},
|
|
102
102
|
"jest": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"optional": true
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "7687b07947a5c866adeb11abbceae72403ccb188",
|
|
125
125
|
"scripts": {
|
|
126
126
|
"build": "expo-module build",
|
|
127
127
|
"clean": "expo-module clean",
|
|
@@ -325,6 +325,10 @@ export function DateRangePicker(props: DateRangePickerProps) {
|
|
|
325
325
|
// -- Dialog views (used internally by the compat layer) ---------------------
|
|
326
326
|
|
|
327
327
|
export interface DatePickerDialogProps {
|
|
328
|
+
/**
|
|
329
|
+
* The initially selected date. When omitted, the dialog opens on the current month with no
|
|
330
|
+
* selection and the confirm button stays disabled until a date is picked.
|
|
331
|
+
*/
|
|
328
332
|
initialDate?: string | null;
|
|
329
333
|
variant?: AndroidVariant;
|
|
330
334
|
showVariantToggle?: boolean;
|
|
@@ -43,6 +43,14 @@ export interface DropdownMenuProps {
|
|
|
43
43
|
*/
|
|
44
44
|
color?: ColorValue;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Shadow elevation of the dropdown menu popup in dp. Set to `0` to remove the shadow.
|
|
48
|
+
* Defaults to Material3's `MenuDefaults.ShadowElevation`.
|
|
49
|
+
*
|
|
50
|
+
* @platform android
|
|
51
|
+
*/
|
|
52
|
+
shadowElevation?: number;
|
|
53
|
+
|
|
46
54
|
/**
|
|
47
55
|
* Optional styles to apply to the `DropdownMenu`.
|
|
48
56
|
*/
|
|
@@ -58,6 +66,7 @@ type NativeMenuProps = {
|
|
|
58
66
|
expanded?: boolean;
|
|
59
67
|
onDismissRequest?: () => void;
|
|
60
68
|
color?: ColorValue;
|
|
69
|
+
shadowElevation?: number;
|
|
61
70
|
style?: StyleProp<ViewStyle>;
|
|
62
71
|
modifiers?: ModifierConfig[];
|
|
63
72
|
children?: ReactNode;
|
|
@@ -10,8 +10,10 @@ import { type CommonViewModifierProps } from '../types';
|
|
|
10
10
|
* - `default` - The default button role.
|
|
11
11
|
* - `cancel` - A button that cancels the current operation.
|
|
12
12
|
* - `destructive` - A button that deletes data or performs a destructive action.
|
|
13
|
+
* - `close` - A button that closes the view it is presented in. Given no `label` and no children,
|
|
14
|
+
* the system draws it as an xmark.
|
|
13
15
|
*/
|
|
14
|
-
export type ButtonRole = 'default' | 'cancel' | 'destructive';
|
|
16
|
+
export type ButtonRole = 'default' | 'cancel' | 'destructive' | 'close';
|
|
15
17
|
|
|
16
18
|
export interface ButtonProps extends CommonViewModifierProps {
|
|
17
19
|
/**
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Slot } from '../SlotView';
|
|
4
|
+
|
|
5
|
+
export interface NavigationDestinationProps {
|
|
6
|
+
/**
|
|
7
|
+
* The `NavigationLink` value this destination is presented for.
|
|
8
|
+
*/
|
|
9
|
+
value: string;
|
|
10
|
+
/**
|
|
11
|
+
* The view pushed onto the stack for `value`.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Associates a destination view with a `NavigationLink` value, matching SwiftUI's
|
|
18
|
+
* `navigationDestination(for:destination:)`. It must be a direct child of the `NavigationStack`,
|
|
19
|
+
* however deeply the link that pushes it is nested inside that stack.
|
|
20
|
+
*
|
|
21
|
+
* Keep it mounted so the pushed screen already carries its `navigationTitle` when the slide
|
|
22
|
+
* starts, or render one for each value on the stack's `path` to build screens on demand.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <NavigationDestination value="settings">
|
|
27
|
+
* <SettingsScreen />
|
|
28
|
+
* </NavigationDestination>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @platform ios
|
|
32
|
+
*/
|
|
33
|
+
export function NavigationDestination(props: NavigationDestinationProps) {
|
|
34
|
+
return (
|
|
35
|
+
<Slot name="destination" extraProps={{ value: props.value }}>
|
|
36
|
+
{props.children}
|
|
37
|
+
</Slot>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
5
|
+
import { type CommonViewModifierProps } from '../types';
|
|
6
|
+
|
|
7
|
+
export interface NavigationLinkProps extends CommonViewModifierProps {
|
|
8
|
+
/**
|
|
9
|
+
* The value to append to the enclosing `NavigationStack`'s path when the link is tapped. The
|
|
10
|
+
* stack presents the `NavigationDestination` whose `value` matches.
|
|
11
|
+
*/
|
|
12
|
+
value: string;
|
|
13
|
+
/**
|
|
14
|
+
* A view that describes the link.
|
|
15
|
+
*/
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const NavigationLinkNativeView: ComponentType<NavigationLinkProps> = requireNativeView(
|
|
20
|
+
'ExpoUI',
|
|
21
|
+
'NavigationLinkView'
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A view that controls a navigation presentation. In a `List` it renders as a row with a
|
|
26
|
+
* disclosure chevron, and tapping it pushes the matching `NavigationDestination`.
|
|
27
|
+
*
|
|
28
|
+
* The link has to be inside the `NavigationStack` itself. Content presented from the stack, such
|
|
29
|
+
* as a `BottomSheet` or a `Popover`, is its own presentation context and does not reach the
|
|
30
|
+
* stack's destinations, so give that content its own `NavigationStack`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <NavigationLink value="settings">
|
|
35
|
+
* <Text>Settings</Text>
|
|
36
|
+
* </NavigationLink>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @platform ios
|
|
40
|
+
*/
|
|
41
|
+
export function NavigationLink(props: NavigationLinkProps) {
|
|
42
|
+
const { modifiers, children, ...restProps } = props;
|
|
43
|
+
return (
|
|
44
|
+
<NavigationLinkNativeView
|
|
45
|
+
modifiers={modifiers}
|
|
46
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
47
|
+
{...restProps}>
|
|
48
|
+
{children}
|
|
49
|
+
</NavigationLinkNativeView>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { requireNativeView } from 'expo';
|
|
2
|
+
import { type ComponentType, type ReactNode } from 'react';
|
|
3
|
+
import { type NativeSyntheticEvent } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { createViewModifierEventListener } from '../modifiers/utils';
|
|
6
|
+
import { type CommonViewModifierProps } from '../types';
|
|
7
|
+
|
|
8
|
+
export interface NavigationStackProps extends CommonViewModifierProps {
|
|
9
|
+
/**
|
|
10
|
+
* The root view of the stack, and the `NavigationDestination` views the stack can push. It is
|
|
11
|
+
* displayed inside a navigation bar.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The values of the views pushed on top of the root view, in the order they were pushed.
|
|
16
|
+
* Leave it undefined to let the stack manage its own path.
|
|
17
|
+
*/
|
|
18
|
+
path?: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Callback function that is called when the stack pushes or pops a view, for example when a
|
|
21
|
+
* `NavigationLink` is tapped or the user swipes back. Gets called with the new path.
|
|
22
|
+
*
|
|
23
|
+
* When `path` is set, the stack is controlled: a push takes effect once the new path comes back
|
|
24
|
+
* through this prop.
|
|
25
|
+
*/
|
|
26
|
+
onPathChange?: (path: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type NativeNavigationStackProps = Omit<NavigationStackProps, 'onPathChange'> & {
|
|
30
|
+
onPathChange?: (event: NativeSyntheticEvent<{ path: string[] }>) => void;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const NavigationStackNativeView: ComponentType<NativeNavigationStackProps> = requireNativeView(
|
|
34
|
+
'ExpoUI',
|
|
35
|
+
'NavigationStackView'
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A view that displays a root view and enables you to present additional views over the root view.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* const [path, setPath] = useState<string[]>([]);
|
|
44
|
+
*
|
|
45
|
+
* <NavigationStack path={path} onPathChange={setPath}>
|
|
46
|
+
* <List>
|
|
47
|
+
* <NavigationLink value="settings">
|
|
48
|
+
* <Text>Settings</Text>
|
|
49
|
+
* </NavigationLink>
|
|
50
|
+
* </List>
|
|
51
|
+
* <NavigationDestination value="settings">
|
|
52
|
+
* <SettingsScreen />
|
|
53
|
+
* </NavigationDestination>
|
|
54
|
+
* </NavigationStack>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @platform ios
|
|
58
|
+
*/
|
|
59
|
+
export function NavigationStack(props: NavigationStackProps) {
|
|
60
|
+
const { modifiers, onPathChange, ...restProps } = props;
|
|
61
|
+
return (
|
|
62
|
+
<NavigationStackNativeView
|
|
63
|
+
modifiers={modifiers}
|
|
64
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
65
|
+
{...restProps}
|
|
66
|
+
onPathChange={
|
|
67
|
+
onPathChange
|
|
68
|
+
? ({ nativeEvent: { path } }) => {
|
|
69
|
+
onPathChange(path);
|
|
70
|
+
}
|
|
71
|
+
: undefined
|
|
72
|
+
}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 interface ToolbarProps extends CommonViewModifierProps {
|
|
8
|
+
/**
|
|
9
|
+
* The view the toolbar belongs to, together with the `Toolbar.Content` that fills it.
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ToolbarContentProps {
|
|
15
|
+
/**
|
|
16
|
+
* The items to place in the toolbar.
|
|
17
|
+
*/
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const ToolbarNativeView: React.ComponentType<ToolbarProps> = requireNativeView(
|
|
22
|
+
'ExpoUI',
|
|
23
|
+
'ToolbarView'
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The items placed in the toolbar of the view `Toolbar` wraps.
|
|
28
|
+
*/
|
|
29
|
+
function ToolbarContent(props: ToolbarContentProps) {
|
|
30
|
+
return <Slot name="content">{props.children}</Slot>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Adds a toolbar to the view it wraps, matching SwiftUI's `toolbar(content:)`.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <NavigationStack>
|
|
39
|
+
* <Toolbar>
|
|
40
|
+
* <Text>Bird description</Text>
|
|
41
|
+
* <Toolbar.Content>
|
|
42
|
+
* <Button role="close" onPress={() => setIsPresented(false)} />
|
|
43
|
+
* </Toolbar.Content>
|
|
44
|
+
* </Toolbar>
|
|
45
|
+
* </NavigationStack>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @platform ios
|
|
49
|
+
*/
|
|
50
|
+
function ToolbarComponent(props: ToolbarProps) {
|
|
51
|
+
const { modifiers, children, ...restProps } = props;
|
|
52
|
+
return (
|
|
53
|
+
<ToolbarNativeView
|
|
54
|
+
modifiers={modifiers}
|
|
55
|
+
{...(modifiers ? createViewModifierEventListener(modifiers) : undefined)}
|
|
56
|
+
{...restProps}>
|
|
57
|
+
{children}
|
|
58
|
+
</ToolbarNativeView>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const Toolbar = Object.assign(ToolbarComponent, { Content: ToolbarContent });
|
|
63
|
+
|
|
64
|
+
export { Toolbar };
|
package/src/swift-ui/index.tsx
CHANGED
|
@@ -25,6 +25,10 @@ export * from './ZStack';
|
|
|
25
25
|
export * from './Group';
|
|
26
26
|
export * from './List';
|
|
27
27
|
export * from './Menu';
|
|
28
|
+
export * from './NavigationDestination';
|
|
29
|
+
export * from './NavigationLink';
|
|
30
|
+
export * from './NavigationSplitView';
|
|
31
|
+
export * from './NavigationStack';
|
|
28
32
|
export * from './Picker';
|
|
29
33
|
export * from './ProgressView';
|
|
30
34
|
export * from './Section';
|
|
@@ -38,6 +42,7 @@ export { useNativeState } from '../State';
|
|
|
38
42
|
export { withAnimation, type WithAnimationCompletionCriteria } from './withAnimation';
|
|
39
43
|
export * from './SyncToggle';
|
|
40
44
|
export * from './TabView';
|
|
45
|
+
export * from './Toolbar';
|
|
41
46
|
export * from './Toggle';
|
|
42
47
|
export {
|
|
43
48
|
TextField,
|
|
@@ -1687,6 +1687,13 @@ export const resizable = (
|
|
|
1687
1687
|
resizingMode?: 'stretch' | 'tile'
|
|
1688
1688
|
) => createModifier('resizable', { ...capInsets, resizingMode });
|
|
1689
1689
|
|
|
1690
|
+
/**
|
|
1691
|
+
* Configures the view's title for purposes of navigation, using a string.
|
|
1692
|
+
* @param title - The title to display.
|
|
1693
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/navigationtitle(_:)).
|
|
1694
|
+
*/
|
|
1695
|
+
export const navigationTitle = (title: string) => createModifier('navigationTitle', { title });
|
|
1696
|
+
|
|
1690
1697
|
// =============================================================================
|
|
1691
1698
|
// Type Definitions
|
|
1692
1699
|
// =============================================================================
|
|
@@ -1830,7 +1837,8 @@ export type BuiltInModifier =
|
|
|
1830
1837
|
| ReturnType<typeof widgetAccentedRenderingMode>
|
|
1831
1838
|
| ReturnType<typeof widgetURL>
|
|
1832
1839
|
| ReturnType<typeof activityBackgroundTint>
|
|
1833
|
-
| ReturnType<typeof containerBackground
|
|
1840
|
+
| ReturnType<typeof containerBackground>
|
|
1841
|
+
| ReturnType<typeof navigationTitle>;
|
|
1834
1842
|
|
|
1835
1843
|
/**
|
|
1836
1844
|
* Main ViewModifier type that supports both built-in and 3rd party modifiers.
|
|
@@ -1873,6 +1881,7 @@ export * from './tag';
|
|
|
1873
1881
|
export * from './pickerStyle';
|
|
1874
1882
|
export * from './menuOrder';
|
|
1875
1883
|
export * from './tabViewModifiers';
|
|
1884
|
+
export * from './navigationModifiers';
|
|
1876
1885
|
export * from './datePickerStyle';
|
|
1877
1886
|
export * from './progressViewStyle';
|
|
1878
1887
|
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
|
-
cee93fd5a15e4eaab695ed3175a4949f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
43ac02b43fa332c84dbd29354a8ffc002828927a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a2eb95b5f7bc80a8406159f0cd3cc67058927f3e88d1ce5e0eed1000f47bf6e7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6a46b6260033cfdf2fcb8cb69b966ac7dcca618a6f3e9c011819a76e42f998c2a549b1864bbbbd642b106c01d9ee184eb822019cc58d4b438103ed8d421cbb2d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar
DELETED
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
87a5f6dc53fef1a3b6810eb8db0ccc6a
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
394fabe7251e3d947f0bbf2037e2bb065b8493d5
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
13b9babd2eaa4ed0f4ad6a09f8443eb1a4bca31cc519d29db8371cdabd6487e4
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
10a5b1af451aa49760a4c2ca23f439feeff3ee645cef0ca3af0ef7e487efeb5d26c3ff608ce68568a005f46707a5b774e274b5ca0ffc058429d633e600c9ed1e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5cdd34e3be888a5735c256250dd728cf
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b7846d058304cfb924196deafc5d6e30418c63cd
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3ce103a426470ca2198f1231ebd5030611bcbd360a51bc830b48dcc7ad7853f2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6c831b75309aa91c19aec99702afc5ce461d7fdd215d6acf9565429437744faf0ecc2b953f82fde708241646797dbd4adf9b47f6dc07b388e6179dd0ad4341e7
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
edd1385c2afe1e6a5c4974dfc1d3b6b8
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8ec443820fac6b3c0527234e124be03c815e81d0
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
68858cf5c7e2ff60833e8e6d3c4c5f1683969c7d5f24965470e431605eaa1f70
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.17/expo.modules.ui-57.0.17.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
637e334e0226ffefc9abe120e7c35fe3441432d6fe47bd1c0dff56445168808763dca58272af02d7af20442213088b037129ff8bff12ce37640a1ad88a13c4d7
|