react-native-terra-ui 0.7.2 → 0.8.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 +28 -0
- package/README.md +1 -1
- package/lib/module/components/avatar/Avatar.js +20 -20
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/button/Button.js +11 -11
- package/lib/module/components/button/Button.js.map +1 -1
- package/lib/module/components/chip/Chip.js +32 -32
- package/lib/module/components/chip/Chip.js.map +1 -1
- package/lib/module/components/empty-state/EmptyState.js +3 -3
- package/lib/module/components/empty-state/EmptyState.js.map +1 -1
- package/lib/module/components/header/variants/LargeTitleHeader/index.js +30 -32
- package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
- package/lib/module/components/header/variants/TitleHeader/index.js +26 -18
- package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
- package/lib/module/components/icon/Icon.js +3 -3
- package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +2 -2
- package/lib/module/components/screen/Screen.js +63 -34
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +28 -9
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenFlatList.js +4 -162
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenList.js +81 -97
- package/lib/module/components/screen/ScreenList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +64 -115
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/hooks/use-screen-ref.js +18 -0
- package/lib/module/components/screen/hooks/use-screen-ref.js.map +1 -0
- package/lib/module/components/screen/hooks/use-screen-scroll-handler.js +19 -0
- package/lib/module/components/screen/hooks/use-screen-scroll-handler.js.map +1 -0
- package/lib/module/components/screen/index.js.map +1 -1
- package/lib/module/components/screen/parts/ScreenFrame.js +47 -0
- package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenHeaderAppearance.js +43 -0
- package/lib/module/components/screen/parts/ScreenHeaderAppearance.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenPlaceholder.js +11 -13
- package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
- package/lib/module/components/screen/parts/ScreenSafeArea.android.js +27 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.android.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.js +26 -0
- package/lib/module/components/screen/parts/ScreenSafeArea.js.map +1 -0
- package/lib/module/components/screen/utils.js +18 -9
- package/lib/module/components/screen/utils.js.map +1 -1
- package/lib/module/components/spinner/Spinner.js +2 -2
- package/lib/module/components/text/Text.js +1 -1
- package/lib/module/components/toast/Toast.js +13 -13
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/components/toolbar/Toolbar.js +2 -2
- package/lib/module/context/ThemeProvider.js +22 -39
- package/lib/module/context/ThemeProvider.js.map +1 -1
- package/lib/module/context/index.js +1 -1
- package/lib/module/context/index.js.map +1 -1
- package/lib/module/theme/breakpoints.js +1 -1
- package/lib/module/theme/define-config.js +21 -0
- package/lib/module/theme/define-config.js.map +1 -0
- package/lib/module/theme/diagnostics.js +13 -0
- package/lib/module/theme/diagnostics.js.map +1 -0
- package/lib/module/theme/errors.js +15 -0
- package/lib/module/theme/errors.js.map +1 -0
- package/lib/module/theme/index.js +7 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/legacy-tokens.js +119 -0
- package/lib/module/theme/legacy-tokens.js.map +1 -0
- package/lib/module/theme/registry.js +122 -130
- package/lib/module/theme/registry.js.map +1 -1
- package/lib/module/theme/resolve-config.js +346 -0
- package/lib/module/theme/resolve-config.js.map +1 -0
- package/lib/module/theme/runtime.js +57 -12
- package/lib/module/theme/runtime.js.map +1 -1
- package/lib/module/theme/screen-margin.js +6 -14
- package/lib/module/theme/screen-margin.js.map +1 -1
- package/lib/module/theme/screen-padding.js +17 -0
- package/lib/module/theme/screen-padding.js.map +1 -0
- package/lib/module/theme/selection-store.js +75 -0
- package/lib/module/theme/selection-store.js.map +1 -0
- package/lib/module/theme/theme.js +81 -36
- package/lib/module/theme/theme.js.map +1 -1
- package/lib/module/theme/tokens/canonical-color-keys.js +102 -0
- package/lib/module/theme/tokens/canonical-color-keys.js.map +1 -0
- package/lib/module/theme/tokens/dark.js +72 -88
- package/lib/module/theme/tokens/dark.js.map +1 -1
- package/lib/module/theme/tokens/light.js +69 -83
- package/lib/module/theme/tokens/light.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +14 -14
- package/lib/module/theme/tokens/primitives.js.map +1 -1
- package/lib/module/theme/tokens/validate.js +238 -0
- package/lib/module/theme/tokens/validate.js.map +1 -0
- package/lib/module/theme/unistyles-adapter.js +77 -0
- package/lib/module/theme/unistyles-adapter.js.map +1 -0
- package/lib/module/utils/accent-generator.js +476 -0
- package/lib/module/utils/accent-generator.js.map +1 -0
- package/lib/module/utils/accent-utils.js +52 -35
- package/lib/module/utils/accent-utils.js.map +1 -1
- package/lib/module/utils/color-utils.js +224 -7
- package/lib/module/utils/color-utils.js.map +1 -1
- package/lib/module/utils/deep-merge.js +1 -1
- package/lib/module/utils/deep-merge.js.map +1 -1
- package/lib/module/utils/resolve-theme-color.js +2 -2
- package/lib/typescript/src/components/chip/types.d.ts +1 -1
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts +1 -1
- package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -5
- package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +11 -5
- package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
- package/lib/typescript/src/components/screen/Screen.d.ts +45 -16
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +42 -26
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +5 -46
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenList.d.ts +62 -50
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +18 -58
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts +5 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts +53 -0
- package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/index.d.ts +2 -2
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts +6 -0
- package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts +21 -0
- package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +6 -8
- package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts +7 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts +6 -0
- package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/types.d.ts +27 -32
- package/lib/typescript/src/components/screen/types.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/utils.d.ts +9 -8
- package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
- package/lib/typescript/src/components/text/Text.d.ts +1 -1
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/toolbar/Toolbar.d.ts +2 -2
- package/lib/typescript/src/context/ThemeProvider.d.ts +29 -12
- package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/context/index.d.ts +1 -1
- package/lib/typescript/src/context/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/breakpoints.d.ts +1 -1
- package/lib/typescript/src/theme/define-config.d.ts +23 -0
- package/lib/typescript/src/theme/define-config.d.ts.map +1 -0
- package/lib/typescript/src/theme/diagnostics.d.ts +4 -0
- package/lib/typescript/src/theme/diagnostics.d.ts.map +1 -0
- package/lib/typescript/src/theme/errors.d.ts +10 -0
- package/lib/typescript/src/theme/errors.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +10 -2
- package/lib/typescript/src/theme/index.d.ts.map +1 -1
- package/lib/typescript/src/theme/legacy-tokens.d.ts +187 -0
- package/lib/typescript/src/theme/legacy-tokens.d.ts.map +1 -0
- package/lib/typescript/src/theme/registry.d.ts +12 -17
- package/lib/typescript/src/theme/registry.d.ts.map +1 -1
- package/lib/typescript/src/theme/resolve-config.d.ts +99 -0
- package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -0
- package/lib/typescript/src/theme/runtime.d.ts +25 -4
- package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
- package/lib/typescript/src/theme/screen-margin.d.ts +6 -14
- package/lib/typescript/src/theme/screen-margin.d.ts.map +1 -1
- package/lib/typescript/src/theme/screen-padding.d.ts +15 -0
- package/lib/typescript/src/theme/screen-padding.d.ts.map +1 -0
- package/lib/typescript/src/theme/selection-store.d.ts +41 -0
- package/lib/typescript/src/theme/selection-store.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +54 -1
- package/lib/typescript/src/theme/theme.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts +95 -0
- package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens/dark.d.ts +56 -63
- package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/light.d.ts +56 -71
- package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/primitives.d.ts +11 -10
- package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
- package/lib/typescript/src/theme/tokens/validate.d.ts +34 -0
- package/lib/typescript/src/theme/tokens/validate.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +166 -86
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/lib/typescript/src/theme/unistyles-adapter.d.ts +33 -0
- package/lib/typescript/src/theme/unistyles-adapter.d.ts.map +1 -0
- package/lib/typescript/src/utils/accent-generator.d.ts +103 -0
- package/lib/typescript/src/utils/accent-generator.d.ts.map +1 -0
- package/lib/typescript/src/utils/accent-utils.d.ts +15 -2
- package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/color-utils.d.ts +59 -2
- package/lib/typescript/src/utils/color-utils.d.ts.map +1 -1
- package/lib/typescript/src/utils/deep-merge.d.ts +1 -0
- package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -1
- package/lib/typescript/src/utils/resolve-theme-color.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +20 -20
- package/src/components/button/Button.tsx +11 -11
- package/src/components/chip/Chip.tsx +32 -32
- package/src/components/chip/types.ts +1 -1
- package/src/components/empty-state/EmptyState.tsx +4 -4
- package/src/components/header/variants/LargeTitleHeader/index.tsx +31 -30
- package/src/components/header/variants/TitleHeader/index.tsx +33 -22
- package/src/components/icon/Icon.tsx +4 -4
- package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +2 -2
- package/src/components/screen/Screen.tsx +89 -43
- package/src/components/screen/ScreenContext.tsx +48 -28
- package/src/components/screen/ScreenFlatList.tsx +5 -191
- package/src/components/screen/ScreenList.tsx +197 -175
- package/src/components/screen/ScreenScrollView.tsx +92 -167
- package/src/components/screen/hooks/use-screen-ref.ts +24 -0
- package/src/components/screen/hooks/use-screen-scroll-handler.ts +31 -0
- package/src/components/screen/index.ts +8 -2
- package/src/components/screen/parts/ScreenFrame.tsx +49 -0
- package/src/components/screen/parts/ScreenHeaderAppearance.tsx +52 -0
- package/src/components/screen/parts/ScreenPlaceholder.tsx +16 -16
- package/src/components/screen/parts/ScreenSafeArea.android.tsx +22 -0
- package/src/components/screen/parts/ScreenSafeArea.tsx +20 -0
- package/src/components/screen/types.ts +29 -32
- package/src/components/screen/utils.ts +24 -11
- package/src/components/spinner/Spinner.tsx +2 -2
- package/src/components/text/Text.tsx +2 -2
- package/src/components/toast/Toast.tsx +13 -13
- package/src/components/toolbar/Toolbar.tsx +4 -4
- package/src/context/ThemeProvider.tsx +47 -51
- package/src/context/index.ts +1 -1
- package/src/theme/breakpoints.ts +1 -1
- package/src/theme/define-config.ts +27 -0
- package/src/theme/diagnostics.ts +11 -0
- package/src/theme/errors.ts +14 -0
- package/src/theme/index.ts +40 -1
- package/src/theme/legacy-tokens.ts +227 -0
- package/src/theme/registry.ts +119 -137
- package/src/theme/resolve-config.ts +406 -0
- package/src/theme/runtime.ts +52 -14
- package/src/theme/screen-margin.ts +6 -25
- package/src/theme/screen-padding.ts +26 -0
- package/src/theme/selection-store.ts +76 -0
- package/src/theme/theme.ts +104 -39
- package/src/theme/tokens/canonical-color-keys.ts +107 -0
- package/src/theme/tokens/dark.ts +91 -98
- package/src/theme/tokens/light.ts +88 -93
- package/src/theme/tokens/primitives.ts +14 -14
- package/src/theme/tokens/validate.ts +271 -0
- package/src/theme/types.ts +184 -95
- package/src/theme/unistyles-adapter.ts +75 -0
- package/src/utils/accent-generator.ts +530 -0
- package/src/utils/accent-utils.ts +66 -39
- package/src/utils/color-utils.ts +225 -8
- package/src/utils/deep-merge.ts +1 -1
- package/src/utils/resolve-theme-color.ts +2 -2
- package/lib/module/components/screen/parts/BottomSafeArea.js +0 -62
- package/lib/module/components/screen/parts/BottomSafeArea.js.map +0 -1
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +0 -30
- package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +0 -1
- package/src/components/screen/parts/BottomSafeArea.tsx +0 -59
|
@@ -1,169 +1,118 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
-
import { Children } from "react";
|
|
5
|
-
import Animated
|
|
4
|
+
import { Children, forwardRef } from "react";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
6
6
|
import { StyleSheet } from "react-native-unistyles";
|
|
7
|
-
import {
|
|
8
|
-
import { resolveScreenMargin } from "../../theme/screen-margin.js";
|
|
7
|
+
import { resolveScreenPadding } from "../../theme/screen-padding.js";
|
|
9
8
|
import { PortalHost } from "../portal/index.js";
|
|
10
|
-
import {
|
|
9
|
+
import { useScreenRef } from "./hooks/use-screen-ref.js";
|
|
10
|
+
import { useScreenScrollHandler } from "./hooks/use-screen-scroll-handler.js";
|
|
11
11
|
import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder.js";
|
|
12
12
|
import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext.js";
|
|
13
|
-
import {
|
|
13
|
+
import { hasHorizontalPadding, hasVerticalPadding } from "./utils.js";
|
|
14
|
+
|
|
15
|
+
/** Native ScrollView props plus Screen layout, placeholders, and worklet support. */
|
|
14
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
17
|
/**
|
|
16
|
-
* Scrollable content
|
|
17
|
-
*
|
|
18
|
-
* header content is injected), and applies token-driven content padding.
|
|
18
|
+
* Scrollable content with a header portal and shared scroll tracking.
|
|
19
|
+
* Must be inside Screen. The ref exposes native ScrollView methods.
|
|
19
20
|
*
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
* thread alongside the screen's own handler, with no JS-thread round trip.
|
|
21
|
+
* `contentContainerStyle` styles the native container, including header content.
|
|
22
|
+
* Use `contentStyle` for the inner content only. `onScroll` receives nativeEvent
|
|
23
|
+
* data on JS, without SyntheticEvent methods; `scrollHandler` runs on the UI thread.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```tsx
|
|
27
|
-
* <Screen
|
|
28
|
-
* <Text>
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @example Loading placeholder instead of a per-screen spinner branch
|
|
33
|
-
* ```tsx
|
|
34
|
-
* const { data, loading } = useQuery();
|
|
35
|
-
*
|
|
36
|
-
* <Screen.ScrollView loading={loading}>
|
|
37
|
-
* <Text>{data?.title}</Text>
|
|
38
|
-
* </Screen.ScrollView>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example Empty placeholder when there is nothing to render
|
|
42
|
-
* ```tsx
|
|
43
|
-
* <Screen.ScrollView EmptyComponent={<EmptyState icon="status.info" title="Nothing yet" fill />}>
|
|
44
|
-
* {items.map((item) => <Row key={item.id} item={item} />)}
|
|
45
|
-
* </Screen.ScrollView>
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* @example Simple JS-side scroll callback
|
|
49
|
-
* ```tsx
|
|
50
|
-
* <Screen.ScrollView onScroll={(e) => console.log(e.nativeEvent.contentOffset.y)}>
|
|
51
|
-
* <Text>Scrollable content</Text>
|
|
52
|
-
* </Screen.ScrollView>
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @example Custom scroll-driven animation
|
|
56
|
-
* ```tsx
|
|
57
|
-
* const headerOpacity = useSharedValue(1);
|
|
58
|
-
* const scrollHandler = useAnimatedScrollHandler({
|
|
59
|
-
* onScroll: (event) => {
|
|
60
|
-
* headerOpacity.value = interpolate(event.contentOffset.y, [0, 100], [1, 0]);
|
|
61
|
-
* // Need a JS-side side effect too? Call scheduleOnRN(fn, ...args) here.
|
|
62
|
-
* },
|
|
63
|
-
* });
|
|
64
|
-
*
|
|
65
|
-
* <Screen.ScrollView scrollHandler={scrollHandler}>
|
|
66
|
-
* <Text>Scrollable content</Text>
|
|
67
|
-
* </Screen.ScrollView>
|
|
27
|
+
* <Screen safeArea="auto" contentPadding="x">
|
|
28
|
+
* <Screen.ScrollView isLoading={isLoading} emptyContent={<Text>Nothing yet</Text>}>
|
|
29
|
+
* {items.map(item => <Row key={item.id} item={item} />)}
|
|
30
|
+
* </Screen.ScrollView>
|
|
31
|
+
* </Screen>
|
|
68
32
|
* ```
|
|
69
33
|
*/
|
|
70
|
-
export function ScreenScrollView({
|
|
34
|
+
export const ScreenScrollView = /*#__PURE__*/forwardRef(function ScreenScrollView({
|
|
71
35
|
children,
|
|
72
36
|
style,
|
|
73
37
|
contentContainerStyle,
|
|
38
|
+
contentStyle,
|
|
74
39
|
scrollHandler: externalScrollHandler,
|
|
75
|
-
onScroll
|
|
40
|
+
onScroll,
|
|
76
41
|
horizontal = false,
|
|
42
|
+
isLoading,
|
|
77
43
|
loading = false,
|
|
44
|
+
loadingContent,
|
|
78
45
|
LoadingComponent,
|
|
46
|
+
emptyContent,
|
|
79
47
|
EmptyComponent,
|
|
48
|
+
contentPadding,
|
|
80
49
|
margins,
|
|
50
|
+
extraBottomPadding = 0,
|
|
51
|
+
isEmpty,
|
|
81
52
|
...rest
|
|
82
|
-
}) {
|
|
53
|
+
}, ref) {
|
|
83
54
|
const {
|
|
84
55
|
scrollRef,
|
|
85
|
-
scrollHandler
|
|
86
|
-
|
|
56
|
+
scrollHandler,
|
|
57
|
+
contentPadding: screenPadding,
|
|
87
58
|
hasHeader,
|
|
88
59
|
background
|
|
89
60
|
} = useScreen();
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
// behind, so `{items.map(...)}` over an empty array counts as empty.
|
|
61
|
+
const resolvedPadding = contentPadding ?? margins ?? screenPadding;
|
|
62
|
+
const mergedRef = useScreenRef(scrollRef, ref);
|
|
93
63
|
const placeholder = renderScreenPlaceholder({
|
|
94
|
-
loading,
|
|
95
|
-
LoadingComponent,
|
|
96
|
-
EmptyComponent,
|
|
97
|
-
isEmpty: Children.toArray(children).length === 0
|
|
98
|
-
});
|
|
99
|
-
const jsScrollHandler = useAnimatedScrollHandler({
|
|
100
|
-
onScroll: event => {
|
|
101
|
-
if (onScrollProp) {
|
|
102
|
-
scheduleOnRN(onScrollProp, {
|
|
103
|
-
nativeEvent: event
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
64
|
+
isLoading: isLoading ?? loading,
|
|
65
|
+
loadingContent: loadingContent !== undefined ? loadingContent : LoadingComponent ?? undefined,
|
|
66
|
+
emptyContent: emptyContent !== undefined ? emptyContent : EmptyComponent,
|
|
67
|
+
isEmpty: isEmpty ?? Children.toArray(children).length === 0
|
|
107
68
|
});
|
|
108
|
-
const
|
|
109
|
-
const composedHandler = useComposedEventHandler(handlers);
|
|
69
|
+
const composedScrollHandler = useScreenScrollHandler(scrollHandler, onScroll, externalScrollHandler);
|
|
110
70
|
return /*#__PURE__*/_jsxs(Animated.ScrollView, {
|
|
111
|
-
ref:
|
|
71
|
+
ref: mergedRef,
|
|
112
72
|
style: [{
|
|
113
73
|
backgroundColor: background
|
|
114
74
|
}, style],
|
|
115
75
|
horizontal: horizontal,
|
|
116
|
-
contentInsetAdjustmentBehavior:
|
|
76
|
+
contentInsetAdjustmentBehavior: "never",
|
|
77
|
+
automaticallyAdjustContentInsets: false,
|
|
78
|
+
automaticallyAdjustsScrollIndicatorInsets: false,
|
|
117
79
|
showsVerticalScrollIndicator: false,
|
|
118
80
|
scrollEventThrottle: 16,
|
|
119
|
-
contentContainerStyle: styles.scrollContent(hasHeader,
|
|
120
|
-
// snapToOffsets={headerSnapOffsets}
|
|
121
|
-
,
|
|
81
|
+
contentContainerStyle: [styles.scrollContent(hasHeader, resolvedPadding, extraBottomPadding), contentContainerStyle],
|
|
122
82
|
...rest,
|
|
123
|
-
onScroll:
|
|
83
|
+
onScroll: composedScrollHandler,
|
|
124
84
|
children: [/*#__PURE__*/_jsx(View, {
|
|
85
|
+
style: styles.headerWrapper(resolvedPadding),
|
|
125
86
|
children: /*#__PURE__*/_jsx(PortalHost, {
|
|
126
87
|
name: SCREEN_HEADER_PORTAL_HOST
|
|
127
88
|
})
|
|
128
89
|
}), /*#__PURE__*/_jsx(View, {
|
|
129
|
-
style: [styles.content(horizontal
|
|
90
|
+
style: [styles.content(horizontal), contentStyle],
|
|
130
91
|
children: placeholder ?? children
|
|
131
|
-
})
|
|
92
|
+
})]
|
|
132
93
|
});
|
|
133
|
-
}
|
|
134
|
-
const styles = StyleSheet.create((theme,
|
|
135
|
-
|
|
136
|
-
// hoisted above `return` — the Babel plugin only attributes a runtime
|
|
137
|
-
// dependency (here, breakpoint) to a style key when the `rt` read it
|
|
138
|
-
// derives from sits inside that key's own value. Hoisting it to the
|
|
139
|
-
// factory's top level silently drops the dependency, so the margin would
|
|
140
|
-
// freeze at whatever breakpoint was active on mount and never update on
|
|
141
|
-
// rotation.
|
|
142
|
-
scrollContent: (hasHeader, margins) => {
|
|
94
|
+
});
|
|
95
|
+
const styles = StyleSheet.create((theme, runtime) => ({
|
|
96
|
+
scrollContent: (hasHeader, padding, extraBottomPadding) => {
|
|
143
97
|
const {
|
|
144
|
-
|
|
145
|
-
|
|
98
|
+
x,
|
|
99
|
+
y
|
|
100
|
+
} = resolveScreenPadding(theme, runtime.breakpoint);
|
|
146
101
|
return {
|
|
147
102
|
flexGrow: 1,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// The safe area is `BottomSafeArea`'s job; counting it here as well
|
|
152
|
-
// would leave a gap the height of the gesture bar.
|
|
153
|
-
paddingBottom: hasYMargin(margins) ? marginY : 0,
|
|
154
|
-
uni__dependencies: [0, 3, 9]
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
content: (horizontal, margins) => {
|
|
158
|
-
const {
|
|
159
|
-
x: marginX
|
|
160
|
-
} = resolveScreenMargin(theme, rt.breakpoint);
|
|
161
|
-
return {
|
|
162
|
-
flexGrow: 1,
|
|
163
|
-
paddingHorizontal: hasXMargin(margins) ? marginX : 0,
|
|
164
|
-
flexDirection: horizontal ? "row" : "column",
|
|
103
|
+
paddingTop: (hasHeader ? theme.layout.header.height : 0) + (hasVerticalPadding(padding) ? y : 0),
|
|
104
|
+
paddingHorizontal: hasHorizontalPadding(padding) ? x : 0,
|
|
105
|
+
paddingBottom: (hasVerticalPadding(padding) ? y : 0) + extraBottomPadding,
|
|
165
106
|
uni__dependencies: [0, 3]
|
|
166
107
|
};
|
|
167
|
-
}
|
|
108
|
+
},
|
|
109
|
+
headerWrapper: padding => ({
|
|
110
|
+
marginHorizontal: hasHorizontalPadding(padding) ? -resolveScreenPadding(theme, runtime.breakpoint).x : 0,
|
|
111
|
+
uni__dependencies: [0, 3]
|
|
112
|
+
}),
|
|
113
|
+
content: horizontal => ({
|
|
114
|
+
flexGrow: 1,
|
|
115
|
+
flexDirection: horizontal ? "row" : "column"
|
|
116
|
+
})
|
|
168
117
|
}));
|
|
169
118
|
//# sourceMappingURL=ScreenScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","
|
|
1
|
+
{"version":3,"names":["Children","forwardRef","Animated","StyleSheet","resolveScreenPadding","PortalHost","useScreenRef","useScreenScrollHandler","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","contentStyle","scrollHandler","externalScrollHandler","onScroll","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","extraBottomPadding","isEmpty","rest","ref","scrollRef","screenPadding","hasHeader","background","resolvedPadding","mergedRef","placeholder","undefined","toArray","length","composedScrollHandler","ScrollView","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","headerWrapper","name","content","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","header","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
/** Bind the animated ref and the caller's native ref to the same instance. */
|
|
5
|
+
export function useScreenRef(screenRef, ref) {
|
|
6
|
+
return useCallback(instance => {
|
|
7
|
+
if (typeof screenRef === "function") screenRef(instance);else if (screenRef) screenRef.current = instance;
|
|
8
|
+
if (typeof ref === "function") {
|
|
9
|
+
const cleanup = ref(instance);
|
|
10
|
+
if (cleanup) return () => {
|
|
11
|
+
if (typeof screenRef === "function") screenRef(null);else if (screenRef) screenRef.current = null;
|
|
12
|
+
cleanup();
|
|
13
|
+
};
|
|
14
|
+
} else if (ref) ref.current = instance;
|
|
15
|
+
return undefined;
|
|
16
|
+
}, [screenRef, ref]);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=use-screen-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useScreenRef","screenRef","ref","instance","current","cleanup","undefined"],"sourceRoot":"../../../../../src","sources":["components/screen/hooks/use-screen-ref.ts"],"mappings":";;AAAA,SAAmBA,WAAW,QAAQ,OAAO;AAI7C;AACA,OAAO,SAASC,YAAYA,CAAIC,SAAsC,EAAEC,GAAuB,EAAE;EAC/F,OAAOH,WAAW,CACfI,QAAkB,IAAK;IACtB,IAAI,OAAOF,SAAS,KAAK,UAAU,EAAEA,SAAS,CAACE,QAAiB,CAAC,CAAC,KAC7D,IAAIF,SAAS,EAAGA,SAAS,CAA0BG,OAAO,GAAGD,QAAQ;IAC1E,IAAI,OAAOD,GAAG,KAAK,UAAU,EAAE;MAC7B,MAAMG,OAAO,GAAGH,GAAG,CAACC,QAAQ,CAAC;MAC7B,IAAIE,OAAO,EACT,OAAO,MAAM;QACX,IAAI,OAAOJ,SAAS,KAAK,UAAU,EAAEA,SAAS,CAAC,IAAI,CAAC,CAAC,KAChD,IAAIA,SAAS,EAAGA,SAAS,CAA0BG,OAAO,GAAG,IAAI;QACtEC,OAAO,CAAC,CAAC;MACX,CAAC;IACL,CAAC,MAAM,IAAIH,GAAG,EAAEA,GAAG,CAACE,OAAO,GAAGD,QAAQ;IACtC,OAAOG,SAAS;EAClB,CAAC,EACD,CAACL,SAAS,EAAEC,GAAG,CACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useAnimatedScrollHandler, useComposedEventHandler } from "react-native-reanimated";
|
|
4
|
+
import { scheduleOnRN } from "react-native-worklets";
|
|
5
|
+
|
|
6
|
+
/** Keeps scroll tracking on the UI thread and schedules optional JS callbacks on RN. */
|
|
7
|
+
export function useScreenScrollHandler(screenScrollHandler, onScroll, externalScrollHandler) {
|
|
8
|
+
const jsScrollHandler = useAnimatedScrollHandler({
|
|
9
|
+
onScroll: event => {
|
|
10
|
+
if (onScroll) {
|
|
11
|
+
scheduleOnRN(onScroll, {
|
|
12
|
+
nativeEvent: event
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return useComposedEventHandler([screenScrollHandler, externalScrollHandler ?? null, onScroll ? jsScrollHandler : null]);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=use-screen-scroll-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAnimatedScrollHandler","useComposedEventHandler","scheduleOnRN","useScreenScrollHandler","screenScrollHandler","onScroll","externalScrollHandler","jsScrollHandler","event","nativeEvent"],"sourceRoot":"../../../../../src","sources":["components/screen/hooks/use-screen-scroll-handler.ts"],"mappings":";;AAEA,SAEEA,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,YAAY,QAAQ,uBAAuB;;AAEpD;AACA,OAAO,SAASC,sBAAsBA,CACpCC,mBAAoE,EACpEC,QAAsC,EACtCC,qBAAuE,EACvE;EACA,MAAMC,eAAe,GAAGP,wBAAwB,CAAC;IAC/CK,QAAQ,EAAGG,KAAK,IAAK;MACnB,IAAIH,QAAQ,EAAE;QACZH,YAAY,CAACG,QAAQ,EAAE;UACrBI,WAAW,EAAED;QACf,CAAuD,CAAC;MAC1D;IACF;EACF,CAAC,CAAC;EAEF,OAAOP,uBAAuB,CAAC,CAC7BG,mBAAmB,EACnBE,qBAAqB,IAAI,IAAI,EAC7BD,QAAQ,GAAGE,eAAe,GAAG,IAAI,CAClC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Screen","useScreen","ScreenFlatList","ScreenList","ScreenScrollView"],"sourceRoot":"../../../../src","sources":["components/screen/index.ts"],"mappings":";;AACA,SAASA,MAAM;AAEf,SAASC,SAAS;AAElB,SAASC,cAAc;
|
|
1
|
+
{"version":3,"names":["Screen","useScreen","ScreenFlatList","ScreenList","ScreenScrollView"],"sourceRoot":"../../../../src","sources":["components/screen/index.ts"],"mappings":";;AACA,SAASA,MAAM;AAEf,SAASC,SAAS;AAElB,SAASC,cAAc;AAQvB,SAASC,UAAU;AAEnB,SAASC,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
+
import { useCallback, useContext, useState } from "react";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
6
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
7
|
+
import { ScreenHeaderAppearanceContext } from "./ScreenHeaderAppearance.js";
|
|
8
|
+
import { ScreenSafeArea } from "./ScreenSafeArea";
|
|
9
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export function ScreenFrame({
|
|
11
|
+
children,
|
|
12
|
+
edges
|
|
13
|
+
}) {
|
|
14
|
+
const appearance = useContext(ScreenHeaderAppearanceContext);
|
|
15
|
+
const [topInset, setTopInset] = useState(0);
|
|
16
|
+
const onLayout = useCallback(event => {
|
|
17
|
+
// This is the actual native padding, including navigator and orientation changes.
|
|
18
|
+
setTopInset(event.nativeEvent.layout.y);
|
|
19
|
+
}, []);
|
|
20
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
|
+
children: [/*#__PURE__*/_jsx(ScreenSafeArea, {
|
|
22
|
+
edges: edges,
|
|
23
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
24
|
+
style: styles.content,
|
|
25
|
+
onLayout: onLayout,
|
|
26
|
+
children: children
|
|
27
|
+
})
|
|
28
|
+
}), edges.top && appearance?.background !== undefined && /*#__PURE__*/_jsx(Animated.View, {
|
|
29
|
+
pointerEvents: "none",
|
|
30
|
+
style: [styles.topSafeArea(topInset, appearance.background.color), appearance.background.animatedStyle]
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const styles = StyleSheet.create(() => ({
|
|
35
|
+
content: {
|
|
36
|
+
flex: 1
|
|
37
|
+
},
|
|
38
|
+
topSafeArea: (height, backgroundColor) => ({
|
|
39
|
+
position: "absolute",
|
|
40
|
+
top: 0,
|
|
41
|
+
left: 0,
|
|
42
|
+
right: 0,
|
|
43
|
+
height,
|
|
44
|
+
backgroundColor
|
|
45
|
+
})
|
|
46
|
+
}));
|
|
47
|
+
//# sourceMappingURL=ScreenFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useContext","useState","Animated","StyleSheet","ScreenHeaderAppearanceContext","ScreenSafeArea","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFrame","children","edges","appearance","topInset","setTopInset","onLayout","event","nativeEvent","layout","y","View","style","styles","content","top","background","undefined","pointerEvents","topSafeArea","color","animatedStyle","create","flex","height","backgroundColor","position","left","right"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenFrame.tsx"],"mappings":";;;AAAA,SAAiCA,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAGjF,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,6BAA6B;AACtC,SAASC,cAAc;AAA2B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,OAAO,SAASC,WAAWA,CAAC;EAAEC,QAAQ;EAAEC;AAAyD,CAAC,EAAE;EAClG,MAAMC,UAAU,GAAGf,UAAU,CAACI,6BAA6B,CAAC;EAC5D,MAAM,CAACY,QAAQ,EAAEC,WAAW,CAAC,GAAGhB,QAAQ,CAAC,CAAC,CAAC;EAC3C,MAAMiB,QAAQ,GAAGnB,WAAW,CAAEoB,KAAwB,IAAK;IACzD;IACAF,WAAW,CAACE,KAAK,CAACC,WAAW,CAACC,MAAM,CAACC,CAAC,CAAC;EACzC,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEX,KAAA,CAAAF,SAAA;IAAAI,QAAA,gBACEN,IAAA,CAACF,cAAc;MAACS,KAAK,EAAEA,KAAM;MAAAD,QAAA,eAC3BN,IAAA,CAACgB,IAAI;QAACC,KAAK,EAAEC,MAAM,CAACC,OAAQ;QAACR,QAAQ,EAAEA,QAAS;QAAAL,QAAA,EAC7CA;MAAQ,CACL;IAAC,CACO,CAAC,EAChBC,KAAK,CAACa,GAAG,IAAIZ,UAAU,EAAEa,UAAU,KAAKC,SAAS,iBAChDtB,IAAA,CAACL,QAAQ,CAACqB,IAAI;MACZO,aAAa,EAAC,MAAM;MACpBN,KAAK,EAAE,CACLC,MAAM,CAACM,WAAW,CAACf,QAAQ,EAAED,UAAU,CAACa,UAAU,CAACI,KAAK,CAAC,EACzDjB,UAAU,CAACa,UAAU,CAACK,aAAa;IACnC,CACH,CACF;EAAA,CACD,CAAC;AAEP;AAEA,MAAMR,MAAM,GAAGtB,UAAU,CAAC+B,MAAM,CAAC,OAAO;EACtCR,OAAO,EAAE;IAAES,IAAI,EAAE;EAAE,CAAC;EACpBJ,WAAW,EAAEA,CAACK,MAAc,EAAEC,eAAuB,MAAM;IACzDC,QAAQ,EAAE,UAAU;IACpBX,GAAG,EAAE,CAAC;IACNY,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRJ,MAAM;IACNC;EACF,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useContext, useLayoutEffect, useMemo, useState } from "react";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export const ScreenHeaderAppearanceContext = /*#__PURE__*/createContext(null);
|
|
6
|
+
const HeaderSlotContext = /*#__PURE__*/createContext(undefined);
|
|
7
|
+
export function ScreenHeaderAppearanceProvider({
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
const [background, setBackground] = useState();
|
|
11
|
+
const value = useMemo(() => ({
|
|
12
|
+
background,
|
|
13
|
+
setBackground
|
|
14
|
+
}), [background]);
|
|
15
|
+
return /*#__PURE__*/_jsx(ScreenHeaderAppearanceContext.Provider, {
|
|
16
|
+
value: value,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Only the designated header slot controls the screen's top safe-area color. */
|
|
22
|
+
export function ScreenHeaderAppearanceSlot({
|
|
23
|
+
children
|
|
24
|
+
}) {
|
|
25
|
+
const appearance = useContext(ScreenHeaderAppearanceContext);
|
|
26
|
+
return /*#__PURE__*/_jsx(HeaderSlotContext.Provider, {
|
|
27
|
+
value: appearance?.setBackground,
|
|
28
|
+
children: children
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Share the overlay's animated style so safe-area fading stays on the UI thread. */
|
|
33
|
+
export function useHeaderBackground(color, animatedStyle) {
|
|
34
|
+
const setBackground = useContext(HeaderSlotContext);
|
|
35
|
+
useLayoutEffect(() => {
|
|
36
|
+
setBackground?.({
|
|
37
|
+
color,
|
|
38
|
+
animatedStyle
|
|
39
|
+
});
|
|
40
|
+
return () => setBackground?.(undefined);
|
|
41
|
+
}, [color, animatedStyle, setBackground]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ScreenHeaderAppearance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useLayoutEffect","useMemo","useState","jsx","_jsx","ScreenHeaderAppearanceContext","HeaderSlotContext","undefined","ScreenHeaderAppearanceProvider","children","background","setBackground","value","Provider","ScreenHeaderAppearanceSlot","appearance","useHeaderBackground","color","animatedStyle"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenHeaderAppearance.tsx"],"mappings":";;AAAA,SACEA,aAAa,EAIbC,UAAU,EACVC,eAAe,EACfC,OAAO,EACPC,QAAQ,QACH,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAgBf,OAAO,MAAMC,6BAA6B,gBAAGP,aAAa,CAA0B,IAAI,CAAC;AACzF,MAAMQ,iBAAiB,gBAAGR,aAAa,CAAgDS,SAAS,CAAC;AAEjG,OAAO,SAASC,8BAA8BA,CAAC;EAAEC;AAA4B,CAAC,EAAE;EAC9E,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGT,QAAQ,CAAmB,CAAC;EAChE,MAAMU,KAAK,GAAGX,OAAO,CAAC,OAAO;IAAES,UAAU;IAAEC;EAAc,CAAC,CAAC,EAAE,CAACD,UAAU,CAAC,CAAC;EAC1E,oBACEN,IAAA,CAACC,6BAA6B,CAACQ,QAAQ;IAACD,KAAK,EAAEA,KAAM;IAAAH,QAAA,EAAEA;EAAQ,CAAyC,CAAC;AAE7G;;AAEA;AACA,OAAO,SAASK,0BAA0BA,CAAC;EAAEL;AAA4B,CAAC,EAAE;EAC1E,MAAMM,UAAU,GAAGhB,UAAU,CAACM,6BAA6B,CAAC;EAC5D,oBACED,IAAA,CAACE,iBAAiB,CAACO,QAAQ;IAACD,KAAK,EAAEG,UAAU,EAAEJ,aAAc;IAAAF,QAAA,EAAEA;EAAQ,CAA6B,CAAC;AAEzG;;AAEA;AACA,OAAO,SAASO,mBAAmBA,CAACC,KAAa,EAAEC,aAAkC,EAAE;EACrF,MAAMP,aAAa,GAAGZ,UAAU,CAACO,iBAAiB,CAAC;EACnDN,eAAe,CAAC,MAAM;IACpBW,aAAa,GAAG;MAAEM,KAAK;MAAEC;IAAc,CAAC,CAAC;IACzC,OAAO,MAAMP,aAAa,GAAGJ,SAAS,CAAC;EACzC,CAAC,EAAE,CAACU,KAAK,EAAEC,aAAa,EAAEP,aAAa,CAAC,CAAC;AAC3C","ignoreList":[]}
|
|
@@ -5,9 +5,8 @@ import { StyleSheet } from "react-native-unistyles";
|
|
|
5
5
|
import { Spinner } from "../../spinner/index.js";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
/**
|
|
8
|
-
* Centres a
|
|
9
|
-
*
|
|
10
|
-
* hugging the top, which needs the content container to grow as well.
|
|
8
|
+
* Centres a placeholder in the available space. The parent must also grow
|
|
9
|
+
* to fill the viewport.
|
|
11
10
|
*/
|
|
12
11
|
export function ScreenPlaceholder({
|
|
13
12
|
children
|
|
@@ -18,24 +17,23 @@ export function ScreenPlaceholder({
|
|
|
18
17
|
});
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* flight there is nothing to be empty about yet.
|
|
20
|
+
* Resolves the loading or empty placeholder, or null to keep the content.
|
|
21
|
+
* Loading takes precedence over the empty state.
|
|
24
22
|
*/
|
|
25
23
|
export function renderScreenPlaceholder({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
isLoading,
|
|
25
|
+
loadingContent,
|
|
26
|
+
emptyContent,
|
|
29
27
|
isEmpty
|
|
30
28
|
}) {
|
|
31
|
-
if (
|
|
29
|
+
if (isLoading) {
|
|
32
30
|
return /*#__PURE__*/_jsx(ScreenPlaceholder, {
|
|
33
|
-
children:
|
|
31
|
+
children: loadingContent === undefined ? /*#__PURE__*/_jsx(Spinner, {}) : loadingContent
|
|
34
32
|
});
|
|
35
33
|
}
|
|
36
|
-
if (isEmpty &&
|
|
34
|
+
if (isEmpty && emptyContent !== undefined) {
|
|
37
35
|
return /*#__PURE__*/_jsx(ScreenPlaceholder, {
|
|
38
|
-
children:
|
|
36
|
+
children: emptyContent
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
39
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","Spinner","jsx","_jsx","ScreenPlaceholder","children","View","style","styles","placeholder","renderScreenPlaceholder","
|
|
1
|
+
{"version":3,"names":["StyleSheet","Spinner","jsx","_jsx","ScreenPlaceholder","children","View","style","styles","placeholder","renderScreenPlaceholder","isLoading","loadingContent","emptyContent","isEmpty","undefined","create","flexGrow","alignItems","justifyContent"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenPlaceholder.tsx"],"mappings":";;;AAGA,SAASA,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,OAAO;AAAwB,SAAAC,GAAA,IAAAC,IAAA;AAGxC;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAC;EAAEC;AAAkC,CAAC,EAAE;EACvE,oBAAOF,IAAA,CAACG,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC,WAAY;IAAAJ,QAAA,EAAEA;EAAQ,CAAO,CAAC;AAC3D;AAQA;AACA;AACA;AACA;AACA,OAAO,SAASK,uBAAuBA,CAAC;EACtCC,SAAS;EACTC,cAAc;EACdC,YAAY;EACZC;AACwB,CAAC,EAAuB;EAChD,IAAIH,SAAS,EAAE;IACb,oBACER,IAAA,CAACC,iBAAiB;MAAAC,QAAA,EAAEO,cAAc,KAAKG,SAAS,gBAAGZ,IAAA,CAACF,OAAO,IAAE,CAAC,GAAGW;IAAc,CAAoB,CAAC;EAExG;EACA,IAAIE,OAAO,IAAID,YAAY,KAAKE,SAAS,EAAE;IACzC,oBAAOZ,IAAA,CAACC,iBAAiB;MAAAC,QAAA,EAAEQ;IAAY,CAAoB,CAAC;EAC9D;EACA,OAAO,IAAI;AACb;AAEA,MAAML,MAAM,GAAGR,UAAU,CAACgB,MAAM,CAAC,OAAO;EACtCP,WAAW,EAAE;IACXQ,QAAQ,EAAE,CAAC;IACXC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
// Keep native codegen declarations outside the library's generated public types.
|
|
6
|
+
const {
|
|
7
|
+
SafeAreaView
|
|
8
|
+
} = require("react-native-screens/src/components/safe-area");
|
|
9
|
+
|
|
10
|
+
/** Android combines system and native interface insets and consumes the selected edges. */
|
|
11
|
+
export function ScreenSafeArea({
|
|
12
|
+
children,
|
|
13
|
+
edges
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/_jsx(SafeAreaView, {
|
|
16
|
+
edges: edges,
|
|
17
|
+
insetType: "all",
|
|
18
|
+
style: styles.fill,
|
|
19
|
+
children: children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const styles = StyleSheet.create(() => ({
|
|
23
|
+
fill: {
|
|
24
|
+
flex: 1
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
//# sourceMappingURL=ScreenSafeArea.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","jsx","_jsx","SafeAreaView","require","ScreenSafeArea","children","edges","insetType","style","styles","fill","create","flex"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenSafeArea.android.tsx"],"mappings":";;AAGA,SAASA,UAAU,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIpD;AACA,MAAM;EAAEC;AAAa,CAAC,GAAGC,OAAO,CAAC,+CAA+C,CAE/E;;AAED;AACA,OAAO,SAASC,cAAcA,CAAC;EAAEC,QAAQ;EAAEC;AAAyD,CAAC,EAAE;EACrG,oBACEL,IAAA,CAACC,YAAY;IAACI,KAAK,EAAEA,KAAM;IAACC,SAAS,EAAC,KAAK;IAACC,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAL,QAAA,EAC5DA;EAAQ,CACG,CAAC;AAEnB;AAEA,MAAMI,MAAM,GAAGV,UAAU,CAACY,MAAM,CAAC,OAAO;EAAED,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAE;AAAE,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
|
|
4
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function ScreenSafeArea({
|
|
7
|
+
children,
|
|
8
|
+
edges
|
|
9
|
+
}) {
|
|
10
|
+
const enabledEdges = Object.keys(edges).filter(edge => edges[edge]);
|
|
11
|
+
// A local provider measures remaining UIKit/browser insets, including native iOS bars.
|
|
12
|
+
return /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
13
|
+
style: styles.fill,
|
|
14
|
+
children: /*#__PURE__*/_jsx(SafeAreaView, {
|
|
15
|
+
edges: enabledEdges,
|
|
16
|
+
style: styles.fill,
|
|
17
|
+
children: children
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const styles = StyleSheet.create(() => ({
|
|
22
|
+
fill: {
|
|
23
|
+
flex: 1
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
//# sourceMappingURL=ScreenSafeArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SafeAreaProvider","SafeAreaView","StyleSheet","jsx","_jsx","ScreenSafeArea","children","edges","enabledEdges","Object","keys","filter","edge","style","styles","fill","create","flex"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenSafeArea.tsx"],"mappings":";;AAEA,SAASA,gBAAgB,EAAEC,YAAY,QAAQ,gCAAgC;AAC/E,SAASC,UAAU,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIpD,OAAO,SAASC,cAAcA,CAAC;EAAEC,QAAQ;EAAEC;AAAyD,CAAC,EAAE;EACrG,MAAMC,YAAY,GAAIC,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAAmCI,MAAM,CAAEC,IAAI,IAAKL,KAAK,CAACK,IAAI,CAAC,CAAC;EACxG;EACA,oBACER,IAAA,CAACJ,gBAAgB;IAACa,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAT,QAAA,eACnCF,IAAA,CAACH,YAAY;MAACM,KAAK,EAAEC,YAAa;MAACK,KAAK,EAAEC,MAAM,CAACC,IAAK;MAAAT,QAAA,EACnDA;IAAQ,CACG;EAAC,CACC,CAAC;AAEvB;AAEA,MAAMQ,MAAM,GAAGZ,UAAU,CAACc,MAAM,CAAC,OAAO;EAAED,IAAI,EAAE;IAAEE,IAAI,EAAE;EAAE;AAAE,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { createElement, isValidElement } from "react";
|
|
4
|
-
/**
|
|
5
|
-
export function
|
|
6
|
-
if (!
|
|
7
|
-
if (/*#__PURE__*/isValidElement(
|
|
8
|
-
return /*#__PURE__*/createElement(
|
|
4
|
+
/** Resolves a list header, footer, or empty component to an element. */
|
|
5
|
+
export function renderListComponent(ListComponent) {
|
|
6
|
+
if (!ListComponent) return null;
|
|
7
|
+
if (/*#__PURE__*/isValidElement(ListComponent)) return ListComponent;
|
|
8
|
+
return /*#__PURE__*/createElement(ListComponent);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/** Whether `
|
|
12
|
-
export const
|
|
11
|
+
/** Whether `padding` pads the horizontal axis. */
|
|
12
|
+
export const hasHorizontalPadding = padding => padding === "all" || padding === "x";
|
|
13
13
|
|
|
14
|
-
/** Whether `
|
|
15
|
-
export const
|
|
14
|
+
/** Whether `padding` pads the vertical axis (top and bottom). */
|
|
15
|
+
export const hasVerticalPadding = padding => padding === "all" || padding === "y";
|
|
16
|
+
export function resolveSafeAreaEdges(safeArea) {
|
|
17
|
+
const includes = edge => safeArea === "auto" || safeArea !== "none" && safeArea.includes(edge);
|
|
18
|
+
return {
|
|
19
|
+
top: includes("top"),
|
|
20
|
+
bottom: includes("bottom"),
|
|
21
|
+
left: includes("left"),
|
|
22
|
+
right: includes("right")
|
|
23
|
+
};
|
|
24
|
+
}
|
|
16
25
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElement","isValidElement","
|
|
1
|
+
{"version":3,"names":["createElement","isValidElement","renderListComponent","ListComponent","hasHorizontalPadding","padding","hasVerticalPadding","resolveSafeAreaEdges","safeArea","includes","edge","top","bottom","left","right"],"sourceRoot":"../../../../src","sources":["components/screen/utils.ts"],"mappings":";;AAAA,SAA6BA,aAAa,EAAEC,cAAc,QAA2B,OAAO;AAM5F;AACA,OAAO,SAASC,mBAAmBA,CAACC,aAA4B,EAAuB;EACrF,IAAI,CAACA,aAAa,EAAE,OAAO,IAAI;EAC/B,iBAAIF,cAAc,CAACE,aAAa,CAAC,EAAE,OAAOA,aAAa;EACvD,oBAAOH,aAAa,CAACG,aAAa,CAAC;AACrC;;AAEA;AACA,OAAO,MAAMC,oBAAoB,GAAIC,OAA6B,IAChEA,OAAO,KAAK,KAAK,IAAIA,OAAO,KAAK,GAAG;;AAEtC;AACA,OAAO,MAAMC,kBAAkB,GAAID,OAA6B,IAC9DA,OAAO,KAAK,KAAK,IAAIA,OAAO,KAAK,GAAG;AAEtC,OAAO,SAASE,oBAAoBA,CAACC,QAAwB,EAAuB;EAClF,MAAMC,QAAQ,GAAIC,IAA+B,IAC/CF,QAAQ,KAAK,MAAM,IAAKA,QAAQ,KAAK,MAAM,IAAIA,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAAE;EACzE,OAAO;IACLC,GAAG,EAAEF,QAAQ,CAAC,KAAK,CAAC;IACpBG,MAAM,EAAEH,QAAQ,CAAC,QAAQ,CAAC;IAC1BI,IAAI,EAAEJ,QAAQ,CAAC,MAAM,CAAC;IACtBK,KAAK,EAAEL,QAAQ,CAAC,OAAO;EACzB,CAAC;AACH","ignoreList":[]}
|
|
@@ -83,7 +83,7 @@ const SpinnerIcon = /*#__PURE__*/memo(function SpinnerIcon({
|
|
|
83
83
|
*/
|
|
84
84
|
export function Spinner({
|
|
85
85
|
size = "md",
|
|
86
|
-
color = "text
|
|
86
|
+
color = "accent.text"
|
|
87
87
|
}) {
|
|
88
88
|
const {
|
|
89
89
|
theme
|
|
@@ -91,7 +91,7 @@ export function Spinner({
|
|
|
91
91
|
const id = useId();
|
|
92
92
|
const gradientId1 = `spinner-def-1-${id}`;
|
|
93
93
|
const gradientId2 = `spinner-def-2-${id}`;
|
|
94
|
-
const resolvedColor = resolveThemeColor(color, theme) ?? theme.color["text
|
|
94
|
+
const resolvedColor = resolveThemeColor(color, theme) ?? theme.color["accent.text"] ?? "";
|
|
95
95
|
const dim = DIMENSION[size];
|
|
96
96
|
const rotation = useSharedValue(0);
|
|
97
97
|
useEffect(() => {
|
|
@@ -51,7 +51,7 @@ export const Text = /*#__PURE__*/forwardRef(function Text({
|
|
|
51
51
|
fontSize: v.fontSize,
|
|
52
52
|
lineHeight: v.lineHeight,
|
|
53
53
|
letterSpacing: v.letterSpacing,
|
|
54
|
-
color: resolveThemeColor(color, theme) ?? theme.color["text.
|
|
54
|
+
color: resolveThemeColor(color, theme) ?? theme.color["text.primary"] ?? ""
|
|
55
55
|
};
|
|
56
56
|
// System font: apply numeric weight. Custom font: family encodes the weight.
|
|
57
57
|
if (isSystemFont) base.fontWeight = FONT_WEIGHT_VALUE[effectiveWeight];else base.fontFamily = resolvedFamily;
|