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.
Files changed (252) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/lib/module/components/avatar/Avatar.js +20 -20
  4. package/lib/module/components/avatar/Avatar.js.map +1 -1
  5. package/lib/module/components/button/Button.js +11 -11
  6. package/lib/module/components/button/Button.js.map +1 -1
  7. package/lib/module/components/chip/Chip.js +32 -32
  8. package/lib/module/components/chip/Chip.js.map +1 -1
  9. package/lib/module/components/empty-state/EmptyState.js +3 -3
  10. package/lib/module/components/empty-state/EmptyState.js.map +1 -1
  11. package/lib/module/components/header/variants/LargeTitleHeader/index.js +30 -32
  12. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  13. package/lib/module/components/header/variants/TitleHeader/index.js +26 -18
  14. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  15. package/lib/module/components/icon/Icon.js +3 -3
  16. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +2 -2
  17. package/lib/module/components/screen/Screen.js +63 -34
  18. package/lib/module/components/screen/Screen.js.map +1 -1
  19. package/lib/module/components/screen/ScreenContext.js +28 -9
  20. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  21. package/lib/module/components/screen/ScreenFlatList.js +4 -162
  22. package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
  23. package/lib/module/components/screen/ScreenList.js +81 -97
  24. package/lib/module/components/screen/ScreenList.js.map +1 -1
  25. package/lib/module/components/screen/ScreenScrollView.js +64 -115
  26. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  27. package/lib/module/components/screen/hooks/use-screen-ref.js +18 -0
  28. package/lib/module/components/screen/hooks/use-screen-ref.js.map +1 -0
  29. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js +19 -0
  30. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js.map +1 -0
  31. package/lib/module/components/screen/index.js.map +1 -1
  32. package/lib/module/components/screen/parts/ScreenFrame.js +47 -0
  33. package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -0
  34. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js +43 -0
  35. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js.map +1 -0
  36. package/lib/module/components/screen/parts/ScreenPlaceholder.js +11 -13
  37. package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
  38. package/lib/module/components/screen/parts/ScreenSafeArea.android.js +27 -0
  39. package/lib/module/components/screen/parts/ScreenSafeArea.android.js.map +1 -0
  40. package/lib/module/components/screen/parts/ScreenSafeArea.js +26 -0
  41. package/lib/module/components/screen/parts/ScreenSafeArea.js.map +1 -0
  42. package/lib/module/components/screen/utils.js +18 -9
  43. package/lib/module/components/screen/utils.js.map +1 -1
  44. package/lib/module/components/spinner/Spinner.js +2 -2
  45. package/lib/module/components/text/Text.js +1 -1
  46. package/lib/module/components/toast/Toast.js +13 -13
  47. package/lib/module/components/toast/Toast.js.map +1 -1
  48. package/lib/module/components/toolbar/Toolbar.js +2 -2
  49. package/lib/module/context/ThemeProvider.js +22 -39
  50. package/lib/module/context/ThemeProvider.js.map +1 -1
  51. package/lib/module/context/index.js +1 -1
  52. package/lib/module/context/index.js.map +1 -1
  53. package/lib/module/theme/breakpoints.js +1 -1
  54. package/lib/module/theme/define-config.js +21 -0
  55. package/lib/module/theme/define-config.js.map +1 -0
  56. package/lib/module/theme/diagnostics.js +13 -0
  57. package/lib/module/theme/diagnostics.js.map +1 -0
  58. package/lib/module/theme/errors.js +15 -0
  59. package/lib/module/theme/errors.js.map +1 -0
  60. package/lib/module/theme/index.js +7 -1
  61. package/lib/module/theme/index.js.map +1 -1
  62. package/lib/module/theme/legacy-tokens.js +119 -0
  63. package/lib/module/theme/legacy-tokens.js.map +1 -0
  64. package/lib/module/theme/registry.js +122 -130
  65. package/lib/module/theme/registry.js.map +1 -1
  66. package/lib/module/theme/resolve-config.js +346 -0
  67. package/lib/module/theme/resolve-config.js.map +1 -0
  68. package/lib/module/theme/runtime.js +57 -12
  69. package/lib/module/theme/runtime.js.map +1 -1
  70. package/lib/module/theme/screen-margin.js +6 -14
  71. package/lib/module/theme/screen-margin.js.map +1 -1
  72. package/lib/module/theme/screen-padding.js +17 -0
  73. package/lib/module/theme/screen-padding.js.map +1 -0
  74. package/lib/module/theme/selection-store.js +75 -0
  75. package/lib/module/theme/selection-store.js.map +1 -0
  76. package/lib/module/theme/theme.js +81 -36
  77. package/lib/module/theme/theme.js.map +1 -1
  78. package/lib/module/theme/tokens/canonical-color-keys.js +102 -0
  79. package/lib/module/theme/tokens/canonical-color-keys.js.map +1 -0
  80. package/lib/module/theme/tokens/dark.js +72 -88
  81. package/lib/module/theme/tokens/dark.js.map +1 -1
  82. package/lib/module/theme/tokens/light.js +69 -83
  83. package/lib/module/theme/tokens/light.js.map +1 -1
  84. package/lib/module/theme/tokens/primitives.js +14 -14
  85. package/lib/module/theme/tokens/primitives.js.map +1 -1
  86. package/lib/module/theme/tokens/validate.js +238 -0
  87. package/lib/module/theme/tokens/validate.js.map +1 -0
  88. package/lib/module/theme/unistyles-adapter.js +77 -0
  89. package/lib/module/theme/unistyles-adapter.js.map +1 -0
  90. package/lib/module/utils/accent-generator.js +476 -0
  91. package/lib/module/utils/accent-generator.js.map +1 -0
  92. package/lib/module/utils/accent-utils.js +52 -35
  93. package/lib/module/utils/accent-utils.js.map +1 -1
  94. package/lib/module/utils/color-utils.js +224 -7
  95. package/lib/module/utils/color-utils.js.map +1 -1
  96. package/lib/module/utils/deep-merge.js +1 -1
  97. package/lib/module/utils/deep-merge.js.map +1 -1
  98. package/lib/module/utils/resolve-theme-color.js +2 -2
  99. package/lib/typescript/src/components/chip/types.d.ts +1 -1
  100. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +1 -1
  101. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
  102. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -5
  103. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  104. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +11 -5
  105. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  106. package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
  107. package/lib/typescript/src/components/screen/Screen.d.ts +45 -16
  108. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  109. package/lib/typescript/src/components/screen/ScreenContext.d.ts +42 -26
  110. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  111. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +5 -46
  112. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  113. package/lib/typescript/src/components/screen/ScreenList.d.ts +62 -50
  114. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  115. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +18 -58
  116. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  117. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts +5 -0
  118. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts.map +1 -0
  119. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts +53 -0
  120. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts.map +1 -0
  121. package/lib/typescript/src/components/screen/index.d.ts +2 -2
  122. package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
  123. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts +6 -0
  124. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -0
  125. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts +21 -0
  126. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts.map +1 -0
  127. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +6 -8
  128. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
  129. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts +7 -0
  130. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts.map +1 -0
  131. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts +6 -0
  132. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts.map +1 -0
  133. package/lib/typescript/src/components/screen/types.d.ts +27 -32
  134. package/lib/typescript/src/components/screen/types.d.ts.map +1 -1
  135. package/lib/typescript/src/components/screen/utils.d.ts +9 -8
  136. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  137. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  138. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  139. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +2 -2
  140. package/lib/typescript/src/context/ThemeProvider.d.ts +29 -12
  141. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  142. package/lib/typescript/src/context/index.d.ts +1 -1
  143. package/lib/typescript/src/context/index.d.ts.map +1 -1
  144. package/lib/typescript/src/theme/breakpoints.d.ts +1 -1
  145. package/lib/typescript/src/theme/define-config.d.ts +23 -0
  146. package/lib/typescript/src/theme/define-config.d.ts.map +1 -0
  147. package/lib/typescript/src/theme/diagnostics.d.ts +4 -0
  148. package/lib/typescript/src/theme/diagnostics.d.ts.map +1 -0
  149. package/lib/typescript/src/theme/errors.d.ts +10 -0
  150. package/lib/typescript/src/theme/errors.d.ts.map +1 -0
  151. package/lib/typescript/src/theme/index.d.ts +10 -2
  152. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  153. package/lib/typescript/src/theme/legacy-tokens.d.ts +187 -0
  154. package/lib/typescript/src/theme/legacy-tokens.d.ts.map +1 -0
  155. package/lib/typescript/src/theme/registry.d.ts +12 -17
  156. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  157. package/lib/typescript/src/theme/resolve-config.d.ts +99 -0
  158. package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -0
  159. package/lib/typescript/src/theme/runtime.d.ts +25 -4
  160. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  161. package/lib/typescript/src/theme/screen-margin.d.ts +6 -14
  162. package/lib/typescript/src/theme/screen-margin.d.ts.map +1 -1
  163. package/lib/typescript/src/theme/screen-padding.d.ts +15 -0
  164. package/lib/typescript/src/theme/screen-padding.d.ts.map +1 -0
  165. package/lib/typescript/src/theme/selection-store.d.ts +41 -0
  166. package/lib/typescript/src/theme/selection-store.d.ts.map +1 -0
  167. package/lib/typescript/src/theme/theme.d.ts +54 -1
  168. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  169. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts +95 -0
  170. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts.map +1 -0
  171. package/lib/typescript/src/theme/tokens/dark.d.ts +56 -63
  172. package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
  173. package/lib/typescript/src/theme/tokens/light.d.ts +56 -71
  174. package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
  175. package/lib/typescript/src/theme/tokens/primitives.d.ts +11 -10
  176. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  177. package/lib/typescript/src/theme/tokens/validate.d.ts +34 -0
  178. package/lib/typescript/src/theme/tokens/validate.d.ts.map +1 -0
  179. package/lib/typescript/src/theme/types.d.ts +166 -86
  180. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  181. package/lib/typescript/src/theme/unistyles-adapter.d.ts +33 -0
  182. package/lib/typescript/src/theme/unistyles-adapter.d.ts.map +1 -0
  183. package/lib/typescript/src/utils/accent-generator.d.ts +103 -0
  184. package/lib/typescript/src/utils/accent-generator.d.ts.map +1 -0
  185. package/lib/typescript/src/utils/accent-utils.d.ts +15 -2
  186. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  187. package/lib/typescript/src/utils/color-utils.d.ts +59 -2
  188. package/lib/typescript/src/utils/color-utils.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/deep-merge.d.ts +1 -0
  190. package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -1
  191. package/lib/typescript/src/utils/resolve-theme-color.d.ts +2 -2
  192. package/package.json +1 -1
  193. package/src/components/avatar/Avatar.tsx +20 -20
  194. package/src/components/button/Button.tsx +11 -11
  195. package/src/components/chip/Chip.tsx +32 -32
  196. package/src/components/chip/types.ts +1 -1
  197. package/src/components/empty-state/EmptyState.tsx +4 -4
  198. package/src/components/header/variants/LargeTitleHeader/index.tsx +31 -30
  199. package/src/components/header/variants/TitleHeader/index.tsx +33 -22
  200. package/src/components/icon/Icon.tsx +4 -4
  201. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +2 -2
  202. package/src/components/screen/Screen.tsx +89 -43
  203. package/src/components/screen/ScreenContext.tsx +48 -28
  204. package/src/components/screen/ScreenFlatList.tsx +5 -191
  205. package/src/components/screen/ScreenList.tsx +197 -175
  206. package/src/components/screen/ScreenScrollView.tsx +92 -167
  207. package/src/components/screen/hooks/use-screen-ref.ts +24 -0
  208. package/src/components/screen/hooks/use-screen-scroll-handler.ts +31 -0
  209. package/src/components/screen/index.ts +8 -2
  210. package/src/components/screen/parts/ScreenFrame.tsx +49 -0
  211. package/src/components/screen/parts/ScreenHeaderAppearance.tsx +52 -0
  212. package/src/components/screen/parts/ScreenPlaceholder.tsx +16 -16
  213. package/src/components/screen/parts/ScreenSafeArea.android.tsx +22 -0
  214. package/src/components/screen/parts/ScreenSafeArea.tsx +20 -0
  215. package/src/components/screen/types.ts +29 -32
  216. package/src/components/screen/utils.ts +24 -11
  217. package/src/components/spinner/Spinner.tsx +2 -2
  218. package/src/components/text/Text.tsx +2 -2
  219. package/src/components/toast/Toast.tsx +13 -13
  220. package/src/components/toolbar/Toolbar.tsx +4 -4
  221. package/src/context/ThemeProvider.tsx +47 -51
  222. package/src/context/index.ts +1 -1
  223. package/src/theme/breakpoints.ts +1 -1
  224. package/src/theme/define-config.ts +27 -0
  225. package/src/theme/diagnostics.ts +11 -0
  226. package/src/theme/errors.ts +14 -0
  227. package/src/theme/index.ts +40 -1
  228. package/src/theme/legacy-tokens.ts +227 -0
  229. package/src/theme/registry.ts +119 -137
  230. package/src/theme/resolve-config.ts +406 -0
  231. package/src/theme/runtime.ts +52 -14
  232. package/src/theme/screen-margin.ts +6 -25
  233. package/src/theme/screen-padding.ts +26 -0
  234. package/src/theme/selection-store.ts +76 -0
  235. package/src/theme/theme.ts +104 -39
  236. package/src/theme/tokens/canonical-color-keys.ts +107 -0
  237. package/src/theme/tokens/dark.ts +91 -98
  238. package/src/theme/tokens/light.ts +88 -93
  239. package/src/theme/tokens/primitives.ts +14 -14
  240. package/src/theme/tokens/validate.ts +271 -0
  241. package/src/theme/types.ts +184 -95
  242. package/src/theme/unistyles-adapter.ts +75 -0
  243. package/src/utils/accent-generator.ts +530 -0
  244. package/src/utils/accent-utils.ts +66 -39
  245. package/src/utils/color-utils.ts +225 -8
  246. package/src/utils/deep-merge.ts +1 -1
  247. package/src/utils/resolve-theme-color.ts +2 -2
  248. package/lib/module/components/screen/parts/BottomSafeArea.js +0 -62
  249. package/lib/module/components/screen/parts/BottomSafeArea.js.map +0 -1
  250. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +0 -30
  251. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +0 -1
  252. package/src/components/screen/parts/BottomSafeArea.tsx +0 -59
