@react-navigation/material-top-tabs 7.4.11 → 8.0.0-alpha.0

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.
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Navigators
5
5
  */
6
- export { createMaterialTopTabNavigator } from "./navigators/createMaterialTopTabNavigator.js";
6
+ export { createMaterialTopTabNavigator, createMaterialTopTabScreen } from "./navigators/createMaterialTopTabNavigator.js";
7
7
 
8
8
  /**
9
9
  * Views
@@ -1 +1 @@
1
- {"version":3,"names":["createMaterialTopTabNavigator","MaterialTopTabBar","MaterialTopTabView","useTabAnimation"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,6BAA6B,QAAQ,+CAA4C;;AAE1F;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,kBAAkB,QAAQ,+BAA4B;;AAE/D;AACA;AACA;AACA,SAASC,eAAe,QAAQ,4BAAyB;;AAEzD;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["createMaterialTopTabNavigator","createMaterialTopTabScreen","MaterialTopTabBar","MaterialTopTabView","useTabAnimation"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,SACEA,6BAA6B,EAC7BC,0BAA0B,QACrB,+CAA4C;;AAEnD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,kBAAkB,QAAQ,+BAA4B;;AAE/D;AACA;AACA;AACA,SAASC,eAAe,QAAQ,4BAAyB;;AAEzD;AACA;AACA","ignoreList":[]}
@@ -4,16 +4,15 @@ import { createNavigatorFactory, TabRouter, useNavigationBuilder } from '@react-
4
4
  import { MaterialTopTabView } from "../views/MaterialTopTabView.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  function MaterialTopTabNavigator({
7
- id,
8
7
  initialRouteName,
9
8
  backBehavior,
10
- UNSTABLE_routeNamesChangeBehavior,
9
+ routeNamesChangeBehavior,
11
10
  children,
12
11
  layout,
13
12
  screenListeners,
14
13
  screenOptions,
15
14
  screenLayout,
16
- UNSTABLE_router,
15
+ router,
17
16
  ...rest
18
17
  }) {
19
18
  const {
@@ -22,16 +21,15 @@ function MaterialTopTabNavigator({
22
21
  navigation,
23
22
  NavigationContent
24
23
  } = useNavigationBuilder(TabRouter, {
25
- id,
26
24
  initialRouteName,
27
25
  backBehavior,
28
- UNSTABLE_routeNamesChangeBehavior,
26
+ routeNamesChangeBehavior,
29
27
  children,
30
28
  layout,
31
29
  screenListeners,
32
30
  screenOptions,
33
31
  screenLayout,
34
- UNSTABLE_router
32
+ router
35
33
  });
36
34
  return /*#__PURE__*/_jsx(NavigationContent, {
37
35
  children: /*#__PURE__*/_jsx(MaterialTopTabView, {
@@ -45,4 +43,7 @@ function MaterialTopTabNavigator({
45
43
  export function createMaterialTopTabNavigator(config) {
46
44
  return createNavigatorFactory(MaterialTopTabNavigator)(config);
47
45
  }
46
+ export function createMaterialTopTabScreen(config) {
47
+ return config;
48
+ }
48
49
  //# sourceMappingURL=createMaterialTopTabNavigator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","MaterialTopTabView","jsx","_jsx","MaterialTopTabNavigator","id","initialRouteName","backBehavior","UNSTABLE_routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","UNSTABLE_router","rest","state","descriptors","navigation","NavigationContent","createMaterialTopTabNavigator","config"],"sourceRoot":"../../../src","sources":["navigators/createMaterialTopTabNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EAMtBC,SAAS,EAGTC,oBAAoB,QACf,0BAA0B;AAQjC,SAASC,kBAAkB,QAAQ,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,SAASC,uBAAuBA,CAAC;EAC/BC,EAAE;EACFC,gBAAgB;EAChBC,YAAY;EACZC,iCAAiC;EACjCC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,eAAe;EACf,GAAGC;AACyB,CAAC,EAAE;EAC/B,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzDnB,oBAAoB,CAMlBD,SAAS,EAAE;IACXM,EAAE;IACFC,gBAAgB;IAChBC,YAAY;IACZC,iCAAiC;IACjCC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC;EACF,CAAC,CAAC;EAEJ,oBACEX,IAAA,CAACgB,iBAAiB;IAAAV,QAAA,eAChBN,IAAA,CAACF,kBAAkB;MAAA,GACbc,IAAI;MACRC,KAAK,EAAEA,KAAM;MACbE,UAAU,EAAEA,UAAW;MACvBD,WAAW,EAAEA;IAAY,CAC1B;EAAC,CACe,CAAC;AAExB;AAEA,OAAO,SAASG,6BAA6BA,CAmB3CC,MAAe,EAAmC;EAClD,OAAOvB,sBAAsB,CAACM,uBAAuB,CAAC,CAACiB,MAAM,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","MaterialTopTabView","jsx","_jsx","MaterialTopTabNavigator","initialRouteName","backBehavior","routeNamesChangeBehavior","children","layout","screenListeners","screenOptions","screenLayout","router","rest","state","descriptors","navigation","NavigationContent","createMaterialTopTabNavigator","config","createMaterialTopTabScreen"],"sourceRoot":"../../../src","sources":["navigators/createMaterialTopTabNavigator.tsx"],"mappings":";;AAAA,SACEA,sBAAsB,EAStBC,SAAS,EAGTC,oBAAoB,QACf,0BAA0B;AAQjC,SAASC,kBAAkB,QAAQ,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjE,SAASC,uBAAuBA,CAAC;EAC/BC,gBAAgB;EAChBC,YAAY;EACZC,wBAAwB;EACxBC,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,aAAa;EACbC,YAAY;EACZC,MAAM;EACN,GAAGC;AACyB,CAAC,EAAE;EAC/B,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAkB,CAAC,GACzDlB,oBAAoB,CAMlBD,SAAS,EAAE;IACXM,gBAAgB;IAChBC,YAAY;IACZC,wBAAwB;IACxBC,QAAQ;IACRC,MAAM;IACNC,eAAe;IACfC,aAAa;IACbC,YAAY;IACZC;EACF,CAAC,CAAC;EAEJ,oBACEV,IAAA,CAACe,iBAAiB;IAAAV,QAAA,eAChBL,IAAA,CAACF,kBAAkB;MAAA,GACba,IAAI;MACRC,KAAK,EAAEA,KAAM;MACbE,UAAU,EAAEA,UAAW;MACvBD,WAAW,EAAEA;IAAY,CAC1B;EAAC,CACe,CAAC;AAExB;AA2BA,OAAO,SAASG,6BAA6BA,CAACC,MAAgB,EAAE;EAC9D,OAAOtB,sBAAsB,CAACM,uBAAuB,CAAC,CAACgB,MAAM,CAAC;AAChE;AAEA,OAAO,SAASC,0BAA0BA,CAIxCD,MAOC,EACD;EACA,OAAOA,MAAM;AACf","ignoreList":[]}
@@ -1,25 +1,31 @@
1
1
  "use strict";
2
2
 
3
3
  import { Text } from '@react-navigation/elements';
4
+ import { Color } from '@react-navigation/elements/internal';
4
5
  import { useLinkBuilder, useLocale, useTheme } from '@react-navigation/native';
5
- import Color from 'color';
6
6
  import { StyleSheet } from 'react-native';
7
7
  import { TabBar, TabBarIndicator } from 'react-native-tab-view';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const renderLabelDefault = ({
9
+ const MaterialLabel = ({
10
10
  color,
11
11
  labelText,
12
12
  style,
13
13
  allowFontScaling
14
14
  }) => {
15
+ const {
16
+ fonts
17
+ } = useTheme();
15
18
  return /*#__PURE__*/_jsx(Text, {
16
19
  style: [{
17
20
  color
18
- }, styles.label, style],
21
+ }, fonts.medium, styles.label, style],
19
22
  allowFontScaling: allowFontScaling,
20
23
  children: labelText
21
24
  });
22
25
  };
26
+ const renderLabelDefault = props => /*#__PURE__*/_jsx(MaterialLabel, {
27
+ ...props
28
+ });
23
29
  export function MaterialTopTabBar({
24
30
  state,
25
31
  navigation,
@@ -27,7 +33,8 @@ export function MaterialTopTabBar({
27
33
  ...rest
28
34
  }) {
29
35
  const {
30
- colors
36
+ colors,
37
+ dark
31
38
  } = useTheme();
32
39
  const {
33
40
  direction
@@ -37,7 +44,7 @@ export function MaterialTopTabBar({
37
44
  } = useLinkBuilder();
38
45
  const focusedOptions = descriptors[state.routes[state.index].key].options;
39
46
  const activeColor = focusedOptions.tabBarActiveTintColor ?? colors.text;
40
- const inactiveColor = focusedOptions.tabBarInactiveTintColor ?? Color(activeColor).alpha(0.5).rgb().string();
47
+ const inactiveColor = focusedOptions.tabBarInactiveTintColor ?? Color(activeColor)?.alpha(0.5).string() ?? (dark ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.5)');
41
48
  const tabBarOptions = Object.fromEntries(state.routes.map(route => {
42
49
  const {
43
50
  options
@@ -1 +1 @@
1
- {"version":3,"names":["Text","useLinkBuilder","useLocale","useTheme","Color","StyleSheet","TabBar","TabBarIndicator","jsx","_jsx","renderLabelDefault","color","labelText","style","allowFontScaling","styles","label","children","MaterialTopTabBar","state","navigation","descriptors","rest","colors","direction","buildHref","focusedOptions","routes","index","key","options","activeColor","tabBarActiveTintColor","text","inactiveColor","tabBarInactiveTintColor","alpha","rgb","string","tabBarOptions","Object","fromEntries","map","route","title","tabBarLabel","tabBarButtonTestID","tabBarAccessibilityLabel","tabBarBadge","tabBarShowIcon","tabBarShowLabel","tabBarIcon","tabBarAllowFontScaling","tabBarLabelStyle","href","name","params","testID","accessibilityLabel","badge","icon","undefined","focused","labelAllowFontScaling","labelStyle","navigationState","scrollEnabled","tabBarScrollEnabled","bounces","tabBarBounces","pressColor","tabBarPressColor","pressOpacity","tabBarPressOpacity","tabStyle","tabBarItemStyle","indicatorStyle","backgroundColor","primary","tabBarIndicatorStyle","gap","tabBarGap","android_ripple","tabBarAndroidRipple","indicatorContainerStyle","tabBarIndicatorContainerStyle","contentContainerStyle","tabBarContentContainerStyle","card","tabBarStyle","onTabPress","preventDefault","event","emit","type","target","canPreventDefault","defaultPrevented","onTabLongPress","renderIndicator","tabBarIndicator","create","textAlign","fontSize","margin"],"sourceRoot":"../../../src","sources":["views/MaterialTopTabBar.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,4BAA4B;AACjD,SAGEC,cAAc,EACdC,SAAS,EACTC,QAAQ,QACH,0BAA0B;AACjC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,SAEEC,MAAM,EACNC,eAAe,QAEV,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ/B,MAAMC,kBAAkB,GAAGA,CAAC;EAC1BC,KAAK;EACLC,SAAS;EACTC,KAAK;EACLC;AACkB,CAAC,KAAK;EACxB,oBACEL,IAAA,CAACT,IAAI;IACHa,KAAK,EAAE,CAAC;MAAEF;IAAM,CAAC,EAAEI,MAAM,CAACC,KAAK,EAAEH,KAAK,CAAE;IACxCC,gBAAgB,EAAEA,gBAAiB;IAAAG,QAAA,EAElCL;EAAS,CACN,CAAC;AAEX,CAAC;AAED,OAAO,SAASM,iBAAiBA,CAAC;EAChCC,KAAK;EACLC,UAAU;EACVC,WAAW;EACX,GAAGC;AACmB,CAAC,EAAE;EACzB,MAAM;IAAEC;EAAO,CAAC,GAAGpB,QAAQ,CAAC,CAAC;EAC7B,MAAM;IAAEqB;EAAU,CAAC,GAAGtB,SAAS,CAAC,CAAC;EACjC,MAAM;IAAEuB;EAAU,CAAC,GAAGxB,cAAc,CAAC,CAAC;EAEtC,MAAMyB,cAAc,GAAGL,WAAW,CAACF,KAAK,CAACQ,MAAM,CAACR,KAAK,CAACS,KAAK,CAAC,CAACC,GAAG,CAAC,CAACC,OAAO;EAEzE,MAAMC,WAAW,GAAGL,cAAc,CAACM,qBAAqB,IAAIT,MAAM,CAACU,IAAI;EACvE,MAAMC,a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gB,EAAE;QAC1BN,cAAc,CAAC,CAAC;MAClB;IACF,CAAE;IACFO,cAAc,EAAEA,CAAC;MAAEvD;IAAM,CAAC,KACxBvB,UAAU,CAACyE,IAAI,CAAC;MACdC,IAAI,EAAE,cAAc;MACpBC,MAAM,EAAEpD,KAAK,CAACd;IAChB,CAAC,CACF;IACDsE,eAAe,EAAEA,CAAC;MAAElC,eAAe,EAAE9C,KAAK;MAAE,GAAGG;IAAK,CAAC,KAAK;MACxD,OAAOI,cAAc,CAAC0E,eAAe,GACnC1E,cAAc,CAAC0E,eAAe,CAAC;QAC7BjF,KAAK,EAAEA,KAA0C;QACjD,GAAGG;MACL,CAAC,CAAC,gBAEFb,IAAA,CAACF,eAAe;QAAC0D,eAAe,EAAE9C,KAAM;QAAA,GAAKG;MAAI,CAAG,CACrD;IACH;EAAE,CACH,CAAC;AAEN;AAEA,MAAMP,MAAM,GAAGV,UAAU,CAACgG,MAAM,CAAC;EAC/BrF,KAAK,EAAE;IACLsF,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE,CAAC;IACT3B,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Text","Color","useLinkBuilder","useLocale","useTheme","StyleSheet","TabBar","TabBarIndicator","jsx","_jsx","MaterialLabel","color","labelText","style","allowFontScaling","fonts","medium","styles","label","children","renderLabelDefault","props","MaterialTopTabBar","state","navigation","descriptors","rest","colors","dark","direction","buildHref","focusedOptions","routes","index","key","options","activeColor","tabBarActiveTintColor","text","inactiveColor","tabBarInactiveTintColor","alpha","string","tabBarOptions","Object","fromEntries","map","route","title","tabBarLabel","tabBarButtonTestID","tabBarAccessibilityLabel","tabBarBadge","tabBarShowIcon","tabBarShowLabel","tabBarIcon","tabBarAllowFontScaling","tabBarLabelStyle","href","name","params","testID","accessibilityLabel","badge","icon","undefined","focused","labelAllowFontScaling","labelStyle","navigationState","scrollEnabled","tabBarScrollEnabled","bounces","tabBarBounces","pressColor","tabBarPressColor","pressOpacity","tabBarPressOpacity","tabStyle","tabBarItemStyle","indicatorStyle","backgroundColor","primary","tabBarIndicatorStyle","gap","tabBarGap","android_ripple","tabBarAndroidRipple","indicatorContainerStyle","tabBarIndicatorContainerStyle","contentContainerStyle","tabBarContentContainerStyle","card","tabBarStyle","onTabPress","preventDefault","event","emit","type","target","canPreventDefault","defaultPrevented","onTabLongPress","renderIndicator","tabBarIndicator","create","textAlign","fontSize","margin"],"sourceRoot":"../../../src","sources":["views/MaterialTopTabBar.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,4BAA4B;AACjD,SAASC,KAAK,QAAQ,qCAAqC;AAC3D,SAGEC,cAAc,EACdC,SAAS,EACTC,QAAQ,QACH,0BAA0B;AACjC,SAA0BC,UAAU,QAAQ,cAAc;AAC1D,SAEEC,MAAM,EACNC,eAAe,QAEV,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ/B,MAAMC,aAAa,GAAGA,CAAC;EACrBC,KAAK;EACLC,SAAS;EACTC,KAAK;EACLC;AACkB,CAAC,KAAK;EACxB,MAAM;IAAEC;EAAM,CAAC,GAAGX,QAAQ,CAAC,CAAC;EAE5B,oBACEK,IAAA,CAACT,IAAI;IACHa,KAAK,EAAE,CAAC;MAAEF;IAAM,CAAC,EAAEI,KAAK,CAACC,MAAM,EAAEC,MAAM,CAACC,KAAK,EAAEL,KAAK,CAAE;IACtDC,gBAAgB,EAAEA,gBAAiB;IAAAK,QAAA,EAElCP;EAAS,CACN,CAAC;AAEX,CAAC;AAED,MAAMQ,kBAAkB,GAAIC,KAAyB,iBACnDZ,IAAA,CAACC,aAAa;EAAA,GAAKW;AAAK,CAAG,CAC5B;AAED,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,KAAK;EACLC,UAAU;EACVC,WAAW;EACX,GAAGC;AACmB,CAAC,EAAE;EACzB,MAAM;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAGxB,QAAQ,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9E,KAAK,EAAE,CAAC;MAAEoE,eAAe,EAAEtD,MAAM,CAACiE;IAAK,CAAC,EAAE7D,cAAc,CAAC8D,WAAW,CAAE;IACtEC,UAAU,EAAEA,CAAC;MAAE/C,KAAK;MAAEgD;IAAe,CAAC,KAAK;MACzC,MAAMC,KAAK,GAAGxE,UAAU,CAACyE,IAAI,CAAC;QAC5BC,IAAI,EAAE,UAAU;QAChBC,MAAM,EAAEpD,KAAK,CAACb,GAAG;QACjBkE,iBAAiB,EAAE;MACrB,CAAC,CAAC;MAEF,IAAIJ,KAAK,CAACK,gBAAgB,EAAE;QAC1BN,cAAc,CAAC,CAAC;MAClB;IACF,CAAE;IACFO,cAAc,EAAEA,CAAC;MAAEvD;IAAM,CAAC,KACxBvB,UAAU,CAACyE,IAAI,CAAC;MACdC,IAAI,EAAE,cAAc;MACpBC,MAAM,EAAEpD,KAAK,CAACb;IAChB,CAAC,CACF;IACDqE,eAAe,EAAEA,CAAC;MAAElC,eAAe,EAAE9C,KAAK;MAAE,GAAGG;IAAK,CAAC,KAAK;MACxD,OAAOK,cAAc,CAACyE,eAAe,GACnCzE,cAAc,CAACyE,eAAe,CAAC;QAC7BjF,KAAK,EAAEA,KAA0C;QACjD,GAAGG;MACL,CAAC,CAAC,gBAEFjB,IAAA,CAACF,eAAe;QAAC8D,eAAe,EAAE9C,KAAM;QAAA,GAAKG;MAAI,CAAG,CACrD;IACH;EAAE,CACH,CAAC;AAEN;AAEA,MAAMT,MAAM,GAAGZ,UAAU,CAACoG,MAAM,CAAC;EAC/BvF,KAAK,EAAE;IACLwF,SAAS,EAAE,QAAQ;IACnBC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE,CAAC;IACT3B,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Navigators
3
3
  */
4
- export { createMaterialTopTabNavigator } from './navigators/createMaterialTopTabNavigator';
4
+ export { createMaterialTopTabNavigator, createMaterialTopTabScreen, } from './navigators/createMaterialTopTabNavigator';
5
5
  /**
6
6
  * Views
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,YAAY,EACV,sBAAsB,EACtB,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,4CAA4C,CAAC;AAEpD;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,YAAY,EACV,sBAAsB,EACtB,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
@@ -1,16 +1,20 @@
1
- import { type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TabNavigationState, type TypedNavigator } from '@react-navigation/native';
1
+ import { type ParamListBase, type StaticConfig, type StaticParamList, type StaticScreenConfig, type StaticScreenConfigLinking, type StaticScreenConfigScreen, type TabNavigationState, type TypedNavigator } from '@react-navigation/native';
2
2
  import type { MaterialTopTabNavigationEventMap, MaterialTopTabNavigationOptions, MaterialTopTabNavigationProp, MaterialTopTabNavigatorProps } from '../types';
3
- declare function MaterialTopTabNavigator({ id, initialRouteName, backBehavior, UNSTABLE_routeNamesChangeBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_router, ...rest }: MaterialTopTabNavigatorProps): import("react/jsx-runtime").JSX.Element;
4
- export declare function createMaterialTopTabNavigator<const ParamList extends ParamListBase, const NavigatorID extends string | undefined = string | undefined, const TypeBag extends NavigatorTypeBagBase = {
3
+ declare function MaterialTopTabNavigator({ initialRouteName, backBehavior, routeNamesChangeBehavior, children, layout, screenListeners, screenOptions, screenLayout, router, ...rest }: MaterialTopTabNavigatorProps): import("react/jsx-runtime").JSX.Element;
4
+ type MaterialTopTabTypeBag<ParamList extends {}> = {
5
5
  ParamList: ParamList;
6
- NavigatorID: NavigatorID;
7
6
  State: TabNavigationState<ParamList>;
8
7
  ScreenOptions: MaterialTopTabNavigationOptions;
9
8
  EventMap: MaterialTopTabNavigationEventMap;
10
9
  NavigationList: {
11
- [RouteName in keyof ParamList]: MaterialTopTabNavigationProp<ParamList, RouteName, NavigatorID>;
10
+ [RouteName in keyof ParamList]: MaterialTopTabNavigationProp<ParamList, RouteName>;
12
11
  };
13
12
  Navigator: typeof MaterialTopTabNavigator;
14
- }, const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
13
+ };
14
+ export declare function createMaterialTopTabNavigator<const ParamList extends ParamListBase>(): TypedNavigator<MaterialTopTabTypeBag<ParamList>, undefined>;
15
+ export declare function createMaterialTopTabNavigator<const Config extends StaticConfig<MaterialTopTabTypeBag<ParamListBase>>>(config: Config): TypedNavigator<MaterialTopTabTypeBag<StaticParamList<{
16
+ config: Config;
17
+ }>>, Config>;
18
+ export declare function createMaterialTopTabScreen<const Linking extends StaticScreenConfigLinking, const Screen extends StaticScreenConfigScreen>(config: StaticScreenConfig<Linking, Screen, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>>): StaticScreenConfig<Linking, Screen, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>>;
15
19
  export {};
16
20
  //# sourceMappingURL=createMaterialTopTabNavigator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createMaterialTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createMaterialTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EAGvB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAGlB,iBAAS,uBAAuB,CAAC,EAC/B,EAAE,EACF,gBAAgB,EAChB,YAAY,EACZ,iCAAiC,EACjC,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,GAAG,IAAI,EACR,EAAE,4BAA4B,2CA+B9B;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,CAAC,SAAS,SAAS,aAAa,EACrC,KAAK,CAAC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EACjE,KAAK,CAAC,OAAO,SAAS,oBAAoB,GAAG;IAC3C,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,+BAA+B,CAAC;IAC/C,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,4BAA4B,CAC1D,SAAS,EACT,SAAS,EACT,WAAW,CACZ;KACF,CAAC;IACF,SAAS,EAAE,OAAO,uBAAuB,CAAC;CAC3C,EACD,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,EAClE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}
1
+ {"version":3,"file":"createMaterialTopTabNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createMaterialTopTabNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAE7B,KAAK,kBAAkB,EAGvB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAGlB,iBAAS,uBAAuB,CAAC,EAC/B,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,MAAM,EACN,eAAe,EACf,aAAa,EACb,YAAY,EACZ,MAAM,EACN,GAAG,IAAI,EACR,EAAE,4BAA4B,2CA8B9B;AAED,KAAK,qBAAqB,CAAC,SAAS,SAAS,EAAE,IAAI;IACjD,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,+BAA+B,CAAC;IAC/C,QAAQ,EAAE,gCAAgC,CAAC;IAC3C,cAAc,EAAE;SACb,SAAS,IAAI,MAAM,SAAS,GAAG,4BAA4B,CAC1D,SAAS,EACT,SAAS,CACV;KACF,CAAC;IACF,SAAS,EAAE,OAAO,uBAAuB,CAAC;CAC3C,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,KAAK,CAAC,SAAS,SAAS,aAAa,KAClC,cAAc,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC;AACjE,wBAAgB,6BAA6B,CAC3C,KAAK,CAAC,MAAM,SAAS,YAAY,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,EAEvE,MAAM,EAAE,MAAM,GACb,cAAc,CACf,qBAAqB,CAAC,eAAe,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EAC1D,MAAM,CACP,CAAC;AAKF,wBAAgB,0BAA0B,CACxC,KAAK,CAAC,OAAO,SAAS,yBAAyB,EAC/C,KAAK,CAAC,MAAM,SAAS,wBAAwB,EAE7C,MAAM,EAAE,kBAAkB,CACxB,OAAO,EACP,MAAM,EACN,kBAAkB,CAAC,aAAa,CAAC,EACjC,+BAA+B,EAC/B,gCAAgC,EAChC,4BAA4B,CAAC,aAAa,CAAC,CAC5C,0LAGF"}
@@ -1,7 +1,7 @@
1
1
  import type { DefaultNavigatorOptions, Descriptor, NavigationHelpers, NavigationProp, ParamListBase, Route, RouteProp, TabActionHelpers, TabNavigationState, TabRouterOptions, Theme } from '@react-navigation/native';
2
2
  import type React from 'react';
3
- import type { Animated, PressableAndroidRippleConfig, StyleProp, TextStyle, ViewStyle } from 'react-native';
4
- import type { SceneRendererProps, TabBar, TabViewProps } from 'react-native-tab-view';
3
+ import type { Animated, ColorValue, PressableAndroidRippleConfig, StyleProp, TextStyle, ViewStyle } from 'react-native';
4
+ import type { TabBar, TabBarProps, TabViewProps } from 'react-native-tab-view';
5
5
  export type MaterialTopTabNavigationEventMap = {
6
6
  /**
7
7
  * Event which fires on tapping on the tab in the tab bar.
@@ -30,12 +30,12 @@ export type MaterialTopTabNavigationEventMap = {
30
30
  };
31
31
  };
32
32
  export type MaterialTopTabNavigationHelpers = NavigationHelpers<ParamListBase, MaterialTopTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
33
- export type MaterialTopTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap> & TabActionHelpers<ParamList>;
34
- export type MaterialTopTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
35
- navigation: MaterialTopTabNavigationProp<ParamList, RouteName, NavigatorID>;
33
+ export type MaterialTopTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = NavigationProp<ParamList, RouteName, TabNavigationState<ParamList>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, TabActionHelpers<ParamList>>;
34
+ export type MaterialTopTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = {
35
+ navigation: MaterialTopTabNavigationProp<ParamList, RouteName>;
36
36
  route: RouteProp<ParamList, RouteName>;
37
37
  };
38
- export type MaterialTopTabOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = MaterialTopTabScreenProps<ParamList, RouteName, NavigatorID> & {
38
+ export type MaterialTopTabOptionsArgs<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = MaterialTopTabScreenProps<ParamList, RouteName> & {
39
39
  theme: Theme;
40
40
  };
41
41
  export type MaterialTopTabNavigationOptions = {
@@ -45,13 +45,13 @@ export type MaterialTopTabNavigationOptions = {
45
45
  title?: string;
46
46
  /**
47
47
  * Title string of a tab displayed in the tab bar
48
- * or a function that given { focused: boolean, color: string } returns a React.Node, to display in tab bar.
48
+ * or a function that given { focused: boolean, color: ColorValue } returns a React.Node, to display in tab bar.
49
49
  *
50
50
  * When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.
51
51
  */
52
52
  tabBarLabel?: string | ((props: {
53
53
  focused: boolean;
54
- color: string;
54
+ color: ColorValue;
55
55
  children: string;
56
56
  }) => React.ReactNode);
57
57
  /**
@@ -68,11 +68,11 @@ export type MaterialTopTabNavigationOptions = {
68
68
  */
69
69
  tabBarShowLabel?: boolean;
70
70
  /**
71
- * A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.
71
+ * A function that given { focused: boolean, color: ColorValue } returns a React.Node to display in the tab bar.
72
72
  */
73
73
  tabBarIcon?: (props: {
74
74
  focused: boolean;
75
- color: string;
75
+ color: ColorValue;
76
76
  }) => React.ReactElement;
77
77
  /**
78
78
  * Whether the tab icon should be visible. Defaults to `false`.
@@ -103,15 +103,15 @@ export type MaterialTopTabNavigationOptions = {
103
103
  /**
104
104
  * Color for the icon and label in the active tab.
105
105
  */
106
- tabBarActiveTintColor?: string;
106
+ tabBarActiveTintColor?: ColorValue;
107
107
  /**
108
108
  * Color for the icon and label in the inactive tabs.
109
109
  */
110
- tabBarInactiveTintColor?: string;
110
+ tabBarInactiveTintColor?: ColorValue;
111
111
  /**
112
112
  * Color for material ripple (Android >= 5.0 only).
113
113
  */
114
- tabBarPressColor?: string;
114
+ tabBarPressColor?: ColorValue;
115
115
  /**
116
116
  * Opacity for pressed tab (iOS and Android < 5.0 only).
117
117
  */
@@ -196,13 +196,17 @@ export type MaterialTopTabNavigationOptions = {
196
196
  };
197
197
  export type MaterialTopTabDescriptor = Descriptor<MaterialTopTabNavigationOptions, MaterialTopTabNavigationProp<ParamListBase>, RouteProp<ParamListBase>>;
198
198
  export type MaterialTopTabDescriptorMap = Record<string, MaterialTopTabDescriptor>;
199
- export type MaterialTopTabNavigationConfig = Omit<TabViewProps<Route<string>>, 'navigationState' | 'onIndexChange' | 'onSwipeStart' | 'onSwipeEnd' | 'renderScene' | 'renderTabBar' | 'renderLazyPlaceholder' | 'swipeEnabled' | 'animationEnabled' | 'lazy' | 'lazyPreloadDistance' | 'lazyPlaceholder'> & {
199
+ export type MaterialTopTabNavigationConfig = Omit<TabViewProps<Route<string>>, 'navigationState' | 'onIndexChange' | 'onSwipeStart' | 'onSwipeEnd' | 'renderScene' | 'renderTabBar' | 'renderLazyPlaceholder' | 'renderAdapter' | 'swipeEnabled' | 'animationEnabled' | 'lazy' | 'lazyPreloadDistance' | 'lazyPlaceholder'> & {
200
200
  /**
201
201
  * Function that returns a React element to display as the tab bar.
202
202
  */
203
203
  tabBar?: (props: MaterialTopTabBarProps) => React.ReactNode;
204
+ /**
205
+ * Function that returns a React element to override the underlying adapter.
206
+ */
207
+ adapter?: TabViewProps<Route<string>>['renderAdapter'];
204
208
  };
205
- export type MaterialTopTabBarProps = SceneRendererProps & {
209
+ export type MaterialTopTabBarProps = Pick<TabBarProps<Route<string>>, 'position' | 'subscribe' | 'jumpTo'> & {
206
210
  state: TabNavigationState<ParamListBase>;
207
211
  navigation: NavigationHelpers<ParamListBase, MaterialTopTabNavigationEventMap>;
208
212
  descriptors: MaterialTopTabDescriptorMap;
@@ -210,5 +214,5 @@ export type MaterialTopTabBarProps = SceneRendererProps & {
210
214
  export type MaterialTopTabAnimationContext = {
211
215
  position: Animated.AnimatedInterpolation<number>;
212
216
  };
213
- export type MaterialTopTabNavigatorProps = DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>> & TabRouterOptions & MaterialTopTabNavigationConfig;
217
+ export type MaterialTopTabNavigatorProps = DefaultNavigatorOptions<ParamListBase, TabNavigationState<ParamListBase>, MaterialTopTabNavigationOptions, MaterialTopTabNavigationEventMap, MaterialTopTabNavigationProp<ParamListBase>> & TabRouterOptions & MaterialTopTabNavigationConfig;
214
218
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,aA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C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,QAAQ,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAChE,aAAa,EACb,kBAAkB,CAAC,aAAa,CAAC,EACjC,+BAA+B,EAC/B,gCAAgC,EAChC,4BAA4B,CAAC,aAAa,CAAC,CAC5C,GACC,gBAAgB,GAChB,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MaterialTopTabBar.d.ts","sourceRoot":"","sources":["../../../../src/views/MaterialTopTabBar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAsBvD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,IAAI,EACR,EAAE,sBAAsB,2CAkHxB"}
1
+ {"version":3,"file":"MaterialTopTabBar.d.ts","sourceRoot":"","sources":["../../../../src/views/MaterialTopTabBar.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA4BvD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,IAAI,EACR,EAAE,sBAAsB,2CAoHxB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/material-top-tabs",
3
3
  "description": "Integration for the animated tab view component from react-native-tab-view",
4
- "version": "7.4.11",
4
+ "version": "8.0.0-alpha.0",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -46,30 +46,30 @@
46
46
  "clean": "del lib"
47
47
  },
48
48
  "dependencies": {
49
- "@react-navigation/elements": "^2.9.3",
49
+ "@react-navigation/elements": "^3.0.0-alpha.0",
50
50
  "color": "^4.2.3",
51
- "react-native-tab-view": "^4.2.2"
51
+ "react-native-tab-view": "^5.0.0-alpha.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@jest/globals": "^30.0.0",
55
- "@react-navigation/native": "^7.1.26",
55
+ "@react-navigation/native": "^8.0.0-alpha.0",
56
56
  "@testing-library/react-native": "^13.2.1",
57
- "@types/react": "~19.0.10",
57
+ "@types/react": "~19.1.10",
58
58
  "del-cli": "^6.0.0",
59
59
  "react": "19.1.0",
60
- "react-native": "0.81.5",
61
- "react-native-builder-bob": "^0.40.17",
62
- "react-native-pager-view": "6.9.1",
60
+ "react-native": "0.81.4",
61
+ "react-native-builder-bob": "^0.40.12",
62
+ "react-native-pager-view": "^8.0.0",
63
63
  "react-native-safe-area-context": "~5.6.0",
64
64
  "react-test-renderer": "19.1.0",
65
65
  "typescript": "^5.9.2"
66
66
  },
67
67
  "peerDependencies": {
68
- "@react-navigation/native": "^7.1.26",
69
- "react": ">= 18.2.0",
68
+ "@react-navigation/native": "^8.0.0-alpha.0",
69
+ "react": ">= 19.0.0",
70
70
  "react-native": "*",
71
- "react-native-pager-view": ">= 6.0.0",
72
- "react-native-safe-area-context": ">= 4.0.0"
71
+ "react-native-pager-view": ">= 7.0.0",
72
+ "react-native-safe-area-context": ">= 5.5.0"
73
73
  },
74
74
  "react-native-builder-bob": {
75
75
  "source": "src",
@@ -89,5 +89,5 @@
89
89
  ]
90
90
  ]
91
91
  },
92
- "gitHead": "2b7ee0d2d1b1ef0390b690f59c0c1dd8bd57e9eb"
92
+ "gitHead": "46daae524ec6a59737147ed506222dd09a5b6e39"
93
93
  }
package/src/index.tsx CHANGED
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Navigators
3
3
  */
4
- export { createMaterialTopTabNavigator } from './navigators/createMaterialTopTabNavigator';
4
+ export {
5
+ createMaterialTopTabNavigator,
6
+ createMaterialTopTabScreen,
7
+ } from './navigators/createMaterialTopTabNavigator';
5
8
 
6
9
  /**
7
10
  * Views
@@ -1,8 +1,11 @@
1
1
  import {
2
2
  createNavigatorFactory,
3
- type NavigatorTypeBagBase,
4
3
  type ParamListBase,
5
4
  type StaticConfig,
5
+ type StaticParamList,
6
+ type StaticScreenConfig,
7
+ type StaticScreenConfigLinking,
8
+ type StaticScreenConfigScreen,
6
9
  type TabActionHelpers,
7
10
  type TabNavigationState,
8
11
  TabRouter,
@@ -20,16 +23,15 @@ import type {
20
23
  import { MaterialTopTabView } from '../views/MaterialTopTabView';
21
24
 
22
25
  function MaterialTopTabNavigator({
23
- id,
24
26
  initialRouteName,
25
27
  backBehavior,
26
- UNSTABLE_routeNamesChangeBehavior,
28
+ routeNamesChangeBehavior,
27
29
  children,
28
30
  layout,
29
31
  screenListeners,
30
32
  screenOptions,
31
33
  screenLayout,
32
- UNSTABLE_router,
34
+ router,
33
35
  ...rest
34
36
  }: MaterialTopTabNavigatorProps) {
35
37
  const { state, descriptors, navigation, NavigationContent } =
@@ -40,16 +42,15 @@ function MaterialTopTabNavigator({
40
42
  MaterialTopTabNavigationOptions,
41
43
  MaterialTopTabNavigationEventMap
42
44
  >(TabRouter, {
43
- id,
44
45
  initialRouteName,
45
46
  backBehavior,
46
- UNSTABLE_routeNamesChangeBehavior,
47
+ routeNamesChangeBehavior,
47
48
  children,
48
49
  layout,
49
50
  screenListeners,
50
51
  screenOptions,
51
52
  screenLayout,
52
- UNSTABLE_router,
53
+ router,
53
54
  });
54
55
 
55
56
  return (
@@ -64,25 +65,47 @@ function MaterialTopTabNavigator({
64
65
  );
65
66
  }
66
67
 
68
+ type MaterialTopTabTypeBag<ParamList extends {}> = {
69
+ ParamList: ParamList;
70
+ State: TabNavigationState<ParamList>;
71
+ ScreenOptions: MaterialTopTabNavigationOptions;
72
+ EventMap: MaterialTopTabNavigationEventMap;
73
+ NavigationList: {
74
+ [RouteName in keyof ParamList]: MaterialTopTabNavigationProp<
75
+ ParamList,
76
+ RouteName
77
+ >;
78
+ };
79
+ Navigator: typeof MaterialTopTabNavigator;
80
+ };
81
+
67
82
  export function createMaterialTopTabNavigator<
68
83
  const ParamList extends ParamListBase,
69
- const NavigatorID extends string | undefined = string | undefined,
70
- const TypeBag extends NavigatorTypeBagBase = {
71
- ParamList: ParamList;
72
- NavigatorID: NavigatorID;
73
- State: TabNavigationState<ParamList>;
74
- ScreenOptions: MaterialTopTabNavigationOptions;
75
- EventMap: MaterialTopTabNavigationEventMap;
76
- NavigationList: {
77
- [RouteName in keyof ParamList]: MaterialTopTabNavigationProp<
78
- ParamList,
79
- RouteName,
80
- NavigatorID
81
- >;
82
- };
83
- Navigator: typeof MaterialTopTabNavigator;
84
- },
85
- const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>,
86
- >(config?: Config): TypedNavigator<TypeBag, Config> {
84
+ >(): TypedNavigator<MaterialTopTabTypeBag<ParamList>, undefined>;
85
+ export function createMaterialTopTabNavigator<
86
+ const Config extends StaticConfig<MaterialTopTabTypeBag<ParamListBase>>,
87
+ >(
88
+ config: Config
89
+ ): TypedNavigator<
90
+ MaterialTopTabTypeBag<StaticParamList<{ config: Config }>>,
91
+ Config
92
+ >;
93
+ export function createMaterialTopTabNavigator(config?: unknown) {
87
94
  return createNavigatorFactory(MaterialTopTabNavigator)(config);
88
95
  }
96
+
97
+ export function createMaterialTopTabScreen<
98
+ const Linking extends StaticScreenConfigLinking,
99
+ const Screen extends StaticScreenConfigScreen,
100
+ >(
101
+ config: StaticScreenConfig<
102
+ Linking,
103
+ Screen,
104
+ TabNavigationState<ParamListBase>,
105
+ MaterialTopTabNavigationOptions,
106
+ MaterialTopTabNavigationEventMap,
107
+ MaterialTopTabNavigationProp<ParamListBase>
108
+ >
109
+ ) {
110
+ return config;
111
+ }
package/src/types.tsx CHANGED
@@ -14,16 +14,13 @@ import type {
14
14
  import type React from 'react';
15
15
  import type {
16
16
  Animated,
17
+ ColorValue,
17
18
  PressableAndroidRippleConfig,
18
19
  StyleProp,
19
20
  TextStyle,
20
21
  ViewStyle,
21
22
  } from 'react-native';
22
- import type {
23
- SceneRendererProps,
24
- TabBar,
25
- TabViewProps,
26
- } from 'react-native-tab-view';
23
+ import type { TabBar, TabBarProps, TabViewProps } from 'react-native-tab-view';
27
24
 
28
25
  export type MaterialTopTabNavigationEventMap = {
29
26
  /**
@@ -53,31 +50,27 @@ export type MaterialTopTabNavigationHelpers = NavigationHelpers<
53
50
  export type MaterialTopTabNavigationProp<
54
51
  ParamList extends ParamListBase,
55
52
  RouteName extends keyof ParamList = keyof ParamList,
56
- NavigatorID extends string | undefined = undefined,
57
53
  > = NavigationProp<
58
54
  ParamList,
59
55
  RouteName,
60
- NavigatorID,
61
56
  TabNavigationState<ParamList>,
62
57
  MaterialTopTabNavigationOptions,
63
- MaterialTopTabNavigationEventMap
64
- > &
65
- TabActionHelpers<ParamList>;
58
+ MaterialTopTabNavigationEventMap,
59
+ TabActionHelpers<ParamList>
60
+ >;
66
61
 
67
62
  export type MaterialTopTabScreenProps<
68
63
  ParamList extends ParamListBase,
69
64
  RouteName extends keyof ParamList = keyof ParamList,
70
- NavigatorID extends string | undefined = undefined,
71
65
  > = {
72
- navigation: MaterialTopTabNavigationProp<ParamList, RouteName, NavigatorID>;
66
+ navigation: MaterialTopTabNavigationProp<ParamList, RouteName>;
73
67
  route: RouteProp<ParamList, RouteName>;
74
68
  };
75
69
 
76
70
  export type MaterialTopTabOptionsArgs<
77
71
  ParamList extends ParamListBase,
78
72
  RouteName extends keyof ParamList = keyof ParamList,
79
- NavigatorID extends string | undefined = undefined,
80
- > = MaterialTopTabScreenProps<ParamList, RouteName, NavigatorID> & {
73
+ > = MaterialTopTabScreenProps<ParamList, RouteName> & {
81
74
  theme: Theme;
82
75
  };
83
76
 
@@ -89,7 +82,7 @@ export type MaterialTopTabNavigationOptions = {
89
82
 
90
83
  /**
91
84
  * Title string of a tab displayed in the tab bar
92
- * or a function that given { focused: boolean, color: string } returns a React.Node, to display in tab bar.
85
+ * or a function that given { focused: boolean, color: ColorValue } returns a React.Node, to display in tab bar.
93
86
  *
94
87
  * When undefined, scene title is used. Use `tabBarShowLabel` to hide the label.
95
88
  */
@@ -97,7 +90,7 @@ export type MaterialTopTabNavigationOptions = {
97
90
  | string
98
91
  | ((props: {
99
92
  focused: boolean;
100
- color: string;
93
+ color: ColorValue;
101
94
  children: string;
102
95
  }) => React.ReactNode);
103
96
 
@@ -118,11 +111,11 @@ export type MaterialTopTabNavigationOptions = {
118
111
  tabBarShowLabel?: boolean;
119
112
 
120
113
  /**
121
- * A function that given { focused: boolean, color: string } returns a React.Node to display in the tab bar.
114
+ * A function that given { focused: boolean, color: ColorValue } returns a React.Node to display in the tab bar.
122
115
  */
123
116
  tabBarIcon?: (props: {
124
117
  focused: boolean;
125
- color: string;
118
+ color: ColorValue;
126
119
  }) => React.ReactElement;
127
120
 
128
121
  /**
@@ -165,17 +158,17 @@ export type MaterialTopTabNavigationOptions = {
165
158
  /**
166
159
  * Color for the icon and label in the active tab.
167
160
  */
168
- tabBarActiveTintColor?: string;
161
+ tabBarActiveTintColor?: ColorValue;
169
162
 
170
163
  /**
171
164
  * Color for the icon and label in the inactive tabs.
172
165
  */
173
- tabBarInactiveTintColor?: string;
166
+ tabBarInactiveTintColor?: ColorValue;
174
167
 
175
168
  /**
176
169
  * Color for material ripple (Android >= 5.0 only).
177
170
  */
178
- tabBarPressColor?: string;
171
+ tabBarPressColor?: ColorValue;
179
172
 
180
173
  /**
181
174
  * Opacity for pressed tab (iOS and Android < 5.0 only).
@@ -294,6 +287,7 @@ export type MaterialTopTabNavigationConfig = Omit<
294
287
  | 'renderScene'
295
288
  | 'renderTabBar'
296
289
  | 'renderLazyPlaceholder'
290
+ | 'renderAdapter'
297
291
  | 'swipeEnabled'
298
292
  | 'animationEnabled'
299
293
  | 'lazy'
@@ -304,9 +298,16 @@ export type MaterialTopTabNavigationConfig = Omit<
304
298
  * Function that returns a React element to display as the tab bar.
305
299
  */
306
300
  tabBar?: (props: MaterialTopTabBarProps) => React.ReactNode;
301
+ /**
302
+ * Function that returns a React element to override the underlying adapter.
303
+ */
304
+ adapter?: TabViewProps<Route<string>>['renderAdapter'];
307
305
  };
308
306
 
309
- export type MaterialTopTabBarProps = SceneRendererProps & {
307
+ export type MaterialTopTabBarProps = Pick<
308
+ TabBarProps<Route<string>>,
309
+ 'position' | 'subscribe' | 'jumpTo'
310
+ > & {
310
311
  state: TabNavigationState<ParamListBase>;
311
312
  navigation: NavigationHelpers<
312
313
  ParamListBase,
@@ -321,7 +322,6 @@ export type MaterialTopTabAnimationContext = {
321
322
 
322
323
  export type MaterialTopTabNavigatorProps = DefaultNavigatorOptions<
323
324
  ParamListBase,
324
- string | undefined,
325
325
  TabNavigationState<ParamListBase>,
326
326
  MaterialTopTabNavigationOptions,
327
327
  MaterialTopTabNavigationEventMap,
@@ -1,4 +1,5 @@
1
1
  import { Text } from '@react-navigation/elements';
2
+ import { Color } from '@react-navigation/elements/internal';
2
3
  import {
3
4
  type ParamListBase,
4
5
  type TabNavigationState,
@@ -6,8 +7,7 @@ import {
6
7
  useLocale,
7
8
  useTheme,
8
9
  } from '@react-navigation/native';
9
- import Color from 'color';
10
- import { StyleSheet } from 'react-native';
10
+ import { type ColorValue, StyleSheet } from 'react-native';
11
11
  import {
12
12
  type Route,
13
13
  TabBar,
@@ -21,15 +21,17 @@ type MaterialLabelProps = Parameters<
21
21
  NonNullable<TabDescriptor<Route>['label']>
22
22
  >[0];
23
23
 
24
- const renderLabelDefault = ({
24
+ const MaterialLabel = ({
25
25
  color,
26
26
  labelText,
27
27
  style,
28
28
  allowFontScaling,
29
29
  }: MaterialLabelProps) => {
30
+ const { fonts } = useTheme();
31
+
30
32
  return (
31
33
  <Text
32
- style={[{ color }, styles.label, style]}
34
+ style={[{ color }, fonts.medium, styles.label, style]}
33
35
  allowFontScaling={allowFontScaling}
34
36
  >
35
37
  {labelText}
@@ -37,22 +39,28 @@ const renderLabelDefault = ({
37
39
  );
38
40
  };
39
41
 
42
+ const renderLabelDefault = (props: MaterialLabelProps) => (
43
+ <MaterialLabel {...props} />
44
+ );
45
+
40
46
  export function MaterialTopTabBar({
41
47
  state,
42
48
  navigation,
43
49
  descriptors,
44
50
  ...rest
45
51
  }: MaterialTopTabBarProps) {
46
- const { colors } = useTheme();
52
+ const { colors, dark } = useTheme();
47
53
  const { direction } = useLocale();
48
54
  const { buildHref } = useLinkBuilder();
49
55
 
50
56
  const focusedOptions = descriptors[state.routes[state.index].key].options;
51
57
 
52
- const activeColor = focusedOptions.tabBarActiveTintColor ?? colors.text;
53
- const inactiveColor =
58
+ const activeColor: ColorValue =
59
+ focusedOptions.tabBarActiveTintColor ?? colors.text;
60
+ const inactiveColor: ColorValue =
54
61
  focusedOptions.tabBarInactiveTintColor ??
55
- Color(activeColor).alpha(0.5).rgb().string();
62
+ Color(activeColor)?.alpha(0.5).string() ??
63
+ (dark ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.5)');
56
64
 
57
65
  const tabBarOptions = Object.fromEntries(
58
66
  state.routes.map((route) => {
@@ -57,7 +57,7 @@ export function MaterialTopTabView({
57
57
  const focusedOptions = descriptors[state.routes[state.index].key].options;
58
58
 
59
59
  return (
60
- <TabView<Route<string>>
60
+ <TabView
61
61
  {...rest}
62
62
  onIndexChange={(index) => {
63
63
  const route = state.routes[index];