expo-router 7.0.0-canary-20251223-b83b31e → 7.0.0-canary-20260105-6b962e6
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/android/build.gradle +2 -2
- package/build/internal/utils.d.ts +1 -1
- package/build/internal/utils.d.ts.map +1 -1
- package/build/internal/utils.js +2 -2
- package/build/internal/utils.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.js +1 -0
- package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -1
- package/build/link/elements.d.ts +19 -1
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js +1 -1
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +1 -0
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.d.ts +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.d.ts.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -7
- package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.js +2 -2
- package/build/link/zoom/ZoomTransitionEnabler.js.map +1 -1
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.js +21 -2
- package/build/native-tabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +8 -0
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/toolbar/elements.d.ts +19 -3
- package/build/toolbar/elements.d.ts.map +1 -1
- package/build/toolbar/elements.js +4 -4
- package/build/toolbar/elements.js.map +1 -1
- package/build/toolbar/index.d.ts +2 -2
- package/build/toolbar/index.js +2 -2
- package/build/toolbar/index.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +81 -138
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +28 -1
- 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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha512 +1 -0
- 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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +10 -10
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- /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-sources.jar → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar} +0 -0
- /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-sources.jar.md5 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.md5} +0 -0
- /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-sources.jar.sha1 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha1} +0 -0
- /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-sources.jar.sha256 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha256} +0 -0
- /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-sources.jar.sha512 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha512} +0 -0
- /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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar} +0 -0
- /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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.md5} +0 -0
- /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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.sha1} +0 -0
- /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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.sha256} +0 -0
- /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 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.sha512} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,wCA6FC;AAhID,qDAAoD;AACpD,+CAAyD;AACzD,+CAAqD;AACrD,+DAM8B;AAC9B,oEAAiE;AAEjE,6CAGsB;AACtB,gDAA8D;AAC9D,mCAKiB;AACjB,uCAIsB;AACtB,gDAAwD;AACxD,6DAA0F;AAE1F,8FAA8F;AAC9F,+DAA+D;AAC/D,mCAAY,CAAC,UAAU,CAAC,oBAAoB,GAAG,KAAK,CAAC;AAErD,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,EACJ,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,GACnB,GAAG,KAAK,CAAC;IAEV,MAAM,oBAAoB,GAAG,IAAA,wBAAgB,EAAC,YAAY,CAAC,CAAC;IAC5D,8DAA8D;IAC9D,oFAAoF;IACpF,wFAAwF;IACxF,2BAA2B;IAC3B,MAAM,4BAA4B,GAChC,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,C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C,CACjB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB;MAAA,CAAC,cAAc,CACjB;IAAA,EAAE,uCAAgB,CAAC,CACpB,CAAC;AACJ,CAAC;AAED,MAAM,mCAAmC,GAAG,IAAI,GAAG,CAAS,4CAAoC,CAAC,CAAC;AAClG,MAAM,0CAA0C,GAAG,IAAI,GAAG,CACxD,qDAA6C,CAC9C,CAAC;AAEF,SAAS,iBAAiB,CAAC,KAAsB;IAC/C,IAAI,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC/E,IAAI,sBAAsB,IAAI,CAAC,mCAAmC,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,CAAC;QAC/F,OAAO,CAAC,IAAI,CACV,iCAAiC,sBAAsB,2BAA2B,4CAAoC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvK,CAAC;QACF,sBAAsB,GAAG,SAAS,CAAC;IACrC,CAAC;IACD,IACE,6BAA6B;QAC7B,CAAC,0CAA0C,CAAC,GAAG,CAAC,6BAA6B,CAAC,EAC9E,CAAC;QACD,OAAO,CAAC,IAAI,CACV,oCAAoC,6BAA6B,2BAA2B,qDAA6C,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClL,CAAC;QACF,6BAA6B,GAAG,SAAS,CAAC;IAC5C,CAAC;IAED,OAAO,CACL,CAAC,iCAAU,CACT,6BAA6B,CAAC,CAAC,6BAA6B,CAAC,CAC7D,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAC/C,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport React, { useDeferredValue, useMemo } from 'react';\nimport { View, type ColorValue } from 'react-native';\nimport {\n BottomTabs,\n BottomTabsScreen,\n featureFlags,\n type BottomTabsProps,\n type BottomTabsScreenAppearance,\n} from 'react-native-screens';\nimport { SafeAreaView } from 'react-native-screens/experimental';\n\nimport {\n createScrollEdgeAppearanceFromOptions,\n createStandardAppearanceFromOptions,\n} from './appearance';\nimport { NativeTabsBottomAccessory } from './common/elements';\nimport {\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES,\n SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS,\n type NativeTabOptions,\n type NativeTabsViewProps,\n} from './types';\nimport {\n convertOptionsIconToRNScreensPropsIcon,\n convertOptionsIconToIOSPropsIcon,\n useAwaitedScreensIcon,\n} from './utils/icon';\nimport { getFirstChildOfType } from '../utils/children';\nimport { useBottomAccessoryFunctionFromBottomAccessories } from './utils/bottomAccessory';\n\n// We let native tabs to control the changes. This requires freeze to be disabled for tab bar.\n// Otherwise user may see glitches when switching between tabs.\nfeatureFlags.experiment.controlledBottomTabs = false;\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const {\n minimizeBehavior,\n disableIndicator,\n focusedIndex,\n tabs,\n sidebarAdaptable,\n nonTriggerChildren,\n } = props;\n\n const deferredFocusedIndex = useDeferredValue(focusedIndex);\n // We need to check if the deferred index is not out of bounds\n // This can happen when the focused index is the last tab, and user removes that tab\n // In that case the deferred index will still point to the last tab, but after re-render\n // it will be out of bounds\n const inBoundsDeferredFocusedIndex =\n deferredFocusedIndex < tabs.length ? deferredFocusedIndex : focusedIndex;\n\n const appearances = tabs.map((tab) => ({\n standardAppearance: createStandardAppearanceFromOptions(tab.options),\n scrollEdgeAppearance: createScrollEdgeAppearanceFromOptions(tab.options),\n }));\n\n const options = tabs.map((tab) => tab.options);\n\n const bottomAccessory = useMemo(\n () => getFirstChildOfType(nonTriggerChildren, NativeTabsBottomAccessory),\n [nonTriggerChildren]\n );\n\n const bottomAccessoryFn = useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory);\n\n const children = tabs.map((tab, index) => {\n const isFocused = index === inBoundsDeferredFocusedIndex;\n\n return (\n <Screen\n key={tab.routeKey}\n routeKey={tab.routeKey}\n name={tab.name}\n options={tab.options}\n isFocused={isFocused}\n standardAppearance={appearances[index].standardAppearance}\n scrollEdgeAppearance={appearances[index].scrollEdgeAppearance}\n badgeTextColor={tab.options.badgeTextColor}\n contentRenderer={tab.contentRenderer}\n />\n );\n });\n\n const currentTabAppearance = appearances[inBoundsDeferredFocusedIndex]?.standardAppearance;\n const tabBarControllerMode: BottomTabsProps['tabBarControllerMode'] = sidebarAdaptable\n ? 'tabSidebar'\n : sidebarAdaptable === false\n ? 'tabBar'\n : 'automatic';\n\n return (\n <BottomTabsWrapper\n // #region android props\n tabBarItemTitleFontColor={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor}\n tabBarItemTitleFontFamily={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontFamily}\n tabBarItemTitleFontSize={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontSizeActive={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontWeight={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontWeight}\n tabBarItemTitleFontStyle={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontStyle}\n tabBarItemIconColor={currentTabAppearance?.stacked?.normal?.tabBarItemIconColor}\n tabBarBackgroundColor={currentTabAppearance?.tabBarBackgroundColor}\n tabBarItemRippleColor={props.rippleColor}\n tabBarItemLabelVisibilityMode={props.labelVisibilityMode}\n tabBarItemIconColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemIconColor ?? props?.tintColor\n }\n tabBarItemTitleFontColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemTitleFontColor ?? props?.tintColor\n }\n // tabBarItemTitleFontSizeActive={activeStyle?.fontSize}\n tabBarItemActiveIndicatorColor={options[inBoundsDeferredFocusedIndex]?.indicatorColor}\n tabBarItemActiveIndicatorEnabled={!disableIndicator}\n // #endregion\n // #region iOS props\n tabBarTintColor={props?.tintColor}\n tabBarMinimizeBehavior={minimizeBehavior}\n tabBarControllerMode={tabBarControllerMode}\n bottomAccessory={bottomAccessoryFn}\n tabBarHidden={props.hidden}\n // #endregion\n onNativeFocusChange={({ nativeEvent: { tabKey } }) => {\n props.onTabChange(tabKey);\n }}>\n {children}\n </BottomTabsWrapper>\n );\n}\n\nfunction Screen(props: {\n routeKey: string;\n name: string;\n isFocused: boolean;\n options: NativeTabOptions;\n standardAppearance: BottomTabsScreenAppearance;\n scrollEdgeAppearance: BottomTabsScreenAppearance;\n badgeTextColor: ColorValue | undefined;\n contentRenderer: () => React.ReactNode;\n}) {\n const {\n routeKey,\n name,\n options,\n isFocused,\n standardAppearance,\n scrollEdgeAppearance,\n badgeTextColor,\n contentRenderer,\n } = props;\n const title = options.title ?? name;\n\n // We need to await the icon, as VectorIcon will load asynchronously\n const icon = useAwaitedScreensIcon(options.icon);\n const selectedIcon = useAwaitedScreensIcon(options.selectedIcon);\n const { colors } = useTheme();\n\n const content = (\n <View\n // https://github.com/software-mansion/react-native-screens/issues/2662#issuecomment-2757735088\n collapsable={false}\n style={[\n { backgroundColor: colors.background },\n options.contentStyle,\n { flex: 1, position: 'relative', overflow: 'hidden' },\n ]}>\n {contentRenderer()}\n </View>\n );\n const wrappedContent =\n process.env.EXPO_OS === 'android' && !options.disableAutomaticContentInsets ? (\n <SafeAreaView\n // https://github.com/software-mansion/react-native-screens/issues/2662#issuecomment-2757735088\n collapsable={false}\n style={{ flex: 1 }}\n edges={{ bottom: true }}>\n {content}\n </SafeAreaView>\n ) : (\n content\n );\n\n return (\n <BottomTabsScreen\n {...options}\n overrideScrollViewContentInsetAdjustmentBehavior={!options.disableAutomaticContentInsets}\n tabBarItemBadgeBackgroundColor={\n standardAppearance.stacked?.normal?.tabBarItemBadgeBackgroundColor\n }\n tabBarItemBadgeTextColor={badgeTextColor}\n standardAppearance={standardAppearance}\n scrollEdgeAppearance={scrollEdgeAppearance}\n icon={convertOptionsIconToRNScreensPropsIcon(icon)}\n selectedIcon={convertOptionsIconToIOSPropsIcon(selectedIcon)}\n title={title}\n freezeContents={false}\n systemItem={options.role}\n {...options.nativeProps}\n tabKey={routeKey}\n isFocused={isFocused}>\n {wrappedContent}\n </BottomTabsScreen>\n );\n}\n\nconst supportedTabBarMinimizeBehaviorsSet = new Set<string>(SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS);\nconst supportedTabBarItemLabelVisibilityModesSet = new Set<string>(\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES\n);\n\nfunction BottomTabsWrapper(props: BottomTabsProps) {\n let { tabBarMinimizeBehavior, tabBarItemLabelVisibilityMode, ...rest } = props;\n if (tabBarMinimizeBehavior && !supportedTabBarMinimizeBehaviorsSet.has(tabBarMinimizeBehavior)) {\n console.warn(\n `Unsupported minimizeBehavior: ${tabBarMinimizeBehavior}. Supported values are: ${SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS.map((behavior) => `\"${behavior}\"`).join(', ')}`\n );\n tabBarMinimizeBehavior = undefined;\n }\n if (\n tabBarItemLabelVisibilityMode &&\n !supportedTabBarItemLabelVisibilityModesSet.has(tabBarItemLabelVisibilityMode)\n ) {\n console.warn(\n `Unsupported labelVisibilityMode: ${tabBarItemLabelVisibilityMode}. Supported values are: ${SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `\"${mode}\"`).join(', ')}`\n );\n tabBarItemLabelVisibilityMode = undefined;\n }\n\n return (\n <BottomTabs\n tabBarItemLabelVisibilityMode={tabBarItemLabelVisibilityMode}\n tabBarMinimizeBehavior={tabBarMinimizeBehavior}\n {...rest}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NativeTabsView.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,CAAC,sBAAsB,CAAC,CAC/C,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { useTheme } from '@react-navigation/native';\nimport React, { useDeferredValue, useMemo } from 'react';\nimport { View, type ColorValue } from 'react-native';\nimport {\n BottomTabs,\n BottomTabsScreen,\n featureFlags,\n type BottomTabsProps,\n type BottomTabsScreenAppearance,\n} from 'react-native-screens';\nimport { SafeAreaView } from 'react-native-screens/experimental';\n\nimport {\n createScrollEdgeAppearanceFromOptions,\n createStandardAppearanceFromOptions,\n} from './appearance';\nimport { Color } from '../color';\nimport { NativeTabsBottomAccessory } from './common/elements';\nimport {\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES,\n SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS,\n type NativeTabOptions,\n type NativeTabsViewProps,\n} from './types';\nimport {\n convertOptionsIconToRNScreensPropsIcon,\n convertOptionsIconToIOSPropsIcon,\n useAwaitedScreensIcon,\n} from './utils/icon';\nimport { getFirstChildOfType } from '../utils/children';\nimport { useBottomAccessoryFunctionFromBottomAccessories } from './utils/bottomAccessory';\n\n// We let native tabs to control the changes. This requires freeze to be disabled for tab bar.\n// Otherwise user may see glitches when switching between tabs.\nfeatureFlags.experiment.controlledBottomTabs = false;\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const {\n minimizeBehavior,\n disableIndicator,\n focusedIndex,\n tabs,\n sidebarAdaptable,\n nonTriggerChildren,\n } = props;\n\n const deferredFocusedIndex = useDeferredValue(focusedIndex);\n // We need to check if the deferred index is not out of bounds\n // This can happen when the focused index is the last tab, and user removes that tab\n // In that case the deferred index will still point to the last tab, but after re-render\n // it will be out of bounds\n const inBoundsDeferredFocusedIndex =\n deferredFocusedIndex < tabs.length ? deferredFocusedIndex : focusedIndex;\n\n const appearances = tabs.map((tab) => ({\n standardAppearance: createStandardAppearanceFromOptions(tab.options),\n scrollEdgeAppearance: createScrollEdgeAppearanceFromOptions(tab.options),\n }));\n\n const options = tabs.map((tab) => tab.options);\n\n const bottomAccessory = useMemo(\n () => getFirstChildOfType(nonTriggerChildren, NativeTabsBottomAccessory),\n [nonTriggerChildren]\n );\n\n const bottomAccessoryFn = useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory);\n\n const children = tabs.map((tab, index) => {\n const isFocused = index === inBoundsDeferredFocusedIndex;\n\n return (\n <Screen\n key={tab.routeKey}\n routeKey={tab.routeKey}\n name={tab.name}\n options={tab.options}\n isFocused={isFocused}\n standardAppearance={appearances[index].standardAppearance}\n scrollEdgeAppearance={appearances[index].scrollEdgeAppearance}\n badgeTextColor={tab.options.badgeTextColor}\n contentRenderer={tab.contentRenderer}\n />\n );\n });\n\n const currentTabAppearance = appearances[inBoundsDeferredFocusedIndex]?.standardAppearance;\n const tabBarControllerMode: BottomTabsProps['tabBarControllerMode'] = sidebarAdaptable\n ? 'tabSidebar'\n : sidebarAdaptable === false\n ? 'tabBar'\n : 'automatic';\n\n // Material Design 3 dynamic color defaults for Android\n const androidMaterialDefaults =\n process.env.EXPO_OS === 'android'\n ? {\n inactiveColor: Color.android.dynamic.onSurfaceVariant,\n activeIconColor: Color.android.dynamic.onSecondaryContainer,\n activeLabelColor: Color.android.dynamic.onSurface,\n backgroundColor: Color.android.dynamic.surfaceContainer,\n rippleColor: Color.android.dynamic.primary,\n indicatorColor: Color.android.dynamic.secondaryContainer,\n }\n : undefined;\n\n return (\n <BottomTabsWrapper\n // #region android props\n tabBarItemTitleFontColor={\n currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor ??\n androidMaterialDefaults?.inactiveColor\n }\n tabBarItemTitleFontFamily={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontFamily}\n tabBarItemTitleFontSize={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontSizeActive={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize}\n tabBarItemTitleFontWeight={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontWeight}\n tabBarItemTitleFontStyle={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontStyle}\n tabBarItemIconColor={\n currentTabAppearance?.stacked?.normal?.tabBarItemIconColor ??\n androidMaterialDefaults?.inactiveColor\n }\n tabBarBackgroundColor={\n currentTabAppearance?.tabBarBackgroundColor ?? androidMaterialDefaults?.backgroundColor\n }\n tabBarItemRippleColor={props.rippleColor ?? androidMaterialDefaults?.rippleColor}\n tabBarItemLabelVisibilityMode={props.labelVisibilityMode}\n tabBarItemIconColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemIconColor ??\n props?.tintColor ??\n androidMaterialDefaults?.activeIconColor\n }\n tabBarItemTitleFontColorActive={\n currentTabAppearance?.stacked?.selected?.tabBarItemTitleFontColor ??\n props?.tintColor ??\n androidMaterialDefaults?.activeLabelColor\n }\n // tabBarItemTitleFontSizeActive={activeStyle?.fontSize}\n tabBarItemActiveIndicatorColor={\n options[inBoundsDeferredFocusedIndex]?.indicatorColor ??\n androidMaterialDefaults?.indicatorColor\n }\n tabBarItemActiveIndicatorEnabled={!disableIndicator}\n // #endregion\n // #region iOS props\n tabBarTintColor={props?.tintColor}\n tabBarMinimizeBehavior={minimizeBehavior}\n tabBarControllerMode={tabBarControllerMode}\n bottomAccessory={bottomAccessoryFn}\n tabBarHidden={props.hidden}\n // #endregion\n onNativeFocusChange={({ nativeEvent: { tabKey } }) => {\n props.onTabChange(tabKey);\n }}>\n {children}\n </BottomTabsWrapper>\n );\n}\n\nfunction Screen(props: {\n routeKey: string;\n name: string;\n isFocused: boolean;\n options: NativeTabOptions;\n standardAppearance: BottomTabsScreenAppearance;\n scrollEdgeAppearance: BottomTabsScreenAppearance;\n badgeTextColor: ColorValue | undefined;\n contentRenderer: () => React.ReactNode;\n}) {\n const {\n routeKey,\n name,\n options,\n isFocused,\n standardAppearance,\n scrollEdgeAppearance,\n badgeTextColor,\n contentRenderer,\n } = props;\n const title = options.title ?? name;\n\n // We need to await the icon, as VectorIcon will load asynchronously\n const icon = useAwaitedScreensIcon(options.icon);\n const selectedIcon = useAwaitedScreensIcon(options.selectedIcon);\n const { colors } = useTheme();\n\n const content = (\n <View\n // https://github.com/software-mansion/react-native-screens/issues/2662#issuecomment-2757735088\n collapsable={false}\n style={[\n { backgroundColor: colors.background },\n options.contentStyle,\n { flex: 1, position: 'relative', overflow: 'hidden' },\n ]}>\n {contentRenderer()}\n </View>\n );\n const wrappedContent =\n process.env.EXPO_OS === 'android' && !options.disableAutomaticContentInsets ? (\n <SafeAreaView\n // https://github.com/software-mansion/react-native-screens/issues/2662#issuecomment-2757735088\n collapsable={false}\n style={{ flex: 1 }}\n edges={{ bottom: true }}>\n {content}\n </SafeAreaView>\n ) : (\n content\n );\n\n return (\n <BottomTabsScreen\n {...options}\n overrideScrollViewContentInsetAdjustmentBehavior={!options.disableAutomaticContentInsets}\n tabBarItemBadgeBackgroundColor={\n standardAppearance.stacked?.normal?.tabBarItemBadgeBackgroundColor\n }\n tabBarItemBadgeTextColor={badgeTextColor}\n standardAppearance={standardAppearance}\n scrollEdgeAppearance={scrollEdgeAppearance}\n icon={convertOptionsIconToRNScreensPropsIcon(icon)}\n selectedIcon={convertOptionsIconToIOSPropsIcon(selectedIcon)}\n title={title}\n freezeContents={false}\n systemItem={options.role}\n {...options.nativeProps}\n tabKey={routeKey}\n isFocused={isFocused}>\n {wrappedContent}\n </BottomTabsScreen>\n );\n}\n\nconst supportedTabBarMinimizeBehaviorsSet = new Set<string>(SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS);\nconst supportedTabBarItemLabelVisibilityModesSet = new Set<string>(\n SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES\n);\n\nfunction BottomTabsWrapper(props: BottomTabsProps) {\n let { tabBarMinimizeBehavior, tabBarItemLabelVisibilityMode, ...rest } = props;\n if (tabBarMinimizeBehavior && !supportedTabBarMinimizeBehaviorsSet.has(tabBarMinimizeBehavior)) {\n console.warn(\n `Unsupported minimizeBehavior: ${tabBarMinimizeBehavior}. Supported values are: ${SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS.map((behavior) => `\"${behavior}\"`).join(', ')}`\n );\n tabBarMinimizeBehavior = undefined;\n }\n if (\n tabBarItemLabelVisibilityMode &&\n !supportedTabBarItemLabelVisibilityModesSet.has(tabBarItemLabelVisibilityMode)\n ) {\n console.warn(\n `Unsupported labelVisibilityMode: ${tabBarItemLabelVisibilityMode}. Supported values are: ${SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES.map((mode) => `\"${mode}\"`).join(', ')}`\n );\n tabBarItemLabelVisibilityMode = undefined;\n }\n\n return (\n <BottomTabs\n tabBarItemLabelVisibilityMode={tabBarItemLabelVisibilityMode}\n tabBarMinimizeBehavior={tabBarMinimizeBehavior}\n {...rest}\n />\n );\n}\n"]}
|
|
@@ -78,7 +78,15 @@ export interface DrawableIcon {
|
|
|
78
78
|
*/
|
|
79
79
|
drawable?: string;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Material icon name for Android native tabs.
|
|
83
|
+
*
|
|
84
|
+
* @platform android
|
|
85
|
+
*/
|
|
81
86
|
export interface MaterialIcon {
|
|
87
|
+
/**
|
|
88
|
+
* Material icon glyph name. See the [Material icons for the complete catalog](https://fonts.google.com/icons).
|
|
89
|
+
*/
|
|
82
90
|
md: AndroidSymbol;
|
|
83
91
|
}
|
|
84
92
|
export type BaseNativeTabsTriggerIconProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAsB,UAAU,EAA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qB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAQ,CAAC;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,2BAA2B,mBAAa,CAAC;AAEtD,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,MAAM,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,4BAA4B,GACvC,OAAO,iCAAiC,SAGzC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB,CAAC,EAAE,UAAU,CAAC;CACtC;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAAS,CAAC;AAEnF,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAE9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;;AAIA,iDAAkE;AAgBrD,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../src/native-tabs/common/elements.tsx"],"names":[],"mappings":";;;AAIA,iDAAkE;AAgBrD,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;AA2FnF;;;;;;;;;;;;;GAaG;AACU,QAAA,qBAAqB,GAAyC,iBAAI,CAAC;AAEhF;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,2BAA2B,GAAG,uBAAU,CAAC;AAM/C,MAAM,4BAA4B,GAAG,SAAS,4BAA4B,CAC/E,KAAwC;IAExC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAJW,QAAA,4BAA4B,gCAIvC;AAiBW,QAAA,sBAAsB,GAA0C,kBAAK,CAAC;AAMnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,yBAAyB,GAA6C,GAAG,EAAE;IACtF,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAFW,QAAA,yBAAyB,6BAEpC","sourcesContent":["import type { AndroidSymbol } from 'expo-symbols';\nimport type { ColorValue, ImageSourcePropType, StyleProp } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { Label, Icon, Badge, VectorIcon } from '../../primitives';\nimport type { NativeTabsLabelStyle } from '../types';\n\nexport interface NativeTabsTriggerLabelProps {\n /**\n * The text to display as the label for the tab.\n */\n children?: string;\n selectedStyle?: StyleProp<NativeTabsLabelStyle>;\n /**\n * If true, the label will be hidden.\n * @default false\n */\n hidden?: boolean;\n}\n\nexport const NativeTabsTriggerLabel: React.FC<NativeTabsTriggerLabelProps> = Label;\n\nexport interface SrcIcon {\n /**\n * The image source to use as an icon.\n *\n * When `sf` prop is used it will override this prop on iOS.\n *\n * When `drawable` or `material` prop is used it will override this prop on Android.\n *\n * The value can be provided in two ways:\n * - As an image source\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon src={require('./path/to/icon.png')} />\n * ```\n *\n * @example\n * ```tsx\n * <Icon src={{ default: require('./path/to/icon.png'), selected: require('./path/to/icon-selected.png') }} />\n * ```\n *\n * @platform Android\n * @platform iOS\n */\n src?:\n | ImageSourcePropType\n | React.ReactElement\n | {\n default?: ImageSourcePropType | React.ReactElement;\n selected: ImageSourcePropType | React.ReactElement;\n };\n}\n\nexport interface SFSymbolIcon {\n /**\n * The name of the SF Symbol to use as an icon.\n *\n * The value can be provided in two ways:\n * - As a string with the SF Symbol name\n * - As an object specifying the default and selected states\n *\n * @example\n * ```tsx\n * <Icon sf=\"magnifyingglass\" />\n * ```\n *\n * @example\n * ```tsx\n * <Icon sf={{ default: \"house\", selected: \"house.fill\" }} />\n * ```\n *\n * @platform iOS\n */\n sf?: SFSymbol | { default?: SFSymbol; selected: SFSymbol };\n}\n\nexport interface DrawableIcon {\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n}\n\n/**\n * Material icon name for Android native tabs.\n *\n * @platform android\n */\nexport interface MaterialIcon {\n /**\n * Material icon glyph name. See the [Material icons for the complete catalog](https://fonts.google.com/icons).\n */\n md: AndroidSymbol;\n}\n\nexport type BaseNativeTabsTriggerIconProps = { selectedColor?: ColorValue };\n\nexport type NativeTabsTriggerIconProps = BaseNativeTabsTriggerIconProps &\n (\n | (SFSymbolIcon & DrawableIcon)\n | (SFSymbolIcon & MaterialIcon)\n | (SFSymbolIcon & SrcIcon)\n | (MaterialIcon & SrcIcon)\n | (DrawableIcon & SrcIcon)\n | SrcIcon\n );\n\n/**\n * Renders an icon for the tab.\n *\n * Accepts various icon sources such as SF Symbols, drawable resources, material icons, or image sources.\n *\n * Acceptable props combinations:\n * - `sf` and `drawable` - `sf` will be used for iOS icon, `drawable` for Android icon\n * - `sf` and `src` - `sf` will be used for iOS icon, `src` for Android icon\n * - `src` and `drawable` - `src` will be used for iOS icon, `drawable` for Android icon\n * - `src` only - `src` will be used for both iOS and Android icons\n *\n * @platform ios\n * @platform android\n */\nexport const NativeTabsTriggerIcon: React.FC<NativeTabsTriggerIconProps> = Icon;\n\n/**\n * Helper component which can be used to load vector icons for `NativeTabs`.\n *\n * @example\n * ```tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n * import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"index\">\n * <NativeTabs.Trigger.Icon src={<NativeTabs.Trigger.VectorIcon family={MaterialCommunityIcons} name=\"home\" />} />\n * </NativeTabs.Trigger>\n * </NativeTabs>\n * );\n * }\n * ```\n */\nexport const NativeTabsTriggerVectorIcon = VectorIcon;\n\nexport interface NativeTabsTriggerPromiseIconProps {\n loader: () => Promise<ImageSourcePropType | null>;\n}\n\nexport const NativeTabsTriggerPromiseIcon = function NativeTabsTriggerPromiseIcon(\n props: NativeTabsTriggerPromiseIconProps\n) {\n return null;\n};\n\nexport interface NativeTabsTriggerBadgeProps {\n /**\n * The text to display as the badge for the tab.\n * If not provided, the badge will not be displayed.\n */\n children?: string;\n\n /**\n * If true, the badge will be hidden.\n * @default false\n */\n hidden?: boolean;\n selectedBackgroundColor?: ColorValue;\n}\n\nexport const NativeTabsTriggerBadge: React.FC<NativeTabsTriggerBadgeProps> = Badge;\n\nexport interface NativeTabsBottomAccessoryProps {\n children?: React.ReactNode;\n}\n\n/**\n * A [bottom accessory](https://developer.apple.com/documentation/uikit/uitabbarcontroller/bottomaccessory) for `NativeTabs` on iOS 26 and above.\n *\n * @example\n * ```tsx\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default Layout(){\n * return (\n * <NativeTabs>\n * <NativeTabs.BottomAccessory>\n * <YourAccessoryComponent />\n * </NativeTabs.BottomAccessory>\n * <NativeTabs.Trigger name=\"index\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @platform iOS 26+\n */\nexport const NativeTabsBottomAccessory: React.FC<NativeTabsBottomAccessoryProps> = () => {\n return null;\n};\n"]}
|
|
@@ -7,6 +7,12 @@ export interface ToolbarMenuProps {
|
|
|
7
7
|
accessibilityLabel?: string;
|
|
8
8
|
accessibilityHint?: string;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* An optional subtitle for the menu. Does not appear on `inline` menus.
|
|
12
|
+
*
|
|
13
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.
|
|
14
|
+
*/
|
|
15
|
+
subtitle?: string;
|
|
10
16
|
/**
|
|
11
17
|
* If `true`, the menu item will be displayed as destructive.
|
|
12
18
|
*
|
|
@@ -40,7 +46,8 @@ export interface ToolbarMenuProps {
|
|
|
40
46
|
inline?: boolean;
|
|
41
47
|
/**
|
|
42
48
|
* If `true`, the menu will be displayed as a palette.
|
|
43
|
-
* This means that the menu will be displayed as one row
|
|
49
|
+
* This means that the menu will be displayed as one row.
|
|
50
|
+
* The `elementSize` property is ignored when palette is used, all items will be `elementSize="small"`. Use `elementSize="medium"` instead of `palette` to display actions with titles horizontally.
|
|
44
51
|
*
|
|
45
52
|
* > **Note**: Palette menus are only supported in submenus.
|
|
46
53
|
*
|
|
@@ -79,6 +86,15 @@ export interface ToolbarMenuProps {
|
|
|
79
86
|
* @default 'plain'
|
|
80
87
|
*/
|
|
81
88
|
variant?: 'plain' | 'done' | 'prominent';
|
|
89
|
+
/**
|
|
90
|
+
* The preferred size of the menu elements.
|
|
91
|
+
* `elementSize` property is ignored when `palette` is used.
|
|
92
|
+
*
|
|
93
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.
|
|
94
|
+
*
|
|
95
|
+
* @platform iOS 16.0+
|
|
96
|
+
*/
|
|
97
|
+
elementSize?: 'auto' | 'small' | 'medium' | 'large';
|
|
82
98
|
}
|
|
83
99
|
/**
|
|
84
100
|
* Adds a context menu for to a toolbar.
|
|
@@ -315,8 +331,8 @@ export interface ToolbarViewProps {
|
|
|
315
331
|
* placeholderTextColor={Color.ios.placeholderText}
|
|
316
332
|
* />
|
|
317
333
|
* </Toolbar.View>
|
|
318
|
-
* <Toolbar.View separateBackground
|
|
319
|
-
* <Pressable onPress={handlePress}>
|
|
334
|
+
* <Toolbar.View separateBackground>
|
|
335
|
+
* <Pressable style={{ width: 32, height: 32 }} onPress={handlePress}>
|
|
320
336
|
* <SymbolView name="plus" size={22} />
|
|
321
337
|
* </Pressable>
|
|
322
338
|
* </Toolbar.View>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/toolbar/el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H,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"}
|
|
@@ -24,7 +24,7 @@ const children_1 = require("../utils/children");
|
|
|
24
24
|
*
|
|
25
25
|
* @platform ios
|
|
26
26
|
*/
|
|
27
|
-
const ToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, title, destructive, children, icon, tintColor, variant, style, }) => {
|
|
27
|
+
const ToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, destructive, children, icon, tintColor, variant, style, elementSize, }) => {
|
|
28
28
|
const identifier = (0, react_1.useId)();
|
|
29
29
|
const validChildren = react_1.Children.toArray(children).filter((child) => (0, react_1.isValidElement)(child) && (child.type === exports.ToolbarMenuAction || child.type === exports.ToolbarMenu));
|
|
30
30
|
const label = (0, children_1.getFirstChildOfType)(children, primitives_1.Label);
|
|
@@ -34,7 +34,7 @@ const ToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground
|
|
|
34
34
|
(iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
|
|
35
35
|
const sf = typeof computedIcon === 'string' ? computedIcon : undefined;
|
|
36
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}/>);
|
|
37
|
+
return (<native_2.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={sf} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={computedTitle} onSelected={() => { }} children={validChildren} identifier={identifier}/>);
|
|
38
38
|
};
|
|
39
39
|
exports.ToolbarMenu = ToolbarMenu;
|
|
40
40
|
/**
|
|
@@ -127,8 +127,8 @@ exports.ToolbarSpacer = ToolbarSpacer;
|
|
|
127
127
|
* placeholderTextColor={Color.ios.placeholderText}
|
|
128
128
|
* />
|
|
129
129
|
* </Toolbar.View>
|
|
130
|
-
* <Toolbar.View separateBackground
|
|
131
|
-
* <Pressable onPress={handlePress}>
|
|
130
|
+
* <Toolbar.View separateBackground>
|
|
131
|
+
* <Pressable style={{ width: 32, height: 32 }} onPress={handlePress}>
|
|
132
132
|
* <SymbolView name="plus" size={22} />
|
|
133
133
|
* </Pressable>
|
|
134
134
|
* </Toolbar.View>
|
|
@@ -1 +1 @@
|
|
|
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,kBAA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AE,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
|
+
{"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;AAmGxD;;;;;;;;;;;;;;GAcG;AACI,MAAM,WAAW,GAA+B,CAAC,EACtD,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CACrD,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,yBAAiB,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAW,CAAC,CAC5F,CAAC;IACF,MAAM,KAAK,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,kBAAK,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,iBAAI,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,KAAK,IAAI,KAAK,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC3D,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BG;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 * An optional subtitle for the menu. Does not appear on `inline` menus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n */\n subtitle?: string;\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 * The `elementSize` property is ignored when palette is used, all items will be `elementSize=\"small\"`. Use `elementSize=\"medium\"` instead of `palette` to display actions with titles horizontally.\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 * The preferred size of the menu elements.\n * `elementSize` property is ignored when `palette` is used.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\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 subtitle,\n title,\n destructive,\n children,\n icon,\n tintColor,\n variant,\n style,\n elementSize,\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 subtitle={subtitle}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n displayAsPalette={palette}\n displayInline={inline}\n preferredElementSize={elementSize}\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>\n * <Pressable style={{ width: 32, height: 32 }} 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"]}
|
package/build/toolbar/index.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import { ToolbarMenu, ToolbarMenuAction, ToolbarButton, ToolbarSpacer, ToolbarVi
|
|
|
13
13
|
* <Toolbar>
|
|
14
14
|
* <Toolbar.Spacer />
|
|
15
15
|
* <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
|
|
16
|
-
* <Toolbar.View
|
|
17
|
-
* <TextInput placeholder="Search" />
|
|
16
|
+
* <Toolbar.View>
|
|
17
|
+
* <TextInput style={{ width: 200 }} placeholder="Search" />
|
|
18
18
|
* </Toolbar.View>
|
|
19
19
|
* <Toolbar.Menu icon="ellipsis">
|
|
20
20
|
* <Toolbar.MenuAction icon="mail" title="Send email" onPress={() => {}} />
|
package/build/toolbar/index.js
CHANGED
|
@@ -21,8 +21,8 @@ Object.defineProperty(exports, "ToolbarView", { enumerable: true, get: function
|
|
|
21
21
|
* <Toolbar>
|
|
22
22
|
* <Toolbar.Spacer />
|
|
23
23
|
* <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
|
|
24
|
-
* <Toolbar.View
|
|
25
|
-
* <TextInput placeholder="Search" />
|
|
24
|
+
* <Toolbar.View>
|
|
25
|
+
* <TextInput style={{ width: 200 }} placeholder="Search" />
|
|
26
26
|
* </Toolbar.View>
|
|
27
27
|
* <Toolbar.Menu icon="ellipsis">
|
|
28
28
|
* <Toolbar.MenuAction icon="mail" title="Send email" onPress={() => {}} />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":";;;AAAA,yCAOoB;AAwCX,4FA7CP,sBAAW,OA6CO;AAAE,kGA5CpB,4BAAiB,OA4CoB;AAAE,8FA3CvC,wBAAa,OA2CuC;AAAE,8FA1CtD,wBAAa,OA0CsD;AAAE,4FAzCrE,sBAAW,OAyCqE;AAtClF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,EAAE;IAChD,IAAI,EAAE,sBAAW;IACjB,UAAU,EAAE,4BAAiB;IAC7B,MAAM,EAAE,wBAAa;IACrB,MAAM,EAAE,wBAAa;IACrB,IAAI,EAAE,sBAAW;CAClB,CAAC,CAAC","sourcesContent":["import {\n ToolbarHost,\n ToolbarMenu,\n ToolbarMenuAction,\n ToolbarButton,\n ToolbarSpacer,\n ToolbarView,\n} from './elements';\n\n/**\n * A component that provides a [bottom toolbar](https://developer.apple.com/design/human-interface-guidelines/toolbars).\n *\n * @example\n * ```tsx\n * import { Toolbar } from \"expo-router\";\n *\n * export default function MyScreen() {\n * return (\n * <>\n * <YourScreenContent />\n * <Toolbar>\n * <Toolbar.Spacer />\n * <Toolbar.Button icon=\"magnifyingglass\" tintColor={Color.ios.placeholderText} />\n * <Toolbar.View style={{ width: 200 }}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toolbar/index.ts"],"names":[],"mappings":";;;AAAA,yCAOoB;AAwCX,4FA7CP,sBAAW,OA6CO;AAAE,kGA5CpB,4BAAiB,OA4CoB;AAAE,8FA3CvC,wBAAa,OA2CuC;AAAE,8FA1CtD,wBAAa,OA0CsD;AAAE,4FAzCrE,sBAAW,OAyCqE;AAtClF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACU,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAW,EAAE;IAChD,IAAI,EAAE,sBAAW;IACjB,UAAU,EAAE,4BAAiB;IAC7B,MAAM,EAAE,wBAAa;IACrB,MAAM,EAAE,wBAAa;IACrB,IAAI,EAAE,sBAAW;CAClB,CAAC,CAAC","sourcesContent":["import {\n ToolbarHost,\n ToolbarMenu,\n ToolbarMenuAction,\n ToolbarButton,\n ToolbarSpacer,\n ToolbarView,\n} from './elements';\n\n/**\n * A component that provides a [bottom toolbar](https://developer.apple.com/design/human-interface-guidelines/toolbars).\n *\n * @example\n * ```tsx\n * import { Toolbar } from \"expo-router\";\n *\n * export default function MyScreen() {\n * return (\n * <>\n * <YourScreenContent />\n * <Toolbar>\n * <Toolbar.Spacer />\n * <Toolbar.Button icon=\"magnifyingglass\" tintColor={Color.ios.placeholderText} />\n * <Toolbar.View>\n * <TextInput style={{ width: 200 }} placeholder=\"Search\" />\n * </Toolbar.View>\n * <Toolbar.Menu icon=\"ellipsis\">\n * <Toolbar.MenuAction icon=\"mail\" title=\"Send email\" onPress={() => {}} />\n * <Toolbar.MenuAction icon=\"trash\" title=\"Delete\" destructive onPress={() => {}} />\n * </Toolbar.Menu>\n * <Toolbar.Spacer />\n * </Toolbar>\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const Toolbar = Object.assign(ToolbarHost, {\n Menu: ToolbarMenu,\n MenuAction: ToolbarMenuAction,\n Button: ToolbarButton,\n Spacer: ToolbarSpacer,\n View: ToolbarView,\n});\n\nexport { ToolbarMenu, ToolbarMenuAction, ToolbarButton, ToolbarSpacer, ToolbarView };\n\nexport type {\n ToolbarProps,\n ToolbarMenuProps,\n ToolbarMenuActionProps,\n ToolbarButtonProps,\n ToolbarSpacerProps,\n ToolbarViewProps as ToolbarCustomViewProps,\n} from './elements';\n"]}
|
package/expo-module.config.json
CHANGED