@react-navigation/elements 2.9.2 → 3.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.
Files changed (184) hide show
  1. package/lib/module/Badge.js +2 -2
  2. package/lib/module/Badge.js.map +1 -1
  3. package/lib/module/BlurEffectBackground.js +59 -0
  4. package/lib/module/BlurEffectBackground.js.map +1 -0
  5. package/lib/module/Button.js +7 -6
  6. package/lib/module/Button.js.map +1 -1
  7. package/lib/module/Color.js +11 -0
  8. package/lib/module/Color.js.map +1 -0
  9. package/lib/module/Container.js +42 -0
  10. package/lib/module/Container.js.map +1 -0
  11. package/lib/module/Header/Header.js +152 -97
  12. package/lib/module/Header/Header.js.map +1 -1
  13. package/lib/module/Header/HeaderBackButton.js +130 -121
  14. package/lib/module/Header/HeaderBackButton.js.map +1 -1
  15. package/lib/module/Header/HeaderBackground.js +10 -17
  16. package/lib/module/Header/HeaderBackground.js.map +1 -1
  17. package/lib/module/Header/HeaderButton.js +6 -2
  18. package/lib/module/Header/HeaderButton.js.map +1 -1
  19. package/lib/module/Header/HeaderButtonBackground.js +27 -0
  20. package/lib/module/Header/HeaderButtonBackground.js.map +1 -0
  21. package/lib/module/Header/HeaderSearchBar.js +174 -123
  22. package/lib/module/Header/HeaderSearchBar.js.map +1 -1
  23. package/lib/module/Header/HeaderTitle.js.map +1 -1
  24. package/lib/module/Header/getDefaultHeaderHeight.js +22 -10
  25. package/lib/module/Header/getDefaultHeaderHeight.js.map +1 -1
  26. package/lib/module/Label/Label.js.map +1 -1
  27. package/lib/module/LiquidGlassView.ios.js +21 -0
  28. package/lib/module/LiquidGlassView.ios.js.map +1 -0
  29. package/lib/module/LiquidGlassView.js +13 -0
  30. package/lib/module/LiquidGlassView.js.map +1 -0
  31. package/lib/module/MissingIcon.js +1 -0
  32. package/lib/module/MissingIcon.js.map +1 -1
  33. package/lib/module/PlatformColor.js +9 -0
  34. package/lib/module/PlatformColor.js.map +1 -0
  35. package/lib/module/PlatformColor.native.js +4 -0
  36. package/lib/module/PlatformColor.native.js.map +1 -0
  37. package/lib/module/PlatformPressable.js.map +1 -1
  38. package/lib/module/Screen.js +29 -23
  39. package/lib/module/Screen.js.map +1 -1
  40. package/lib/module/assets/back-icon.ios.svg +4 -0
  41. package/lib/module/assets/back-icon@1x.ios.png +0 -0
  42. package/lib/module/assets/back-icon@2x.ios.png +0 -0
  43. package/lib/module/assets/back-icon@3x.ios.png +0 -0
  44. package/lib/module/assets/back-icon@4x.ios.png +0 -0
  45. package/lib/module/assets/search-icon-legacy.png +0 -0
  46. package/lib/module/assets/search-icon-legacy@1x.ios.png +0 -0
  47. package/lib/module/assets/search-icon-legacy@2x.ios.png +0 -0
  48. package/lib/module/assets/search-icon-legacy@3x.ios.png +0 -0
  49. package/lib/module/assets/search-icon-legacy@4x.ios.png +0 -0
  50. package/lib/module/assets/search-icon.ios.svg +4 -0
  51. package/lib/module/assets/search-icon@1x.ios.png +0 -0
  52. package/lib/module/assets/search-icon@2x.ios.png +0 -0
  53. package/lib/module/assets/search-icon@3x.ios.png +0 -0
  54. package/lib/module/assets/search-icon@4x.ios.png +0 -0
  55. package/lib/module/getBlurBackgroundColor.js +48 -0
  56. package/lib/module/getBlurBackgroundColor.js.map +1 -0
  57. package/lib/module/index.js +2 -8
  58. package/lib/module/index.js.map +1 -1
  59. package/lib/module/internal.js +10 -0
  60. package/lib/module/internal.js.map +1 -0
  61. package/lib/module/useFrameSize.js +4 -4
  62. package/lib/module/useFrameSize.js.map +1 -1
  63. package/lib/typescript/src/Badge.d.ts.map +1 -1
  64. package/lib/typescript/src/BlurEffectBackground.d.ts +16 -0
  65. package/lib/typescript/src/BlurEffectBackground.d.ts.map +1 -0
  66. package/lib/typescript/src/Button.d.ts +5 -4
  67. package/lib/typescript/src/Button.d.ts.map +1 -1
  68. package/lib/typescript/src/Color.d.ts +13 -0
  69. package/lib/typescript/src/Color.d.ts.map +1 -0
  70. package/lib/typescript/src/Container.d.ts +8 -0
  71. package/lib/typescript/src/Container.d.ts.map +1 -0
  72. package/lib/typescript/src/Header/Header.d.ts +1 -5
  73. package/lib/typescript/src/Header/Header.d.ts.map +1 -1
  74. package/lib/typescript/src/Header/HeaderBackButton.d.ts +1 -1
  75. package/lib/typescript/src/Header/HeaderBackButton.d.ts.map +1 -1
  76. package/lib/typescript/src/Header/HeaderBackground.d.ts +5 -3
  77. package/lib/typescript/src/Header/HeaderBackground.d.ts.map +1 -1
  78. package/lib/typescript/src/Header/HeaderButton.d.ts +2 -0
  79. package/lib/typescript/src/Header/HeaderButton.d.ts.map +1 -1
  80. package/lib/typescript/src/Header/HeaderButtonBackground.d.ts +5 -0
  81. package/lib/typescript/src/Header/HeaderButtonBackground.d.ts.map +1 -0
  82. package/lib/typescript/src/Header/HeaderSearchBar.d.ts +5 -2
  83. package/lib/typescript/src/Header/HeaderSearchBar.d.ts.map +1 -1
  84. package/lib/typescript/src/Header/HeaderTitle.d.ts +2 -2
  85. package/lib/typescript/src/Header/HeaderTitle.d.ts.map +1 -1
  86. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts +5 -2
  87. package/lib/typescript/src/Header/getDefaultHeaderHeight.d.ts.map +1 -1
  88. package/lib/typescript/src/Label/Label.d.ts +2 -2
  89. package/lib/typescript/src/Label/Label.d.ts.map +1 -1
  90. package/lib/typescript/src/LiquidGlassView.d.ts +9 -0
  91. package/lib/typescript/src/LiquidGlassView.d.ts.map +1 -0
  92. package/lib/typescript/src/LiquidGlassView.ios.d.ts +5 -0
  93. package/lib/typescript/src/LiquidGlassView.ios.d.ts.map +1 -0
  94. package/lib/typescript/src/MissingIcon.d.ts +2 -2
  95. package/lib/typescript/src/MissingIcon.d.ts.map +1 -1
  96. package/lib/typescript/src/PlatformColor.d.ts +7 -0
  97. package/lib/typescript/src/PlatformColor.d.ts.map +1 -0
  98. package/lib/typescript/src/PlatformColor.native.d.ts +2 -0
  99. package/lib/typescript/src/PlatformColor.native.d.ts.map +1 -0
  100. package/lib/typescript/src/PlatformPressable.d.ts +3 -3
  101. package/lib/typescript/src/PlatformPressable.d.ts.map +1 -1
  102. package/lib/typescript/src/Screen.d.ts.map +1 -1
  103. package/lib/typescript/src/getBlurBackgroundColor.d.ts +7 -0
  104. package/lib/typescript/src/getBlurBackgroundColor.d.ts.map +1 -0
  105. package/lib/typescript/src/index.d.ts +0 -6
  106. package/lib/typescript/src/index.d.ts.map +1 -1
  107. package/lib/typescript/src/internal.d.ts +8 -0
  108. package/lib/typescript/src/internal.d.ts.map +1 -0
  109. package/lib/typescript/src/types.d.ts +20 -22
  110. package/lib/typescript/src/types.d.ts.map +1 -1
  111. package/package.json +22 -21
  112. package/src/Badge.tsx +3 -2
  113. package/src/BlurEffectBackground.tsx +90 -0
  114. package/src/Button.tsx +33 -21
  115. package/src/Color.tsx +21 -0
  116. package/src/Container.tsx +44 -0
  117. package/src/Header/Header.tsx +226 -156
  118. package/src/Header/HeaderBackButton.tsx +194 -168
  119. package/src/Header/HeaderBackground.tsx +17 -19
  120. package/src/Header/HeaderButton.tsx +7 -2
  121. package/src/Header/HeaderButtonBackground.tsx +29 -0
  122. package/src/Header/HeaderSearchBar.tsx +227 -129
  123. package/src/Header/HeaderTitle.tsx +2 -1
  124. package/src/Header/getDefaultHeaderHeight.tsx +29 -18
  125. package/src/Label/Label.tsx +2 -1
  126. package/src/LiquidGlassView.ios.tsx +39 -0
  127. package/src/LiquidGlassView.tsx +20 -0
  128. package/src/MissingIcon.tsx +12 -3
  129. package/src/PlatformColor.native.tsx +1 -0
  130. package/src/PlatformColor.tsx +8 -0
  131. package/src/PlatformPressable.tsx +2 -1
  132. package/src/Screen.tsx +24 -25
  133. package/src/assets/back-icon.ios.svg +4 -0
  134. package/src/assets/back-icon@1x.ios.png +0 -0
  135. package/src/assets/back-icon@2x.ios.png +0 -0
  136. package/src/assets/back-icon@3x.ios.png +0 -0
  137. package/src/assets/back-icon@4x.ios.png +0 -0
  138. package/src/assets/search-icon-legacy.png +0 -0
  139. package/src/assets/search-icon-legacy@1x.ios.png +0 -0
  140. package/src/assets/search-icon-legacy@2x.ios.png +0 -0
  141. package/src/assets/search-icon-legacy@3x.ios.png +0 -0
  142. package/src/assets/search-icon-legacy@4x.ios.png +0 -0
  143. package/src/assets/search-icon.ios.svg +4 -0
  144. package/src/assets/search-icon@1x.ios.png +0 -0
  145. package/src/assets/search-icon@2x.ios.png +0 -0
  146. package/src/assets/search-icon@3x.ios.png +0 -0
  147. package/src/assets/search-icon@4x.ios.png +0 -0
  148. package/src/getBlurBackgroundColor.tsx +68 -0
  149. package/src/index.tsx +2 -8
  150. package/src/internal.tsx +7 -0
  151. package/src/types.tsx +21 -21
  152. package/src/useFrameSize.tsx +4 -4
  153. package/lib/module/Background.js +0 -22
  154. package/lib/module/Background.js.map +0 -1
  155. package/lib/module/MaskedView.android.js +0 -4
  156. package/lib/module/MaskedView.android.js.map +0 -1
  157. package/lib/module/MaskedView.ios.js +0 -4
  158. package/lib/module/MaskedView.ios.js.map +0 -1
  159. package/lib/module/MaskedView.js +0 -12
  160. package/lib/module/MaskedView.js.map +0 -1
  161. package/lib/module/MaskedViewNative.js +0 -30
  162. package/lib/module/MaskedViewNative.js.map +0 -1
  163. package/lib/module/ResourceSavingView.js +0 -57
  164. package/lib/module/ResourceSavingView.js.map +0 -1
  165. package/lib/module/assets/back-icon-mask.png +0 -0
  166. package/lib/typescript/src/Background.d.ts +0 -9
  167. package/lib/typescript/src/Background.d.ts.map +0 -1
  168. package/lib/typescript/src/MaskedView.android.d.ts +0 -2
  169. package/lib/typescript/src/MaskedView.android.d.ts.map +0 -1
  170. package/lib/typescript/src/MaskedView.d.ts +0 -11
  171. package/lib/typescript/src/MaskedView.d.ts.map +0 -1
  172. package/lib/typescript/src/MaskedView.ios.d.ts +0 -2
  173. package/lib/typescript/src/MaskedView.ios.d.ts.map +0 -1
  174. package/lib/typescript/src/MaskedViewNative.d.ts +0 -11
  175. package/lib/typescript/src/MaskedViewNative.d.ts.map +0 -1
  176. package/lib/typescript/src/ResourceSavingView.d.ts +0 -10
  177. package/lib/typescript/src/ResourceSavingView.d.ts.map +0 -1
  178. package/src/Background.tsx +0 -24
  179. package/src/MaskedView.android.tsx +0 -1
  180. package/src/MaskedView.ios.tsx +0 -1
  181. package/src/MaskedView.tsx +0 -13
  182. package/src/MaskedViewNative.tsx +0 -33
  183. package/src/ResourceSavingView.tsx +0 -76
  184. package/src/assets/back-icon-mask.png +0 -0
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  import { useTheme } from '@react-navigation/native';
4
- import Color from 'color';
5
4
  import * as React from 'react';