@@ -1,67 +1,83 @@
1
1
  import { type ReactNode } from "react";
2
2
  import Animated, { type AnimatedRef, type ScrollHandlerProcessed, type SharedValue } from "react-native-reanimated";
3
- import type { ScreenMargins } from "./types.js";
3
+ import type { ScreenContentPadding, ScreenSafeArea } from "./types.js";
4
+ /** Internal animated ref shared by the screen's primary scroll container. */
4
5
  export type ScreenScrollRef = AnimatedRef<Animated.ScrollView>;
5
- /** `PortalHost` name shared by `Screen.ScrollView` / `Screen.FlatList` and header variants that portal content into them. */
6
+ /** Local portal target for scrollable header content. */
6
7
  export declare const SCREEN_HEADER_PORTAL_HOST = "screen-header";
8
+ /** Shared configuration and UI-thread scroll values returned by `useScreen`. */
7
9
  export interface ScreenContextValue {
8
10
  /**
9
- * Which axes scroll containers pad with `layout.screen.margin`.
10
- * Overridable per `Screen.ScrollView` / `Screen.FlatList` / `Screen.List`
11
- * via their own `margins` prop.
11
+ * Which axes scroll containers pad with `layout.screen.padding`.
12
+ * Each scroll container can override this with its own `contentPadding` prop.
12
13
  */
13
- margins: ScreenMargins;
14
+ contentPadding: ScreenContentPadding;
15
+ /** Safe-area policy applied by the root; descendants must not reapply it. */
16
+ safeArea: ScreenSafeArea;
17
+ /** @deprecated Use contentPadding. */
18
+ margins: ScreenContentPadding;
14
19
  /** Whether a `Screen.Header` is present. Used by scroll containers to add top inset. */
15
20
  hasHeader: boolean;
16
- /**
17
- * Live vertical scroll offset of the screen's scroll container, driven by
18
- * `Screen.ScrollView` / `Screen.FlatList`. Headers (and consumer UI) read it
19
- * to animate on scroll.
20
- */
21
+ /** Vertical scroll offset, updated on the UI thread for header animations. */
21
22
  scrollY: SharedValue<number>;
22
23
  /**
23
- * Scroll distance (px) over which the active header collapses — measured by
24
- * the header (e.g. large-title portal height, parallax hero height). `0`
25
- * disables snap and collapse-range animations (`Header.Title` screens).
24
+ * Optional collapse distance for custom headers. Set via setHeaderCollapseHeight.
25
+ * Built-in headers derive their animation range from the theme.
26
26
  */
27
27
  headerCollapseHeight: SharedValue<number>;
28
28
  /**
29
- * Native `snapToOffsets` for the scroll container. `[0, height]` when a
30
- * collapsible header is active; `undefined` otherwise.
29
+ * Native list snap offsets set by setHeaderCollapseHeight. Undefined by default.
30
+ * For Screen.ScrollView, pass these explicitly as snapToOffsets.
31
31
  */
32
32
  headerSnapOffsets: number[] | undefined;
33
- /** Updates collapse height for animations and native snap offsets. */
33
+ /** Rounds the height and sets `[0, height]` snap offsets; nonpositive heights clear snapping. */
34
34
  setHeaderCollapseHeight: (height: number) => void;
35
- /** Shared scroll container ref — bound by `Screen.ScrollView` / `Screen.FlatList`. */
35
+ /**
36
+ * Ref bound by ScrollView and FlatList containers, including `Screen.List`
37
+ * with FlatList. Custom list implementations do not bind this ref.
38
+ * Its declared ScrollView type does not expose FlatList-specific methods.
39
+ */
36
40
  scrollRef: ScreenScrollRef;
37
41
  /** Scroll handler that mirrors offset into `scrollY`. */
38
42
  scrollHandler: ScrollHandlerProcessed<Record<string, unknown>>;
43
+ /** Resolved background color shared with scroll containers. */
39
44
  background?: string;
40
45
  }
