@react-navigation/bottom-tabs 7.20.0 → 7.21.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.
Files changed (33) hide show
  1. package/lib/module/unstable/Deferred.js +3 -10
  2. package/lib/module/unstable/Deferred.js.map +1 -1
  3. package/lib/module/unstable/NativeBottomTabView.native.js +288 -196
  4. package/lib/module/unstable/NativeBottomTabView.native.js.map +1 -1
  5. package/lib/module/views/BottomTabBar.js +111 -64
  6. package/lib/module/views/BottomTabBar.js.map +1 -1
  7. package/lib/module/views/BottomTabItem.js +2 -0
  8. package/lib/module/views/BottomTabItem.js.map +1 -1
  9. package/lib/module/views/BottomTabView.js +78 -57
  10. package/lib/module/views/BottomTabView.js.map +1 -1
  11. package/lib/module/views/TabBarIcon.js +6 -2
  12. package/lib/module/views/TabBarIcon.js.map +1 -1
  13. package/lib/typescript/src/types.d.ts +4 -0
  14. package/lib/typescript/src/types.d.ts.map +1 -1
  15. package/lib/typescript/src/unstable/Deferred.d.ts.map +1 -1
  16. package/lib/typescript/src/unstable/NativeBottomTabView.native.d.ts.map +1 -1
  17. package/lib/typescript/src/unstable/types.d.ts +124 -4
  18. package/lib/typescript/src/unstable/types.d.ts.map +1 -1
  19. package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -1
  20. package/lib/typescript/src/views/BottomTabItem.d.ts +5 -1
  21. package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -1
  22. package/lib/typescript/src/views/BottomTabView.d.ts.map +1 -1
  23. package/lib/typescript/src/views/TabBarIcon.d.ts +2 -1
  24. package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -1
  25. package/package.json +6 -6
  26. package/src/types.tsx +5 -0
  27. package/src/unstable/Deferred.tsx +3 -11
  28. package/src/unstable/NativeBottomTabView.native.tsx +356 -218
  29. package/src/unstable/types.tsx +133 -4
  30. package/src/views/BottomTabBar.tsx +153 -82
  31. package/src/views/BottomTabItem.tsx +6 -0
  32. package/src/views/BottomTabView.tsx +100 -66
  33. package/src/views/TabBarIcon.tsx +9 -2
@@ -13,6 +13,7 @@ type Props = {
13
13
  route: Route<string>;
14
14
  variant: 'uikit' | 'material';
15
15
  size: 'compact' | 'regular';
16
+ iconSize?: number;
16
17
  badge?: string | number;
17
18
  badgeStyle?: StyleProp<TextStyle>;
18
19
  activeOpacity: number;
@@ -44,6 +45,7 @@ export function TabBarIcon({
44
45
  route: _,
45
46
  variant,
46
47
  size,
48
+ iconSize: iconSizeOverride,
47
49
  badge,
48
50
  badgeStyle,
49
51
  activeOpacity,
@@ -55,11 +57,12 @@ export function TabBarIcon({
55
57
  style,
56
58
  }: Props) {
57
59
  const iconSize =
58
- variant === 'material'
60
+ iconSizeOverride ??
61
+ (variant === 'material'
59
62
  ? ICON_SIZE_MATERIAL
60
63
  : size === 'compact'
61
64
  ? ICON_SIZE_ROUND_COMPACT
62
- : ICON_SIZE_ROUND;
65
+ : ICON_SIZE_ROUND);
63
66
 
64
67
  // We render the icon twice at the same position on top of each other:
65
68
  // active and inactive one, so we can fade between them.
@@ -71,6 +74,10 @@ export function TabBarIcon({
71
74
  : size === 'compact'
72
75
  ? styles.wrapperUikitCompact
73
76
  : styles.wrapperUikit,
77
+ iconSizeOverride != null && {
78
+ width: iconSizeOverride,
79
+ height: iconSizeOverride,
80
+ },
74
81
  style,
75
82
  ]}
76
83
  >