6
5
  import { Animated, Platform, StyleSheet } from 'react-native';
6
+ import { Color } from "./Color.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const useNativeDriver = Platform.OS !== 'web';
9
9
  export function Badge({
@@ -49,7 +49,7 @@ export function Badge({
49
49
  backgroundColor = colors.notification,
50
50
  ...restStyle
51
51
  } = StyleSheet.flatten(style) || {};
52
- const textColor = Color(backgroundColor).isLight() ? 'black' : 'white';
52
+ const textColor = Color(backgroundColor)?.isLight() ? 'black' : 'white';
53
53
  const borderRadius = size / 2;
54
54
  const fontSize = Math.floor(size * 3 / 4);
55
55
  return /*#__PURE__*/_jsx(Animated.Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["useTheme","Color","React","Animated","Platform","StyleSheet","jsx","_jsx","useNativeDriver","OS","Badge","children","style","visible","size","rest","opacity","useState","Value","rendered","setRendered","colors","fonts","useEffect","timing","toValue","duration","start","finished","stopAnimation","backgroundColor","notification","restStyle","flatten","textColor","isLight","borderRadius","fontSize","Math","floor","Text","numberOfLines","transform","scale","interpolate","inputRange","outputRange","color","lineHeight","height","minWidth","borderCurve","regular","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAO,KA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ignoreList":[]}
1
+ {"version":3,"names":["useTheme","React","Animated","Platform","StyleSheet","Color","jsx","_jsx","useNativeDriver","OS","Badge","children","style","visible","size","rest","opacity","useState","Value","rendered","setRendered","colors","fonts","useEffect","timing","toValue","duration","start","finished","stopAnimation","backgroundColor","notification","restStyle","flatten","textColor","isLight","borderRadius","fontSize","Math","floor","Text","numberOfLines","transform","scale","interpolate","inputRange","outputRange","color","lineHeight","height","minWidth","borderCurve","regular","styles","container","create","alignSelf","textAlign","paddingHorizontal","overflow"],"sourceRoot":"../../src","sources":["Badge.tsx"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,0BAA0B;AACnD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,QAAQ,EAERC,UAAU,QAGL,cAAc;AAErB,SAASC,KAAK,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqBhC,MAAMC,eAAe,GAAGL,QAAQ,CAACM,EAAE,KAAK,KAAK;AAE7C,OAAO,SAASC,KAAKA,CAAC;EACpBC,QAAQ;EACRC,KAAK;EACLC,OAAO,GAAG,IAAI;EACdC,IAAI,GAAG,EAAE;EACT,GAAGC;AACE,CAAC,EAAE;EACR,MAAM,CAACC,OAAO,CAAC,GAAGf,KAAK,CAACgB,QAAQ,CAAC,MAAM,IAAIf,QAAQ,CAACgB,KAAK,CAACL,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;EAC3E,MAAM,CAACM,QAAQ,EAAEC,WAAW,CAAC,GAAGnB,KAAK,CAACgB,QAAQ,CAACJ,OAAO,CAAC;EAEvD,MAAM;IAAEQ,MAAM;IAAEC;EAAM,CAAC,GAAGtB,QAAQ,CAAC,CAAC;EAEpCC,KAAK,CAACsB,SAAS,CAAC,MAAM;IACpB,IAAI,CAACJ,QAAQ,EAAE;MACb;IACF;IAEAjB,QAAQ,CAACsB,MAAM,CAACR,OAAO,EAAE;MACvBS,OAAO,EAAEZ,OAAO,GAAG,CAAC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AI;MACZoC,QAAQ,EAAEpC,IAAI;MACdE,OAAO;MACPc,eAAe;MACfO,QAAQ;MACRD,YAAY;MACZe,WAAW,EAAE;IACf,CAAC,EACD7B,KAAK,CAAC8B,OAAO,EACbC,MAAM,CAACC,SAAS,EAChBtB,SAAS,CACT;IAAA,GACEjB,IAAI;IAAAJ,QAAA,EAEPA;EAAQ,CACI,CAAC;AAEpB;AAEA,MAAM0C,MAAM,GAAGjD,UAAU,CAACmD,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,SAAS,EAAE,UAAU;IACrBC,SAAS,EAAE,QAAQ;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ import * as React from 'react';
4
+ import { Animated, Platform, StyleSheet, View } from 'react-native';
5
+ import { getBlurBackgroundColor } from "./getBlurBackgroundColor.js";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ /**
8
+ * Component to use as a background to provide apple-style blur effect.
9
+ *
10
+ * Only supported on web. Falls back to a regular `View` on other platforms.
11
+ */
12
+ export function BlurEffectBackground({
13
+ blurEffect,
14
+ style,
15
+ children,
16
+ ...rest
17
+ }) {
18
+ let containerStyle, blurStyle, blurBackground, colorBackground;
19
+ if (Platform.OS === 'web' && blurEffect && blurEffect !== 'none') {
20
+ const blurBackgroundColor = getBlurBackgroundColor(blurEffect);
21
+ if (blurBackgroundColor) {
22
+ const backdropFilter = `saturate(180%) blur(30px)`;
23
+ blurStyle = {
24
+ // @ts-expect-error backdropFilter is web-only
25
+ backdropFilter,
26
+ webkitBackdropFilter: backdropFilter
27
+ };
28
+ blurBackground = /*#__PURE__*/_jsx("div", {
29
+ style: {
30
+ position: 'absolute',
31
+ left: 0,
32
+ right: 0,
33
+ top: 0,
34
+ bottom: 0,
35
+ zIndex: -1,
36
+ backgroundColor: blurBackgroundColor
37
+ }
38
+ });
39
+ const flattenedStyle = StyleSheet.flatten(style) || {};
40
+ containerStyle = [flattenedStyle, {
41
+ backgroundColor: 'transparent'
42
+ }];
43
+ colorBackground = 'backgroundColor' in flattenedStyle && flattenedStyle.backgroundColor !== 'transparent' ? /*#__PURE__*/_jsx(Animated.View, {
44
+ style: [StyleSheet.absoluteFill, {
45
+ zIndex: -1,
46
+ backgroundColor: flattenedStyle.backgroundColor
47
+ }]
48
+ }) : null;
49
+ }
50
+ } else {
51
+ containerStyle = style;
52
+ }
53
+ return /*#__PURE__*/_jsxs(View, {
54
+ style: [blurStyle, containerStyle],
55
+ ...rest,
56
+ children: [blurBackground, colorBackground, children]
57
+ });
58
+ }
59
+ //# sourceMappingURL=BlurEffectBackground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Animated","Platform","StyleSheet","View","getBlurBackgroundColor","jsx","_jsx","jsxs","_jsxs","BlurEffectBackground","blurEffect","style","children","rest","containerStyle","blurStyle","blurBackground","colorBackground","OS","blurBackgroundColor","backdropFilter","webkitBackdropFilter","position","left","right","top","bottom","zIndex","backgroundColor","flattenedStyle","flatten","absoluteFill"],"sourceRoot":"../../src","sources":["BlurEffectBackground.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,QAAQ,EAERC,UAAU,EACVC,IAAI,QAGC,cAAc;AAErB,SAEEC,sBAAsB,QACjB,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQlC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAC;EACnCC,UAAU;EACVC,KAAK;EACLC,QAAQ;EACR,GAAGC;AACE,CAAC,EAAE;EACR,IAAIC,cAAc,EAAEC,SAAS,EAAEC,cAAc,EAAEC,eAAe;EAE9D,IAAIhB,QAAQ,CAACiB,EAAE,KAAK,KAAK,IAAIR,UAAU,IAAIA,UAAU,KAAK,MAAM,EAAE;IAChE,MAAMS,mBAAmB,GAAGf,sBAAsB,CAACM,UAAU,CAAC;IAE9D,IAAIS,mBAAmB,EAAE;MACvB,MAAMC,cAAc,GAAG,2BAA2B;MAElDL,SAAS,GAAG;QACV;QACAK,cAAc;QACdC,oBAAoB,EAAED;MACxB,CAAC;MAEDJ,cAAc,gBACZV,IAAA;QACEK,KAAK,EAAE;UACLW,QAAQ,EAAE,UAAU;UACpBC,IAAI,EAAE,CAAC;UACPC,KAAK,EAAE,CAAC;UACRC,GAAG,EAAE,CAAC;UACNC,MAAM,EAAE,CAAC;UACTC,MAAM,EAAE,CAAC,CAAC;UACVC,eAAe,EAAET;QACnB;MAAE,CACH,CACF;MAED,MAAMU,cAAc,GAAG3B,UAAU,CAAC4B,OAAO,CAACnB,KAAK,CAAC,IAAI,CAAC,CAAC;MAEtDG,cAAc,GAAG,CAACe,cAAc,EAAE;QAAED,eAAe,EAAE;MAAc,CAAC,CAAC;MACrEX,eAAe,GACb,iBAAiB,IAAIY,cAAc,IACnCA,cAAc,CAACD,eAAe,KAAK,aAAa,gBAC9CtB,IAAA,CAACN,QAAQ,CAACG,IAAI;QACZQ,KAAK,EAAE,CACLT,UAAU,CAAC6B,YAAY,EACvB;UACEJ,MAAM,EAAE,CAAC,CAAC;UACVC,eAAe,EAAEC,cAAc,CAACD;QAClC,CAAC;MACD,CACH,CAAC,GACA,IAAI;IACZ;EACF,CAAC,MAAM;IACLd,cAAc,GAAGH,KAAK;EACxB;EAEA,oBACEH,KAAA,CAACL,IAAI;IAACQ,KAAK,EAAE,CAACI,SAAS,EAAED,cAAc,CAAE;IAAA,GAAKD,IAAI;IAAAD,QAAA,GAC/CI,cAAc,EACdC,eAAe,EACfL,QAAQ;EAAA,CACL,CAAC;AAEX","ignoreList":[]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  import { useLinkProps, useTheme } from '@react-navigation/native';
4
- import Color from 'color';
5
4
  import * as React from 'react';
6
5
  import { Platform, StyleSheet } from 'react-native';
6
+ import { Color } from "./Color.js";
7
7
  import { PlatformPressable } from "./PlatformPressable.js";
8
8
  import { Text } from "./Text.js";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -48,6 +48,7 @@ function ButtonBase({
48
48
  ...rest
49
49
  }) {
50
50
  const {
51
+ dark,
51
52
  colors,
52
53
  fonts
53
54
  } = useTheme();
@@ -60,25 +61,25 @@ function ButtonBase({
60
61
  textColor = color;
61
62
  break;
62
63
  case 'tinted':
63
- backgroundColor = Color(color).fade(0.85).string();
64
+ backgroundColor = Color(color)?.fade(0.85).string() ?? (dark ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.06)');
64
65
  textColor = color;
65
66
  break;
66
67
  case 'filled':
67
68
  backgroundColor = color;
68
- textColor = Color(color).isDark() ? 'white' : Color(color).darken(0.71).string();
69
+ textColor = Color(color)?.isDark() ? 'white' : Color(color)?.darken(0.71).string() ?? '#fff';
69
70
  break;
70
71
  }
71
72
  return /*#__PURE__*/_jsx(PlatformPressable, {
72
73
  ...rest,
73
74
  android_ripple: {
74
75
  radius: BUTTON_RADIUS,
75
- color: Color(textColor).fade(0.85).string(),
76
+ color: Color(textColor)?.fade(0.85).string() ?? 'rgba(0, 0, 0, 0.1)',
76
77
  ...android_ripple
77
78
  },
78
79
  pressOpacity: Platform.OS === 'ios' ? undefined : 1,
79
- hoverEffect: {
80
+ hoverEffect: typeof textColor === 'string' ? {
80
81
  color: textColor
81
- },
82
+ } : undefined,
82
83
  style: [{
83
84
  backgroundColor
84
85
  }, styles.button, style],
@@ -1 +1 @@
1
- {"version":3,"names":["useLinkProps","useTheme","Color","React","Platform","StyleSheet","PlatformPressable","Text","jsx","_jsx","BUTTON_RADIUS","Button","props","ButtonLink","ButtonBase","screen","params","action","href","rest","variant","color","customColor","android_ripple","style","children","colors","fonts","primary","backgroundColor","textColor","fade","string","isDark","darken","radius","pressOpacity","OS","undefined","hoverEffect","styles","button","regular","text","create","paddingHorizontal","paddingVertical","borderRad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AAM,EAAE;IACNI,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,YAAY,EAAErC,aAAa;IAC3BsC,WAAW,EAAE;EACf,CAAC;EACDL,IAAI,EAAE;IACJM,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,GAAG;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useLinkProps","useTheme","React","Platform","StyleSheet","Color","PlatformPressable","Text","jsx","_jsx","BUTTON_RADIUS","Button","props","ButtonLink","ButtonBase","screen","params","action","href","rest","variant","color","customColor","android_ripple","style","children","dark","colors","fonts","primary","backgroundColor","textColor","fade","string","isDark","darken","radius","pressOpacity","OS","undefined","hoverEffect","styles","button","regular","text","create","paddingHorizontal","paddingVertical","borderRadius","borderCurve","fontSize","lineHeight","letterSpacing","textAlign"],"sourceRoot":"../../src","sources":["Button.tsx"],"mappings":";;AAAA,SAGEA,YAAY,EACZC,QAAQ,QACH,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAA0BC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAEpE,SAASC,KAAK,QAAQ,YAAS;AAC/B,SACEC,iBAAiB,QAEZ,wBAAqB;AAC5B,SAASC,IAAI,QAAQ,WAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAa9B,MAAMC,aAAa,GAAG,EAAE;AASxB,OAAO,SAASC,MAAMA,CAGpBC,KAA8D,EAAE;EAChE,IAAI,QAAQ,IAAIA,KAAK,IAAI,QAAQ,IAAIA,KAAK,EAAE;IAC1C;IACA,oBAAOH,IAAA,CAACI,UAAU;MAAA,GAAKD;IAAK,CAAG,CAAC;EAClC,CAAC,MAAM;IACL,oBAAOH,IAAA,CAACK,UAAU;MAAA,GAAKF;IAAK,CAAG,CAAC;EAClC;AACF;AAEA,SAASC,UAAUA,CAGjB;EACAE,MAAM;EACNC,MAAM;EACNC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AEhB,KAAK,CAAC0B,SAAS,CAAC,EAAEC,IAAI,CAAC,IAAI,CAAC,CAACC,MAAM,CAAC,CAAC,IAAI,oBAAoB;MACpE,GAAGV;IACL,CAAE;IACFc,YAAY,EAAElC,QAAQ,CAACmC,EAAE,KAAK,KAAK,GAAGC,SAAS,GAAG,CAAE;IACpDC,WAAW,EACT,OAAOT,SAAS,KAAK,QAAQ,GAAG;MAAEV,KAAK,EAAEU;IAAU,CAAC,GAAGQ,SACxD;IACDf,KAAK,EAAE,CAAC;MAAEM;IAAgB,CAAC,EAAEW,MAAM,CAACC,MAAM,EAAElB,KAAK,CAAE;IAAAC,QAAA,eAEnDhB,IAAA,CAACF,IAAI;MAACiB,KAAK,EAAE,CAAC;QAAEH,KAAK,EAAEU;MAAU,CAAC,EAAEH,KAAK,CAACe,OAAO,EAAEF,MAAM,CAACG,IAAI,CAAE;MAAAnB,QAAA,EAC7DA;IAAQ,CACL;EAAC,CACU,CAAC;AAExB;AAEA,MAAMgB,MAAM,GAAGrC,UAAU,CAACyC,MAAM,CAAC;EAC/BH,MAAM,EAAE;IACNI,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,YAAY,EAAEtC,aAAa;IAC3BuC,WAAW,EAAE;EACf,CAAC;EACDL,IAAI,EAAE;IACJM,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,GAAG;IAClBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ // eslint-disable-next-line no-restricted-imports
4
+ import OriginalColor from 'color';
5
+ export function Color(value) {
6
+ if (typeof value === 'string' && !value.startsWith('var(')) {
7
+ return OriginalColor(value);
8
+ }
9
+ return undefined;
10
+ }
11
+ //# sourceMappingURL=Color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["OriginalColor","Color","value","startsWith","undefined"],"sourceRoot":"../../src","sources":["Color.tsx"],"mappings":";;AAAA;AACA,OAAOA,aAAa,MAAM,OAAO;AAajC,OAAO,SAASC,KAAKA,CAACC,KAAiB,EAAyB;EAC9D,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACA,KAAK,CAACC,UAAU,CAAC,MAAM,CAAC,EAAE;IAC1D,OAAOH,aAAa,CAACE,KAAK,CAAC;EAC7B;EAEA,OAAOE,SAAS;AAClB","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ import { Platform, View } from 'react-native';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export function Container({
6
+ inert,
7
+ children,
8
+ style
9
+ }) {
10
+ if (Platform.OS === 'web') {
11
+ return /*#__PURE__*/_jsx("div", {
12
+ inert: inert,
13
+ "aria-hidden": inert,
14
+ style: {
15
+ ...DEFAULT_STYLE,
16
+ ...style
17
+ },
18
+ children: children
19
+ });
20
+ }
21
+ return /*#__PURE__*/_jsx(View, {
22
+ "aria-hidden": inert,
23
+ style: [{
24
+ pointerEvents: inert ? 'none' : 'box-none'
25
+ }, style],
26
+ collapsable: false,
27
+ children: children
28
+ });
29
+ }
30
+ const DEFAULT_STYLE = {
31
+ display: 'flex',
32
+ alignContent: 'flex-start',
33
+ alignItems: 'stretch',
34
+ boxSizing: 'border-box',
35
+ flexBasis: 'auto',
36
+ flexDirection: 'column',
37
+ flexShrink: 0,
38
+ minHeight: 0,
39
+ minWidth: 0,
40
+ position: 'relative'
41
+ };
42
+ //# sourceMappingURL=Container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","View","jsx","_jsx","Container","inert","children","style","OS","DEFAULT_STYLE","pointerEvents","collapsable","display","alignContent","alignItems","boxSizing","flexBasis","flexDirection","flexShrink","minHeight","minWidth","position"],"sourceRoot":"../../src","sources":["Container.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,IAAI,QAAwB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQ9D,OAAO,SAASC,SAASA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAa,CAAC,EAAE;EAC3D,IAAIP,QAAQ,CAACQ,EAAE,KAAK,KAAK,EAAE;IACzB,oBACEL,IAAA;MACEE,KAAK,EAAEA,KAAM;MACb,eAAaA,KAAM;MACnBE,KAAK,EAAE;QAAE,GAAGE,aAAa;QAAE,GAAGF;MAAM,CAAE;MAAAD,QAAA,EAErCA;IAAQ,CACN,CAAC;EAEV;EAEA,oBACEH,IAAA,CAACF,IAAI;IACH,eAAaI,KAAM;IACnBE,KAAK,EAAE,CAAC;MAAEG,aAAa,EAAEL,KAAK,GAAG,MAAM,GAAG;IAAW,CAAC,EAAEE,KAAK,CAAE;IAC/DI,WAAW,EAAE,KAAM;IAAAL,QAAA,EAElBA;EAAQ,CACL,CAAC;AAEX;AAEA,MAAMG,aAAa,GAAG;EACpBG,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,YAAY;EAC1BC,UAAU,EAAE,SAAS;EACrBC,SAAS,EAAE,YAAY;EACvBC,SAAS,EAAE,MAAM;EACjBC,aAAa,EAAE,QAAQ;EACvBC,UAAU,EAAE,CAAC;EACbC,SAAS,EAAE,CAAC;EACZC,QAAQ,EAAE,CAAC;EACXC,QAAQ,EAAE;AACZ,CAAwC","ignoreList":[]}
@@ -1,24 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  import { useNavigation, useTheme } from '@react-navigation/native';
4
- import Color from 'color';
5
4
  import * as React from 'react';
6
- import { Animated, Platform, StyleSheet, View } from 'react-native';
5
+ import { Animated, Easing, Platform, StyleSheet, View } from 'react-native';
7
6
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
8
7
  import searchIcon from '../assets/search-icon.png';
8
+ import { Color } from "../Color.js";
9
+ import { isLiquidGlassSupported } from '../LiquidGlassView';
10
+ import { PlatformColor } from '../PlatformColor';
9
11
  import { useFrameSize } from "../useFrameSize.js";
10
12
  import { getDefaultHeaderHeight } from "./getDefaultHeaderHeight.js";
11
13
  import { HeaderBackButton } from "./HeaderBackButton.js";
12
14
  import { HeaderBackground } from "./HeaderBackground.js";
13
- import { HeaderButton } from "./HeaderButton.js";
15
+ import { BUTTON_SIZE, BUTTON_SPACING, HeaderButton } from "./HeaderButton.js";
16
+ import { HeaderButtonBackground } from "./HeaderButtonBackground.js";
14
17
  import { HeaderIcon } from "./HeaderIcon.js";
15
18
  import { HeaderSearchBar } from "./HeaderSearchBar.js";
16
19
  import { HeaderShownContext } from "./HeaderShownContext.js";
17
20
  import { HeaderTitle } from "./HeaderTitle.js";
18
-
19
- // Width of the screen in split layout on portrait mode on iPad Mini
20
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
21
- const IPAD_MINI_MEDIUM_WIDTH = 414;
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ const STATUS_BAR_OFFSET = Platform.select({
23
+ // The top inset on iOS is a bit less than the status bar height
24
+ ios: -7,
25
+ default: 0
26
+ });
22
27
  const warnIfHeaderStylesDefined = styles => {
23
28
  Object.keys(styles).forEach(styleProp => {
24
29
  const value = styles[styleProp];
@@ -29,33 +34,16 @@ const warnIfHeaderStylesDefined = styles => {
29
34
  }
30
35
  });
31
36
  };
37
+ const useNativeDriver = Platform.OS !== 'web';
32
38
  export function Header(props) {
33
39
  const insets = useSafeAreaInsets();
34
- const frame = useFrameSize(size => size, true);
35
40
  const {
36
41
  colors
37
42
  } = useTheme();
38
43
  const navigation = useNavigation();
39
44
  const isParentHeaderShown = React.useContext(HeaderShownContext);
40
45
  const [searchBarVisible, setSearchBarVisible] = React.useState(false);
41
- const [titleLayout, setTitleLayout] = React.useState(undefined);
42
- const onTitleLayout = e => {
43
- const {
44
- height,
45
- width
46
- } = e.nativeEvent.layout;
47
- setTitleLayout(titleLayout => {
48
- if (titleLayout && height === titleLayout.height && width === titleLayout.width) {
49
- return titleLayout;
50
- }
51
- return {
52
- height,
53
- width
54
- };
55
- });
56
- };
57
46
  const {
58
- layout = frame,
59
47
  modal = false,
60
48
  back,
61
49
  title,
@@ -68,13 +56,14 @@ export function Header(props) {
68
56
  headerTransparent,
69
57
  headerTintColor,
70
58
  headerBackground,
59
+ headerBlurEffect,
71
60
  headerRight,
72
61
  headerTitleAllowFontScaling: titleAllowFontScaling,
73
62
  headerTitleStyle: titleStyle,
74
63
  headerLeftContainerStyle: leftContainerStyle,
75
64
  headerRightContainerStyle: rightContainerStyle,
76
65
  headerTitleContainerStyle: titleContainerStyle,
77
- headerBackButtonDisplayMode = Platform.OS === 'ios' ? 'default' : 'minimal',
66
+ headerBackButtonDisplayMode = Platform.OS !== 'ios' || isLiquidGlassSupported ? 'minimal' : 'default',
78
67
  headerBackTitleStyle,
79
68
  headerBackgroundContainerStyle: backgroundContainerStyle,
80
69
  headerStyle: customHeaderStyle,
@@ -83,7 +72,11 @@ export function Header(props) {
83
72
  headerPressOpacity,
84
73
  headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top
85
74
  } = props;
86
- const defaultHeight = getDefaultHeaderHeight(layout, modal, headerStatusBarHeight);
75
+ const defaultHeight = useFrameSize(frame => getDefaultHeaderHeight({
76
+ landscape: frame.width > frame.height,
77
+ modalPresentation: modal,
78
+ topInset: headerStatusBarHeight
79
+ }));
87
80
  const {
88
81
  height = defaultHeight,
89
82
  maxHeight,
@@ -218,7 +211,7 @@ export function Header(props) {
218
211
  ...safeStyles
219
212
  };
220
213
  const iconTintColor = headerTintColor ?? Platform.select({
221
- ios: colors.primary,
214
+ ios: isLiquidGlassSupported && PlatformColor ? PlatformColor('label') : colors.primary,
222
215
  default: colors.text
223
216
  });
224
217
  const leftButton = headerLeft ? headerLeft({
@@ -226,8 +219,6 @@ export function Header(props) {
226
219
  pressColor: headerPressColor,
227
220
  pressOpacity: headerPressOpacity,
228
221
  displayMode: headerBackButtonDisplayMode,
229
- titleLayout,
230
- screenLayout: layout,
231
222
  canGoBack: Boolean(back),
232
223
  onPress: back ? navigation.goBack : undefined,
233
224
  label: back?.title,
@@ -243,9 +234,50 @@ export function Header(props) {
243
234
  const headerTitle = typeof customTitle !== 'function' ? props => /*#__PURE__*/_jsx(HeaderTitle, {
244
235
  ...props
245
236
  }) : customTitle;
237
+ const buttonMinWidth = headerTitleAlign === 'center' && (leftButton || rightButton) ? BUTTON_SIZE : 0;
238
+ const [searchBarRendered, setSearchBarRendered] = React.useState(searchBarVisible);
239
+ const searchBarVisibleRef = React.useRef(searchBarVisible);
240
+ const [searchBarVisibleAnim] = React.useState(() => new Animated.Value(searchBarVisible ? 1 : 0));
241
+ if (searchBarVisible && !searchBarRendered) {
242
+ setSearchBarRendered(true);
243
+ }
244
+ React.useEffect(() => {
245
+ // Avoid act warning in tests just by rendering header
246
+ if (searchBarVisible === searchBarVisibleRef.current) {
247
+ return;
248
+ }
249
+ Animated.timing(searchBarVisibleAnim, {
250
+ toValue: searchBarVisible ? 1 : 0,
251
+ duration: 150,
252
+ useNativeDriver,
253
+ easing: Easing.in(Easing.linear)
254
+ }).start(({
255
+ finished
256
+ }) => {
257
+ if (finished) {
258
+ setSearchBarRendered(searchBarVisible);
259
+ searchBarVisibleRef.current = searchBarVisible;
260
+ }
261
+ });
262
+ return () => {
263
+ searchBarVisibleAnim.stopAnimation();
264
+ };
265
+ }, [searchBarVisible, searchBarVisibleAnim]);
266
+ const headerOpacity = searchBarVisibleAnim.interpolate({
267
+ inputRange: [0, 1],
268
+ outputRange: [1, 0]
269
+ });
270
+ const searchBarOpacity = searchBarVisibleAnim.interpolate({
271
+ inputRange: [0, 1],
272
+ outputRange: [
273
+ // FIXME: Liquid glass views don't work properly with `opacity: 0`
274
+ // So we use a small value instead to workaround this issue.
275
+ 0.1, 1]
276
+ });
277
+ const statusBarSpacing = Math.max(headerStatusBarHeight + STATUS_BAR_OFFSET, 0);
246
278
  return /*#__PURE__*/_jsxs(Animated.View, {
247
- pointerEvents: "box-none",
248
279
  style: [{
280
+ pointerEvents: 'box-none',
249
281
  height,
250
282
  minHeight,
251
283
  maxHeight,
@@ -253,53 +285,46 @@ export function Header(props) {
253
285
  transform
254
286
  }],
255
287
  children: [/*#__PURE__*/_jsx(Animated.View, {
256
- pointerEvents: "box-none",
257
- style: [StyleSheet.absoluteFill, backgroundContainerStyle],
288
+ style: [styles.background, backgroundContainerStyle],
258
289
  children: headerBackground ? headerBackground({
259
290
  style: backgroundStyle
260
291
  }) : /*#__PURE__*/_jsx(HeaderBackground, {
261
- pointerEvents:
262
- // Allow touch through the header when background color is transparent
263
- headerTransparent && (backgroundStyle.backgroundColor === 'transparent' || Color(backgroundStyle.backgroundColor).alpha() === 0) ? 'none' : 'auto',
264
- style: backgroundStyle
292
+ blurEffect: headerBlurEffect,
293
+ style: [{
294
+ // Allow touch through the header when background color is transparent
295
+ pointerEvents: headerTransparent && backgroundStyle.backgroundColor && (backgroundStyle.backgroundColor === 'transparent' || Color(backgroundStyle.backgroundColor)?.alpha() === 0) ? 'none' : 'auto'
296
+ }, backgroundStyle]
265
297
  })
266
- }), /*#__PURE__*/_jsx(View, {
267
- pointerEvents: "none",
268
- style: {
269
- height: headerStatusBarHeight
270
- }
271
- }), /*#__PURE__*/_jsxs(View, {
272
- pointerEvents: "box-none",
273
- style: [styles.content, Platform.OS === 'ios' && frame.width >= IPAD_MINI_MEDIUM_WIDTH ? styles.large : null],
274
- children: [/*#__PURE__*/_jsx(Animated.View, {
275
- pointerEvents: "box-none",
276
- style: [styles.start, !searchBarVisible && headerTitleAlign === 'center' && styles.expand, {
298
+ }), /*#__PURE__*/_jsxs(Animated.View, {
299
+ style: [styles.content, {
300
+ pointerEvents: searchBarVisible ? 'none' : 'auto',
301
+ marginTop: statusBarSpacing,
302
+ opacity: headerOpacity
303
+ }],
304
+ children: [/*#__PURE__*/_jsx(View, {
305
+ style: [styles.start, headerTitleAlign === 'center' ? styles.expand : styles.shrink, {
306
+ minWidth: buttonMinWidth,
277
307
  marginStart: insets.left
278
- }, leftContainerStyle],
279
- children: leftButton
280
- }), Platform.OS === 'ios' || !searchBarVisible ? /*#__PURE__*/_jsxs(_Fragment, {
281
- children: [/*#__PURE__*/_jsx(Animated.View, {
282
- pointerEvents: "box-none",
283
- style: [styles.title, {
284
- // Avoid the title from going offscreen or overlapping buttons
285
- maxWidth: headerTitleAlign === 'center' ? layout.width - ((leftButton ? headerBackButtonDisplayMode !== 'minimal' ? 80 : 32 : 16) + (rightButton || headerSearchBarOptions ? 16 : 0) + Math.max(insets.left, insets.right)) * 2 : layout.width - ((leftButton ? 52 : 16) + (rightButton || headerSearchBarOptions ? 52 : 16) + insets.left - insets.right)
286
- }, headerTitleAlign === 'left' && leftButton ? {
287
- marginStart: 4
288
- } : {
289
- marginHorizontal: 16
290
- }, titleContainerStyle],
291
- children: headerTitle({
292
- children: title,
293
- allowFontScaling: titleAllowFontScaling,
294
- tintColor: headerTintColor,
295
- onLayout: onTitleLayout,
296
- style: titleStyle
297
- })
298
- }), /*#__PURE__*/_jsxs(Animated.View, {
299
- pointerEvents: "box-none",
300
- style: [styles.end, styles.expand, {
301
- marginEnd: insets.right
302
- }, rightContainerStyle],
308
+ }],
309
+ children: /*#__PURE__*/_jsx(HeaderButtonBackground, {
310
+ style: [styles.buttonContainer, leftContainerStyle],
311
+ children: leftButton
312
+ })
313
+ }), /*#__PURE__*/_jsx(Animated.View, {
314
+ style: [styles.title, !leftButton && styles.titleStart, titleContainerStyle],
315
+ children: headerTitle({
316
+ children: title,
317
+ allowFontScaling: titleAllowFontScaling,
318
+ tintColor: headerTintColor,
319
+ style: [styles.titleText, titleStyle]
320
+ })
321
+ }), /*#__PURE__*/_jsx(View, {
322
+ style: [styles.end, styles.expand, {
323
+ minWidth: buttonMinWidth,
324
+ marginEnd: insets.right
325
+ }],
326
+ children: /*#__PURE__*/_jsxs(HeaderButtonBackground, {
327
+ style: [styles.buttonContainer, rightContainerStyle],
303
328
  children: [rightButton, headerSearchBarOptions ? /*#__PURE__*/_jsx(HeaderButton, {
304
329
  tintColor: iconTintColor,
305
330
  pressColor: headerPressColor,
@@ -313,51 +338,81 @@ export function Header(props) {
313
338
  tintColor: iconTintColor
314
339
  })
315
340
  }) : null]
316
- })]
317
- }) : null, Platform.OS === 'ios' || searchBarVisible ? /*#__PURE__*/_jsx(HeaderSearchBar, {
318
- ...headerSearchBarOptions,
319
- visible: searchBarVisible,
320
- onClose: () => {
321
- setSearchBarVisible(false);
322
- headerSearchBarOptions?.onClose?.();
323
- },
324
- tintColor: headerTintColor,
325
- style: [Platform.OS === 'ios' ? [StyleSheet.absoluteFill, {
326
- paddingTop: headerStatusBarHeight ? 0 : 4
327
- }, {
328
- backgroundColor: backgroundColor ?? colors.card
329
- }] : !leftButton && {
330
- marginStart: 8
331
- }]
332
- }) : null]
333
- })]
341
+ })
342
+ })]
343
+ }), searchBarRendered ? /*#__PURE__*/_jsx(HeaderSearchBar, {
344
+ ...headerSearchBarOptions,
345
+ statusBarHeight: statusBarSpacing,
346
+ visible: searchBarVisible,
347
+ onClose: () => {
348
+ setSearchBarVisible(false);
349
+ headerSearchBarOptions?.onClose?.();
350
+ },
351
+ tintColor: headerTintColor,
352
+ style: [StyleSheet.absoluteFill, {
353
+ opacity: searchBarOpacity
354
+ }]
355
+ }) : null]
334
356
  });
335
357
  }
358
+ const BUTTON_OFFSET = Platform.OS === 'ios' ? 10 : 4;
359
+ const TITLE_START_OFFSET = Platform.OS === 'ios' ? 0 :
360
+ // Since button container is always present,
361
+ // We need to account for its horizontal margin as well
362
+ 16 - BUTTON_OFFSET * 2;
336
363
  const styles = StyleSheet.create({
337
364
  content: {
365
+ pointerEvents: 'box-none',
338
366
  flex: 1,
339
367
  flexDirection: 'row',
340
368
  alignItems: 'stretch'
341
369
  },
342
- large: {
343
- marginHorizontal: 5
344
- },
345
370
  title: {
346
- justifyContent: 'center'
371
+ flexShrink: 1,
372
+ minWidth: 0,
373
+ justifyContent: 'center',
374
+ pointerEvents: 'box-none',
375
+ // Make sure title goes below liquid glass buttons
376
+ zIndex: -1
377
+ },
378
+ titleStart: {
379
+ marginLeft: TITLE_START_OFFSET
380
+ },
381
+ titleText: {
382
+ textAlign: 'center'
383
+ },
384
+ buttonContainer: {
385
+ flexDirection: 'row',
386
+ pointerEvents: 'box-none',
387
+ gap: BUTTON_SPACING,
388
+ marginHorizontal: BUTTON_OFFSET
347
389
  },
348
390
  start: {
349
391
  flexDirection: 'row',
350
392
  alignItems: 'center',
351
- justifyContent: 'flex-start'
393
+ justifyContent: 'flex-start',
394
+ pointerEvents: 'box-none'
352
395
  },
353
396
  end: {
354
397
  flexDirection: 'row',
355
398
  alignItems: 'center',
356
- justifyContent: 'flex-end'
399
+ justifyContent: 'flex-end',
400
+ pointerEvents: 'box-none'
357
401
  },
358
402
  expand: {
359
403
  flexGrow: 1,
404
+ flexShrink: 1,
360
405
  flexBasis: 0
406
+ },
407
+ shrink: {
408
+ flexGrow: 0,
409
+ flexShrink: 1,
410
+ minWidth: 0,
411
+ maxWidth: '50%'
412
+ },
413
+ background: {
414
+ ...StyleSheet.absoluteFillObject,
415
+ pointerEvents: 'box-none'
361
416
  }
362
417
  });
363
418
  //# sourceMappingURL=Header.js.map