41
46
  export declare const ScreenContext: import("react").Context<ScreenContextValue | null>;
47
+ /** Internal provider inputs resolved by the Screen root. */
42
48
  export interface ScreenScrollProviderProps {
43
49
  children: ReactNode;
44
- /** Which axes scroll containers pad with `layout.screen.margin`. Default `'all'`. */
45
- margins?: ScreenMargins;
50
+ /** Which axes scroll containers pad with `layout.screen.padding`. Default `'all'`. */
51
+ contentPadding?: ScreenContentPadding;
52
+ safeArea?: ScreenSafeArea;
46
53
  /** Whether a `Screen.Header` child is present. Default false. */
47
54
  hasHeader?: boolean;
55
+ /** Resolved background color shared with scroll containers. */
48
56
  background?: string;
49
57
  }
50
58
  /**
51
59
  * Owns the screen's shared scroll ref, offset, snap offsets, and header collapse
52
- * metrics. Header variants call {@link ScreenContextValue.setHeaderCollapseHeight};
53
- * scroll containers bind the ref via {@link useScreen}.
60
+ * metrics. Scroll containers bind the ref via {@link useScreen}.
54
61
  */
55
- export declare function ScreenScrollProvider({ background, children, margins, hasHeader, }: ScreenScrollProviderProps): import("react").JSX.Element;
62
+ export declare function ScreenScrollProvider({ background, children, contentPadding, safeArea, hasHeader, }: ScreenScrollProviderProps): import("react").JSX.Element;
56
63
  /**
57
- * Access the enclosing `Screen`'s shared scroll state, ref, and snap offsets.
64
+ * Reads the nearest `Screen`'s configuration, shared scroll state, and ref.
65
+ * Read `scrollY.value` in Reanimated worklets to animate without React renders.
66
+ * The ref belongs to the primary scroll container, not the screen root.
58
67
  *
59
68
  * @example
60
69
  * ```tsx
61
- * const { scrollY, scrollRef, headerSnapOffsets } = useScreen();
70
+ * function FadingContent() {
71
+ * const { scrollY } = useScreen();
72
+ * const style = useAnimatedStyle(() => ({
73
+ * opacity: interpolate(scrollY.value, [0, 100], [1, 0], "clamp"),
74
+ * }));
75
+ * return <Animated.View style={style}>{content}</Animated.View>;
76
+ * }
62
77
  * ```
63
78
  *
64
- * @throws if called outside a `Screen`.
79
+ * @returns The nearest Screen's configuration and scroll state.
80
+ * @throws Error when called outside a Screen provider.
65
81
  */
