react-native-collapsible-sticky-header 0.0.0-stage → 0.1.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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +569 -2
  3. package/lib/commonjs/Badge.js +65 -0
  4. package/lib/commonjs/Badge.js.map +1 -0
  5. package/lib/commonjs/CollapsibleStickyHeaderScreen.js +386 -0
  6. package/lib/commonjs/CollapsibleStickyHeaderScreen.js.map +1 -0
  7. package/lib/commonjs/HeaderGreeting.js +122 -0
  8. package/lib/commonjs/HeaderGreeting.js.map +1 -0
  9. package/lib/commonjs/HeaderNavBar.js +219 -0
  10. package/lib/commonjs/HeaderNavBar.js.map +1 -0
  11. package/lib/commonjs/ImageOrNode.js +40 -0
  12. package/lib/commonjs/ImageOrNode.js.map +1 -0
  13. package/lib/commonjs/animations.js +34 -0
  14. package/lib/commonjs/animations.js.map +1 -0
  15. package/lib/commonjs/index.js +122 -0
  16. package/lib/commonjs/index.js.map +1 -0
  17. package/lib/commonjs/optionalGradient.js +24 -0
  18. package/lib/commonjs/optionalGradient.js.map +1 -0
  19. package/lib/commonjs/package.json +1 -0
  20. package/lib/commonjs/theme.js +93 -0
  21. package/lib/commonjs/theme.js.map +1 -0
  22. package/lib/commonjs/types.js +6 -0
  23. package/lib/commonjs/types.js.map +1 -0
  24. package/lib/commonjs/useStickyHeader.js +143 -0
  25. package/lib/commonjs/useStickyHeader.js.map +1 -0
  26. package/lib/commonjs/utils.js +90 -0
  27. package/lib/commonjs/utils.js.map +1 -0
  28. package/lib/module/Badge.js +61 -0
  29. package/lib/module/Badge.js.map +1 -0
  30. package/lib/module/CollapsibleStickyHeaderScreen.js +379 -0
  31. package/lib/module/CollapsibleStickyHeaderScreen.js.map +1 -0
  32. package/lib/module/HeaderGreeting.js +118 -0
  33. package/lib/module/HeaderGreeting.js.map +1 -0
  34. package/lib/module/HeaderNavBar.js +215 -0
  35. package/lib/module/HeaderNavBar.js.map +1 -0
  36. package/lib/module/ImageOrNode.js +36 -0
  37. package/lib/module/ImageOrNode.js.map +1 -0
  38. package/lib/module/animations.js +28 -0
  39. package/lib/module/animations.js.map +1 -0
  40. package/lib/module/index.js +11 -0
  41. package/lib/module/index.js.map +1 -0
  42. package/lib/module/optionalGradient.js +20 -0
  43. package/lib/module/optionalGradient.js.map +1 -0
  44. package/lib/module/package.json +1 -0
  45. package/lib/module/theme.js +88 -0
  46. package/lib/module/theme.js.map +1 -0
  47. package/lib/module/types.js +4 -0
  48. package/lib/module/types.js.map +1 -0
  49. package/lib/module/useStickyHeader.js +138 -0
  50. package/lib/module/useStickyHeader.js.map +1 -0
  51. package/lib/module/utils.js +78 -0
  52. package/lib/module/utils.js.map +1 -0
  53. package/lib/typescript/commonjs/package.json +1 -0
  54. package/lib/typescript/commonjs/src/Badge.d.ts +20 -0
  55. package/lib/typescript/commonjs/src/Badge.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/src/CollapsibleStickyHeaderScreen.d.ts +10 -0
  57. package/lib/typescript/commonjs/src/CollapsibleStickyHeaderScreen.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/HeaderGreeting.d.ts +33 -0
  59. package/lib/typescript/commonjs/src/HeaderGreeting.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/src/HeaderNavBar.d.ts +48 -0
  61. package/lib/typescript/commonjs/src/HeaderNavBar.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/ImageOrNode.d.ts +16 -0
  63. package/lib/typescript/commonjs/src/ImageOrNode.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/src/animations.d.ts +9 -0
  65. package/lib/typescript/commonjs/src/animations.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/src/index.d.ts +10 -0
  67. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/optionalGradient.d.ts +13 -0
  69. package/lib/typescript/commonjs/src/optionalGradient.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/src/theme.d.ts +81 -0
  71. package/lib/typescript/commonjs/src/theme.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/src/types.d.ts +244 -0
  73. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/src/useStickyHeader.d.ts +12 -0
  75. package/lib/typescript/commonjs/src/useStickyHeader.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/src/utils.d.ts +30 -0
  77. package/lib/typescript/commonjs/src/utils.d.ts.map +1 -0
  78. package/lib/typescript/module/package.json +1 -0
  79. package/lib/typescript/module/src/Badge.d.ts +20 -0
  80. package/lib/typescript/module/src/Badge.d.ts.map +1 -0
  81. package/lib/typescript/module/src/CollapsibleStickyHeaderScreen.d.ts +10 -0
  82. package/lib/typescript/module/src/CollapsibleStickyHeaderScreen.d.ts.map +1 -0
  83. package/lib/typescript/module/src/HeaderGreeting.d.ts +33 -0
  84. package/lib/typescript/module/src/HeaderGreeting.d.ts.map +1 -0
  85. package/lib/typescript/module/src/HeaderNavBar.d.ts +48 -0
  86. package/lib/typescript/module/src/HeaderNavBar.d.ts.map +1 -0
  87. package/lib/typescript/module/src/ImageOrNode.d.ts +16 -0
  88. package/lib/typescript/module/src/ImageOrNode.d.ts.map +1 -0
  89. package/lib/typescript/module/src/animations.d.ts +9 -0
  90. package/lib/typescript/module/src/animations.d.ts.map +1 -0
  91. package/lib/typescript/module/src/index.d.ts +10 -0
  92. package/lib/typescript/module/src/index.d.ts.map +1 -0
  93. package/lib/typescript/module/src/optionalGradient.d.ts +13 -0
  94. package/lib/typescript/module/src/optionalGradient.d.ts.map +1 -0
  95. package/lib/typescript/module/src/theme.d.ts +81 -0
  96. package/lib/typescript/module/src/theme.d.ts.map +1 -0
  97. package/lib/typescript/module/src/types.d.ts +244 -0
  98. package/lib/typescript/module/src/types.d.ts.map +1 -0
  99. package/lib/typescript/module/src/useStickyHeader.d.ts +12 -0
  100. package/lib/typescript/module/src/useStickyHeader.d.ts.map +1 -0
  101. package/lib/typescript/module/src/utils.d.ts +30 -0
  102. package/lib/typescript/module/src/utils.d.ts.map +1 -0
  103. package/package.json +142 -4
