expo-router 7.0.0-canary-20251216-3f01dbf → 7.0.0-canary-20251223-b83b31e

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 (124) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/color/index.d.ts +44 -0
  3. package/build/color/index.d.ts.map +1 -1
  4. package/build/color/index.js +69 -5
  5. package/build/color/index.js.map +1 -1
  6. package/build/exports.d.ts +1 -0
  7. package/build/exports.d.ts.map +1 -1
  8. package/build/exports.js +3 -1
  9. package/build/exports.js.map +1 -1
  10. package/build/layouts/StackClient.d.ts +1 -1
  11. package/build/layouts/stack-utils/StackHeaderButton.d.ts +77 -2
  12. package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -1
  13. package/build/layouts/stack-utils/StackHeaderButton.js +3 -0
  14. package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -1
  15. package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -1
  16. package/build/layouts/stack-utils/StackHeaderLeftRight.js +7 -5
  17. package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -1
  18. package/build/layouts/stack-utils/StackHeaderMenu.d.ts +83 -7
  19. package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -1
  20. package/build/layouts/stack-utils/StackHeaderMenu.js +14 -4
  21. package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -1
  22. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +7 -1
  23. package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -1
  24. package/build/layouts/stack-utils/StackHeaderSpacer.js +5 -2
  25. package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -1
  26. package/build/layouts/stack-utils/{StackHeaderItem.d.ts → StackHeaderView.d.ts} +18 -5
  27. package/build/layouts/stack-utils/StackHeaderView.d.ts.map +1 -0
  28. package/build/layouts/stack-utils/{StackHeaderItem.js → StackHeaderView.js} +14 -10
  29. package/build/layouts/stack-utils/StackHeaderView.js.map +1 -0
  30. package/build/layouts/stack-utils/index.d.ts +3 -3
  31. package/build/layouts/stack-utils/index.d.ts.map +1 -1
  32. package/build/layouts/stack-utils/index.js +4 -4
  33. package/build/layouts/stack-utils/index.js.map +1 -1
  34. package/build/layouts/stack-utils/shared.d.ts +4 -42
  35. package/build/layouts/stack-utils/shared.d.ts.map +1 -1
  36. package/build/layouts/stack-utils/shared.js +3 -22
  37. package/build/layouts/stack-utils/shared.js.map +1 -1
  38. package/build/link/ExpoLink.d.ts.map +1 -1
  39. package/build/link/ExpoLink.js +1 -8
  40. package/build/link/ExpoLink.js.map +1 -1
  41. package/build/link/elements.d.ts +36 -13
  42. package/build/link/elements.d.ts.map +1 -1
  43. package/build/link/elements.js +14 -5
  44. package/build/link/elements.js.map +1 -1
  45. package/build/link/preview/native.d.ts +12 -1
  46. package/build/link/preview/native.d.ts.map +1 -1
  47. package/build/link/preview/native.js.map +1 -1
  48. package/build/navigationEvents/index.d.ts +36 -0
  49. package/build/navigationEvents/index.d.ts.map +1 -0
  50. package/build/navigationEvents/index.js +53 -0
  51. package/build/navigationEvents/index.js.map +1 -0
  52. package/build/toolbar/elements.d.ts +325 -16
  53. package/build/toolbar/elements.d.ts.map +1 -1
  54. package/build/toolbar/elements.js +130 -12
  55. package/build/toolbar/elements.js.map +1 -1
  56. package/build/toolbar/index.d.ts +38 -6
  57. package/build/toolbar/index.d.ts.map +1 -1
  58. package/build/toolbar/index.js +36 -1
  59. package/build/toolbar/index.js.map +1 -1
  60. package/build/toolbar/native.ios.d.ts.map +1 -1
  61. package/build/toolbar/native.ios.js.map +1 -1
  62. package/build/toolbar/native.types.d.ts +6 -5
  63. package/build/toolbar/native.types.d.ts.map +1 -1
  64. package/build/toolbar/native.types.js.map +1 -1
  65. package/build/useScreens.d.ts.map +1 -1
  66. package/build/useScreens.js +50 -0
  67. package/build/useScreens.js.map +1 -1
  68. package/build/utils/font.d.ts +9 -0
  69. package/build/utils/font.d.ts.map +1 -0
  70. package/build/utils/font.js +20 -0
  71. package/build/utils/font.js.map +1 -0
  72. package/expo-module.config.json +1 -1
  73. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +105 -24
  74. package/ios/LinkPreview/LinkPreviewNativeModule.swift +35 -8
  75. package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +16 -20
  76. package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +1 -8
  77. package/ios/LinkPreview/LinkPreviewNativeView.swift +48 -50
  78. package/ios/LinkPreview/LinkZoomTransition.swift +8 -10
  79. package/ios/RouterViewWithLogger.swift +5 -0
  80. package/ios/Toolbar/RouterFontUtils.swift +50 -0
  81. package/ios/Toolbar/RouterToolbarHostView.swift +41 -17
  82. package/ios/Toolbar/RouterToolbarItemView.swift +30 -13
  83. package/ios/Toolbar/RouterToolbarModule.swift +28 -0
  84. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar +0 -0
  85. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.md5 +1 -0
  86. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha1 +1 -0
  87. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha256 +1 -0
  88. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha512 +1 -0
  89. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module} +17 -17
  90. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.md5 +1 -0
  91. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha1 +1 -0
  92. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha256 +1 -0
  93. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha512 +1 -0
  94. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom} +1 -1
  95. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.md5 +1 -0
  96. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha1 +1 -0
  97. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha256 +1 -0
  98. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha512 +1 -0
  99. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  100. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  101. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  102. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  103. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  104. package/package.json +10 -10
  105. package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +0 -1
  106. package/build/layouts/stack-utils/StackHeaderItem.js.map +0 -1
  107. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar +0 -0
  108. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.md5 +0 -1
  109. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha1 +0 -1
  110. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha256 +0 -1
  111. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.aar.sha512 +0 -1
  112. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.md5 +0 -1
  113. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha1 +0 -1
  114. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha256 +0 -1
  115. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.module.sha512 +0 -1
  116. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.md5 +0 -1
  117. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha1 +0 -1
  118. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha256 +0 -1
  119. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf.pom.sha512 +0 -1
  120. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar} +0 -0
  121. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.md5 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.md5} +0 -0
  122. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha1 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha1} +0 -0
  123. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha256 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha256} +0 -0
  124. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-3f01dbf/expo.modules.router-7.0.0-canary-20251216-3f01dbf-sources.jar.sha512 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha512} +0 -0