66
82
  export declare function useScreen(): ScreenContextValue;
67
83
  //# sourceMappingURL=ScreenContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAA8C,MAAM,OAAO,CAAC;AAElG,OAAO,QAAQ,EAAE,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE/D,6HAA6H;AAC7H,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB,wFAAwF;IACxF,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;OAIG;IACH,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,sEAAsE;IACtE,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,sFAAsF;IACtF,SAAS,EAAE,eAAe,CAAC;IAC3B,yDAAyD;IACzD,aAAa,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,UAA0B,EAC1B,QAAQ,EACR,OAAe,EACf,SAAiB,GAClB,EAAE,yBAAyB,+BA+C3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
1
+ {"version":3,"file":"ScreenContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAA8C,MAAM,OAAO,CAAC;AAElG,OAAO,QAAQ,EAAE,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,YAAS,CAAC;AAEpE,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE/D,yDAAyD;AACzD,eAAO,MAAM,yBAAyB,kBAAkB,CAAC;AAEzD,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,EAAE,oBAAoB,CAAC;IACrC,6EAA6E;IAC7E,QAAQ,EAAE,cAAc,CAAC;IACzB,sCAAsC;IACtC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,wFAAwF;IACxF,SAAS,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B;;;OAGG;IACH,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,iGAAiG;IACjG,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD;;;;OAIG;IACH,SAAS,EAAE,eAAe,CAAC;IAC3B,yDAAyD;IACzD,aAAa,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/D,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,4DAA4D;AAC5D,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,UAA0B,EAC1B,QAAQ,EACR,cAAsB,EACtB,QAAiB,EACjB,SAAiB,GAClB,EAAE,yBAAyB,+BAkD3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
@@ -1,47 +1,6 @@
1
- import { type FlatListProps } from "react-native";
2
- import type { ScreenScrollableProps } from "./types.js";
3
- /**
4
- * @deprecated Use {@link ScreenListProps} (`Screen.List`) instead
5
- * `Screen.List` renders `FlatList` by default and binds the screen's shared
6
- * scroll ref exactly as `Screen.FlatList` does, but also lets a screen swap in
7
- * any other FlatList-shaped list (e.g. `FlashList`) via its `as` prop.
8
- */
9
- export interface ScreenFlatListProps<T> extends Omit<FlatListProps<T>, "CellRendererComponent" | "horizontal">, ScreenScrollableProps {
10
- /**
11
- * Extra bottom padding on the list content — clearance for a tab bar or home
12
- * indicator. Defaults to the `layout.screen.margin.y` token when margins are
13
- * enabled, otherwise `0`.
14
- */
15
- bottomInset?: number;
16
- }
17
- /**
18
- * `FlatList` variant of `Screen.ScrollView`: binds the screen's shared scroll
19
- * ref, mirrors offset into `scrollY`, hosts the portal target above the list,
20
- * and applies token-driven content padding.
21
- *
22
- * Shares `loading` / `LoadingComponent` / `EmptyComponent` / `margins` /
23
- * `horizontal` with `Screen.ScrollView`, so a screen can swap one container for
24
- * another without relearning its API.
25
- *
26
- * @deprecated Use {@link ScreenList} (`Screen.List`) instead — it renders
27
- * `FlatList` by default and behaves identically, but also accepts an `as`
28
- * prop for swapping in another list implementation later without changing
29
- * the surrounding API.
30
- *
31
- * @example
32
- * ```tsx
33
- * <Screen.FlatList data={items} renderItem={({ item }) => <Row item={item} />} />
34
- * ```
35
- *
36
- * @example Loading and empty placeholders
37
- * ```tsx
38
- * <Screen.FlatList
39
- * data={items}
40
- * loading={isLoading}
41
- * EmptyComponent={<EmptyState icon="status.info" title="Nothing yet" fill />}
42
- * renderItem={({ item }) => <Row item={item} />}
43
- * />
44
- * ```
45
- */
46
- export declare function ScreenFlatList<T>({ data, style, contentContainerStyle, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, horizontal, loading, LoadingComponent, EmptyComponent, margins, bottomInset, onScroll, ...rest }: ScreenFlatListProps<T>): import("react").JSX.Element;
1
+ import { ScreenList, type ScreenListProps } from "./ScreenList.js";
2
+ /** @deprecated Use ScreenListProps. */
3
+ export type ScreenFlatListProps<T> = ScreenListProps<T>;
4
+ /** @deprecated Use Screen.List, which exposes the same native FlatList and ref. */
5
+ export declare const ScreenFlatList: typeof ScreenList;
47
6
  //# sourceMappingURL=ScreenFlatList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenFlatList.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA2D,MAAM,cAAc,CAAC;AAc3G,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAAC,CAAC,CACpC,SAAQ,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,uBAAuB,GAAG,YAAY,CAAC,EACpE,qBAAqB;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAChC,IAAI,EACJ,KAAK,EACL,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,UAAkB,EAClB,OAAe,EACf,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,mBAAmB,CAAC,CAAC,CAAC,+BA0ExB"}
1
+ {"version":3,"file":"ScreenFlatList.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAc,CAAC;AAEhE,uCAAuC;AACvC,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AACxD,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,OAAO,UAAuB,CAAC"}
@@ -1,65 +1,77 @@
1
- import { type ComponentPropsWithoutRef, type ElementType, type ReactElement } from "react";
2
- import { FlatList, type NativeScrollEvent, type NativeSyntheticEvent, type StyleProp, type ViewStyle } from "react-native";
1
+ import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ElementType, type ReactElement, type RefAttributes } from "react";
2
+ import { FlatList, type FlatListProps, type ListRenderItem } from "react-native";
3
3
  import type { ScreenScrollableProps } from "./types.js";