@@ -0,0 +1,12 @@
1
+ import type { UseStickyHeaderOptions, UseStickyHeaderResult } from './types';
2
+ export declare const DEFAULT_STICKY_FADE_DISTANCE = 40;
3
+ export declare const DEFAULT_STICKY_POINTER_OFFSET = 20;
4
+ export declare const DEFAULT_COLLAPSE_TRANSLATE_Y = -12;
5
+ /**
6
+ * Scroll-driven state for a collapsing header with a sticky bar.
7
+ *
8
+ * All styles are computed on the UI thread. The hook only re-renders when the
9
+ * sticky state flips (and when the nav bar is first measured).
10
+ */
11
+ export declare function useStickyHeader(options?: UseStickyHeaderOptions): UseStickyHeaderResult;
12
+ //# sourceMappingURL=useStickyHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/useStickyHeader.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAQ7E,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CA2IvB"}
@@ -0,0 +1,30 @@
1
+ import type { ImageSourcePropType } from 'react-native';
2
+ import type { HeaderAction } from './types';
3
+ /** Counts above this render as `"{max}+"` unless overridden. */
4
+ export declare const DEFAULT_BADGE_MAX = 9;
5
+ /** The most icon buttons a header bar renders. */
6
+ export declare const MAX_HEADER_ACTIONS = 3;
7
+ /**
8
+ * Scroll offset at which the header is considered collapsed:
9
+ * `topInset + navBarHeight + offset`. Returns 0 while the nav bar has not
10
+ * been measured, which keeps the sticky bar hidden.
11
+ */
12
+ export declare function computeThreshold(navBarHeight: number, topInset: number, offset?: number): number;
13
+ /** 0 at the top, 1 once `scrollY` reaches the threshold. */
14
+ export declare function getCollapseProgress(scrollY: number, threshold: number): number;
15
+ /**
16
+ * 0 before `threshold - fadeDistance`, 1 at the threshold. A fade distance
17
+ * of 0 makes the transition instant.
18
+ */
19
+ export declare function getStickyProgress(scrollY: number, threshold: number, fadeDistance: number): number;
20
+ /** Whether the sticky bar should receive touches / be read by screen readers. */
21
+ export declare function isStickyAt(scrollY: number, threshold: number, pointerOffset: number): boolean;
22
+ export declare function isImageSource(value: unknown): value is ImageSourcePropType;
23
+ /** Drops hidden actions and keeps the first `MAX_HEADER_ACTIONS`. */
24
+ export declare function limitActions(actions: HeaderAction[] | undefined): {
25
+ actions: HeaderAction[];
26
+ overflow: number;
27
+ };
28
+ export declare function warnActionOverflow(overflow: number): void;
29
+ export declare function formatBadgeCount(count: number, max: number): string;
30
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,gEAAgE;AAChE,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAOpC;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAI,GACT,MAAM,CAIR;AAED,4DAA4D;AAC5D,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,MAAM,CAIR;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GACnB,MAAM,CAKR;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAGT;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAO1E;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,SAAS,GAAG;IACjE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAMA;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CASzD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnE"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,20 @@
1
+ import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
2
+ export type BadgeProps = {
3
+ count: number;
4
+ /** Counts above `max` render as `"{max}+"`. Default 9. */
5
+ max?: number;
6
+ color?: string;
7
+ textColor?: string;
8
+ borderColor?: string;
9
+ /** Border width. Default 1.5. */
10
+ borderWidth?: number;
11
+ /** Minimum width / height. Default 18. */
12
+ size?: number;
13
+ /** Render a badge for 0. Default false. */
14
+ showZero?: boolean;
15
+ style?: StyleProp<ViewStyle>;
16
+ textStyle?: StyleProp<TextStyle>;
17
+ testID?: string;
18
+ };
19
+ export declare const Badge: import("react").MemoExoticComponent<({ count, max, color, textColor, borderColor, borderWidth, size, showZero, style, textStyle, testID, }: BadgeProps) => import("react").JSX.Element | null>;
20
+ //# sourceMappingURL=Badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../../src/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,KAAK,8IAYf,UAAU,wCAqCX,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type ReactElement } from 'react';
2
+ import type { CollapsibleStickyHeaderScreenProps } from './types.js';
3
+ export declare const DEFAULT_BACKGROUND_OVERHANG = 60;
4
+ export declare const DEFAULT_FADE_HEIGHT = 60;
5
+ /**
6
+ * A scrollable screen with a hero header that collapses as you scroll, and a
7
+ * compact sticky bar that fades in once the expanded nav bar has scrolled away.
8
+ */
9
+ export declare function CollapsibleStickyHeaderScreen<ItemT = unknown, SectionT = unknown>(props: CollapsibleStickyHeaderScreenProps<ItemT, SectionT>): ReactElement;
10
+ //# sourceMappingURL=CollapsibleStickyHeaderScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapsibleStickyHeaderScreen.d.ts","sourceRoot":"","sources":["../../../../src/CollapsibleStickyHeaderScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EACV,kCAAkC,EAMnC,MAAM,YAAS,CAAC;AAQjB,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAoBtC;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,GAAG,OAAO,EACf,QAAQ,GAAG,OAAO,EAClB,KAAK,EAAE,kCAAkC,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,YAAY,CAqd1E"}
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ImageStyle, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
3
+ import { type StickyHeaderTheme, type StickyHeaderThemeOverrides } from './theme.js';
4
+ import type { ImageOrNode as ImageOrNodeValue } from './types.js';
5
+ export type HeaderGreetingProps = {
6
+ /** e.g. "Welcome back". */
7
+ greeting?: ReactNode;
8
+ /** e.g. the user's name. */
9
+ title?: ReactNode;
10
+ subtitle?: ReactNode;
11
+ /** Image source or any element (initials, icon...). */
12
+ avatar?: ImageOrNodeValue;
13
+ /** Default `'right'`. */
14
+ avatarPosition?: 'left' | 'right';
15
+ /** Default `theme.avatarSize` (44). */
16
+ avatarSize?: number;
17
+ onAvatarPress?: () => void;
18
+ /** Default "Profile". */
19
+ avatarAccessibilityLabel?: string;
20
+ greetingStyle?: StyleProp<TextStyle>;
21
+ titleStyle?: StyleProp<TextStyle>;
22
+ subtitleStyle?: StyleProp<TextStyle>;
23
+ avatarStyle?: StyleProp<ImageStyle | ViewStyle>;
24
+ theme?: StickyHeaderThemeOverrides;
25
+ resolvedTheme?: StickyHeaderTheme;
26
+ /** Rendered below the text block. */
27
+ children?: ReactNode;
28
+ style?: StyleProp<ViewStyle>;
29
+ testID?: string;
30
+ };
31
+ /** The default collapsible block: greeting, title, subtitle and an optional avatar. */
32
+ export declare const HeaderGreeting: import("react").MemoExoticComponent<({ greeting, title, subtitle, avatar, avatarPosition, avatarSize, onAvatarPress, avatarAccessibilityLabel, greetingStyle, titleStyle, subtitleStyle, avatarStyle, theme: themeOverrides, resolvedTheme, children, style, testID, }: HeaderGreetingProps) => import("react").JSX.Element>;
33
+ //# sourceMappingURL=HeaderGreeting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderGreeting.d.ts","sourceRoot":"","sources":["../../../../src/HeaderGreeting.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,YAAS,CAAC;AACjB,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG;IAChC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uDAAuD;IACvD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,yBAAyB;IACzB,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,yBAAyB;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,0BAA0B,CAAC;IACnC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAyBF,uFAAuF;AACvF,eAAO,MAAM,cAAc,0QAkBxB,mBAAmB,iCAmGpB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ImageStyle, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
3
+ import { type LogoDimensions, type StickyHeaderTheme, type StickyHeaderThemeOverrides } from './theme.js';
4
+ import type { HeaderAction, HeaderVariant, ImageOrNode as ImageOrNodeValue } from './types.js';
5
+ export type HeaderNavBarItem = 'logo' | 'title' | 'avatar' | 'actions';
6
+ export type HeaderNavBarProps = {
7
+ /** `'overlay'` sits on the hero background, `'solid'` is the sticky bar. */
8
+ variant?: HeaderVariant;
9
+ logo?: ImageOrNodeValue;
10
+ /** Defaults to the theme's `logoSize.expanded` / `logoSize.compact` for the variant. */
11
+ logoSize?: Partial<LogoDimensions>;
12
+ logoStyle?: StyleProp<ImageStyle | ViewStyle>;
13
+ logoAccessibilityLabel?: string;
14
+ onLogoPress?: () => void;
15
+ /** Text (or node) shown next to, or instead of, the logo. */
16
+ title?: ReactNode;
17
+ titleStyle?: StyleProp<TextStyle>;
18
+ /** Image source or element shown as a round avatar in the leading area. */
19
+ avatar?: ImageOrNodeValue;
20
+ /** Default `theme.avatarSizeCompact` (32) for `'solid'`, `theme.avatarSize` otherwise. */
21
+ avatarSize?: number;
22
+ avatarStyle?: StyleProp<ImageStyle | ViewStyle>;
23
+ onAvatarPress?: () => void;
24
+ /** Default "Profile". */
25
+ avatarAccessibilityLabel?: string;
26
+ /** Up to `MAX_HEADER_ACTIONS` icon buttons; extra ones are dropped with a dev warning. */
27
+ actions?: HeaderAction[];
28
+ /**
29
+ * Which items to render. Leading items (`logo`, `avatar`, `title`) appear
30
+ * left to right in the given order; `actions` always sit on the right.
31
+ * Default: everything that was passed, in the order logo, avatar, title, actions.
32
+ */
33
+ show?: HeaderNavBarItem[];
34
+ /** Overrides the theme's icon color for the variant. */
35
+ iconColor?: string;
36
+ /** Overrides the theme's `iconSize`. */
37
+ iconSize?: number;
38
+ /** Deep-merged over the default theme. */
39
+ theme?: StickyHeaderThemeOverrides;
40
+ /** Already-merged theme (used internally to skip merging). */
41
+ resolvedTheme?: StickyHeaderTheme;
42
+ /** Rendered between the title and the actions. */
43
+ children?: ReactNode;
44
+ style?: StyleProp<ViewStyle>;
45
+ testID?: string;
46
+ };
47
+ export declare const HeaderNavBar: import("react").MemoExoticComponent<({ variant, logo, logoSize, logoStyle, logoAccessibilityLabel, onLogoPress, title, titleStyle, avatar, avatarSize, avatarStyle, onAvatarPress, avatarAccessibilityLabel, actions, show, iconColor, iconSize, theme: themeOverrides, resolvedTheme, children, style, testID, }: HeaderNavBarProps) => import("react").JSX.Element>;
48
+ //# sourceMappingURL=HeaderNavBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeaderNavBar.d.ts","sourceRoot":"","sources":["../../../../src/HeaderNavBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAChC,MAAM,YAAS,CAAC;AACjB,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,IAAI,gBAAgB,EAChC,MAAM,YAAS,CAAC;AAQjB,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAIvE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,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
+ import { type ImageResizeMode, type ImageStyle, type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { ImageOrNode as ImageOrNodeValue } from './types.js';
4
+ type Props = {
5
+ value: ImageOrNodeValue;
6
+ /** Applied to the `Image`, or to the wrapper around a custom node. */
7
+ style?: StyleProp<ImageStyle | ViewStyle>;
8
+ accessibilityLabel?: string;
9
+ /** Default `'contain'` (logos). Use `'cover'` for round avatars. */
10
+ resizeMode?: ImageResizeMode;
11
+ testID?: string;
12
+ };
13
+ /** Renders an image source as an `Image`, anything else as-is. */
14
+ export declare function ImageOrNode({ value, style, accessibilityLabel, resizeMode, testID, }: Props): ReactNode;
15
+ export {};
16
+ //# sourceMappingURL=ImageOrNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageOrNode.d.ts","sourceRoot":"","sources":["../../../../src/ImageOrNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,YAAS,CAAC;AAG/D,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,gBAAgB,CAAC;IACxB,sEAAsE;IACtE,KAAK,CAAC,EAAE,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAC1C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,kBAAkB,EAClB,UAAsB,EACtB,MAAM,GACP,EAAE,KAAK,GAAG,SAAS,CA2BnB"}
@@ -0,0 +1,9 @@
1
+ import type { ProgressAnimation } from './types.js';
2
+ /** Default sticky bar animation: fade in. */
3
+ export declare const fadeStickyAnimation: ProgressAnimation;
4
+ /**
5
+ * Slides the sticky bar down from above while fading it in.
6
+ * @param distance How far above its resting place the bar starts. Default 120.
7
+ */
8
+ export declare function slideStickyAnimation(distance?: number): ProgressAnimation;
9
+ //# sourceMappingURL=animations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../../../src/animations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAEjD,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,EAAE,iBAGjC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,SAAM,GAAG,iBAAiB,CAQtE"}
@@ -0,0 +1,10 @@
1
+ export { CollapsibleStickyHeaderScreen } from './CollapsibleStickyHeaderScreen.js';
2
+ export { useStickyHeader, DEFAULT_COLLAPSE_TRANSLATE_Y, DEFAULT_STICKY_FADE_DISTANCE, DEFAULT_STICKY_POINTER_OFFSET, } from './useStickyHeader.js';
3
+ export { HeaderNavBar, type HeaderNavBarItem, type HeaderNavBarProps, } from './HeaderNavBar.js';
4
+ export { HeaderGreeting, type HeaderGreetingProps } from './HeaderGreeting.js';
5
+ export { Badge, type BadgeProps } from './Badge.js';
6
+ export { createTheme, defaultTheme, type DeepPartial, type LogoDimensions, type StickyHeaderTheme, type StickyHeaderThemeOverrides, } from './theme.js';
7
+ export { DEFAULT_BADGE_MAX, MAX_HEADER_ACTIONS, computeThreshold, getCollapseProgress, getStickyProgress, isStickyAt, } from './utils.js';
8
+ export { fadeStickyAnimation, slideStickyAnimation } from './animations.js';
9
+ export type * from './types.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAiC,CAAC;AAChF,OAAO,EACL,eAAe,EACf,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,mBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,YAAS,CAAC;AACjD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,GAChC,MAAM,YAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,GACX,MAAM,YAAS,CAAC;AACjB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAc,CAAC;AACzE,mBAAmB,YAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
+ export type LinearGradientLike = ComponentType<{
4
+ colors: readonly string[];
5
+ style?: StyleProp<ViewStyle>;
6
+ pointerEvents?: 'none';
7
+ }>;
8
+ /**
9
+ * Resolves `expo-linear-gradient` when it is installed. The require sits in a
10
+ * try/catch so Metro treats it as an optional dependency.
11
+ */
12
+ export declare function getLinearGradient(): LinearGradientLike | null;
13
+ //# sourceMappingURL=optionalGradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optionalGradient.d.ts","sourceRoot":"","sources":["../../../../src/optionalGradient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;IAC7C,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAIH;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,GAAG,IAAI,CAY7D"}
@@ -0,0 +1,81 @@
1
+ export type LogoDimensions = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ export type NavBarSpacing = {
6
+ paddingHorizontal: number;
7
+ paddingVertical: number;
8
+ };
9
+ export type StickyHeaderTheme = {
10
+ colors: {
11
+ /** Sticky (compact) bar background. */
12
+ stickyBg: string;
13
+ /** Header background when there is no image (or behind it). */
14
+ headerBg: string;
15
+ /** Icon color in the expanded ("overlay") bar. */
16
+ iconOverlay: string;
17
+ /** Icon color in the sticky ("solid") bar. */
18
+ iconSolid: string;
19
+ /** Background of the round icon hit area per variant. */
20
+ actionBgOverlay: string;
21
+ actionBgSolid: string;
22
+ badge: string;
23
+ badgeText: string;
24
+ badgeBorder: string;
25
+ greeting: string;
26
+ title: string;
27
+ subtitle: string;
28
+ stickyTitle: string;
29
+ /** Default fade from the header into the page. */
30
+ fade: [string, string];
31
+ shadow: string;
32
+ };
33
+ spacing: {
34
+ /** Horizontal padding of the collapsible block. */
35
+ horizontal: number;
36
+ /** Gap between action buttons. */
37
+ actionGap: number;
38
+ /** Gap between avatar and text. */
39
+ avatarGap: number;
40
+ /** Gap between the logo, avatar and title in the nav bar. */
41
+ leadingGap: number;
42
+ navBar: {
43
+ overlay: NavBarSpacing;
44
+ solid: NavBarSpacing;
45
+ };
46
+ };
47
+ radius: {
48
+ headerBottom: number;
49
+ };
50
+ /** Opacity of an action button while pressed. */
51
+ pressedOpacity: number;
52
+ iconSize: number;
53
+ /** Size of the round action hit area. */
54
+ actionSize: number;
55
+ avatarSize: number;
56
+ /** Avatar size in the sticky (compact) bar. */
57
+ avatarSizeCompact: number;
58
+ badgeSize: number;
59
+ logoSize: {
60
+ expanded: LogoDimensions;
61
+ compact: LogoDimensions;
62
+ };
63
+ typography: {
64
+ greetingSize: number;
65
+ titleSize: number;
66
+ subtitleSize: number;
67
+ stickyTitleSize: number;
68
+ };
69
+ };
70
+ export type DeepPartial<T> = {
71
+ [K in keyof T]?: T[K] extends readonly unknown[] ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K];
72
+ };
73
+ export type StickyHeaderThemeOverrides = DeepPartial<StickyHeaderTheme>;
74
+ /** Neutral defaults. Brand colors belong in your own theme. */
75
+ export declare const defaultTheme: StickyHeaderTheme;
76
+ /**
77
+ * Deep-merges one or more partial themes over the defaults. Arrays (such as
78
+ * `colors.fade`) are replaced, not merged.
79
+ */
80
+ export declare function createTheme(...overrides: Array<StickyHeaderThemeOverrides | undefined>): StickyHeaderTheme;
81
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/theme.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE;QACN,uCAAuC;QACvC,QAAQ,EAAE,MAAM,CAAC;QACjB,+DAA+D;QAC/D,QAAQ,EAAE,MAAM,CAAC;QACjB,kDAAkD;QAClD,WAAW,EAAE,MAAM,CAAC;QACpB,8CAA8C;QAC9C,SAAS,EAAE,MAAM,CAAC;QAClB,yDAAyD;QACzD,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,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EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,GAC5C,CAAC,CAAC,CAAC,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACjB,CAAC,CAAC,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAExE,+DAA+D;AAC/D,eAAO,MAAM,YAAY,EAAE,iBA+C1B,CAAC;AA0BF;;;GAGG;AACH,wBAAgB,WAAW,CACzB,GAAG,SAAS,EAAE,KAAK,CAAC,0BAA0B,GAAG,SAAS,CAAC,GAC1D,iBAAiB,CAKnB"}
@@ -0,0 +1,244 @@
1
+ import type { ComponentType, ReactNode, Ref } from 'react';
2
+ import type { FlatListProps, ImageSourcePropType, ImageStyle, LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent, ScrollViewProps, SectionListProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
3
+ import type { EasingFunction, SharedValue, useAnimatedStyle } from 'react-native-reanimated';
4
+ import type { EdgeInsets } from 'react-native-safe-area-context';
5
+ import type { StickyHeaderTheme, StickyHeaderThemeOverrides } from './theme.js';
6
+ /** Items the sticky (collapsed) bar can show. */
7
+ export type StickyContentItem = 'logo' | 'title' | 'avatar' | 'actions';
8
+ /** Which bar a nav bar / icon is being rendered in. */
9
+ export type HeaderVariant = 'overlay' | 'solid';
10
+ /** An image source (`require(...)`, `{ uri }`) or any React element. */
11
+ export type ImageOrNode = ImageSourcePropType | ReactNode;
12
+ /** The style returned by `useAnimatedStyle`. */
13
+ export type AnimatedViewStyle = ReturnType<typeof useAnimatedStyle>;
14
+ /** A plain style object returned from an animation worklet. */
15
+ export type AnimatedStyleResult = ViewStyle & Record<string, unknown>;
16
+ /**
17
+ * Builds a style from a 0→1 progress value. Runs on the UI thread, so the
18
+ * function MUST start with the `'worklet'` directive.
19
+ */
20
+ export type ProgressAnimation = (progress: number) => AnimatedStyleResult;
21
+ export type HeaderActionIconRenderer = (props: {
22
+ color: string;
23
+ size: number;
24
+ variant: HeaderVariant;
25
+ }) => ReactNode;
26
+ export type HeaderAction = {
27
+ /** Stable key for the action. */
28
+ key: string;
29
+ /** An element, or a function that receives the variant's color and size. */
30
+ icon: ReactNode | HeaderActionIconRenderer;
31
+ onPress: () => void;
32
+ /** Required: read by screen readers. */
33
+ accessibilityLabel: string;
34
+ accessibilityHint?: string;
35
+ /** Shows a count badge when > 0. */
36
+ badgeCount?: number;
37
+ /** Per-icon override of the theme's variant icon color. */
38
+ color?: string;
39
+ /** Per-icon override of the theme's `iconSize`. */
40
+ size?: number;
41
+ /** Style of the round hit area. */
42
+ style?: StyleProp<ViewStyle>;
43
+ /** Hidden actions are skipped and do not count towards the limit. */
44
+ hidden?: boolean;
45
+ /** Set to `false` to only show this action in the expanded bar. Default `true`. */
46
+ showInSticky?: boolean;
47
+ testID?: string;
48
+ };
49
+ export type ShadowStyle = Pick<ViewStyle, 'shadowColor' | 'shadowOpacity' | 'shadowRadius' | 'shadowOffset' | 'elevation'>;
50
+ export type EnteringAnimationConfig = {
51
+ /** Default 650ms. */
52
+ duration?: number;
53
+ /** Extra delay added for each following block. Default 70ms. */
54
+ stagger?: number;
55
+ /** Default `Easing.out(Easing.cubic)`. */
56
+ easing?: EasingFunction;
57
+ };
58
+ /** Context passed to the slot render props. */
59
+ export type HeaderSlotContext = {
60
+ /**
61
+ * 0→1 progress for the slot. For the expanded nav and the collapsible
62
+ * block this is the collapse progress; for the sticky nav it is the sticky
63
+ * bar's reveal progress.
64
+ */
65
+ progress: SharedValue<number>;
66
+ isSticky: boolean;
67
+ variant: HeaderVariant;
68
+ theme: StickyHeaderTheme;
69
+ insets: EdgeInsets;
70
+ /** Visible actions (already limited to `MAX_HEADER_ACTIONS`). */
71
+ actions: HeaderAction[];
72
+ };
73
+ export type BackgroundRenderContext = {
74
+ theme: StickyHeaderTheme;
75
+ insets: EdgeInsets;
76
+ collapseProgress: SharedValue<number>;
77
+ };
78
+ export type BackgroundFadeRenderContext = {
79
+ colors: [string, string];
80
+ height: number;
81
+ style: StyleProp<ViewStyle>;
82
+ };
83
+ export type UseStickyHeaderOptions = {
84
+ /** Added to the measured threshold (top inset + nav bar height). Default 0. */
85
+ thresholdOffset?: number;
86
+ /** Distance before the threshold over which the sticky bar fades in. Default 40. */
87
+ stickyFadeDistance?: number;
88
+ /** The sticky bar becomes touchable at `threshold - stickyPointerOffset`. Default 20. */
89
+ stickyPointerOffset?: number;
90
+ /** translateY applied to the collapsible block when fully collapsed. Default -12. */
91
+ collapseTranslateY?: number;
92
+ /** Worklet building the collapsible block's style from collapse progress. */
93
+ collapseAnimation?: ProgressAnimation;
94
+ /** Worklet building the sticky bar's style from its reveal progress. */
95
+ stickyAnimation?: ProgressAnimation;
96
+ /** Include the safe-area top inset in the threshold. Default true. */
97
+ respectSafeArea?: boolean;
98
+ /** Overrides the top inset read from `react-native-safe-area-context`. */
99
+ topInset?: number;
100
+ /** Overrides `useReducedMotion()`. */
101
+ reducedMotion?: boolean;
102
+ /** Called on the JS thread once per sticky transition. */
103
+ onStickyChange?: (isSticky: boolean) => void;
104
+ /**
105
+ * Plain JS `onScroll` listener. Note: providing it makes every scroll frame
106
+ * cross to the JS thread.
107
+ */
108
+ onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
109
+ };
110
+ export type UseStickyHeaderResult = {
111
+ /** Pass to the `onScroll` prop of an Animated scrollable. */
112
+ scrollHandler: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
113
+ scrollY: SharedValue<number>;
114
+ /** 0 until the nav bar has been measured. */
115
+ threshold: SharedValue<number>;
116
+ navBarHeight: SharedValue<number>;
117
+ collapseProgress: SharedValue<number>;
118
+ stickyProgress: SharedValue<number>;
119
+ collapseStyle: AnimatedViewStyle;
120
+ stickyStyle: AnimatedViewStyle;
121
+ isSticky: boolean;
122
+ /** Attach to the expanded nav bar's `onLayout`. */
123
+ onNavLayout: (event: LayoutChangeEvent) => void;
124
+ /** Worklet: feed a scroll offset manually (custom scrollables). */
125
+ updateScrollY: (y: number) => void;
126
+ topInset: number;
127
+ reducedMotion: boolean;
128
+ };
129
+ type ScrollableBase = {
130
+ /** Called through `runOnJS`; every scroll frame crosses to the JS thread. */
131
+ onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
132
+ };
133
+ export type HeaderFlatListProps<ItemT> = Omit<FlatListProps<ItemT>, 'onScroll' | 'ListHeaderComponent'> & ScrollableBase;
134
+ export type HeaderSectionListProps<ItemT, SectionT> = Omit<SectionListProps<ItemT, SectionT>, 'onScroll' | 'ListHeaderComponent'> & ScrollableBase;
135
+ export type HeaderScrollViewProps = Omit<ScrollViewProps, 'onScroll'> & ScrollableBase;
136
+ export type CollapsibleStickyHeaderBaseProps = {
137
+ backgroundImage?: ImageSourcePropType;
138
+ backgroundColor?: string;
139
+ backgroundStyle?: StyleProp<ViewStyle>;
140
+ backgroundImageStyle?: StyleProp<ImageStyle>;
141
+ renderBackground?: (ctx: BackgroundRenderContext) => ReactNode;
142
+ /** How far the background extends below the header. Default 60 (0 when rounded). */
143
+ backgroundOverhang?: number;
144
+ /** Rounds the header's bottom corners. Default `theme.radius.headerBottom` (0). */
145
+ headerBottomRadius?: number;
146
+ /** Default true, or false when `headerBottomRadius > 0`. */
147
+ showFade?: boolean;
148
+ /** Default `['transparent', '#ffffff']`. */
149
+ fadeColors?: [string, string];
150
+ /** Default 60. */
151
+ fadeHeight?: number;
152
+ /**
153
+ * Custom gradient renderer. Without it, `expo-linear-gradient` is used if
154
+ * installed; otherwise no fade is drawn.
155
+ */
156
+ renderBackgroundFade?: (ctx: BackgroundFadeRenderContext) => ReactNode;
157
+ logo?: ImageOrNode;
158
+ /** Compact-bar logo. Falls back to `logo`; pass `false` to hide it in the sticky bar only. */
159
+ stickyLogo?: ImageOrNode | false;
160
+ logoSize?: Partial<StickyHeaderTheme['logoSize']>;
161
+ logoStyle?: StyleProp<ImageStyle | ViewStyle>;
162
+ logoAccessibilityLabel?: string;
163
+ onLogoPress?: (variant: HeaderVariant) => void;
164
+ greeting?: ReactNode;
165
+ title?: ReactNode;
166
+ subtitle?: ReactNode;
167
+ avatar?: ImageOrNode;
168
+ avatarPosition?: 'left' | 'right';
169
+ avatarSize?: number;
170
+ onAvatarPress?: () => void;
171
+ avatarAccessibilityLabel?: string;
172
+ greetingStyle?: StyleProp<TextStyle>;
173
+ titleStyle?: StyleProp<TextStyle>;
174
+ subtitleStyle?: StyleProp<TextStyle>;
175
+ avatarStyle?: StyleProp<ImageStyle | ViewStyle>;
176
+ stickyTitle?: ReactNode;
177
+ stickyTitleStyle?: StyleProp<TextStyle>;
178
+ /**
179
+ * What the sticky (collapsed) bar shows. Leading items render left to right
180
+ * in this order; `'actions'` always sit on the right.
181
+ * Default `['logo', 'title', 'actions']`. Add `'avatar'` to show `avatar`.
182
+ */
183
+ stickyContent?: StickyContentItem[];
184
+ /** Avatar size in the sticky bar. Default `theme.avatarSizeCompact` (32). */
185
+ stickyAvatarSize?: number;
186
+ stickyAvatarStyle?: StyleProp<ImageStyle | ViewStyle>;
187
+ /** Up to `MAX_HEADER_ACTIONS` (3) icon buttons. */
188
+ actions?: HeaderAction[];
189
+ renderExpandedNav?: (ctx: HeaderSlotContext) => ReactNode;
190
+ renderCollapsible?: (ctx: HeaderSlotContext) => ReactNode;
191
+ renderStickyNav?: (ctx: HeaderSlotContext) => ReactNode;
192
+ /**
193
+ * Custom sticky bar background (gradient, image, blur), drawn behind its
194
+ * content. The bar's color becomes transparent unless `stickyBarBackground` is set.
195
+ */
196
+ renderStickyBackground?: (ctx: HeaderSlotContext) => ReactNode;
197
+ /** Extra content rendered inside the header (on the background). */
198
+ children?: ReactNode;
199
+ /** Extra content rendered after the header, on the page background. */
200
+ ListHeaderExtra?: ReactNode;
201
+ thresholdOffset?: number;
202
+ stickyFadeDistance?: number;
203
+ stickyPointerOffset?: number;
204
+ collapseTranslateY?: number;
205
+ collapseAnimation?: ProgressAnimation;
206
+ stickyAnimation?: ProgressAnimation;
207
+ respectSafeArea?: boolean;
208
+ /** `false` disables, `true` uses defaults (650 / 70 / out-cubic). */
209
+ enteringAnimations?: boolean | EnteringAnimationConfig;
210
+ onStickyChange?: (isSticky: boolean) => void;
211
+ theme?: StickyHeaderThemeOverrides;
212
+ stickyBarStyle?: StyleProp<ViewStyle>;
213
+ stickyBarBackground?: string;
214
+ /** `true` (default) uses the soft default shadow; pass an object to customise. */
215
+ stickyShadow?: boolean | ShadowStyle;
216
+ containerStyle?: StyleProp<ViewStyle>;
217
+ headerStyle?: StyleProp<ViewStyle>;
218
+ testID?: string;
219
+ };
220
+ export type CollapsibleStickyHeaderScreenProps<ItemT = unknown, SectionT = unknown> = CollapsibleStickyHeaderBaseProps & ({
221
+ as?: 'FlatList';
222
+ scrollProps: HeaderFlatListProps<ItemT>;
223
+ listRef?: Ref<unknown>;
224
+ } | {
225
+ as: 'SectionList';
226
+ scrollProps: HeaderSectionListProps<ItemT, SectionT>;
227
+ listRef?: Ref<unknown>;
228
+ } | {
229
+ as: 'ScrollView';
230
+ scrollProps?: HeaderScrollViewProps;
231
+ listRef?: Ref<unknown>;
232
+ } | {
233
+ /**
234
+ * A custom scrollable created with `Animated.createAnimatedComponent`
235
+ * (e.g. FlashList). It must accept `onScroll` and, unless
236
+ * `headerPlacement` is `'children'`, `ListHeaderComponent`.
237
+ */
238
+ as: ComponentType<any>;
239
+ scrollProps?: Record<string, unknown> & ScrollableBase;
240
+ listRef?: Ref<unknown>;
241
+ headerPlacement?: 'ListHeaderComponent' | 'children';
242
+ });
243
+ export {};
244
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OA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mB,CAAC,EAAE,MAAM,CAAC;IAC7B,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IACrC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,kCAAkC,CAC5C,KAAK,GAAG,OAAO,EACf,QAAQ,GAAG,OAAO,IAChB,gCAAgC,GAClC,CACI;IACE,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,WAAW,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB,GACD;IACE,EAAE,EAAE,aAAa,CAAC;IAClB,WAAW,EAAE,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACrD,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB,GACD;IACE,EAAE,EAAE,YAAY,CAAC;IACjB,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB,GACD;IACE;;;;OAIG;IACH,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC;IACvD,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,eAAe,CAAC,EAAE,qBAAqB,GAAG,UAAU,CAAC;CACtD,CACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { UseStickyHeaderOptions, UseStickyHeaderResult } from './types.js';
2
+ export declare const DEFAULT_STICKY_FADE_DISTANCE = 40;
3
+ export declare const DEFAULT_STICKY_POINTER_OFFSET = 20;
4
+ export declare const DEFAULT_COLLAPSE_TRANSLATE_Y = -12;
5
+ /**
6
+ * Scroll-driven state for a collapsing header with a sticky bar.
7
+ *
8
+ * All styles are computed on the UI thread. The hook only re-renders when the
9
+ * sticky state flips (and when the nav bar is first measured).
10
+ */
11
+ export declare function useStickyHeader(options?: UseStickyHeaderOptions): UseStickyHeaderResult;
12
+ //# sourceMappingURL=useStickyHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStickyHeader.d.ts","sourceRoot":"","sources":["../../../../src/useStickyHeader.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAQ7E,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAChD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CA2IvB"}