@hzblj/kara-components 0.27.2 → 0.28.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.
- package/CHANGELOG.md +13 -0
- package/lib/module/organisms/header/header-title.js +9 -4
- package/lib/module/organisms/header/header-title.js.map +1 -1
- package/lib/module/organisms/header/native-inline-large-title.android.js +4 -0
- package/lib/module/organisms/header/native-inline-large-title.android.js.map +1 -0
- package/lib/module/organisms/header/native-inline-large-title.ios.js +7 -0
- package/lib/module/organisms/header/native-inline-large-title.ios.js.map +1 -0
- package/lib/module/organisms/header/native-inline-large-title.types.js +4 -0
- package/lib/module/organisms/header/native-inline-large-title.types.js.map +1 -0
- package/lib/module/organisms/header/use-header-scroll-to-top.js +1 -1
- package/lib/module/organisms/header/use-header-scroll-to-top.js.map +1 -1
- package/lib/module/organisms/header/use-header.js +8 -5
- package/lib/module/organisms/header/use-header.js.map +1 -1
- package/lib/module/organisms/header/use-hero-header.js +1 -0
- package/lib/module/organisms/header/use-hero-header.js.map +1 -1
- package/lib/module/organisms/header/use-stack-screen-options.js +1 -1
- package/lib/typescript/organisms/header/header-title.d.ts +6 -4
- package/lib/typescript/organisms/header/header.types.d.ts +13 -4
- package/lib/typescript/organisms/header/native-inline-large-title.d.ts +1 -0
- package/lib/typescript/organisms/header/native-inline-large-title.ios.d.ts +3 -0
- package/lib/typescript/organisms/header/native-inline-large-title.types.d.ts +2 -0
- package/lib/typescript/organisms/header/use-header.d.ts +3 -3
- package/lib/typescript/organisms/header/use-stack-screen-options.d.ts +1 -1
- package/package.json +4 -4
- package/src/organisms/header/header-title.tsx +12 -6
- package/src/organisms/header/header.types.ts +13 -4
- package/src/organisms/header/native-inline-large-title.android.tsx +3 -0
- package/src/organisms/header/native-inline-large-title.ios.tsx +6 -0
- package/src/organisms/header/native-inline-large-title.types.ts +3 -0
- package/src/organisms/header/use-header-scroll-to-top.ts +1 -1
- package/src/organisms/header/use-header.ts +15 -7
- package/src/organisms/header/use-hero-header.tsx +1 -0
- package/src/organisms/header/use-stack-screen-options.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @hzblj/kara-components
|
|
2
2
|
|
|
3
|
+
## 0.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#99](https://github.com/hzblj/kara-ui/pull/99) [`2323d8e`](https://github.com/hzblj/kara-ui/commit/2323d8e4df8f60bc18555a32a2ae6c8c59c258d8) Thanks [@hzblj](https://github.com/hzblj)! - `largeTitle: 'inline'` on `useHeader` and `useHeaderOptions` puts the large title on the leading side of the bar row, next to the actions, as the Apple TV app's tabs have it (iOS 17), instead of in a row of its own under the bar. Render the result's new `inlineLargeTitle` after the list. Android shows the bar's plain title. The view behind it is `InlineLargeTitle` in `@hzblj/kara-native/swift-ui`, and `useHeaderScrollToTop` takes the same `largeTitle` value.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`2323d8e`](https://github.com/hzblj/kara-ui/commit/2323d8e4df8f60bc18555a32a2ae6c8c59c258d8), [`eb223d7`](https://github.com/hzblj/kara-ui/commit/eb223d7d831715c4f08b14898d9883fe7f1195d8), [`4f723ab`](https://github.com/hzblj/kara-ui/commit/4f723ab183fcef56641dd76c42937cb01447b6e4)]:
|
|
12
|
+
- @hzblj/kara-native@0.28.0
|
|
13
|
+
- @hzblj/kara-sx@0.28.0
|
|
14
|
+
- @hzblj/kara-theme@0.28.0
|
|
15
|
+
|
|
3
16
|
## 0.27.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
|
5
5
|
import Animated, { Extrapolation, interpolate, useAnimatedReaction, useAnimatedStyle, useDerivedValue, useSharedValue } from 'react-native-reanimated';
|
|
6
6
|
import { scheduleOnRN } from 'react-native-worklets';
|
|
7
7
|
import { RnText } from "../../atoms/rn-text/index.js";
|
|
8
|
+
import { NativeInlineLargeTitle } from './native-inline-large-title';
|
|
8
9
|
import { hasNativeSubtitle, NativeSubtitle } from './native-subtitle';
|
|
9
10
|
|
|
10
11
|
/** Past half, a revealed title counts as shown: the native title and subtitle switch then. */
|
|
@@ -139,10 +140,12 @@ const CollapsingTitle = ({
|
|
|
139
140
|
})
|
|
140
141
|
});
|
|
141
142
|
};
|
|
143
|
+
const INLINE_LARGE_TITLE = /*#__PURE__*/_jsx(NativeInlineLargeTitle, {});
|
|
142
144
|
/**
|
|
143
|
-
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll
|
|
144
|
-
* large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
145
|
-
* top app bar does. iOS needs neither: the large title is UIKit's own
|
|
145
|
+
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll,
|
|
146
|
+
* large or inline large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
147
|
+
* Material's large top app bar does. iOS needs neither: the large title is UIKit's own, and an inline one only needs
|
|
148
|
+
* the view that keeps it in the bar row.
|
|
146
149
|
*/
|
|
147
150
|
export const useHeaderTitle = ({
|
|
148
151
|
largeTitle,
|
|
@@ -164,7 +167,7 @@ export const useHeaderTitle = ({
|
|
|
164
167
|
const options = useMemo(() => {
|
|
165
168
|
const titleOptions = {};
|
|
166
169
|
if (largeTitle !== undefined) {
|
|
167
|
-
titleOptions.headerLargeTitleEnabled = Platform.OS === 'ios' && largeTitle;
|
|
170
|
+
titleOptions.headerLargeTitleEnabled = Platform.OS === 'ios' && largeTitle !== false;
|
|
168
171
|
}
|
|
169
172
|
if (title === undefined) {
|
|
170
173
|
return titleOptions;
|
|
@@ -222,7 +225,9 @@ export const useHeaderTitle = ({
|
|
|
222
225
|
height: largeTitleHeight,
|
|
223
226
|
title: title
|
|
224
227
|
}) : null, [isAndroidLargeTitle, largeTitleHeight, title]);
|
|
228
|
+
const inlineLargeTitle = largeTitle === 'inline' ? INLINE_LARGE_TITLE : null;
|
|
225
229
|
return {
|
|
230
|
+
inlineLargeTitle,
|
|
226
231
|
largeTitle: largeTitleRow,
|
|
227
232
|
onScroll,
|
|
228
233
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","Extrapolation","interpolate","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","scheduleOnRN","RnText","hasNativeSubtitle","NativeSubtitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","REVEALED_THRESHOLD","LEADING_TITLE_RESERVED_WIDTH","styles","create","largeTitle","paddingHorizontal","paddingVertical","leadingTitleAndroid","paddingStart","paddingTop","leadingTitleIos","flexShrink","shrink","useIsTitleRevealed","progress","revealed","setRevealed","undefined","value","isRevealed","wasRevealed","Reveal","children","animatedStyle","opacity","style","BarTitle","title","accessibilityRole","allowFontScaling","numberOfLines","variant","LeadingTitle","subtitle","width","content","color","OS","maxWidth","LargeTitle","height","onLayout","event","nativeEvent","layout","CollapsingTitle","scrollY","CLAMP","useHeaderTitle","titleHidden","titleRevealProgress","titleTransition","largeTitleHeight","isAndroidLargeTitle","onScroll","offsetY","options","titleOptions","headerLargeTitleEnabled","headerTitle","shownTitle","headerBackground","subtitleHidden","transition","leadingTitle","largeTitleRow"],"sourceRoot":"../../../../src","sources":["organisms/header/header-title.tsx"],"mappings":";;AACA,SAAwBA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AACpE,SAAgCC,QAAQ,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAO,cAAc;AACpG,OAAOC,QAAQ,IACbC,aAAa,EACbC,WAAW,EAEXC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,QACT,yBAAyB;AAChC,SAAQC,YAAY,QAAO,uBAAuB;AAElD,SAAQC,MAAM,QAAO,8BAAqB;AAE1C,SAAQC,iBAAiB,EAAEC,cAAc,QAAO,mBAAmB;;AAEnE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,kBAAkB,GAAG,GAAG;;AAE9B;AACA,MAAMC,4BAA4B,GAAG,GAAG;AAExC,MAAMC,MAAM,
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useState","Platform","StyleSheet","useWindowDimensions","View","Animated","Extrapolation","interpolate","useAnimatedReaction","useAnimatedStyle","useDerivedValue","useSharedValue","scheduleOnRN","RnText","NativeInlineLargeTitle","hasNativeSubtitle","NativeSubtitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","REVEALED_THRESHOLD","LEADING_TITLE_RESERVED_WIDTH","styles","create","largeTitle","paddingHorizontal","paddingVertical","leadingTitleAndroid","paddingStart","paddingTop","leadingTitleIos","flexShrink","shrink","useIsTitleRevealed","progress","revealed","setRevealed","undefined","value","isRevealed","wasRevealed","Reveal","children","animatedStyle","opacity","style","BarTitle","title","accessibilityRole","allowFontScaling","numberOfLines","variant","LeadingTitle","subtitle","width","content","color","OS","maxWidth","LargeTitle","height","onLayout","event","nativeEvent","layout","CollapsingTitle","scrollY","CLAMP","INLINE_LARGE_TITLE","useHeaderTitle","titleHidden","titleRevealProgress","titleTransition","largeTitleHeight","isAndroidLargeTitle","onScroll","offsetY","options","titleOptions","headerLargeTitleEnabled","headerTitle","shownTitle","headerBackground","subtitleHidden","transition","leadingTitle","largeTitleRow","inlineLargeTitle"],"sourceRoot":"../../../../src","sources":["organisms/header/header-title.tsx"],"mappings":";;AACA,SAAwBA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AACpE,SAAgCC,QAAQ,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAO,cAAc;AACpG,OAAOC,QAAQ,IACbC,aAAa,EACbC,WAAW,EAEXC,mBAAmB,EACnBC,gBAAgB,EAChBC,e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AACnB,KAAK,EAAEA;MAAM,CAAE,CAAC;MAC9G,OAAO+B,YAAY;IACrB;IAEAA,YAAY,CAACE,WAAW,GAAGjC,KAAK;IAChC,OAAO+B,YAAY;EACrB,CAAC,EAAE,CACDJ,mBAAmB,EACnBlD,UAAU,EACViD,gBAAgB,EAChBtC,QAAQ,EACR+B,OAAO,EACPb,QAAQ,EACRN,KAAK,EACLuB,WAAW,EACXC,mBAAmB,EACnBC,eAAe,CAChB,CAAC;EAEF,MAAMc,aAAa,GAAG1F,OAAO,CAC3B,MAAO8E,mBAAmB,IAAI3B,KAAK,gBAAGhC,IAAA,CAAC4C,UAAU;IAACC,MAAM,EAAEa,gBAAiB;IAAC1B,KAAK,EAAEA;EAAM,CAAE,CAAC,GAAG,IAAK,EACpG,CAAC2B,mBAAmB,EAAED,gBAAgB,EAAE1B,KAAK,CAC/C,CAAC;EAED,MAAMwC,gBAAgB,GAAG/D,UAAU,KAAK,QAAQ,GAAG4C,kBAAkB,GAAG,IAAI;EAE5E,OAAO;IAACmB,gBAAgB;IAAE/D,UAAU,EAAE8D,aAAa;IAAEX,QAAQ;IAAEE,OAAO;IAAE1C;EAAQ,CAAC;AACnF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeInlineLargeTitle"],"sourceRoot":"../../../../src","sources":["organisms/header/native-inline-large-title.android.tsx"],"mappings":";;AAEA,OAAO,MAAMA,sBAAuD,GAAGA,CAAA,KAAM,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { InlineLargeTitle } from '@hzblj/kara-native/swift-ui';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
/** iOS 17 keeps the large title in the bar row, next to the bar items (`LargeTitleDisplayMode.inline`). */
|
|
6
|
+
export const NativeInlineLargeTitle = () => /*#__PURE__*/_jsx(InlineLargeTitle, {});
|
|
7
|
+
//# sourceMappingURL=native-inline-large-title.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InlineLargeTitle","jsx","_jsx","NativeInlineLargeTitle"],"sourceRoot":"../../../../src","sources":["organisms/header/native-inline-large-title.ios.tsx"],"mappings":";;AAAA,SAAQA,gBAAgB,QAAO,6BAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAI5D;AACA,OAAO,MAAMC,sBAAuD,GAAGA,CAAA,kBAAMD,IAAA,CAACF,gBAAgB,IAAE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["organisms/header/native-inline-large-title.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -37,7 +37,7 @@ export const useHeaderScrollToTop = (ref, {
|
|
|
37
37
|
topInset = 0
|
|
38
38
|
} = {}) => {
|
|
39
39
|
const barInset = useHeaderBarInset();
|
|
40
|
-
const offset = Platform.OS === 'ios' ? -(barInset + (largeTitle ? LARGE_TITLE_HEIGHT : 0) + topInset) : 0;
|
|
40
|
+
const offset = Platform.OS === 'ios' ? -(barInset + (largeTitle === true ? LARGE_TITLE_HEIGHT : 0) + topInset) : 0;
|
|
41
41
|
return useMemo(() => ({
|
|
42
42
|
current: {
|
|
43
43
|
scrollToTop: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","Platform","useHeaderBarInset","LARGE_TITLE_HEIGHT","scrollToOffset","target","offset","animated","scrollTo","y","getScrollResponder","useHeaderScrollToTop","ref","largeTitle","topInset","barInset","OS","current","scrollToTop"],"sourceRoot":"../../../../src","sources":["organisms/header/use-header-scroll-to-top.ts"],"mappings":";;AAAA,SAAwBA,OAAO,QAAO,OAAO;AAC7C,SAAQC,QAAQ,QAAO,cAAc;AAGrC,SAAQC,iBAAiB,QAAO,wBAAwB;;AAExD;AACA,MAAMC,kBAAkB,GAAG,EAAE;AAE7B,MAAMC,cAAc,GAAGA,CAACC,MAAwB,EAAEC,MAAc,KAAK;EACnE,IAAI,gBAAgB,IAAID,MAAM,EAAE;IAC9BA,MAAM,CAACD,cAAc,CAAC;MAACG,QAAQ,EAAE,IAAI;MAAED;IAAM,CAAC,CAAC;IAC/C;EACF;EAEA,IAAI,UAAU,IAAID,MAAM,EAAE;IACxBA,MAAM,CAACG,QAAQ,CAAC;MAACD,QAAQ,EAAE,IAAI;MAAEE,CAAC,EAAEH;IAAM,CAAC,CAAC;IAC5C;EACF;EAEAD,MAAM,CAACK,kBAAkB,CAAC,CAAC,EAAEF,QAAQ,CAAC;IAACD,QAAQ,EAAE,IAAI;IAAEE,CAAC,EAAEH;EAAM,CAAC,CAAC;AACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,oBAAoB,GAAGA,CAClCC,GAAuC,EACvC;EAACC,UAAU,GAAG,KAAK;EAAEC,QAAQ,GAAG;AAA2B,CAAC,GAAG,CAAC,CAAC,KACxC;EACzB,MAAMC,QAAQ,GAAGb,iBAAiB,CAAC,CAAC;EACpC,MAAMI,MAAM,GAAGL,QAAQ,CAACe,EAAE,KAAK,KAAK,GAAG,EAAED,QAAQ,IAAIF,UAAU,GAAGV,kBAAkB,GAAG,CAAC,CAAC,GAAGW,QAAQ,CAAC,GAAG,CAAC;
|
|
1
|
+
{"version":3,"names":["useMemo","Platform","useHeaderBarInset","LARGE_TITLE_HEIGHT","scrollToOffset","target","offset","animated","scrollTo","y","getScrollResponder","useHeaderScrollToTop","ref","largeTitle","topInset","barInset","OS","current","scrollToTop"],"sourceRoot":"../../../../src","sources":["organisms/header/use-header-scroll-to-top.ts"],"mappings":";;AAAA,SAAwBA,OAAO,QAAO,OAAO;AAC7C,SAAQC,QAAQ,QAAO,cAAc;AAGrC,SAAQC,iBAAiB,QAAO,wBAAwB;;AAExD;AACA,MAAMC,kBAAkB,GAAG,EAAE;AAE7B,MAAMC,cAAc,GAAGA,CAACC,MAAwB,EAAEC,MAAc,KAAK;EACnE,IAAI,gBAAgB,IAAID,MAAM,EAAE;IAC9BA,MAAM,CAACD,cAAc,CAAC;MAACG,QAAQ,EAAE,IAAI;MAAED;IAAM,CAAC,CAAC;IAC/C;EACF;EAEA,IAAI,UAAU,IAAID,MAAM,EAAE;IACxBA,MAAM,CAACG,QAAQ,CAAC;MAACD,QAAQ,EAAE,IAAI;MAAEE,CAAC,EAAEH;IAAM,CAAC,CAAC;IAC5C;EACF;EAEAD,MAAM,CAACK,kBAAkB,CAAC,CAAC,EAAEF,QAAQ,CAAC;IAACD,QAAQ,EAAE,IAAI;IAAEE,CAAC,EAAEH;EAAM,CAAC,CAAC;AACpE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,oBAAoB,GAAGA,CAClCC,GAAuC,EACvC;EAACC,UAAU,GAAG,KAAK;EAAEC,QAAQ,GAAG;AAA2B,CAAC,GAAG,CAAC,CAAC,KACxC;EACzB,MAAMC,QAAQ,GAAGb,iBAAiB,CAAC,CAAC;EACpC,MAAMI,MAAM,GAAGL,QAAQ,CAACe,EAAE,KAAK,KAAK,GAAG,EAAED,QAAQ,IAAIF,UAAU,KAAK,IAAI,GAAGV,kBAAkB,GAAG,CAAC,CAAC,GAAGW,QAAQ,CAAC,GAAG,CAAC;EAElH,OAAOd,OAAO,CACZ,OAAO;IACLiB,OAAO,EAAE;MACPC,WAAW,EAAEA,CAAA,KAAM;QACjB,IAAIN,GAAG,CAACK,OAAO,EAAE;UACfb,cAAc,CAACQ,GAAG,CAACK,OAAO,EAAEX,MAAM,CAAC;QACrC;MACF;IACF;EACF,CAAC,CAAC,EACF,CAACA,MAAM,EAAEM,GAAG,CACd,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -7,9 +7,9 @@ import { useHeaderTitle } from "./header-title.js";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A screen's header as native-stack options, with what its list needs alongside: the title (centred, leading with a
|
|
10
|
-
* subtitle, revealed on scroll or large), the actions on both sides (the navigation bar's own items on
|
|
11
|
-
* buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
12
|
-
* Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
10
|
+
* subtitle, revealed on scroll, large or inline large), the actions on both sides (the navigation bar's own items on
|
|
11
|
+
* iOS, Material buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
12
|
+
* a React Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
13
13
|
*/
|
|
14
14
|
export const useHeaderOptions = ({
|
|
15
15
|
backHidden,
|
|
@@ -45,11 +45,12 @@ export const useHeaderOptions = ({
|
|
|
45
45
|
}
|
|
46
46
|
return {
|
|
47
47
|
contentInsetAdjustmentBehavior: 'automatic',
|
|
48
|
+
inlineLargeTitle: headerTitle.inlineLargeTitle,
|
|
48
49
|
largeTitle: headerTitle.largeTitle,
|
|
49
50
|
onScroll: headerTitle.onScroll,
|
|
50
51
|
options
|
|
51
52
|
};
|
|
52
|
-
}, [actionOptions, headerTitle.largeTitle, headerTitle.onScroll, headerTitle.options, search]);
|
|
53
|
+
}, [actionOptions, headerTitle.inlineLargeTitle, headerTitle.largeTitle, headerTitle.onScroll, headerTitle.options, search]);
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
/**
|
|
@@ -60,6 +61,7 @@ export const useHeaderOptions = ({
|
|
|
60
61
|
export const useHeader = (navigation, params) => {
|
|
61
62
|
const {
|
|
62
63
|
contentInsetAdjustmentBehavior,
|
|
64
|
+
inlineLargeTitle,
|
|
63
65
|
largeTitle,
|
|
64
66
|
onScroll,
|
|
65
67
|
options
|
|
@@ -69,8 +71,9 @@ export const useHeader = (navigation, params) => {
|
|
|
69
71
|
}, [navigation, options]);
|
|
70
72
|
return useMemo(() => ({
|
|
71
73
|
contentInsetAdjustmentBehavior,
|
|
74
|
+
inlineLargeTitle,
|
|
72
75
|
largeTitle,
|
|
73
76
|
onScroll
|
|
74
|
-
}), [contentInsetAdjustmentBehavior, largeTitle, onScroll]);
|
|
77
|
+
}), [contentInsetAdjustmentBehavior, inlineLargeTitle, largeTitle, onScroll]);
|
|
75
78
|
};
|
|
76
79
|
//# sourceMappingURL=use-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAppTheme","useLayoutEffect","useMemo","toHeaderOptions","useHeaderTitle","useHeaderOptions","backHidden","largeTitle","leadingActions","search","subtitle","title","titleHidden","titleRevealProgress","titleTransition","trailingActions","theme","headerTitle","actionOptions","options","Object","assign","headerSearchBarOptions","contentInsetAdjustmentBehavior","onScroll","useHeader","navigation","params","setOptions"],"sourceRoot":"../../../../src","sources":["organisms/header/use-header.ts"],"mappings":";;AAAA,SAAQA,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,eAAe,EAAEC,OAAO,QAAO,OAAO;AAG9C,SAAQC,eAAe,QAAO,kBAAkB;AAChD,SAAQC,cAAc,QAAO,mBAAgB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,UAAU;EACVC,UAAU;EACVC,cAAc;EACdC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,WAAW,GAAG,KAAK;EACnBC,mBAAmB;EACnBC,eAAe;EACfC;AACY,CAAC,KAA0B;EACvC,MAAMC,KAAK,GAAGhB,WAAW,CAAC,CAAC;EAC3B,MAAMiB,WAAW,GAAGb,cAAc,CAAC;IAACG,UAAU;IAAEG,QAAQ;IAAEC,KAAK;IAAEC,WAAW;IAAEC,mBAAmB;IAAEC;EAAe,CAAC,CAAC;EAEpH,MAAMI,aAAa,GAAGhB,OAAO,CAC3B,MAAMC,eAAe,CAAC;IAACG,UAAU;IAAEE,cAAc;IAAEO;EAAe,CAAC,EAAEC,KAAK,CAAC,EAC3E,CAACV,UAAU,EAAEE,cAAc,EAAEQ,KAAK,EAAED,eAAe,CACrD,CAAC;EAED,OAAOb,OAAO,CAAC,MAAM;IACnB,MAAMiB,OAAsB,GAAG,CAAC,CAAC;IAEjCC,MAAM,CAACC,MAAM,CAACF,OAAO,EAAEF,WAAW,CAACE,OAAO,EAAED,aAAa,CAAC;IAE1D,IAAIT,MAAM,EAAE;MACVU,OAAO,CAACG,sBAAsB,GAAGb,MAAM;IACzC;IAEA,OAAO;MACLc,8BAA8B,EAAE,WAAW;
|
|
1
|
+
{"version":3,"names":["useAppTheme","useLayoutEffect","useMemo","toHeaderOptions","useHeaderTitle","useHeaderOptions","backHidden","largeTitle","leadingActions","search","subtitle","title","titleHidden","titleRevealProgress","titleTransition","trailingActions","theme","headerTitle","actionOptions","options","Object","assign","headerSearchBarOptions","contentInsetAdjustmentBehavior","inlineLargeTitle","onScroll","useHeader","navigation","params","setOptions"],"sourceRoot":"../../../../src","sources":["organisms/header/use-header.ts"],"mappings":";;AAAA,SAAQA,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,eAAe,EAAEC,OAAO,QAAO,OAAO;AAG9C,SAAQC,eAAe,QAAO,kBAAkB;AAChD,SAAQC,cAAc,QAAO,mBAAgB;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,UAAU;EACVC,UAAU;EACVC,cAAc;EACdC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,WAAW,GAAG,KAAK;EACnBC,mBAAmB;EACnBC,eAAe;EACfC;AACY,CAAC,KAA0B;EACvC,MAAMC,KAAK,GAAGhB,WAAW,CAAC,CAAC;EAC3B,MAAMiB,WAAW,GAAGb,cAAc,CAAC;IAACG,UAAU;IAAEG,QAAQ;IAAEC,KAAK;IAAEC,WAAW;IAAEC,mBAAmB;IAAEC;EAAe,CAAC,CAAC;EAEpH,MAAMI,aAAa,GAAGhB,OAAO,CAC3B,MAAMC,eAAe,CAAC;IAACG,UAAU;IAAEE,cAAc;IAAEO;EAAe,CAAC,EAAEC,KAAK,CAAC,EAC3E,CAACV,UAAU,EAA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ollEdgeEffectAvailable","isViewControllerBasedStatusBarAppearance","useAppTheme","useCallback","useEffect","useLayoutEffect","useMemo","useState","Platform","StatusBar","Extrapolation","interpolate","useAnimatedReaction","useDerivedValue","useSharedValue","useSafeAreaInsets","scheduleOnRN","headerColor","useIsTitleRevealed","HeroHeaderBackground","useHeaderOptions","useHeaderBarInset","HERO_HEADER_SCREEN_OPTIONS","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","REVEAL_RANGE","ANDROID_BAR_HEIGHT","useHeroBarHeight","iosBarInset","top","OS","useIsOverHero","progress","overHero","setOverHero","value","isOver","wasOver","useIsScreenFocused","navigation","focused","setFocused","isFocused","unsubscribeFocus","addListener","unsubscribeBlur","BAR_STYLES","dark","light","useHeroStatusBar","overHeroStyle","perScreen","setOptions","statusBarStyle","animated","barStyle","useRevealProgress","barHeight","heroHeight","introProgress","scrollY","heroUnderBar","start","end","scrollProgress","CLAMP","Math","max","onScroll","offsetY","useHeroHeader","backHidden","leadingActions","revealedTrailingActions","subtitle","title","titleTransition","trailingActions","theme","titleShown","scrolledOverHero","statusBar","visibleTrailingActions","actions","action","push","options","titleRevealProgress","appearance","headerTintColor","scrollEdgeEffects","background","children","height","contentInsetAdjustmentBehavior","largeTitle"],"sourceRoot":"../../../../src","sources":["organisms/header/use-hero-header.tsx"],"mappings":";;AAAA,SAAQA,2BAA2B,EAAEC,wCAAwC,QAAO,oBAAoB;AACxG,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAChF,SAAQC,QAAQ,EAAEC,SAAS,QAAO,cAAc;AAChD,SACEC,aAAa,EACbC,WAAW,EAEXC,mBAAmB,EACnBC,eAAe,EACfC,cAAc,QACT,yBAAyB;AAChC,SAAQC,iBAAiB,QAAO,gCAAgC;AAChE,SAAQC,YAAY,QAAO,uBAAuB;AAUlD,SAAQC,WAAW,QAAO,mBAAgB;A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KAAK,OAAO;IACnD,MAAMsC,UAAyB,GAAG;MAChCC,eAAe,EAAE5E,WAAW,CAACiE,KAAK,EAAE9B,KAAK,GAAG,mBAAmB,GAAG,iBAAiB;IACrF,CAAC;IAED,IAAIpD,2BAA2B,CAAC,CAAC,EAAE;MACjC4F,UAAU,CAACE,iBAAiB,GAAG;QAAC7D,GAAG,EAAEmD,gBAAgB,GAAG,QAAQ,GAAG;MAAW,CAAC;IACjF;IAEAzC,UAAU,CAACa,UAAU,CAACoC,UAAU,CAAC;EACnC,CAAC,EAAE,CAACjD,UAAU,EAAEN,QAAQ,EAAEiB,aAAa,EAAE8B,gBAAgB,EAAEF,KAAK,CAAC,CAAC;EAElE,MAAMa,UAAU,GAAGzF,OAAO,CACxB,mBACEsB,KAAA,CAAAF,SAAA;IAAAsE,QAAA,gBACExE,IAAA,CAACL,oBAAoB;MAAC8E,MAAM,EAAEpC,SAAU;MAACzB,QAAQ,EAAEA;IAAS,CAAE,CAAC,EAC9DiD,SAAS;EAAA,CACV,CACH,EACD,CAACxB,SAAS,EAAEzB,QAAQ,EAAEiD,SAAS,CACjC,CAAC;EAED,OAAO;IACLU,UAAU;IACVG,8BAA8B,EAAE,OAAO;IACvCC,UAAU,EAAE,IAAI;
|
|
1
|
+
{"version":3,"names":["isScrollEdgeEffectAvailable","isViewControllerBasedStatusBarAppearance","useAppTheme","useCallback","useEffect","useLayoutEffect","useMemo","useState","Platform","StatusBar","Extrapolation","interpolate","useAnimatedReaction","useDerivedValue","useSharedValue","useSafeAreaInsets","scheduleOnRN","headerColor","useIsTitleRevealed","HeroHeaderBackground","useHeaderOptions","useHeaderBarInset","HERO_HEADER_SCREEN_OPTIONS","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","REVEAL_RANGE","ANDROID_BAR_HEIGHT","useHeroBarHeight","iosBarInset","top","OS","useIsOverHero","progress","overHero","setOverHero","value","isOver","wasOver","useIsScreenFocused","navigation","focused","setFocused","isFocused","unsubscribeFocus","addListener","unsubscribeBlur","BAR_STYLES","dark","light","useHeroStatusBar","overHeroStyle","perScreen","setOptions","statusBarStyle","animated","barStyle","useRevealProgress","barHeight","heroHeight","introProgress","scrollY","heroUnderBar","start","end","scrollProgress","CLAMP","Math","max","onScroll","offsetY","useHeroHeader","backHidden","leadingActions","revealedTrailingActions","subtitle","title","titleTransition","trailingActions","theme","titleShown","scrolledOverHero","statusBar","visibleTrailingActions","actions","action","push","options","titleRevealProgress","appearance","headerTintColor","scrollEdgeEffects","background","children","height","contentInsetAdjustmentBehavior","inlineLargeTitle","largeTitle"],"sourceRoot":"../../../../src","sources":["organisms/header/use-hero-header.tsx"],"mappings":";;AAAA,SAAQA,2BAA2B,EAAEC,wCAAwC,QAAO,oBAAoB;AACxG,SAAQC,WAAW,QAAO,mBAAmB;AAC7C,SAAQC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,OAAO,EAAEC,QAAQ,QAAO,OAAO;AAChF,SAAQC,QAAQ,EAAEC,SAAS,QAAO,cAAc;AAChD,SACEC,aAAa,EACbC,WAAW,EAEXC,mBAAmB,EACnBC,eAAe,EACfC,cAAc,QACT,yBAAyB;AAChC,SAAQC,iBAAiB,QAAO,gCAAgC;AAChE,SAAQC,YAAY,QAAO,uBAAuB;AAUlD,SAAQC,WAAW,QAAO,mBAAgB;AAC1C,SAAQC,kBAAkB,QAAO,mBAAgB;AACjD,SAAQC,oBAAoB,QAAO,0BAA0B;AAC7D,SAAQC,gBAAgB,QAAO,iBAAc;AAC7C,SAAQC,iBAAiB,QAAO,wBAAwB;AACxD,SAAQC,0BAA0B,QAAO,+BAA4B;;AAErE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,CAAU;;AAExC;AACA,MAAMC,kBAAkB,GAAG,EAAE;AAE7B,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAC7B,MA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,CAAC;EAElE,MAAMa,UAAU,GAAGzF,OAAO,CACxB,mBACEsB,KAAA,CAAAF,SAAA;IAAAsE,QAAA,gBACExE,IAAA,CAACL,oBAAoB;MAAC8E,MAAM,EAAEpC,SAAU;MAACzB,QAAQ,EAAEA;IAAS,CAAE,CAAC,EAC9DiD,SAAS;EAAA,CACV,CACH,EACD,CAACxB,SAAS,EAAEzB,QAAQ,EAAEiD,SAAS,CACjC,CAAC;EAED,OAAO;IACLU,UAAU;IACVG,8BAA8B,EAAE,OAAO;IACvCC,gBAAgB,EAAE,IAAI;IACtBC,UAAU,EAAE,IAAI;IAChB5B,QAAQ;IACRpC,QAAQ;IACRgC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -47,7 +47,7 @@ export const useStackScreenOptions = () => {
|
|
|
47
47
|
}, [theme]);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
/** A screen with a large title that collapses into the bar as its list scrolls. */
|
|
50
|
+
/** A screen with a large title that collapses into the bar as its list scrolls, or sits in the bar row (`'inline'`). */
|
|
51
51
|
export const LARGE_TITLE_SCREEN_OPTIONS = {
|
|
52
52
|
headerLargeTitleEnabled: true,
|
|
53
53
|
headerShown: true
|
|
@@ -3,7 +3,7 @@ import { type SharedValue } from 'react-native-reanimated';
|
|
|
3
3
|
import type { HeaderOptions } from './header.types';
|
|
4
4
|
export declare const useIsTitleRevealed: (progress?: SharedValue<number>) => boolean;
|
|
5
5
|
type TitleParams = {
|
|
6
|
-
largeTitle?: boolean;
|
|
6
|
+
largeTitle?: boolean | 'inline';
|
|
7
7
|
subtitle?: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
titleHidden: boolean;
|
|
@@ -11,11 +11,13 @@ type TitleParams = {
|
|
|
11
11
|
titleTransition?: NavigationTitleTransition;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll
|
|
15
|
-
* large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
16
|
-
* top app bar does. iOS needs neither: the large title is UIKit's own
|
|
14
|
+
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll,
|
|
15
|
+
* large or inline large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
16
|
+
* Material's large top app bar does. iOS needs neither: the large title is UIKit's own, and an inline one only needs
|
|
17
|
+
* the view that keeps it in the bar row.
|
|
17
18
|
*/
|
|
18
19
|
export declare const useHeaderTitle: ({ largeTitle, subtitle, title, titleHidden, titleRevealProgress, titleTransition, }: TitleParams) => {
|
|
20
|
+
inlineLargeTitle: import("react").JSX.Element | null;
|
|
19
21
|
largeTitle: import("react").JSX.Element | null;
|
|
20
22
|
onScroll: (offsetY: number) => void;
|
|
21
23
|
options: HeaderOptions;
|
|
@@ -136,8 +136,12 @@ export type HeaderParams = {
|
|
|
136
136
|
* A large title that collapses into the bar as the list scrolls. iOS draws UIKit's own; Android, where the native
|
|
137
137
|
* stack has none, puts it into the content as the list's first row (`largeTitle` in the result) and fades the bar's
|
|
138
138
|
* title in once that row has scrolled away, as Material's large top app bar does. Wire `onScroll` for it.
|
|
139
|
+
*
|
|
140
|
+
* `'inline'` puts the large title on the leading side of the bar row instead, level with the actions, as the Apple
|
|
141
|
+
* TV app's tabs have it (iOS 17), with no row of its own under the bar. Render `inlineLargeTitle` from the result.
|
|
142
|
+
* Android shows the bar's plain title.
|
|
139
143
|
*/
|
|
140
|
-
largeTitle?: boolean;
|
|
144
|
+
largeTitle?: boolean | 'inline';
|
|
141
145
|
/**
|
|
142
146
|
* The leading side's actions, in screen order from the edge. On iOS they follow the back button. Unset leaves the
|
|
143
147
|
* side as the stack's options have it; an empty array clears it.
|
|
@@ -268,7 +272,12 @@ export type HeaderContent = {
|
|
|
268
272
|
* lets the content run under it.
|
|
269
273
|
*/
|
|
270
274
|
contentInsetAdjustmentBehavior: 'automatic' | 'never';
|
|
271
|
-
/**
|
|
275
|
+
/**
|
|
276
|
+
* iOS, with `largeTitle: 'inline'`: what keeps the large title in the bar row. Render it once anywhere in the screen,
|
|
277
|
+
* after the list, outside a SwiftUI host. `null` everywhere else.
|
|
278
|
+
*/
|
|
279
|
+
inlineLargeTitle: ReactElement | null;
|
|
280
|
+
/** Android, with `largeTitle: true`: the large title, to render as the list's first row. `null` everywhere else. */
|
|
272
281
|
largeTitle: ReactElement | null;
|
|
273
282
|
/** A worklet to call with the list's vertical offset from its scroll handler, for what follows the scroll. */
|
|
274
283
|
onScroll: (offsetY: number) => void;
|
|
@@ -439,8 +448,8 @@ export type HeaderScrollable = {
|
|
|
439
448
|
}) => void;
|
|
440
449
|
};
|
|
441
450
|
export type HeaderScrollToTopOptions = {
|
|
442
|
-
/**
|
|
443
|
-
largeTitle?: boolean;
|
|
451
|
+
/** The screen's `largeTitle`: the top includes an expanded one on iOS (an inline one has no row of its own). */
|
|
452
|
+
largeTitle?: boolean | 'inline';
|
|
444
453
|
/** Extra room above the content, for a bar the screen lays out under the header itself. */
|
|
445
454
|
topInset?: number;
|
|
446
455
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './native-inline-large-title.ios';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NativeInlineLargeTitleComponent } from './native-inline-large-title.types';
|
|
2
|
+
/** iOS 17 keeps the large title in the bar row, next to the bar items (`LargeTitleDisplayMode.inline`). */
|
|
3
|
+
export declare const NativeInlineLargeTitle: NativeInlineLargeTitleComponent;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { HeaderContent, HeaderNavigation, HeaderOptionsResult, HeaderParams } from './header.types';
|
|
2
2
|
/**
|
|
3
3
|
* A screen's header as native-stack options, with what its list needs alongside: the title (centred, leading with a
|
|
4
|
-
* subtitle, revealed on scroll or large), the actions on both sides (the navigation bar's own items on
|
|
5
|
-
* buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
6
|
-
* Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
4
|
+
* subtitle, revealed on scroll, large or inline large), the actions on both sides (the navigation bar's own items on
|
|
5
|
+
* iOS, Material buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
6
|
+
* a React Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
7
7
|
*/
|
|
8
8
|
export declare const useHeaderOptions: ({ backHidden, largeTitle, leadingActions, search, subtitle, title, titleHidden, titleRevealProgress, titleTransition, trailingActions, }: HeaderParams) => HeaderOptionsResult;
|
|
9
9
|
/**
|
|
@@ -6,7 +6,7 @@ import type { StackScreenOptions } from './header.types';
|
|
|
6
6
|
* bar in the surface colour.
|
|
7
7
|
*/
|
|
8
8
|
export declare const useStackScreenOptions: () => StackScreenOptions;
|
|
9
|
-
/** A screen with a large title that collapses into the bar as its list scrolls. */
|
|
9
|
+
/** A screen with a large title that collapses into the bar as its list scrolls, or sits in the bar row (`'inline'`). */
|
|
10
10
|
export declare const LARGE_TITLE_SCREEN_OPTIONS: StackScreenOptions;
|
|
11
11
|
/** A screen without the stack's header, for one that draws its own or none. */
|
|
12
12
|
export declare const HIDDEN_HEADER_SCREEN_OPTIONS: StackScreenOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hzblj/kara-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "The atoms, molecules, organisms and templates of @hzblj/kara-ui — real SwiftUI and Jetpack Compose views through @expo/ui.",
|
|
5
5
|
"author": "Jan Blazej",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@hzblj/expo-native-icons": "^0.2.0",
|
|
68
68
|
"@hzblj/expo-rich-haptics": "^0.1.0",
|
|
69
|
-
"@hzblj/kara-native": "^0.
|
|
70
|
-
"@hzblj/kara-sx": "^0.
|
|
71
|
-
"@hzblj/kara-theme": "^0.
|
|
69
|
+
"@hzblj/kara-native": "^0.28.0",
|
|
70
|
+
"@hzblj/kara-sx": "^0.28.0",
|
|
71
|
+
"@hzblj/kara-theme": "^0.28.0",
|
|
72
72
|
"sf-symbols-typescript": "^2.2.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
@@ -14,6 +14,7 @@ import {scheduleOnRN} from 'react-native-worklets'
|
|
|
14
14
|
|
|
15
15
|
import {RnText} from '../../atoms/rn-text'
|
|
16
16
|
import type {HeaderOptions} from './header.types'
|
|
17
|
+
import {NativeInlineLargeTitle} from './native-inline-large-title'
|
|
17
18
|
import {hasNativeSubtitle, NativeSubtitle} from './native-subtitle'
|
|
18
19
|
|
|
19
20
|
/** Past half, a revealed title counts as shown: the native title and subtitle switch then. */
|
|
@@ -121,8 +122,10 @@ const CollapsingTitle = ({
|
|
|
121
122
|
)
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
const INLINE_LARGE_TITLE = <NativeInlineLargeTitle />
|
|
126
|
+
|
|
124
127
|
type TitleParams = {
|
|
125
|
-
largeTitle?: boolean
|
|
128
|
+
largeTitle?: boolean | 'inline'
|
|
126
129
|
subtitle?: string
|
|
127
130
|
title?: string
|
|
128
131
|
titleHidden: boolean
|
|
@@ -131,9 +134,10 @@ type TitleParams = {
|
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
/**
|
|
134
|
-
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll
|
|
135
|
-
* large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
136
|
-
* top app bar does. iOS needs neither: the large title is UIKit's own
|
|
137
|
+
* The title half of a header: the options that show the title (centred, leading with a subtitle, revealed on scroll,
|
|
138
|
+
* large or inline large), plus on Android the large title row and the scroll worklet that collapses it into the bar, as
|
|
139
|
+
* Material's large top app bar does. iOS needs neither: the large title is UIKit's own, and an inline one only needs
|
|
140
|
+
* the view that keeps it in the bar row.
|
|
137
141
|
*/
|
|
138
142
|
export const useHeaderTitle = ({
|
|
139
143
|
largeTitle,
|
|
@@ -160,7 +164,7 @@ export const useHeaderTitle = ({
|
|
|
160
164
|
const titleOptions: HeaderOptions = {}
|
|
161
165
|
|
|
162
166
|
if (largeTitle !== undefined) {
|
|
163
|
-
titleOptions.headerLargeTitleEnabled = Platform.OS === 'ios' && largeTitle
|
|
167
|
+
titleOptions.headerLargeTitleEnabled = Platform.OS === 'ios' && largeTitle !== false
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
if (title === undefined) {
|
|
@@ -228,5 +232,7 @@ export const useHeaderTitle = ({
|
|
|
228
232
|
[isAndroidLargeTitle, largeTitleHeight, title]
|
|
229
233
|
)
|
|
230
234
|
|
|
231
|
-
|
|
235
|
+
const inlineLargeTitle = largeTitle === 'inline' ? INLINE_LARGE_TITLE : null
|
|
236
|
+
|
|
237
|
+
return {inlineLargeTitle, largeTitle: largeTitleRow, onScroll, options, revealed}
|
|
232
238
|
}
|
|
@@ -153,8 +153,12 @@ export type HeaderParams = {
|
|
|
153
153
|
* A large title that collapses into the bar as the list scrolls. iOS draws UIKit's own; Android, where the native
|
|
154
154
|
* stack has none, puts it into the content as the list's first row (`largeTitle` in the result) and fades the bar's
|
|
155
155
|
* title in once that row has scrolled away, as Material's large top app bar does. Wire `onScroll` for it.
|
|
156
|
+
*
|
|
157
|
+
* `'inline'` puts the large title on the leading side of the bar row instead, level with the actions, as the Apple
|
|
158
|
+
* TV app's tabs have it (iOS 17), with no row of its own under the bar. Render `inlineLargeTitle` from the result.
|
|
159
|
+
* Android shows the bar's plain title.
|
|
156
160
|
*/
|
|
157
|
-
largeTitle?: boolean
|
|
161
|
+
largeTitle?: boolean | 'inline'
|
|
158
162
|
/**
|
|
159
163
|
* The leading side's actions, in screen order from the edge. On iOS they follow the back button. Unset leaves the
|
|
160
164
|
* side as the stack's options have it; an empty array clears it.
|
|
@@ -263,7 +267,12 @@ export type HeaderContent = {
|
|
|
263
267
|
* lets the content run under it.
|
|
264
268
|
*/
|
|
265
269
|
contentInsetAdjustmentBehavior: 'automatic' | 'never'
|
|
266
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* iOS, with `largeTitle: 'inline'`: what keeps the large title in the bar row. Render it once anywhere in the screen,
|
|
272
|
+
* after the list, outside a SwiftUI host. `null` everywhere else.
|
|
273
|
+
*/
|
|
274
|
+
inlineLargeTitle: ReactElement | null
|
|
275
|
+
/** Android, with `largeTitle: true`: the large title, to render as the list's first row. `null` everywhere else. */
|
|
267
276
|
largeTitle: ReactElement | null
|
|
268
277
|
/** A worklet to call with the list's vertical offset from its scroll handler, for what follows the scroll. */
|
|
269
278
|
onScroll: (offsetY: number) => void
|
|
@@ -418,8 +427,8 @@ export type HeaderScrollable =
|
|
|
418
427
|
| {scrollToOffset: (params: {animated?: boolean; offset: number}) => void}
|
|
419
428
|
|
|
420
429
|
export type HeaderScrollToTopOptions = {
|
|
421
|
-
/**
|
|
422
|
-
largeTitle?: boolean
|
|
430
|
+
/** The screen's `largeTitle`: the top includes an expanded one on iOS (an inline one has no row of its own). */
|
|
431
|
+
largeTitle?: boolean | 'inline'
|
|
423
432
|
/** Extra room above the content, for a bar the screen lays out under the header itself. */
|
|
424
433
|
topInset?: number
|
|
425
434
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {InlineLargeTitle} from '@hzblj/kara-native/swift-ui'
|
|
2
|
+
|
|
3
|
+
import type {NativeInlineLargeTitleComponent} from './native-inline-large-title.types'
|
|
4
|
+
|
|
5
|
+
/** iOS 17 keeps the large title in the bar row, next to the bar items (`LargeTitleDisplayMode.inline`). */
|
|
6
|
+
export const NativeInlineLargeTitle: NativeInlineLargeTitleComponent = () => <InlineLargeTitle />
|
|
@@ -31,7 +31,7 @@ export const useHeaderScrollToTop = (
|
|
|
31
31
|
{largeTitle = false, topInset = 0}: HeaderScrollToTopOptions = {}
|
|
32
32
|
): HeaderScrollToTopRef => {
|
|
33
33
|
const barInset = useHeaderBarInset()
|
|
34
|
-
const offset = Platform.OS === 'ios' ? -(barInset + (largeTitle ? LARGE_TITLE_HEIGHT : 0) + topInset) : 0
|
|
34
|
+
const offset = Platform.OS === 'ios' ? -(barInset + (largeTitle === true ? LARGE_TITLE_HEIGHT : 0) + topInset) : 0
|
|
35
35
|
|
|
36
36
|
return useMemo(
|
|
37
37
|
() => ({
|
|
@@ -7,9 +7,9 @@ import {useHeaderTitle} from './header-title'
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A screen's header as native-stack options, with what its list needs alongside: the title (centred, leading with a
|
|
10
|
-
* subtitle, revealed on scroll or large), the actions on both sides (the navigation bar's own items on
|
|
11
|
-
* buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
12
|
-
* Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
10
|
+
* subtitle, revealed on scroll, large or inline large), the actions on both sides (the navigation bar's own items on
|
|
11
|
+
* iOS, Material buttons on Android) and a search field. Spread `options` into Expo Router's `<Stack.Screen options>` or
|
|
12
|
+
* a React Navigation screen's `options`. Memoize the action arrays: new arrays build new options on every render.
|
|
13
13
|
*/
|
|
14
14
|
export const useHeaderOptions = ({
|
|
15
15
|
backHidden,
|
|
@@ -42,11 +42,19 @@ export const useHeaderOptions = ({
|
|
|
42
42
|
|
|
43
43
|
return {
|
|
44
44
|
contentInsetAdjustmentBehavior: 'automatic',
|
|
45
|
+
inlineLargeTitle: headerTitle.inlineLargeTitle,
|
|
45
46
|
largeTitle: headerTitle.largeTitle,
|
|
46
47
|
onScroll: headerTitle.onScroll,
|
|
47
48
|
options,
|
|
48
49
|
}
|
|
49
|
-
}, [
|
|
50
|
+
}, [
|
|
51
|
+
actionOptions,
|
|
52
|
+
headerTitle.inlineLargeTitle,
|
|
53
|
+
headerTitle.largeTitle,
|
|
54
|
+
headerTitle.onScroll,
|
|
55
|
+
headerTitle.options,
|
|
56
|
+
search,
|
|
57
|
+
])
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
/**
|
|
@@ -55,14 +63,14 @@ export const useHeaderOptions = ({
|
|
|
55
63
|
* belongs in its static `options` too: iOS morphs the bar items between screens only when they exist at the push.
|
|
56
64
|
*/
|
|
57
65
|
export const useHeader = (navigation: HeaderNavigation, params: HeaderParams): HeaderContent => {
|
|
58
|
-
const {contentInsetAdjustmentBehavior, largeTitle, onScroll, options} = useHeaderOptions(params)
|
|
66
|
+
const {contentInsetAdjustmentBehavior, inlineLargeTitle, largeTitle, onScroll, options} = useHeaderOptions(params)
|
|
59
67
|
|
|
60
68
|
useLayoutEffect(() => {
|
|
61
69
|
navigation.setOptions(options)
|
|
62
70
|
}, [navigation, options])
|
|
63
71
|
|
|
64
72
|
return useMemo(
|
|
65
|
-
() => ({contentInsetAdjustmentBehavior, largeTitle, onScroll}),
|
|
66
|
-
[contentInsetAdjustmentBehavior, largeTitle, onScroll]
|
|
73
|
+
() => ({contentInsetAdjustmentBehavior, inlineLargeTitle, largeTitle, onScroll}),
|
|
74
|
+
[contentInsetAdjustmentBehavior, inlineLargeTitle, largeTitle, onScroll]
|
|
67
75
|
)
|
|
68
76
|
}
|
|
@@ -46,7 +46,7 @@ export const useStackScreenOptions = (): StackScreenOptions => {
|
|
|
46
46
|
}, [theme])
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
/** A screen with a large title that collapses into the bar as its list scrolls. */
|
|
49
|
+
/** A screen with a large title that collapses into the bar as its list scrolls, or sits in the bar row (`'inline'`). */
|
|
50
50
|
export const LARGE_TITLE_SCREEN_OPTIONS: StackScreenOptions = {headerLargeTitleEnabled: true, headerShown: true}
|
|
51
51
|
|
|
52
52
|
/** A screen without the stack's header, for one that draws its own or none. */
|