@@ -1,24 +1,333 @@
1
- import { type StyleProp, type ViewStyle } from 'react-native';
1
+ import { type ReactNode } from 'react';
2
+ import { type ColorValue, type StyleProp } from 'react-native';
2
3
  import type { SFSymbol } from 'sf-symbols-typescript';
3
- import type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';
4
- import { LinkMenuAction, type LinkMenuActionProps, type LinkMenuProps } from '../link/elements';
5
- export type ToolbarMenuProps = LinkMenuProps;
6
- export declare const ToolbarMenu: import("react").FC<LinkMenuProps>;
4
+ import { LinkMenuAction, type LinkMenuActionProps } from '../link/elements';
5
+ import type { BasicTextStyle } from '../utils/font';
6
+ export interface ToolbarMenuProps {
7
+ accessibilityLabel?: string;
8
+ accessibilityHint?: string;
9
+ children?: React.ReactNode;
10
+ /**
11
+ * If `true`, the menu item will be displayed as destructive.
12
+ *
13
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.
14
+ */
15
+ destructive?: boolean;
16
+ disabled?: boolean;
17
+ hidden?: boolean;
18
+ /**
19
+ * Whether to hide the shared background when `sharesBackground` is enabled.
20
+ *
21
+ * Only available for root level menus.
22
+ *
23
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
24
+ *
25
+ * @platform iOS 26+
26
+ */
27
+ hidesSharedBackground?: boolean;
28
+ /**
29
+ * Optional SF Symbol displayed alongside the menu item.
30
+ */
31
+ icon?: SFSymbol;
32
+ /**
33
+ * If `true`, the menu will be displayed inline.
34
+ * This means that the menu will not be collapsed
35
+ *
36
+ * > **Note*: Inline menus are only supported in submenus.
37
+ *
38
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.
39
+ */
40
+ inline?: boolean;
41
+ /**
42
+ * If `true`, the menu will be displayed as a palette.
43
+ * This means that the menu will be displayed as one row
44
+ *
45
+ * > **Note**: Palette menus are only supported in submenus.
46
+ *
47
+ * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.
48
+ */
49
+ palette?: boolean;
50
+ /**
51
+ * Whether to separate the background of this item from other header items.
52
+ *
53
+ * > **Note**: Text buttons cannot share the background.
54
+ *
55
+ * This prop reverses the native behavior of `sharesBackground`.
56
+ *
57
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
58
+ *
59
+ * @default false
60
+ *
61
+ * @platform iOS 26+
62
+ */
63
+ separateBackground?: boolean;
64
+ /**
65
+ * Style for the label of the header item.
66
+ */
67
+ style?: StyleProp<BasicTextStyle>;
68
+ /**
69
+ * The title of the menu item
70
+ */
71
+ title?: string;
72
+ /**
73
+ * Tint color for the menu icon and text.
74
+ */
75
+ tintColor?: ColorValue;
76
+ /**
77
+ * Controls the visual style of the menu when represented as a bar button.
78
+ *
79
+ * @default 'plain'
80
+ */
81
+ variant?: 'plain' | 'done' | 'prominent';
82
+ }
83
+ /**
84
+ * Adds a context menu for to a toolbar.
85
+ *
86
+ * @example
87
+ * ```tsx
88
+ * <Toolbar>
89
+ * <Toolbar.Menu title="Options">
90
+ * <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
91
+ * <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
92
+ * </Toolbar.Menu>
93
+ * </Toolbar>
94
+ * ```
95
+ *
96
+ * @platform ios
97
+ */
98
+ export declare const ToolbarMenu: React.FC<ToolbarMenuProps>;
7
99
  export type ToolbarMenuActionProps = LinkMenuActionProps;
100
+ /**
101
+ * A single action item within a toolbar menu.
102
+ *
103
+ * For available props, see [`LinkMenuActionProps`](./router/#linkmenuactionprops).
104
+ *
105
+ * @example
106
+ * ```tsx
107
+ * <Toolbar>
108
+ * <Toolbar.Menu title="Options">
109
+ * <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
110
+ * <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
111
+ * </Toolbar.Menu>
112
+ * </Toolbar>
113
+ * ```
114
+ *
115
+ * @platform ios
116
+ */
8
117
  export declare const ToolbarMenuAction: typeof LinkMenuAction;
