react-native-terra-ui 0.11.10 → 0.11.12
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 +17 -0
- package/lib/module/components/box/Box.js +35 -10
- package/lib/module/components/box/Box.js.map +1 -1
- package/lib/module/components/header/hooks/use-header-color.js +16 -0
- package/lib/module/components/header/hooks/use-header-color.js.map +1 -0
- package/lib/module/components/header/hooks/use-large-title-header.js +81 -0
- package/lib/module/components/header/hooks/use-large-title-header.js.map +1 -0
- package/lib/module/components/header/parts/HeaderAccessory.js +21 -6
- package/lib/module/components/header/parts/HeaderAccessory.js.map +1 -1
- package/lib/module/components/header/parts/HeaderBar.js +122 -0
- package/lib/module/components/header/parts/HeaderBar.js.map +1 -0
- package/lib/module/components/header/parts/HeaderGradientOverlay.js +20 -76
- package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -1
- package/lib/module/components/header/parts/HeaderSurface.js +16 -37
- package/lib/module/components/header/parts/HeaderSurface.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +51 -388
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js +72 -0
- package/lib/module/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.js.map +1 -0
- package/lib/module/components/header/variants/TitleHeader/index.js +32 -161
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/surface/Surface.js +2 -0
- package/lib/module/components/surface/Surface.js.map +1 -1
- package/lib/typescript/src/components/box/Box.d.ts +28 -4
- package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
- package/lib/typescript/src/components/header/hooks/use-header-color.d.ts +4 -0
- package/lib/typescript/src/components/header/hooks/use-header-color.d.ts.map +1 -0
- package/lib/typescript/src/components/header/hooks/use-large-title-header.d.ts +36 -0
- package/lib/typescript/src/components/header/hooks/use-large-title-header.d.ts.map +1 -0
- package/lib/typescript/src/components/header/parts/HeaderAccessory.d.ts +8 -5
- package/lib/typescript/src/components/header/parts/HeaderAccessory.d.ts.map +1 -1
- package/lib/typescript/src/components/header/parts/HeaderBar.d.ts +17 -0
- package/lib/typescript/src/components/header/parts/HeaderBar.d.ts.map +1 -0
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts +12 -15
- package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -1
- package/lib/typescript/src/components/header/parts/HeaderSurface.d.ts +8 -9
- package/lib/typescript/src/components/header/parts/HeaderSurface.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +3 -23
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts +11 -0
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.d.ts.map +1 -0
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +3 -19
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/surface/Surface.d.ts +1 -1
- package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/Toast.d.ts +1 -1
- package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/box/Box.tsx +59 -16
- package/src/components/header/hooks/use-header-color.ts +14 -0
- package/src/components/header/hooks/use-large-title-header.ts +78 -0
- package/src/components/header/parts/HeaderAccessory.tsx +26 -7
- package/src/components/header/parts/HeaderBar.tsx +125 -0
- package/src/components/header/parts/HeaderGradientOverlay.tsx +18 -70
- package/src/components/header/parts/HeaderSurface.tsx +16 -35
- package/src/components/header/variants/LargeTitleHeader/index.tsx +44 -371
- package/src/components/header/variants/LargeTitleHeader/parts/LargeTitleContent.tsx +88 -0
- package/src/components/header/variants/TitleHeader/index.tsx +32 -149
- package/src/components/surface/Surface.tsx +2 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
|
+
import Animated from "react-native-reanimated";
|
|
5
|
+
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
6
|
+
import { FONT_WEIGHT_VALUE } from "../../../../../utils/typography.js";
|
|
7
|
+
import { isTextTitle } from "../../../utils.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export function LargeTitleContent({
|
|
10
|
+
title,
|
|
11
|
+
overline,
|
|
12
|
+
subtitle,
|
|
13
|
+
hasAccessoryBelow,
|
|
14
|
+
onHeightChange,
|
|
15
|
+
animatedStyle
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
theme
|
|
19
|
+
} = useUnistyles();
|
|
20
|
+
// Layout height excludes the collapse transform.
|
|
21
|
+
const handleLayout = event => onHeightChange?.(event.nativeEvent.layout.height);
|
|
22
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
23
|
+
style: [styles.portalContent(hasAccessoryBelow), animatedStyle],
|
|
24
|
+
onLayout: handleLayout,
|
|
25
|
+
children: [!!overline && /*#__PURE__*/_jsx(Text, {
|
|
26
|
+
style: styles.overline,
|
|
27
|
+
maxFontSizeMultiplier: theme.typography.variants["label-sm"].maxFontSizeMultiplier,
|
|
28
|
+
children: overline
|
|
29
|
+
}), isTextTitle(title) ? /*#__PURE__*/_jsx(Text, {
|
|
30
|
+
style: styles.largeTitle,
|
|
31
|
+
maxFontSizeMultiplier: theme.typography.variants["headline-lg"].maxFontSizeMultiplier,
|
|
32
|
+
children: title
|
|
33
|
+
}) : title, !!subtitle && /*#__PURE__*/_jsx(Text, {
|
|
34
|
+
style: styles.subtitle,
|
|
35
|
+
maxFontSizeMultiplier: theme.typography.variants["body-lg"].maxFontSizeMultiplier,
|
|
36
|
+
children: subtitle
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const styles = StyleSheet.create(theme => ({
|
|
41
|
+
portalContent: hasAccessoryBelow => ({
|
|
42
|
+
gap: theme.spacing["1"] / 2,
|
|
43
|
+
// Include the gap in the measured height used to position the accessory.
|
|
44
|
+
paddingBottom: hasAccessoryBelow ? theme.spacing["2"] : 0,
|
|
45
|
+
paddingHorizontal: theme.layout.screen.padding.x,
|
|
46
|
+
uni__dependencies: [0]
|
|
47
|
+
}),
|
|
48
|
+
overline: {
|
|
49
|
+
fontSize: theme.typography.variants["label-sm"].fontSize,
|
|
50
|
+
lineHeight: theme.typography.variants["label-sm"].lineHeight,
|
|
51
|
+
letterSpacing: theme.typography.variants["label-sm"].letterSpacing,
|
|
52
|
+
fontWeight: FONT_WEIGHT_VALUE[theme.typography.variants["label-sm"].fontWeight],
|
|
53
|
+
color: theme.color["text.tertiary"] ?? "",
|
|
54
|
+
uni__dependencies: [0]
|
|
55
|
+
},
|
|
56
|
+
largeTitle: {
|
|
57
|
+
fontSize: theme.typography.variants["headline-lg"].fontSize,
|
|
58
|
+
lineHeight: theme.typography.variants["headline-lg"].lineHeight,
|
|
59
|
+
letterSpacing: theme.typography.variants["headline-lg"].letterSpacing,
|
|
60
|
+
fontWeight: FONT_WEIGHT_VALUE[theme.typography.variants["headline-lg"].fontWeight],
|
|
61
|
+
color: theme.color["text.primary"] ?? "",
|
|
62
|
+
uni__dependencies: [0]
|
|
63
|
+
},
|
|
64
|
+
subtitle: {
|
|
65
|
+
fontSize: theme.typography.variants["body-lg"].fontSize,
|
|
66
|
+
lineHeight: theme.typography.variants["body-lg"].lineHeight,
|
|
67
|
+
letterSpacing: theme.typography.variants["body-lg"].letterSpacing,
|
|
68
|
+
color: theme.color["text.tertiary"] ?? "",
|
|
69
|
+
uni__dependencies: [0]
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
//# sourceMappingURL=LargeTitleContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Animated","StyleSheet","useUnistyles","FONT_WEIGHT_VALUE","isTextTitle","jsx","_jsx","jsxs","_jsxs","LargeTitleContent","title","overline","subtitle","hasAccessoryBelow","onHeightChange","animatedStyle","theme","handleLayout","event","nativeEvent","layout","height","View","style","styles","portalContent","onLayout","children","Text","maxFontSizeMultiplier","typography","variants","largeTitle","create","gap","spacing","paddingBottom","paddingHorizontal","screen","padding","x","uni__dependencies","fontSize","lineHeight","letterSpacing","fontWeight","color"],"sourceRoot":"../../../../../../../src","sources":["components/header/variants/LargeTitleHeader/parts/LargeTitleContent.tsx"],"mappings":";;;AAGA,OAAOA,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AAAyB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG7C,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,iBAAiB;EACjBC,cAAc;EACdC;AAOF,CAAC,EAAE;EACD,MAAM;IAAEC;EAAM,CAAC,GAAGd,YAAY,CAAC,CAAC;EAChC;EACA,MAAMe,YAAY,GAAIC,KAAwB,IAAKJ,cAAc,GAAGI,KAAK,CAACC,WAAW,CAACC,MAAM,CAACC,MAAM,CAAC;EAEpG,oBACEb,KAAA,CAACR,QAAQ,CAACsB,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,aAAa,CAACZ,iBAAiB,CAAC,EAAEE,aAAa,CAAE;IAACW,QAAQ,EAAET,YAAa;IAAAU,QAAA,GACpG,CAAC,CAAChB,QAAQ,iBACTL,IAAA,CAACsB,IAAI;MACHL,KAAK,EAAEC,MAAM,CAACb,QAAS;MACvBkB,qBAAqB,EAAEb,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,UAAU,CAAC,CAACF,qBAAsB;MAAAF,QAAA,EAElF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,CAACc,UAAU,CAAC;IAC/EC,KAAK,EAAG9B,KAAK,CAAC8B,KAAK,CAAmD,eAAe,CAAC,IAAI,EAAE;IAAAL,iBAAA;EAC9F,CAAC;EACDT,UAAU,EAAE;IACVU,QAAQ,EAAE1B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,aAAa,CAAC,CAACW,QAAQ;IAC3DC,UAAU,EAAE3B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,aAAa,CAAC,CAACY,UAAU;IAC/DC,aAAa,EAAE5B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,aAAa,CAAC,CAACa,aAAa;IACrEC,UAAU,EAAE1C,iBAAiB,CAACa,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,aAAa,CAAC,CAACc,UAAU,CAAC;IAClFC,KAAK,EAAG9B,KAAK,CAAC8B,KAAK,CAAmD,cAAc,CAAC,IAAI,EAAE;IAAAL,iBAAA;EAC7F,CAAC;EACD7B,QAAQ,EAAE;IACR8B,QAAQ,EAAE1B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,SAAS,CAAC,CAACW,QAAQ;IACvDC,UAAU,EAAE3B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,SAAS,CAAC,CAACY,UAAU;IAC3DC,aAAa,EAAE5B,KAAK,CAACc,UAAU,CAACC,QAAQ,CAAC,SAAS,CAAC,CAACa,aAAa;IACjEE,KAAK,EAAG9B,KAAK,CAAC8B,KAAK,CAAmD,eAAe,CAAC,IAAI,EAAE;IAAAL,iBAAA;EAC9F;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
7
|
-
import { resolveThemeColor } from "../../../../utils/resolve-theme-color.js";
|
|
8
|
-
import { FONT_WEIGHT_VALUE } from "../../../../utils/typography.js";
|
|
4
|
+
import { useContext } from "react";
|
|
5
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
9
6
|
import { useHeaderBackground } from "../../../screen/parts/ScreenHeaderAppearance.js";
|
|
10
7
|
import { ScreenContext } from "../../../screen/ScreenContext.js";
|
|
11
|
-
import {
|
|
12
|
-
import { HeaderDismissButton } from "../../header-buttons.js";
|
|
8
|
+
import { useHeaderColor } from "../../hooks/use-header-color.js";
|
|
13
9
|
import { HeaderAccessory } from "../../parts/HeaderAccessory.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Compact title bar (leading slot · title · trailing slot) with a top safe-area
|
|
19
|
-
* inset outside Screen. Within Screen, the root owns safe-area clearance. The inline counterpart to `Header.LargeTitle`; use it for screens that
|
|
20
|
-
* don't need a collapsing large title.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <Screen.Header>
|
|
25
|
-
* <Header.Title
|
|
26
|
-
* title="Stats"
|
|
27
|
-
* trailingActions={
|
|
28
|
-
* <Toolbar.Button icon="add" accessibilityLabel="Add" onPress={add} />
|
|
29
|
-
* }
|
|
30
|
-
* />
|
|
31
|
-
* </Screen.Header>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
10
|
+
import { HeaderBar } from "../../parts/HeaderBar.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
/** Compact header. Screen owns the safe area when present; standalone headers reserve it here. */
|
|
34
13
|
export function TitleHeader({
|
|
35
14
|
title,
|
|
36
15
|
leadingActions,
|
|
@@ -39,79 +18,34 @@ export function TitleHeader({
|
|
|
39
18
|
RightToolbar,
|
|
40
19
|
accessory,
|
|
41
20
|
accessoryPadding = "x",
|
|
42
|
-
dismissAction = "none",
|
|
43
|
-
navigation,
|
|
44
|
-
onDismiss,
|
|
45
21
|
titleAlignment = "center",
|
|
46
22
|
background,
|
|
47
|
-
bg
|
|
23
|
+
bg,
|
|
24
|
+
...dismissProps
|
|
48
25
|
}) {
|
|
49
|
-
const {
|
|
50
|
-
theme
|
|
51
|
-
} = useUnistyles();
|
|
52
26
|
const screen = useContext(ScreenContext);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}), leadingContent]
|
|
74
|
-
}) : leadingContent;
|
|
75
|
-
const trailing = dismissAction === "close" ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
76
|
-
children: [trailingContent, /*#__PURE__*/_jsx(HeaderDismissButton, {
|
|
77
|
-
dismissAction: dismissAction,
|
|
78
|
-
navigation: navigation,
|
|
79
|
-
onDismiss: onDismiss
|
|
80
|
-
})]
|
|
81
|
-
}) : trailingContent;
|
|
82
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
83
|
-
style: styles.container,
|
|
84
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
85
|
-
style: styles.safeArea(isTransparent, bgColor, screen !== null)
|
|
86
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
87
|
-
style: styles.barGroup,
|
|
88
|
-
children: [/*#__PURE__*/_jsx(HeaderSurface, {
|
|
89
|
-
color: gradientColor
|
|
90
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
91
|
-
style: styles.bar,
|
|
92
|
-
children: [leading != null && /*#__PURE__*/_jsx(Toolbar, {
|
|
93
|
-
children: leading
|
|
94
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
95
|
-
style: styles.titleContainer,
|
|
96
|
-
pointerEvents: isCustomTitle(title) ? "box-none" : "none",
|
|
97
|
-
children: isTextTitle(title) ? String(title).trim().length > 0 && /*#__PURE__*/_jsx(Text, {
|
|
98
|
-
style: styles.title,
|
|
99
|
-
children: title
|
|
100
|
-
}) : title
|
|
101
|
-
}), trailing != null && /*#__PURE__*/_jsx(Toolbar, {
|
|
102
|
-
style: styles.trailing,
|
|
103
|
-
children: trailing
|
|
104
|
-
})]
|
|
105
|
-
}), accessory != null && /*#__PURE__*/_jsx(HeaderAccessory, {
|
|
106
|
-
padding: accessoryPadding,
|
|
107
|
-
onHeightChange: handleAccessoryHeightChange,
|
|
108
|
-
children: accessory
|
|
109
|
-
})]
|
|
110
|
-
})]
|
|
111
|
-
});
|
|
112
|
-
}
|
|
27
|
+
const color = useHeaderColor(background ?? bg);
|
|
28
|
+
useHeaderBackground(color);
|
|
29
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
30
|
+
style: styles.container,
|
|
31
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
32
|
+
style: styles.safeArea(color, screen !== null)
|
|
33
|
+
}), /*#__PURE__*/_jsx(HeaderBar, {
|
|
34
|
+
...dismissProps,
|
|
35
|
+
title: title,
|
|
36
|
+
titleAlignment: titleAlignment,
|
|
37
|
+
color: color,
|
|
38
|
+
leading: leadingActions !== undefined ? leadingActions : LeftToolbar,
|
|
39
|
+
trailing: trailingActions !== undefined ? trailingActions : RightToolbar
|
|
40
|
+
}), accessory != null && /*#__PURE__*/_jsx(HeaderAccessory, {
|
|
41
|
+
padding: accessoryPadding,
|
|
42
|
+
color: color,
|
|
43
|
+
onHeightChange: screen?.setHeaderAccessoryHeight,
|
|
44
|
+
children: accessory
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
113
47
|
}
|
|
114
|
-
const styles = StyleSheet.create((
|
|
48
|
+
const styles = StyleSheet.create((_, runtime) => ({
|
|
115
49
|
container: {
|
|
116
50
|
position: "absolute",
|
|
117
51
|
top: 0,
|
|
@@ -119,73 +53,10 @@ const styles = StyleSheet.create((theme, runtime) => ({
|
|
|
119
53
|
right: 0,
|
|
120
54
|
zIndex: 1000
|
|
121
55
|
},
|
|
122
|
-
safeArea: (
|
|
56
|
+
safeArea: (color, withinScreen) => ({
|
|
123
57
|
height: withinScreen ? 0 : runtime.insets.top,
|
|
124
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: color,
|
|
125
59
|
uni__dependencies: [9]
|
|
126
|
-
})
|
|
127
|
-
// Anchors the absolutely positioned surface over the bar and the accessory both.
|
|
128
|
-
barGroup: {
|
|
129
|
-
position: "relative"
|
|
130
|
-
},
|
|
131
|
-
bar: {
|
|
132
|
-
height: theme.layout.header.height,
|
|
133
|
-
flexDirection: "row",
|
|
134
|
-
alignItems: "center",
|
|
135
|
-
paddingHorizontal: theme.layout.screen.padding.x,
|
|
136
|
-
gap: theme.spacing["3"],
|
|
137
|
-
justifyContent: "space-between",
|
|
138
|
-
uni__dependencies: [0]
|
|
139
|
-
},
|
|
140
|
-
// A centered title is absolutely positioned, so it leaves the flex row. With
|
|
141
|
-
// no leading slot the trailing toolbar would be the only in-flow child and
|
|
142
|
-
// `space-between` would park it on the left — the auto margin pins it right.
|
|
143
|
-
trailing: {
|
|
144
|
-
justifyContent: "flex-end",
|
|
145
|
-
variants: {
|
|
146
|
-
titleAlignment: {
|
|
147
|
-
center: {
|
|
148
|
-
marginLeft: "auto"
|
|
149
|
-
},
|
|
150
|
-
left: {}
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
uni__dependencies: [4]
|
|
154
|
-
},
|
|
155
|
-
titleContainer: {
|
|
156
|
-
variants: {
|
|
157
|
-
titleAlignment: {
|
|
158
|
-
center: {
|
|
159
|
-
position: "absolute",
|
|
160
|
-
left: 0,
|
|
161
|
-
right: 0,
|
|
162
|
-
alignItems: "center"
|
|
163
|
-
},
|
|
164
|
-
left: {
|
|
165
|
-
flex: 1,
|
|
166
|
-
alignItems: "flex-start"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
uni__dependencies: [4]
|
|
171
|
-
},
|
|
172
|
-
title: {
|
|
173
|
-
fontSize: theme.typography.variants["title-md"].fontSize,
|
|
174
|
-
lineHeight: theme.typography.variants["title-md"].lineHeight,
|
|
175
|
-
letterSpacing: theme.typography.variants["title-md"].letterSpacing,
|
|
176
|
-
fontWeight: FONT_WEIGHT_VALUE[theme.typography.variants["title-md"].fontWeight],
|
|
177
|
-
color: theme.color["text.primary"] ?? "",
|
|
178
|
-
variants: {
|
|
179
|
-
titleAlignment: {
|
|
180
|
-
center: {
|
|
181
|
-
textAlign: "center"
|
|
182
|
-
},
|
|
183
|
-
left: {
|
|
184
|
-
textAlign: "left"
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
uni__dependencies: [0, 4]
|
|
189
|
-
}
|
|
60
|
+
})
|
|
190
61
|
}));
|
|
191
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useContext","StyleSheet","useHeaderBackground","ScreenContext","useHeaderColor","HeaderAccessory","HeaderBar","jsx","_jsx","jsxs","_jsxs","TitleHeader","title","leadingActions","trailingActions","LeftToolbar","RightToolbar","accessory","accessoryPadding","titleAlignment","background","bg","dismissProps","screen","color","View","style","styles","container","children","safeArea","leading","undefined","trailing","padding","onHeightChange","setHeaderAccessoryHeight","create","_","runtime","position","top","left","right","zIndex","withinScreen","height","insets","backgroundColor","uni__dependencies"],"sourceRoot":"../../../../../../src","sources":["components/header/variants/TitleHeader/index.tsx"],"mappings":";;;AAAA,SAAyBA,UAAU,QAAQ,OAAO;AAGlD,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,mBAAmB;AAC5B,SAASC,aAAa;AAEtB,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,SAAS;AAAgC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA4ClD;AACA,OAAO,SAASC,WAAWA,CA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AAE,CAAC;IAAEC,MAAM,EAAE;EAAK,CAAC;EAC5Ed,QAAQ,EAAEA,CAACN,KAAa,EAAEqB,YAAqB,MAAM;IACnDC,MAAM,EAAED,YAAY,GAAG,CAAC,GAAGN,OAAO,CAACQ,MAAM,CAACN,GAAG;IAC7CO,eAAe,EAAExB,KAAK;IAAAyB,iBAAA;EACxB,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -61,6 +61,7 @@ const resolveElevation = (variant, elevation) => {
|
|
|
61
61
|
*/
|
|
62
62
|
export const Surface = /*#__PURE__*/forwardRef(function Surface({
|
|
63
63
|
variant = "base",
|
|
64
|
+
p = "3",
|
|
64
65
|
elevation,
|
|
65
66
|
radius,
|
|
66
67
|
borderWidth,
|
|
@@ -71,6 +72,7 @@ export const Surface = /*#__PURE__*/forwardRef(function Surface({
|
|
|
71
72
|
return /*#__PURE__*/_jsx(Box, {
|
|
72
73
|
ref: ref,
|
|
73
74
|
background: VARIANT_BG[variant],
|
|
75
|
+
p: p,
|
|
74
76
|
radius: radius ?? getDefaultRadius("surface"),
|
|
75
77
|
borderWidth: borderWidth ?? variantBorder.borderWidth,
|
|
76
78
|
borderColor: borderColor ?? variantBorder.borderColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","getDefaultRadius","getSurfaceElevation","Box","jsx","_jsx","VARIANT_BG","base","raised","sunken","transparent","VARIANT_BORDER","borderWidth","borderColor","resolveElevation","variant","elevation","undefined","Surface","radius","rest","ref","variantBorder","background"],"sourceRoot":"../../../../src","sources":["components/surface/Surface.tsx"],"mappings":";;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AAGrD,SAASC,gBAAgB,EAAEC,mBAAmB;AAE9C,SAAgCC,GAAG;;AAEnC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgBA,MAAMC,UAA8C,GAAG;EACrDC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,gBAAgB;EACxBC,MAAM,EAAE,gBAAgB;EACxBC,WAAW,EAAE;AACf,CAAC;;AAED;AACA,MAAMC,cAAoG,GAAG;EAC3GJ,IAAI,EAAE,CAAC,CAAC;EACRC,MAAM,EAAE;IAAEI,WAAW,EAAE,UAAU;IAAEC,WAAW,EAAE;EAAgB,CAAC;EACjEJ,MAAM,EAAE;IAAEG,WAAW,EAAE,UAAU;IAAEC,WAAW,EAAE;EAAiB,CAAC;EAClEH,WAAW,EAAE,CAAC;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,gBAAgB,GAAGA,CAACC,OAAuB,EAAEC,SAAwB,KAAmB;EAC5F,IAAID,OAAO,KAAK,aAAa,EAAE,OAAO,MAAM;EAC5C,IAAIC,SAAS,KAAKC,SAAS,EAAE,OAAOD,SAAS;EAC7C,IAAID,OAAO,KAAK,QAAQ,EAAE,OAAO,IAAI;EACrC,OAAOb,mBAAmB,CAAC,CAAC;AAC9B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMgB,OAAO,gBAAGlB,UAAU,CAA0C,SAASkB,OAAOA,CACzF;EAAEH,OAAO,GAAG,MAAM;
|
|
1
|
+
{"version":3,"names":["forwardRef","getDefaultRadius","getSurfaceElevation","Box","jsx","_jsx","VARIANT_BG","base","raised","sunken","transparent","VARIANT_BORDER","borderWidth","borderColor","resolveElevation","variant","elevation","undefined","Surface","p","radius","rest","ref","variantBorder","background"],"sourceRoot":"../../../../src","sources":["components/surface/Surface.tsx"],"mappings":";;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AAGrD,SAASC,gBAAgB,EAAEC,mBAAmB;AAE9C,SAAgCC,GAAG;;AAEnC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgBA,MAAMC,UAA8C,GAAG;EACrDC,IAAI,EAAE,iBAAiB;EACvBC,MAAM,EAAE,gBAAgB;EACxBC,MAAM,EA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ACV,WAAY;IACtDG,SAAS,EAAEF,gBAAgB,CAACC,OAAO,EAAEC,SAAS,CAAE;IAAA,GAC5CK;EAAI,CACT,CAAC;AAEN,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef, type ElementType, type ReactElement } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
2
3
|
import { type BoxStyleProps } from "./utils.js";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
/** Props owned by Box itself — everything else belongs to the rendered element. */
|
|
5
|
+
interface BoxOwnProps extends BoxStyleProps {
|
|
6
|
+
/** Merge Box's style/props onto a single child instead of rendering an element. Takes precedence over `as`. */
|
|
5
7
|
asChild?: boolean;
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Props of `Box` when cast as `T`. Token style-props plus everything the
|
|
11
|
+
* rendered component accepts — `<Box as={Pressable} onPress={…} />` type-checks
|
|
12
|
+
* against `Pressable`, not `View`.
|
|
13
|
+
*/
|
|
14
|
+
export type BoxProps<T extends ElementType = typeof View> = BoxOwnProps & {
|
|
15
|
+
/** Render as this component instead of `View`. It must accept a `style` prop. */
|
|
16
|
+
as?: T;
|
|
17
|
+
} & Omit<ComponentPropsWithRef<T>, keyof BoxOwnProps | "as">;
|
|
7
18
|
/**
|
|
8
19
|
* Base layout primitive: a `View` styled through theme-token props.
|
|
9
20
|
* The only component family exposing token style-props.
|
|
21
|
+
*
|
|
22
|
+
* Pass `as` to cast it as another component — the token style-props still
|
|
23
|
+
* resolve, and the rest of the props are typed against that component.
|
|
24
|
+
* Note that `as` renders a component Box does not own, so a Unistyles style
|
|
25
|
+
* handed to it only stays theme-reactive if that component's own module runs
|
|
26
|
+
* through the Unistyles Babel plugin (see the stylesheet note below).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Box row gap="2" p="4" />
|
|
31
|
+
* <Box as={Pressable} onPress={onPress} p="3" radius="md" />
|
|
32
|
+
* ```
|
|
10
33
|
*/
|
|
11
|
-
export declare const Box:
|
|
34
|
+
export declare const Box: <T extends ElementType = typeof View>(props: BoxProps<T>) => ReactElement | null;
|
|
35
|
+
export {};
|
|
12
36
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../../src/components/box/Box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../../src/components/box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAEhB,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EAAkB,IAAI,EAAkB,MAAM,cAAc,CAAC;AAKpE,OAAO,EAAuB,KAAK,aAAa,EAAmB,MAAM,YAAS,CAAC;AAEnF,mFAAmF;AACnF,UAAU,WAAY,SAAQ,aAAa;IACzC,+GAA+G;IAC/G,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,OAAO,IAAI,IAAI,WAAW,GAAG;IACxE,iFAAiF;IACjF,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC;AA6C7D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,GAAG,EAA4B,CAAC,CAAC,SAAS,WAAW,GAAG,OAAO,IAAI,EAC9E,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KACf,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-header-color.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/hooks/use-header-color.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,UAIhD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { HeaderAccessoryBehavior } from "../types.js";
|
|
2
|
+
interface LargeTitleLayoutOptions {
|
|
3
|
+
hasAccessory: boolean;
|
|
4
|
+
accessoryBehavior: HeaderAccessoryBehavior;
|
|
5
|
+
isLargeTitleHidden: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Coordinates measured layout and UI-thread animation without animating accessory padding. */
|
|
8
|
+
export declare function useLargeTitleHeader({ hasAccessory, accessoryBehavior, isLargeTitleHidden, }: LargeTitleLayoutOptions): {
|
|
9
|
+
isSticky: boolean;
|
|
10
|
+
accessoryOffset: number;
|
|
11
|
+
reservedAccessoryHeight: number;
|
|
12
|
+
setAccessoryHeight: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
13
|
+
setLargeTitleHeight: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
14
|
+
accessoryStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
15
|
+
transform: {
|
|
16
|
+
translateY: number;
|
|
17
|
+
}[];
|
|
18
|
+
}>;
|
|
19
|
+
surfaceStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
20
|
+
opacity: number;
|
|
21
|
+
}>;
|
|
22
|
+
compactTitleStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
23
|
+
opacity: number;
|
|
24
|
+
transform: {
|
|
25
|
+
translateY: number;
|
|
26
|
+
}[];
|
|
27
|
+
}>;
|
|
28
|
+
largeTitleStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
29
|
+
opacity: number;
|
|
30
|
+
transform: {
|
|
31
|
+
translateY: number;
|
|
32
|
+
}[];
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=use-large-title-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-large-title-header.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/hooks/use-large-title-header.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAU,CAAC;AAExD,UAAU,uBAAuB;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,uBAAuB,CAAC;IAC3C,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,EAClC,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DzB"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import Animated from "react-native-reanimated";
|
|
3
3
|
import type { HeaderAccessoryPadding } from "../types.js";
|
|
4
|
+
import { type HeaderSurfaceProps } from "./HeaderSurface.js";
|
|
4
5
|
export interface HeaderAccessoryProps {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
/** Horizontal padding around the accessory. */
|
|
7
8
|
padding: HeaderAccessoryPadding;
|
|
9
|
+
color: string;
|
|
10
|
+
surfaceStyle?: HeaderSurfaceProps["animatedStyle"];
|
|
8
11
|
/** Reports layout height in dp; reports zero on cleanup to release reserved space. */
|
|
9
|
-
onHeightChange
|
|
12
|
+
onHeightChange?: (height: number) => void;
|
|
10
13
|
/** Additional styles for the accessory container. */
|
|
11
|
-
style?:
|
|
14
|
+
style?: ComponentProps<typeof Animated.View>["style"];
|
|
12
15
|
}
|
|
13
16
|
/** Measures accessory content so the header can reserve space in the scroll container. */
|
|
14
|
-
export declare function HeaderAccessory({ children, padding, onHeightChange, style }: HeaderAccessoryProps): import("react").JSX.Element;
|
|
17
|
+
export declare function HeaderAccessory({ children, padding, color, surfaceStyle, onHeightChange, style, }: HeaderAccessoryProps): import("react").JSX.Element;
|
|
15
18
|
/** Reserves scroll-content space for the sticky accessory rendered in the header overlay. */
|
|
16
19
|
export declare function HeaderAccessorySpacer({ height }: {
|
|
17
20
|
height: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderAccessory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderAccessory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"HeaderAccessory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderAccessory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAGlG,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAU,CAAC;AACvD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,+CAA+C;IAC/C,OAAO,EAAE,sBAAsB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,sFAAsF;IACtF,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,OAAO,EACP,KAAK,EACL,YAAY,EACZ,cAAc,EACd,KAAK,GACN,EAAE,oBAAoB,+BAwBtB;AAED,6FAA6F;AAC7F,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,+BAEnE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import Animated from "react-native-reanimated";
|
|
3
|
+
import { type HeaderDismissProps } from "../header-buttons.js";
|
|
4
|
+
import { type HeaderSurfaceProps } from "./HeaderSurface.js";
|
|
5
|
+
interface HeaderBarProps extends HeaderDismissProps {
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
leading?: ReactNode;
|
|
8
|
+
trailing?: ReactNode;
|
|
9
|
+
titleAlignment: "center" | "left";
|
|
10
|
+
color: string;
|
|
11
|
+
surfaceStyle?: HeaderSurfaceProps["animatedStyle"];
|
|
12
|
+
titleStyle?: ComponentProps<typeof Animated.View>["style"];
|
|
13
|
+
}
|
|
14
|
+
/** Shared compact bar. Only the title and background animate; actions stay interactive. */
|
|
15
|
+
export declare function HeaderBar({ title, leading, trailing, titleAlignment, color, surfaceStyle, titleStyle, dismissAction, navigation, onDismiss, }: HeaderBarProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=HeaderBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HeaderBar.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAK/C,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,sBAAmB,CAAC;AAEjF,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAEzE,UAAU,cAAe,SAAQ,kBAAkB;IACjD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;CAC5D;AAED,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,cAAc,EACd,KAAK,EACL,YAAY,EACZ,UAAU,EACV,aAAsB,EACtB,UAAU,EACV,SAAS,GACV,EAAE,cAAc,+BAsChB"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* the curve has to be steep enough to read as a band. Overhanging lets the tail
|
|
6
|
-
* finish in open space, so the header releases content instead of cutting it.
|
|
2
|
+
* Opacity at the overlay's bottom edge. The top is fully opaque, so the header
|
|
3
|
+
* thins slightly toward the boundary rather than cutting content off square —
|
|
4
|
+
* but never far enough to read as see-through.
|
|
7
5
|
*/
|
|
8
|
-
export declare const
|
|
6
|
+
export declare const HEADER_FADE_END_OPACITY = 0.85;
|
|
9
7
|
export interface HeaderGradientOverlayProps {
|
|
10
|
-
/** Fill color,
|
|
8
|
+
/** Fill color, ramped from opaque to {@link HEADER_FADE_END_OPACITY}. */
|
|
11
9
|
color: string;
|
|
10
|
+
startOpacity?: number;
|
|
11
|
+
endOpacity?: number;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Vertical fade
|
|
15
|
-
*
|
|
16
|
-
* Reaches zero rather than stopping short. An overlay ending at partial opacity
|
|
17
|
-
* leaves a hard step wherever it is clipped, and that step is far more visible
|
|
18
|
-
* than the fade it was meant to hide — it is what cuts content off square as it
|
|
19
|
-
* scrolls under the header.
|
|
14
|
+
* Vertical fade behind header content, shared by header variants.
|
|
20
15
|
*
|
|
21
|
-
*
|
|
16
|
+
* A two-stop linear ramp spanning the overlay's own box: it neither overhangs
|
|
17
|
+
* the surface nor reserves a band inside it, so callers size the surface and
|
|
18
|
+
* the ramp simply spans whatever they gave it.
|
|
22
19
|
*/
|
|
23
|
-
export declare function HeaderGradientOverlay({ color }: HeaderGradientOverlayProps): import("react").JSX.Element;
|
|
20
|
+
export declare function HeaderGradientOverlay({ color, startOpacity, endOpacity, }: HeaderGradientOverlayProps): import("react").JSX.Element;
|
|
24
21
|
//# sourceMappingURL=HeaderGradientOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderGradientOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderGradientOverlay.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"HeaderGradientOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderGradientOverlay.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,MAAM,WAAW,0BAA0B;IACzC,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,YAAgB,EAChB,UAAoC,GACrC,EAAE,0BAA0B,+BAc5B"}
|
|
@@ -3,20 +3,19 @@ type HeaderOpacityStyle = ReturnType<typeof useAnimatedStyle<{
|
|
|
3
3
|
opacity: number;
|
|
4
4
|
}>>;
|
|
5
5
|
export interface HeaderSurfaceProps {
|
|
6
|
-
/** Fill color,
|
|
6
|
+
/** Fill color, ramped toward the surface's bottom edge. */
|
|
7
7
|
color: string;
|
|
8
8
|
/** Opacity style for variants that fade the whole surface in as they collapse. */
|
|
9
9
|
animatedStyle?: HeaderOpacityStyle;
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
* @defaultValue The themed bar height plus `HEADER_FADE_EXTENT`.
|
|
13
|
-
*/
|
|
14
|
-
fadeHeight?: number;
|
|
10
|
+
/** Continue the bar's gradient from 0.85 to 0.80 beneath an accessory. */
|
|
11
|
+
accessory?: boolean;
|
|
15
12
|
}
|
|
16
13
|
/**
|
|
17
|
-
* Header background with
|
|
18
|
-
*
|
|
14
|
+
* Header background with matching gradient boundaries for the bar and accessory.
|
|
15
|
+
*
|
|
16
|
+
* The ramp spans the surface itself: it is sized by the caller and stays inside
|
|
17
|
+
* those bounds, so a taller surface stretches the fade rather than adding to it.
|
|
19
18
|
*/
|
|
20
|
-
export declare function HeaderSurface({ color, animatedStyle,
|
|
19
|
+
export declare function HeaderSurface({ color, animatedStyle, accessory }: HeaderSurfaceProps): import("react").JSX.Element;
|
|
21
20
|
export {};
|
|
22
21
|
//# sourceMappingURL=HeaderSurface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderSurface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderSurface.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HeaderSurface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/header/parts/HeaderSurface.tsx"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAK1E,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAEnF,MAAM,WAAW,kBAAkB;IACjC,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAUpF"}
|