4
- import { type ListHeaderComponent } from "./utils.js";
4
+ /** Minimal row information supported by custom list adapters. FlatList also supplies separators. */
5
5
  export interface ScreenListRenderItemInfo<T> {
6
6
  item: T;
7
7
  index: number;
8
8
  }
9
- export type ScreenListProps<T = unknown, As extends ElementType = typeof FlatList> = ScreenScrollableProps & Omit<ComponentPropsWithoutRef<As>, "data" | "renderItem" | "keyExtractor" | "style" | "contentContainerStyle" | "onScroll" | "ListHeaderComponent" | "ListFooterComponent" | "ListEmptyComponent" | keyof ScreenScrollableProps> & {
10
- /**
11
- * Which list component to render as. Defaults to React Native's
12
- * `FlatList` — pass any list with a FlatList-shaped prop surface
13
- * (`data`, `renderItem`, `ListHeaderComponent`, …), e.g. `FlashList`
14
- * from `@shopify/flash-list`, or a custom virtualized list.
15
- *
16
- * Only the default `FlatList` binds the screen's shared imperative
17
- * scroll ref — a custom `as` is responsible for its own ref if it needs
18
- * one, since not every list exposes a Reanimated-compatible ref (e.g.
19
- * `FlashList`'s ref exposes a different, non Reanimated-compatible
20
- * imperative API).
21
- */
22
- as?: As;
9
+ /** Native viewability token with the item inferred from data. */
10
+ type NativeViewToken = Parameters<NonNullable<FlatListProps<unknown>["onViewableItemsChanged"]>>[0]["viewableItems"][number];
11
+ export type ScreenListViewToken<T> = Omit<NativeViewToken, "item"> & {
12
+ item: T;
13
+ };
14
+ type ViewabilityCallback<T> = (info: {
15
+ viewableItems: ScreenListViewToken<T>[];
16
+ changed: ScreenListViewToken<T>[];
17
+ }) => void;
18
+ type ListLayoutProps = ScreenScrollableProps & {
19
+ /** @deprecated Use extraBottomPadding. This replaces themed bottom padding; safeArea belongs to Screen. */
20
+ bottomInset?: number;
21
+ };
22
+ /** Native FlatList props with item inference retained across callbacks and refs. */
23
+ type NativeScreenListProps<T> = ListLayoutProps & Omit<FlatListProps<T>, keyof ListLayoutProps | "data" | "renderItem" | "onViewableItemsChanged" | "viewabilityConfigCallbackPairs"> & {
24
+ /** Native FlatList is used by default. */
25
+ as?: typeof FlatList;
26
+ /** Null, undefined, and empty data use the empty slot. */
23
27
  data?: readonly T[] | null;
24
- renderItem?: (info: ScreenListRenderItemInfo<T>) => ReactElement | null;
28
+ /** Render a row, including native separator helpers. */
29
+ renderItem: ListRenderItem<T>;
30
+ /** Item-typed native viewability callback. */
31
+ onViewableItemsChanged?: ViewabilityCallback<T> | null;
32
+ /** Item-typed native viewability callback/configuration pairs. */
33
+ viewabilityConfigCallbackPairs?: {
34
+ viewabilityConfig: NonNullable<FlatListProps<T>["viewabilityConfig"]>;
35
+ onViewableItemsChanged: ViewabilityCallback<T>;
36
+ }[];
37
+ };
38
+ /** Props an adapter must accept and forward to its scrollable list implementation. */
39
+ export type ScreenListAdapterProps<T> = Pick<FlatListProps<T>, "style" | "contentContainerStyle" | "onScroll" | "ListHeaderComponent" | "ListFooterComponent" | "ListEmptyComponent" | "horizontal" | "scrollEventThrottle" | "contentInsetAdjustmentBehavior" | "automaticallyAdjustContentInsets" | "automaticallyAdjustsScrollIndicatorInsets" | "showsVerticalScrollIndicator" | "snapToOffsets"> & {
40
+ data?: readonly T[] | null;
41
+ renderItem: (info: ScreenListRenderItemInfo<T>) => ReactElement | null;
25
42
  keyExtractor?: (item: T, index: number) => string;
26
- ListHeaderComponent?: ListHeaderComponent;
27
- ListFooterComponent?: ListHeaderComponent;
28
- ListEmptyComponent?: ListHeaderComponent;
29
- style?: StyleProp<ViewStyle>;
30
- contentContainerStyle?: StyleProp<ViewStyle>;
31
- onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
32
- /**
33
- * Extra bottom padding on the list content — clearance for a tab bar or
34
- * home indicator. Defaults to the `layout.screen.margin.y` token when
35
- * margins are enabled, otherwise `0`.
36
- */
37
- bottomInset?: number;
38
43
  };
44
+ type AdapterKeys = "data" | "renderItem" | "onScroll" | "contentContainerStyle" | "ListHeaderComponent" | "ListFooterComponent" | "ListEmptyComponent";
45
+ /** Custom lists must accept the adapter contract and forward a ref for Reanimated. */
46
+ export type ScreenCustomListProps<T, As extends ElementType> = ListLayoutProps & ScreenListAdapterProps<T> & Omit<ComponentPropsWithoutRef<As>, keyof ListLayoutProps | keyof ScreenListAdapterProps<T>> & {
47
+ as: As & (As extends typeof FlatList ? never : AdapterKeys extends keyof ComponentPropsWithoutRef<As> ? readonly T[] extends NonNullable<ComponentPropsWithoutRef<As>["data"]> ? "ref" extends keyof ComponentPropsWithRef<As> ? unknown : never : never : never);
48
+ ref?: ComponentPropsWithRef<As>["ref"];
49
+ };
50
+ /** Screen list props, optionally parameterized by a custom adapter component. */
51
+ export type ScreenListProps<T = unknown, As extends ElementType = typeof FlatList> = As extends typeof FlatList ? NativeScreenListProps<T> : ScreenCustomListProps<T, As>;
52
+ interface ScreenListComponent {
53
+ <T>(props: ScreenListProps<T> & RefAttributes<FlatList<T>>): ReactElement | null;
54
+ <T, As extends ElementType>(props: ScreenCustomListProps<T, As>): ReactElement | null;
55
+ displayName?: string;
56
+ }
39
57
  /**
40
- * Polymorphic list container renders whichever list `as` names (defaults
41
- * to `FlatList`), applying the same margin/header/safe-area/scroll-handler
42
- * chrome regardless of which one it is. A screen can swap list
43
- * implementations by changing `as`, without relearning the surrounding API.
58
+ * Virtualized Screen content. FlatList is the default and its native ref and
59
+ * item callbacks retain their types. Native refreshing keeps rows visible;
60
+ * isLoading replaces them with loadingContent (a Spinner by default).
44
61
  *
45
- * @example
46
- * ```tsx
47
- * <Screen.List data={items} renderItem={({ item }) => <Row item={item} />} />
48
- * ```
62
+ * Custom `as` components must implement ScreenListAdapterProps, forward their
63
+ * ref, and forward the supplied scroll events, styles, and header/footer slots.
64
+ * Their native ref is forwarded to callers; useScreen().scrollRef is FlatList-only here.
65
+ * JS onScroll receives nativeEvent data without SyntheticEvent methods.
49
66
  *
50
- * @example Any other list component
67
+ * @example
51
68
  * ```tsx
52
- * import { FlashList } from '@shopify/flash-list';
53
- *
54
- * <Screen.List
55
- * as={FlashList}
56
- * data={items}
57
- * renderItem={({ item }) => <Row item={item} />}
58
- * />
69
+ * <Screen safeArea="auto">
70
+ * <Screen.List data={items} renderItem={({ item }) => <Row item={item} />}
71
+ * isLoading={isLoading} refreshing={isRefreshing} onRefresh={refresh} />
72
+ * </Screen>
59
73
  * ```
60
74
  */
61
- export declare function ScreenList<T = unknown, As extends ElementType = typeof FlatList>({ as, data, renderItem, style, contentContainerStyle, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, horizontal, loading, LoadingComponent, EmptyComponent, margins, bottomInset, onScroll, ...rest }: ScreenListProps<T, As>): import("react").JSX.Element;
62
- export declare namespace ScreenList {
63
- var displayName: string;
64
- }
75
+ export declare const ScreenList: ScreenListComponent;
76
+ export {};
65
77
  //# sourceMappingURL=ScreenList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenList.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EAChB,KAAK,YAAY,EAElB,MAAM,OAAO,CAAC;AACf,OAAO,EACL,QAAQ,EACR,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AActB,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AACpE,OAAO,EAA0B,KAAK,mBAAmB,EAAoB,MAAM,YAAS,CAAC;AAE7F,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,EAAE,SAAS,WAAW,GAAG,OAAO,QAAQ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M,CAAC;CACtB;AA2FD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,EAAqB,mBAAmB,CAAC"}
@@ -1,71 +1,31 @@
1
1
  import { type ReactNode } from "react";
2
- import { type ScrollViewProps } from "react-native";
3
- import { type ScrollHandlerProcessed } from "react-native-reanimated";
2
+ import { type ScrollViewProps, type StyleProp, type ViewStyle } from "react-native";
4
3
  import type { ScreenScrollableProps } from "./types.js";
4
+ /** Native ScrollView props plus Screen layout, placeholders, and worklet support. */
5
5
  export interface ScreenScrollViewProps extends Omit<ScrollViewProps, "horizontal">, ScreenScrollableProps {
6
+ /** Content replaced while loading or empty. */
6
7
  children?: ReactNode;
7
- /**
8
- * Reanimated scroll handler for custom scroll-driven animation, composed
9
- * alongside the screen's own scroll tracking and any JS `onScroll`
10
- * callback. Runs on the UI thread — for simple JS-side callbacks, use
11
- * `onScroll` instead; it doesn't require writing a worklet.
12
- */
13
- scrollHandler?: ScrollHandlerProcessed<Record<string, unknown>>;
8
+ /** Style the inner content View, excluding the header portal. */
9
+ contentStyle?: StyleProp<ViewStyle>;
10
+ /** Override empty-child detection, for example when a child component renders null. */
11
+ isEmpty?: boolean;
14
12
  }
15
13
  /**
16
- * Scrollable content container for a `Screen`. Binds the screen's shared scroll
17
- * ref, mirrors offset into `scrollY`, hosts the portal target at the top (where
18
- * header content is injected), and applies token-driven content padding.
14
+ * Scrollable content with a header portal and shared scroll tracking.
15
+ * Must be inside Screen. The ref exposes native ScrollView methods.
19
16
  *
20
- * For simple side effects (analytics, infinite-scroll triggers), pass a plain
21
- * `onScroll` callback. For scroll-driven animation, pass your own
22
- * `useAnimatedScrollHandler` via `scrollHandler` instead — it runs on the UI
23
- * thread alongside the screen's own handler, with no JS-thread round trip.
17
+ * `contentContainerStyle` styles the native container, including header content.
18
+ * Use `contentStyle` for the inner content only. `onScroll` receives nativeEvent
19
+ * data on JS, without SyntheticEvent methods; `scrollHandler` runs on the UI thread.
24
20
  *
25
21
  * @example
26
22
  * ```tsx
27
- * <Screen.ScrollView>
28
- * <Text>Scrollable content</Text>
29
- * </Screen.ScrollView>
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>
23
+ * <Screen safeArea="auto" contentPadding="x">
24
+ * <Screen.ScrollView isLoading={isLoading} emptyContent={<Text>Nothing yet</Text>}>
25
+ * {items.map(item => <Row key={item.id} item={item} />)}
26
+ * </Screen.ScrollView>
27
+ * </Screen>
68
28
  * ```
69
29
  */
70
- export declare function ScreenScrollView({ children, style, contentContainerStyle, scrollHandler: externalScrollHandler, onScroll: onScrollProp, horizontal, loading, LoadingComponent, EmptyComponent, margins, ...rest }: ScreenScrollViewProps): import("react").JSX.Element;
30
+ export declare const ScreenScrollView: import("react").ForwardRefExoticComponent<ScreenScrollViewProps & import("react").RefAttributes<import("react-native/types_generated/Libraries/Components/ScrollView/ScrollView").PublicScrollViewInstance>>;
71
31
  //# sourceMappingURL=ScreenScrollView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAqD,KAAK,eAAe,EAAQ,MAAM,cAAc,CAAC;AAE7G,OAAiB,EACf,KAAK,sBAAsB,EAG5B,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAGpE,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,qBAAqB;IACvG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,KAAK,EACL,qBAAqB,EACrB,aAAa,EAAE,qBAAqB,EACpC,QAAQ,EAAE,YAAY,EACtB,UAAkB,EAClB,OAAe,EACf,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,GAAG,IAAI,EACR,EAAE,qBAAqB,+BA+DvB"}
1
+ {"version":3,"file":"ScreenScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAmB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAW3G,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAG3E,qFAAqF;AACrF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,qBAAqB;IACvG,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,8MA2D5B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type Ref } from "react";
2
+ import type { ScreenScrollRef } from "../ScreenContext.js";
3
+ /** Bind the animated ref and the caller's native ref to the same instance. */
4
+ export declare function useScreenRef<T>(screenRef: ScreenScrollRef | undefined, ref: Ref<T> | undefined): (instance: T | null) => (() => void) | undefined;
5
+ //# sourceMappingURL=use-screen-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-screen-ref.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/hooks/use-screen-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAe,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAkB,CAAC;AAExD,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,eAAe,GAAG,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,cAEhF,CAAC,GAAG,IAAI,8BAgBtB"}
@@ -0,0 +1,53 @@
1
+ import type { ScrollViewProps } from "react-native";
2
+ import { type ScrollHandlerProcessed } from "react-native-reanimated";
3
+ /** Keeps scroll tracking on the UI thread and schedules optional JS callbacks on RN. */
4
+ export declare function useScreenScrollHandler(screenScrollHandler: ScrollHandlerProcessed<Record<string, unknown>>, onScroll?: ScrollViewProps["onScroll"], externalScrollHandler?: ScrollHandlerProcessed<Record<string, unknown>>): (event: Readonly<{
5
+ bubbles: boolean | undefined;
6
+ cancelable: boolean | undefined;
7
+ currentTarget: number | import("react-native").HostInstance;
8
+ defaultPrevented: boolean | undefined;
9
+ dispatchConfig: Readonly<{
10
+ registrationName: string;
11
+ }>;
12
+ eventPhase: number | undefined;
13
+ preventDefault: () => void;
14
+ isDefaultPrevented: () => boolean;
15
+ stopPropagation: () => void;
16
+ isPropagationStopped: () => boolean;
17
+ isTrusted: boolean | undefined;
18
+ nativeEvent: Readonly<{
19
+ contentInset: Readonly<{
20
+ bottom: number;
21
+ left: number;
22
+ right: number;
23
+ top: number;
24
+ }>;
25
+ contentOffset: Readonly<{
26
+ y: number;
27
+ x: number;
28
+ }>;
29
+ contentSize: Readonly<{
30
+ height: number;
31
+ width: number;
32
+ }>;
33
+ layoutMeasurement: Readonly<{
34
+ height: number;
35
+ width: number;
36
+ }>;
37
+ velocity?: Readonly<{
38
+ y: number;
39
+ x: number;
40
+ }>;
41
+ zoomScale?: number;
42
+ responderIgnoreScroll?: boolean;
43
+ targetContentOffset?: Readonly<{
44
+ y: number;
45
+ x: number;
46
+ }>;
47
+ }>;
48
+ persist: () => void;
49
+ target: (number | undefined) | import("react-native").HostInstance;
50
+ timeStamp: number;
51
+ type: string | undefined;
52
+ }>, context?: Record<string, unknown> | undefined) => void;
53
+ //# sourceMappingURL=use-screen-scroll-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-screen-scroll-handler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/hooks/use-screen-scroll-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2C,eAAe,EAAE,MAAM,cAAc,CAAC;AAE7F,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,yBAAyB,CAAC;AAGjC,wFAAwF;AACxF,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACpE,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,EACtC,qBAAqB,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DAiBxE"}
@@ -4,9 +4,9 @@ export type { ScreenContextValue } from "./ScreenContext.js";
4
4
  export { useScreen } from "./ScreenContext.js";
5
5
  export type { ScreenFlatListProps } from "./ScreenFlatList.js";
6
6
  export { ScreenFlatList } from "./ScreenFlatList.js";
7
- export type { ScreenListProps } from "./ScreenList.js";
7
+ export type { ScreenCustomListProps, ScreenListAdapterProps, ScreenListProps, ScreenListRenderItemInfo, ScreenListViewToken, } from "./ScreenList.js";
8
8
  export { ScreenList } from "./ScreenList.js";
9
9
  export type { ScreenScrollViewProps } from "./ScreenScrollView.js";
10
10
  export { ScreenScrollView } from "./ScreenScrollView.js";
11
- export type { ScreenMargins, ScreenScrollableProps } from "./types.js";
11
+ export type { ScreenContentPadding, ScreenMargins, ScreenSafeArea, ScreenScrollableProps } from "./types.js";
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAiB,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAC1C,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAiB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAiB,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAkB,CAAC;AAClD,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,iBAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAC1C,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAoB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,YAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type PropsWithChildren } from "react";
2
+ import type { ScreenSafeAreaEdges } from "../types.js";
3
+ export declare function ScreenFrame({ children, edges }: PropsWithChildren<{
4
+ edges: ScreenSafeAreaEdges;
5
+ }>): import("react").JSX.Element;
6
+ //# sourceMappingURL=ScreenFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenFrame.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAMlF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAU,CAAC;AAIpD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC,+BA0BjG"}
@@ -0,0 +1,21 @@
1
+ import { type Dispatch, type PropsWithChildren, type SetStateAction } from "react";
2
+ import type { useAnimatedStyle } from "react-native-reanimated";
3
+ type HeaderOpacityStyle = ReturnType<typeof useAnimatedStyle<{
4
+ opacity: number;
5
+ }>>;
6
+ interface HeaderBackground {
7
+ color: string;
8
+ animatedStyle?: HeaderOpacityStyle;
9
+ }
10
+ interface HeaderAppearance {
11
+ background: HeaderBackground | undefined;
12
+ setBackground: Dispatch<SetStateAction<HeaderBackground | undefined>>;
13
+ }
14
+ export declare const ScreenHeaderAppearanceContext: import("react").Context<HeaderAppearance | null>;
15
+ export declare function ScreenHeaderAppearanceProvider({ children }: PropsWithChildren): import("react").JSX.Element;
16
+ /** Only the designated header slot controls the screen's top safe-area color. */
17
+ export declare function ScreenHeaderAppearanceSlot({ children }: PropsWithChildren): import("react").JSX.Element;
18
+ /** Share the overlay's animated style so safe-area fading stays on the UI thread. */
19
+ export declare function useHeaderBackground(color: string, animatedStyle?: HeaderOpacityStyle): void;
20
+ export {};
21
+ //# sourceMappingURL=ScreenHeaderAppearance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenHeaderAppearance.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenHeaderAppearance.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAKpB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAAC;AAEnF,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC;AAED,UAAU,gBAAgB;IACxB,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACzC,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC;CACvE;AAED,eAAO,MAAM,6BAA6B,kDAA+C,CAAC;AAG1F,wBAAgB,8BAA8B,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+BAM7E;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,+BAKzE;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,kBAAkB,QAMpF"}
@@ -1,22 +1,20 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  import type { ScreenScrollableProps } from "../types.js";
3
3
  /**
4
- * Centres a loading/empty placeholder in whatever space the content leaves.
5
- * Grows so the placeholder sits in the middle of the content area rather than
6
- * hugging the top, which needs the content container to grow as well.
4
+ * Centres a placeholder in the available space. The parent must also grow
5
+ * to fill the viewport.
7
6
  */
8
7
  export declare function ScreenPlaceholder({ children }: {
9
8
  children: ReactNode;
10
9
  }): import("react").JSX.Element;
11
- interface PlaceholderInput extends Pick<ScreenScrollableProps, "loading" | "LoadingComponent" | "EmptyComponent"> {
10
+ interface ScreenPlaceholderOptions extends Pick<ScreenScrollableProps, "isLoading" | "loadingContent" | "emptyContent"> {
12
11
  /** Whether the container has nothing to render (empty `data`, no children). */
13
12
  isEmpty: boolean;
14
13
  }
15
14
  /**
16
- * The placeholder a scroll container should show instead of its content, or
17
- * `null` to render the content. Loading wins over empty: while data is in
18
- * flight there is nothing to be empty about yet.
15
+ * Resolves the loading or empty placeholder, or null to keep the content.
16
+ * Loading takes precedence over the empty state.
19
17
  */
20
- export declare function renderScreenPlaceholder({ loading, LoadingComponent, EmptyComponent, isEmpty, }: PlaceholderInput): ReactElement | null;
18
+ export declare function renderScreenPlaceholder({ isLoading, loadingContent, emptyContent, isEmpty, }: ScreenPlaceholderOptions): ReactElement | null;
21
19
  export {};
22
20
  //# sourceMappingURL=ScreenPlaceholder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenPlaceholder.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEtE;AAED,UAAU,gBACR,SAAQ,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;IACtF,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,OAAO,GACR,EAAE,gBAAgB,GAAG,YAAY,GAAG,IAAI,CAQxC"}
1
+ {"version":3,"file":"ScreenPlaceholder.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenPlaceholder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAU,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEtE;AAED,UAAU,wBACR,SAAQ,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC;IACpF,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,cAAc,EACd,YAAY,EACZ,OAAO,GACR,EAAE,wBAAwB,GAAG,YAAY,GAAG,IAAI,CAUhD"}
@@ -0,0 +1,7 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import type { ScreenSafeAreaEdges } from "../types.js";
3
+ /** Android combines system and native interface insets and consumes the selected edges. */
4
+ export declare function ScreenSafeArea({ children, edges }: PropsWithChildren<{
5
+ edges: ScreenSafeAreaEdges;
6
+ }>): import("react").JSX.Element;
7
+ //# sourceMappingURL=ScreenSafeArea.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenSafeArea.android.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenSafeArea.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAU,CAAC;AAOpD,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC,+BAMpG"}