9
- export interface ToolbarButtonProps extends Pick<RouterToolbarItemProps, 'barButtonItemStyle' | 'hidden' | 'selected' | 'possibleTitles' | 'tintColor' | 'hidesSharedBackground' | 'sharesBackground'> {
10
- children?: string;
11
- sf?: SFSymbol;
118
+ export interface ToolbarButtonProps {
119
+ accessibilityLabel?: string;
120
+ accessibilityHint?: string;
121
+ /**
122
+ * The text label for the button.
123
+ *
124
+ * > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.
125
+ *
126
+ * @example
127
+ * ```tsx
128
+ * import { Toolbar } from 'expo-router/unstable-toolbar';
129
+ *
130
+ * ...
131
+ * <Toolbar.Button>This is button label</Toolbar.Button>
132
+ * ```
133
+ */
134
+ children?: ReactNode;
135
+ disabled?: boolean;
136
+ /**
137
+ * Whether the button should be hidden.
138
+ *
139
+ * @default false
140
+ */
141
+ hidden?: boolean;
142
+ /**
143
+ * Whether to hide the shared background.
144
+ *
145
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
146
+ *
147
+ * @platform iOS 26+
148
+ */
149
+ hidesSharedBackground?: boolean;
150
+ /**
151
+ * The name of the SF Symbol to display as the button icon.
152
+ * For a list of available symbols, see [SF Symbols](https://developer.apple.com/sf-symbols/).
153
+ */
154
+ icon?: SFSymbol;
155
+ /**
156
+ * Callback function when the button is pressed.
157
+ */
12
158
  onPress?: () => void;
159
+ /**
160
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/possibletitles) for more information.
161
+ */
162
+ possibleTitles?: string[];
163
+ /**
164
+ * Whether the button is in a selected state
165
+ *
166
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information.
167
+ */
168
+ selected?: boolean;
169
+ /**
170
+ * Whether to separate the background of this item from other header items.
171
+ *
172
+ * > **Note**: Text buttons cannot share the background.
173
+ *
174
+ * This prop reverses the native behavior of `sharesBackground`.
175
+ *
176
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
177
+ *
178
+ * @default false
179
+ *
180
+ * @platform iOS 26+
181
+ */
182
+ separateBackground?: boolean;
183
+ /**
184
+ * Style for the label of the header item.
185
+ */
186
+ style?: StyleProp<BasicTextStyle>;
187
+ /**
188
+ * Tint color for the button icon and text.
189
+ */
190
+ tintColor?: ColorValue;
191
+ /**
192
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/style-swift.enum) for more information.
193
+ *
194
+ * @default 'plain'
195
+ */
196
+ variant?: 'plain' | 'done' | 'prominent';
13
197
  }
14
- export declare const ToolbarButton: ({ children, sf, onPress, ...rest }: ToolbarButtonProps) => import("react").JSX.Element;
15
- export type ToolbarSpacerProps = Pick<RouterToolbarItemProps, 'width' | 'hidden'>;
16
- export declare const ToolbarSpacer: ({ width, ...rest }: ToolbarSpacerProps) => import("react").JSX.Element;
17
- export interface ToolbarViewProps extends Pick<RouterToolbarItemProps, 'hidesSharedBackground' | 'sharesBackground'> {
198
+ /**
199
+ * A button component for use in the toolbar.
200
+ * It should only be used as a child of `Toolbar`.
201
+ *
202
+ * @example
203
+ * ```tsx
204
+ * <Toolbar>
205
+ * <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
206
+ * <Toolbar.Button>Text Button</Toolbar.Button>
207
+ * <Toolbar.Button hidden={!isSearchFocused} icon="xmark" onPress={handleClear} />
208
+ * </Toolbar>
209
+ * ```
210
+ *
211
+ * @platform ios
212
+ */
213
+ export declare const ToolbarButton: (props: ToolbarButtonProps) => import("react").JSX.Element;
214
+ export type ToolbarSpacerProps = {
215
+ /**
216
+ * Whether to hide the shared background when `sharesBackground` is enabled.
217
+ *
218
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
219
+ *
220
+ * @platform iOS 26+
221
+ */
222
+ hidesSharedBackground?: boolean;
223
+ /**
224
+ * Whether the spacer should be hidden.
225
+ *
226
+ * @default false
227
+ */
228
+ hidden?: boolean;
229
+ /**
230
+ * Whether the spacer shares the background with adjacent toolbar items.
231
+ *
232
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
233
+ *
234
+ * @platform iOS 26+
235
+ * @default false
236
+ */
237
+ sharesBackground?: boolean;
238
+ /**
239
+ * By default, the spacer is flexible and expands to fill available space.
240
+ * If a width is provided, it creates a [fixed-width spacer](https://developer.apple.com/documentation/uikit/uibarbuttonitem/fixedspace(_:)).
241
+ */
242
+ width?: number;
243
+ };
244
+ /**
245
+ * A spacer component for the toolbar.
246
+ * Without a width, it creates a flexible spacer that expands to fill available space.
247
+ * With a width, it creates a fixed-width spacer.
248
+ * It should only be used as a child of `Toolbar`.
249
+ *
250
+ * @example
251
+ * ```tsx
252
+ * <Toolbar>
253
+ * <Toolbar.Spacer />
254
+ * <Toolbar.Button icon="magnifyingglass" />
255
+ * <Toolbar.Spacer width={20} />
256
+ * <Toolbar.Button icon="mic" />
257
+ * <Toolbar.Spacer />
258
+ * </Toolbar>
259
+ * ```
260
+ *
261
+ * @platform ios
262
+ */
263
+ export declare const ToolbarSpacer: (props: ToolbarSpacerProps) => import("react").JSX.Element;
264
+ /**
265
+ * Props for the ToolbarView component.
266
+ *
267
+ * @platform ios
268
+ */
269
+ export interface ToolbarViewProps {
270
+ /**
271
+ * React elements to render inside the toolbar view.
272
+ */
18
273
  children: React.ReactNode;
19
- style?: StyleProp<Omit<ViewStyle, 'position' | 'inset' | 'top' | 'left' | 'right' | 'bottom' | 'flex'>>;
274
+ /**
275
+ * Whether the view should be hidden.
276
+ *
277
+ * @default false
278
+ */
279
+ hidden?: boolean;
280
+ /**
281
+ * Whether to hide the shared background when `sharesBackground` is enabled.
282
+ *
283
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
284
+ *
285
+ * @platform iOS 18+
286
+ */
287
+ hidesSharedBackground?: boolean;
288
+ /**
289
+ * Whether to separate the background of this item from other header items.
290
+ *
291
+ * This prop reverses the native behavior of `sharesBackground`.
292
+ *
293
+ * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
294
+ *
295
+ * @default false
296
+ *
297
+ * @platform iOS 26+
298
+ */
299
+ separateBackground?: boolean;
300
+ }
301
+ /**
302
+ * A custom view component for the toolbar that can contain any React elements.
303
+ * Useful for embedding custom components.
304
+ * It should only be used as a child of `Toolbar`.
305
+ *
306
+ * The items within the view will be absolutely positioned, so flexbox styles will not work as expected.
307
+ *
308
+ * @example
309
+ * ```tsx
310
+ * <Toolbar>
311
+ * <Toolbar.Spacer />
312
+ * <Toolbar.View>
313
+ * <TextInput
314
+ * placeholder="Search"
315
+ * placeholderTextColor={Color.ios.placeholderText}
316
+ * />
317
+ * </Toolbar.View>
318
+ * <Toolbar.View separateBackground style={{ width: 32, height: 32 }}>
319
+ * <Pressable onPress={handlePress}>
320
+ * <SymbolView name="plus" size={22} />
321
+ * </Pressable>
322
+ * </Toolbar.View>
323
+ * </Toolbar>
324
+ * ```
325
+ *
326
+ * @platform ios
327
+ */
328
+ export declare const ToolbarView: ({ children, hidden, hidesSharedBackground, separateBackground, }: ToolbarViewProps) => import("react").JSX.Element;
329
+ export interface ToolbarProps {
330
+ children?: React.ReactNode;
20
331
  }
21
- export declare const ToolbarView: ({ children, style, ...rest }: ToolbarViewProps) => import("react").JSX.Element;
22
- export type ToolbarHostProps = RouterToolbarHostProps;
23
- export declare const ToolbarHost: (props: ToolbarHostProps) => import("react").JSX.Element;
332
+ export declare const ToolbarHost: (props: ToolbarProps) => import("react").JSX.Element;
24
333
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ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,MAAM,kBAAkB,GAAG;IAC/B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,gCAYtD,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,WAAW,GAAI,kEAKzB,gBAAgB,gCAWlB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,gCAO9C,CAAC"}
@@ -1,28 +1,146 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ToolbarHost = exports.ToolbarView = exports.ToolbarSpacer = exports.ToolbarButton = exports.ToolbarMenuAction = exports.ToolbarMenu = void 0;
4
- const non_secure_1 = require("nanoid/non-secure");
5
4
  const react_1 = require("react");
6
5
  const react_native_1 = require("react-native");
7
6
  const native_1 = require("./native");
8
7
  const InternalLinkPreviewContext_1 = require("../link/InternalLinkPreviewContext");
9
8
  const elements_1 = require("../link/elements");
10
- exports.ToolbarMenu = elements_1.LinkMenu;
9
+ const native_2 = require("../link/preview/native");
10
+ const primitives_1 = require("../primitives");
11
+ const children_1 = require("../utils/children");
12
+ /**
13
+ * Adds a context menu for to a toolbar.
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Toolbar>
18
+ * <Toolbar.Menu title="Options">
19
+ * <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
20
+ * <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
21
+ * </Toolbar.Menu>
22
+ * </Toolbar>
23
+ * ```
24
+ *
25
+ * @platform ios
26
+ */
27
+ const ToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, title, destructive, children, icon, tintColor, variant, style, }) => {
28
+ const identifier = (0, react_1.useId)();
29
+ const validChildren = react_1.Children.toArray(children).filter((child) => (0, react_1.isValidElement)(child) && (child.type === exports.ToolbarMenuAction || child.type === exports.ToolbarMenu));
30
+ const label = (0, children_1.getFirstChildOfType)(children, primitives_1.Label);
31
+ const iconComponent = (0, children_1.getFirstChildOfType)(children, primitives_1.Icon);
32
+ const computedTitle = title ?? label?.props.children ?? '';
33
+ const computedIcon = icon ??
34
+ (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
35
+ const sf = typeof computedIcon === 'string' ? computedIcon : undefined;
36
+ const titleStyle = react_native_1.StyleSheet.flatten(style);
37
+ return (<native_2.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={sf} destructive={destructive} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={computedTitle} onSelected={() => { }} children={validChildren} identifier={identifier}/>);
38
+ };
39
+ exports.ToolbarMenu = ToolbarMenu;
40
+ /**
41
+ * A single action item within a toolbar menu.
42
+ *
43
+ * For available props, see [`LinkMenuActionProps`](./router/#linkmenuactionprops).
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <Toolbar>
48
+ * <Toolbar.Menu title="Options">
49
+ * <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
50
+ * <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
51
+ * </Toolbar.Menu>
52
+ * </Toolbar>
53
+ * ```
54
+ *
55
+ * @platform ios
56
+ */
11
57
  exports.ToolbarMenuAction = elements_1.LinkMenuAction;
12
- const ToolbarButton = ({ children, sf, onPress, ...rest }) => {
13
- const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
14
- return (<native_1.RouterToolbarItem {...rest} onSelected={onPress} identifier={id} title={children} systemImageName={sf}/>);
58
+ // As noted in https://sebvidal.com/blog/whats-new-in-uikit-26/?utm_source=chatgpt.com#:~:text=It%27s%20worth%20noting%20that%2C%20at%20the%20time%20of%20writing%2C%20bar%20button%20badges%20are%20only%20supported%20in%20navigation%20bars%20%2D%20not%20tool%20bars.
59
+ // currently badges are not supported in toolbars, and only in navigation bars.
60
+ // Therefore, there is no badge support in ToolbarButton
61
+ /**
62
+ * A button component for use in the toolbar.
63
+ * It should only be used as a child of `Toolbar`.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Toolbar>
68
+ * <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
69
+ * <Toolbar.Button>Text Button</Toolbar.Button>
70
+ * <Toolbar.Button hidden={!isSearchFocused} icon="xmark" onPress={handleClear} />
71
+ * </Toolbar>
72
+ * ```
73
+ *
74
+ * @platform ios
75
+ */
76
+ const ToolbarButton = (props) => {
77
+ const id = (0, react_1.useId)();
78
+ const areChildrenString = typeof props.children === 'string';
79
+ const label = areChildrenString
80
+ ? props.children
81
+ : (0, children_1.getFirstChildOfType)(props.children, primitives_1.Label)?.props.children;
82
+ const iconComponent = !props.icon && !areChildrenString ? (0, children_1.getFirstChildOfType)(props.children, primitives_1.Icon) : undefined;
83
+ const icon = props.icon ??
84
+ (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
85
+ const sf = typeof icon === 'string' ? icon : undefined;
86
+ return (<native_1.RouterToolbarItem accessibilityHint={props.accessibilityHint} accessibilityLabel={props.accessibilityLabel} barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant} disabled={props.disabled} hidden={props.hidden} hidesSharedBackground={props.hidesSharedBackground} identifier={id} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={sf} title={label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
15
87
  };
16
88
  exports.ToolbarButton = ToolbarButton;
17
- const ToolbarSpacer = ({ width, ...rest }) => {
18
- const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
19
- return (<native_1.RouterToolbarItem {...rest} identifier={id} type={width ? 'fixedSpacer' : 'fluidSpacer'} width={width}/>);
89
+ /**
90
+ * A spacer component for the toolbar.
91
+ * Without a width, it creates a flexible spacer that expands to fill available space.
92
+ * With a width, it creates a fixed-width spacer.
93
+ * It should only be used as a child of `Toolbar`.
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * <Toolbar>
98
+ * <Toolbar.Spacer />
99
+ * <Toolbar.Button icon="magnifyingglass" />
100
+ * <Toolbar.Spacer width={20} />
101
+ * <Toolbar.Button icon="mic" />
102
+ * <Toolbar.Spacer />
103
+ * </Toolbar>
104
+ * ```
105
+ *
106
+ * @platform ios
107
+ */
108
+ const ToolbarSpacer = (props) => {
109
+ const id = (0, react_1.useId)();
110
+ return (<native_1.RouterToolbarItem hidesSharedBackground={props.hidesSharedBackground} hidden={props.hidden} identifier={id} sharesBackground={props.sharesBackground} type={props.width ? 'fixedSpacer' : 'fluidSpacer'} width={props.width}/>);
20
111
  };
21
112
  exports.ToolbarSpacer = ToolbarSpacer;
22
- const ToolbarView = ({ children, style, ...rest }) => {
23
- const id = (0, react_1.useMemo)(() => (0, non_secure_1.nanoid)(), []);
24
- return (<native_1.RouterToolbarItem {...rest} identifier={id}>
25
- <react_native_1.View style={[style, { position: 'absolute' }]}>{children}</react_native_1.View>
113
+ /**
114
+ * A custom view component for the toolbar that can contain any React elements.
115
+ * Useful for embedding custom components.
116
+ * It should only be used as a child of `Toolbar`.
117
+ *
118
+ * The items within the view will be absolutely positioned, so flexbox styles will not work as expected.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * <Toolbar>
123
+ * <Toolbar.Spacer />
124
+ * <Toolbar.View>
125
+ * <TextInput
126
+ * placeholder="Search"
127
+ * placeholderTextColor={Color.ios.placeholderText}
128
+ * />
129
+ * </Toolbar.View>
130
+ * <Toolbar.View separateBackground style={{ width: 32, height: 32 }}>
131
+ * <Pressable onPress={handlePress}>
132
+ * <SymbolView name="plus" size={22} />
133
+ * </Pressable>
134
+ * </Toolbar.View>
135
+ * </Toolbar>
136
+ * ```
137
+ *
138
+ * @platform ios
139
+ */
140
+ const ToolbarView = ({ children, hidden, hidesSharedBackground, separateBackground, }) => {
141
+ const id = (0, react_1.useId)();
142
+ return (<native_1.RouterToolbarItem hidesSharedBackground={hidesSharedBackground} hidden={hidden} identifier={id} sharesBackground={!separateBackground}>
143
+ {children}
26
144
  </native_1.RouterToolbarItem>);
27
145
  };
28
146
  exports.ToolbarView = ToolbarView;
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":";;;AAAA,kDAA2C;AAC3C,iCAAgC;AAChC,+CAAoE;AAGpE,qCAAgE;AAEhE,mFAAgF;AAChF,+CAK0B;AAGb,QAAA,WAAW,GAAG,mBAAQ,CAAC;AAGvB,QAAA,iBAAiB,GAAG,yBAAc,CAAC;AAiBzC,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,EAAsB,EAAE,EAAE;IACtF,MAAM,EAAE,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,mBAAM,GAAE,E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AAC;AAPW,QAAA,WAAW,eAOtB;AAGK,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAE,EAAE;IACrD,uEAAuE;IACvE,OAAO,CACL,CAAC,uDAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAChE;MAAA,CAAC,0BAAiB,CAAC,IAAI,KAAK,CAAC,EAC/B;IAAA,EAAE,uDAA0B,CAAC,CAC9B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB","sourcesContent":["import { nanoid } from 'nanoid/non-secure';\nimport { useMemo } from 'react';\nimport { View, type StyleProp, type ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { RouterToolbarHost, RouterToolbarItem } from './native';\nimport type { RouterToolbarHostProps, RouterToolbarItemProps } from './native.types';\nimport { InternalLinkPreviewContext } from '../link/InternalLinkPreviewContext';\nimport {\n LinkMenu,\n LinkMenuAction,\n type LinkMenuActionProps,\n type LinkMenuProps,\n} from '../link/elements';\n\nexport type ToolbarMenuProps = LinkMenuProps;\nexport const ToolbarMenu = LinkMenu;\n\nexport type ToolbarMenuActionProps = LinkMenuActionProps;\nexport const ToolbarMenuAction = LinkMenuAction;\n\nexport interface ToolbarButtonProps\n extends Pick<\n RouterToolbarItemProps,\n | 'barButtonItemStyle'\n | 'hidden'\n | 'selected'\n | 'possibleTitles'\n | 'tintColor'\n | 'hidesSharedBackground'\n | 'sharesBackground'\n > {\n children?: string;\n sf?: SFSymbol;\n onPress?: () => void;\n}\nexport const ToolbarButton = ({ children, sf, onPress, ...rest }: ToolbarButtonProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem\n {...rest}\n onSelected={onPress}\n identifier={id}\n title={children}\n systemImageName={sf}\n />\n );\n};\n\nexport type ToolbarSpacerProps = Pick<RouterToolbarItemProps, 'width' | 'hidden'>;\nexport const ToolbarSpacer = ({ width, ...rest }: ToolbarSpacerProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem\n {...rest}\n identifier={id}\n type={width ? 'fixedSpacer' : 'fluidSpacer'}\n width={width}\n />\n );\n};\n\nexport interface ToolbarViewProps\n extends Pick<RouterToolbarItemProps, 'hidesSharedBackground' | 'sharesBackground'> {\n children: React.ReactNode;\n style?: StyleProp<\n Omit<ViewStyle, 'position' | 'inset' | 'top' | 'left' | 'right' | 'bottom' | 'flex'>\n >;\n}\nexport const ToolbarView = ({ children, style, ...rest }: ToolbarViewProps) => {\n const id = useMemo(() => nanoid(), []);\n return (\n <RouterToolbarItem {...rest} identifier={id}>\n <View style={[style, { position: 'absolute' }]}>{children}</View>\n </RouterToolbarItem>\n );\n};\n\nexport type ToolbarHostProps = RouterToolbarHostProps;\nexport const ToolbarHost = (props: ToolbarHostProps) => {\n // TODO: Replace InternalLinkPreviewContext with a more generic context\n return (\n <InternalLinkPreviewContext value={{ isVisible: false, href: '' }}>\n <RouterToolbarHost {...props} />\n </InternalLinkPreviewContext>\n );\n};\n"]}
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":";;;AAAA,iCAAwE;AACxE,+CAA2E;AAG3E,qCAAgE;AAChE,mFAAgF;AAChF,+CAA4E;AAC5E,mDAAiE;AACjE,8CAA4C;AAC5C,gDAAwD;AAmFxD;;;;;;;;;;;;;;GAcG;AACI,MAAM,WAAW,GAA+B,CAAC,EACtD,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,GACN,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACrD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rB,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,gBAAgB,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACzC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAClD,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,aAAa,iBAYxB;AAwCF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,MAAM,WAAW,GAAG,CAAC,EAC1B,QAAQ,EACR,MAAM,EACN,qBAAqB,EACrB,kBAAkB,GACD,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,IAAA,aAAK,GAAE,CAAC;IACnB,OAAO,CACL,CAAC,0BAAiB,CAChB,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAC7C,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CACtC;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,WAAW,eAgBtB;AAMK,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAE,EAAE;IACjD,uEAAuE;IACvE,OAAO,CACL,CAAC,uDAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAChE;MAAA,CAAC,0BAAiB,CAAC,IAAI,KAAK,CAAC,EAC/B;IAAA,EAAE,uDAA0B,CAAC,CAC9B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB","sourcesContent":["import { Children, isValidElement, useId, type ReactNode } from 'react';\nimport { StyleSheet, type ColorValue, type StyleProp } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { RouterToolbarHost, RouterToolbarItem } from './native';\nimport { InternalLinkPreviewContext } from '../link/InternalLinkPreviewContext';\nimport { LinkMenuAction, type LinkMenuActionProps } from '../link/elements';\nimport { NativeLinkPreviewAction } from '../link/preview/native';\nimport { Icon, Label } from '../primitives';\nimport { getFirstChildOfType } from '../utils/children';\nimport type { BasicTextStyle } from '../utils/font';\n\nexport interface ToolbarMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: React.ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n disabled?: boolean;\n hidden?: boolean;\n /**\n * Whether to hide the shared background when `sharesBackground` is enabled.\n *\n * Only available for root level menus.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * > **Note*: Inline menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * > **Note**: Text buttons cannot share the background.\n *\n * This prop reverses the native behavior of `sharesBackground`.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.\n *\n * @default false\n *\n * @platform iOS 26+\n */\n separateBackground?: boolean;\n /**\n * Style for the label of the header item.\n */\n style?: StyleProp<BasicTextStyle>;\n /**\n * The title of the menu item\n */\n title?: string;\n\n /**\n * Tint color for the menu icon and text.\n */\n tintColor?: ColorValue;\n\n /**\n * Controls the visual style of the menu when represented as a bar button.\n *\n * @default 'plain'\n */\n variant?: 'plain' | 'done' | 'prominent';\n}\n\n/**\n * Adds a context menu for to a toolbar.\n *\n * @example\n * ```tsx\n * <Toolbar>\n * <Toolbar.Menu title=\"Options\">\n * <Toolbar.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Toolbar.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Toolbar.Menu>\n * </Toolbar>\n * ```\n *\n * @platform ios\n */\nexport const ToolbarMenu: React.FC<ToolbarMenuProps> = ({\n accessibilityHint,\n accessibilityLabel,\n separateBackground,\n hidesSharedBackground,\n palette,\n inline,\n hidden,\n title,\n destructive,\n children,\n icon,\n tintColor,\n variant,\n style,\n}) => {\n const identifier = useId();\n const validChildren = Children.toArray(children).filter(\n (child) =>\n isValidElement(child) && (child.type === ToolbarMenuAction || child.type === ToolbarMenu)\n );\n const label = getFirstChildOfType(children, Label);\n const iconComponent = getFirstChildOfType(children, Icon);\n\n const computedTitle = title ?? label?.props.children ?? '';\n const computedIcon =\n icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof computedIcon === 'string' ? computedIcon : undefined;\n const titleStyle = StyleSheet.flatten(style);\n return (\n <NativeLinkPreviewAction\n sharesBackground={!separateBackground}\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n icon={sf}\n destructive={destructive}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n displayAsPalette={palette}\n displayInline={inline}\n tintColor={tintColor}\n titleStyle={titleStyle}\n barButtonItemStyle={variant === 'done' ? 'prominent' : variant}\n title={computedTitle}\n onSelected={() => {}}\n children={validChildren}\n identifier={identifier}\n />\n );\n};\n\nexport type ToolbarMenuActionProps = LinkMenuActionProps;\n\n/**\n * A single action item within a toolbar menu.\n *\n * For available props, see [`LinkMenuActionProps`](./router/#linkmenuactionprops).\n *\n * @example\n * ```tsx\n * <Toolbar>\n * <Toolbar.Menu title=\"Options\">\n * <Toolbar.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Toolbar.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Toolbar.Menu>\n * </Toolbar>\n * ```\n *\n * @platform ios\n */\nexport const ToolbarMenuAction = LinkMenuAction;\n\nexport interface ToolbarButtonProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /**\n * The text label for the button.\n *\n * > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.\n *\n * @example\n * ```tsx\n * import { Toolbar } from 'expo-router/unstable-toolbar';\n *\n * ...\n * <Toolbar.Button>This is button label</Toolbar.Button>\n * ```\n */\n children?: ReactNode;\n disabled?: boolean;\n\n /**\n * Whether the button should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n\n /**\n * Whether to hide the shared background.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n\n // TODO: support ImageSourcePropType icons in addition to SFSymbols\n /**\n * The name of the SF Symbol to display as the button icon.\n * For a list of available symbols, see [SF Symbols](https://developer.apple.com/sf-symbols/).\n */\n icon?: SFSymbol;\n\n /**\n * Callback function when the button is pressed.\n */\n onPress?: () => void;\n\n /**\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/possibletitles) for more information.\n */\n possibleTitles?: string[];\n\n /**\n * Whether the button is in a selected state\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information.\n */\n selected?: boolean;\n\n /**\n * Whether to separate the background of this item from other header items.\n *\n * > **Note**: Text buttons cannot share the background.\n *\n * This prop reverses the native behavior of `sharesBackground`.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.\n *\n * @default false\n *\n * @platform iOS 26+\n */\n separateBackground?: boolean;\n\n /**\n * Style for the label of the header item.\n */\n style?: StyleProp<BasicTextStyle>;\n\n /**\n * Tint color for the button icon and text.\n */\n tintColor?: ColorValue;\n\n /**\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/style-swift.enum) for more information.\n *\n * @default 'plain'\n */\n variant?: 'plain' | 'done' | 'prominent';\n}\n\n// As noted in https://sebvidal.com/blog/whats-new-in-uikit-26/?utm_source=chatgpt.com#:~:text=It%27s%20worth%20noting%20that%2C%20at%20the%20time%20of%20writing%2C%20bar%20button%20badges%20are%20only%20supported%20in%20navigation%20bars%20%2D%20not%20tool%20bars.\n// currently badges are not supported in toolbars, and only in navigation bars.\n// Therefore, there is no badge support in ToolbarButton\n/**\n * A button component for use in the toolbar.\n * It should only be used as a child of `Toolbar`.\n *\n * @example\n * ```tsx\n * <Toolbar>\n * <Toolbar.Button icon=\"magnifyingglass\" tintColor={Color.ios.placeholderText} />\n * <Toolbar.Button>Text Button</Toolbar.Button>\n * <Toolbar.Button hidden={!isSearchFocused} icon=\"xmark\" onPress={handleClear} />\n * </Toolbar>\n * ```\n *\n * @platform ios\n */\nexport const ToolbarButton = (props: ToolbarButtonProps) => {\n const id = useId();\n const areChildrenString = typeof props.children === 'string';\n const label = areChildrenString\n ? (props.children as string)\n : getFirstChildOfType(props.children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(props.children, Icon) : undefined;\n const icon =\n props.icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof icon === 'string' ? icon : undefined;\n return (\n <RouterToolbarItem\n accessibilityHint={props.accessibilityHint}\n accessibilityLabel={props.accessibilityLabel}\n barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant}\n disabled={props.disabled}\n hidden={props.hidden}\n hidesSharedBackground={props.hidesSharedBackground}\n identifier={id}\n onSelected={props.onPress}\n possibleTitles={props.possibleTitles}\n selected={props.selected}\n sharesBackground={!props.separateBackground}\n systemImageName={sf}\n title={label}\n tintColor={props.tintColor}\n titleStyle={StyleSheet.flatten(props.style)}\n />\n );\n};\n\nexport type ToolbarSpacerProps = {\n /**\n * Whether to hide the shared background when `sharesBackground` is enabled.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Whether the spacer should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n /**\n * Whether the spacer shares the background with adjacent toolbar items.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.\n *\n * @platform iOS 26+\n * @default false\n */\n sharesBackground?: boolean;\n /**\n * By default, the spacer is flexible and expands to fill available space.\n * If a width is provided, it creates a [fixed-width spacer](https://developer.apple.com/documentation/uikit/uibarbuttonitem/fixedspace(_:)).\n */\n width?: number;\n};\n\n/**\n * A spacer component for the toolbar.\n * Without a width, it creates a flexible spacer that expands to fill available space.\n * With a width, it creates a fixed-width spacer.\n * It should only be used as a child of `Toolbar`.\n *\n * @example\n * ```tsx\n * <Toolbar>\n * <Toolbar.Spacer />\n * <Toolbar.Button icon=\"magnifyingglass\" />\n * <Toolbar.Spacer width={20} />\n * <Toolbar.Button icon=\"mic\" />\n * <Toolbar.Spacer />\n * </Toolbar>\n * ```\n *\n * @platform ios\n */\nexport const ToolbarSpacer = (props: ToolbarSpacerProps) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={props.hidesSharedBackground}\n hidden={props.hidden}\n identifier={id}\n sharesBackground={props.sharesBackground}\n type={props.width ? 'fixedSpacer' : 'fluidSpacer'}\n width={props.width}\n />\n );\n};\n\n/**\n * Props for the ToolbarView component.\n *\n * @platform ios\n */\nexport interface ToolbarViewProps {\n /**\n * React elements to render inside the toolbar view.\n */\n children: React.ReactNode;\n /**\n * Whether the view should be hidden.\n *\n * @default false\n */\n hidden?: boolean;\n /**\n * Whether to hide the shared background when `sharesBackground` is enabled.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 18+\n */\n hidesSharedBackground?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * This prop reverses the native behavior of `sharesBackground`.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.\n *\n * @default false\n *\n * @platform iOS 26+\n */\n separateBackground?: boolean;\n}\n\n/**\n * A custom view component for the toolbar that can contain any React elements.\n * Useful for embedding custom components.\n * It should only be used as a child of `Toolbar`.\n *\n * The items within the view will be absolutely positioned, so flexbox styles will not work as expected.\n *\n * @example\n * ```tsx\n * <Toolbar>\n * <Toolbar.Spacer />\n * <Toolbar.View>\n * <TextInput\n * placeholder=\"Search\"\n * placeholderTextColor={Color.ios.placeholderText}\n * />\n * </Toolbar.View>\n * <Toolbar.View separateBackground style={{ width: 32, height: 32 }}>\n * <Pressable onPress={handlePress}>\n * <SymbolView name=\"plus\" size={22} />\n * </Pressable>\n * </Toolbar.View>\n * </Toolbar>\n * ```\n *\n * @platform ios\n */\nexport const ToolbarView = ({\n children,\n hidden,\n hidesSharedBackground,\n separateBackground,\n}: ToolbarViewProps) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n identifier={id}\n sharesBackground={!separateBackground}>\n {children}\n </RouterToolbarItem>\n );\n};\n\nexport interface ToolbarProps {\n children?: React.ReactNode;\n}\n\nexport const ToolbarHost = (props: ToolbarProps) => {\n // TODO: Replace InternalLinkPreviewContext with a more generic context\n return (\n <InternalLinkPreviewContext value={{ isVisible: false, href: '' }}>\n <RouterToolbarHost {...props} />\n </InternalLinkPreviewContext>\n );\n};\n"]}
@@ -1,9 +1,41 @@
1
- export declare const Toolbar: ((props: import("./elements").ToolbarHostProps) => import("react").JSX.Element) & {
2
- Menu: import("react").FC<import("..").LinkMenuProps>;
1
+ import { ToolbarMenu, ToolbarMenuAction, ToolbarButton, ToolbarSpacer, ToolbarView } from './elements';
2
+ /**
3
+ * A component that provides a [bottom toolbar](https://developer.apple.com/design/human-interface-guidelines/toolbars).
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * import { Toolbar } from "expo-router";
8
+ *
9
+ * export default function MyScreen() {
10
+ * return (
11
+ * <>
12
+ * <YourScreenContent />
13
+ * <Toolbar>
14
+ * <Toolbar.Spacer />
15
+ * <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
16
+ * <Toolbar.View style={{ width: 200 }}>
17
+ * <TextInput placeholder="Search" />
18
+ * </Toolbar.View>
19
+ * <Toolbar.Menu icon="ellipsis">
20
+ * <Toolbar.MenuAction icon="mail" title="Send email" onPress={() => {}} />
21
+ * <Toolbar.MenuAction icon="trash" title="Delete" destructive onPress={() => {}} />
22
+ * </Toolbar.Menu>
23
+ * <Toolbar.Spacer />
24
+ * </Toolbar>
25
+ * </>
26
+ * );
27
+ * }
28
+ * ```
29
+ *
30
+ * @platform ios
31
+ */
32
+ export declare const Toolbar: ((props: import("./elements").ToolbarProps) => import("react").JSX.Element) & {
33
+ Menu: import("react").FC<import("./elements").ToolbarMenuProps>;
3
34
  MenuAction: typeof import("..").LinkMenuAction;
4
- Button: ({ children, sf, onPress, ...rest }: import("./elements").ToolbarButtonProps) => import("react").JSX.Element;
5
- Spacer: ({ width, ...rest }: import("./elements").ToolbarSpacerProps) => import("react").JSX.Element;
6
- View: ({ children, style, ...rest }: import("./elements").ToolbarViewProps) => import("react").JSX.Element;
35
+ Button: (props: import("./elements").ToolbarButtonProps) => import("react").JSX.Element;
36
+ Spacer: (props: import("./elements").ToolbarSpacerProps) => import("react").JSX.Element;
37
+ View: ({ children, hidden, hidesSharedBackground, separateBackground, }: import("./elements").ToolbarViewProps) => import("react").JSX.Element;
7
38
  };
8
- export type { ToolbarHostProps, ToolbarMenuProps, ToolbarMenuActionProps, ToolbarButtonProps, ToolbarSpacerProps, ToolbarViewProps as ToolbarCustomViewProps, } from './elements';
39
+ export { ToolbarMenu, ToolbarMenuAction, ToolbarButton, ToolbarSpacer, ToolbarView };
40
+ export type { ToolbarProps, ToolbarMenuProps, ToolbarMenuActionProps, ToolbarButtonProps, ToolbarSpacerProps, ToolbarViewProps as ToolbarCustomViewProps, } from './elements';
9
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO;;;;;;CAMlB,CAAC;AAEH,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,IAAI,sBAAsB,GAC3C,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,OAAO;;;;;;CAMlB,CAAC;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;AAErF,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,IAAI,sBAAsB,GAC3C,MAAM,YAAY,CAAC"}