react-native-terra-ui 0.5.1 → 0.7.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 (359) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/lib/module/components/avatar/Avatar.js +60 -60
  3. package/lib/module/components/avatar/Avatar.js.map +1 -1
  4. package/lib/module/components/box/Box.js +2 -2
  5. package/lib/module/components/box/Box.js.map +1 -1
  6. package/lib/module/components/box/utils.js +19 -19
  7. package/lib/module/components/box/utils.js.map +1 -1
  8. package/lib/module/components/button/Button.js +54 -48
  9. package/lib/module/components/button/Button.js.map +1 -1
  10. package/lib/module/components/chip/Chip.js +94 -94
  11. package/lib/module/components/chip/Chip.js.map +1 -1
  12. package/lib/module/components/chip/utils.js +3 -3
  13. package/lib/module/components/empty-state/EmptyState.js +40 -40
  14. package/lib/module/components/empty-state/EmptyState.js.map +1 -1
  15. package/lib/module/components/header/header-buttons.js +5 -5
  16. package/lib/module/components/header/header-buttons.js.map +1 -1
  17. package/lib/module/components/header/parts/HeaderGradientOverlay.js +82 -12
  18. package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -1
  19. package/lib/module/components/header/variants/LargeTitleHeader/index.js +64 -60
  20. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  21. package/lib/module/components/header/variants/TitleHeader/index.js +33 -29
  22. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  23. package/lib/module/components/icon/Icon.js +6 -6
  24. package/lib/module/components/icon/Icon.js.map +1 -1
  25. package/lib/module/components/image/Image.js +6 -6
  26. package/lib/module/components/image/Image.js.map +1 -1
  27. package/lib/module/components/page-indicator/PageIndicator.js +1 -1
  28. package/lib/module/components/page-indicator/PageIndicatorRoot.js.map +1 -1
  29. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +8 -8
  30. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js.map +1 -1
  31. package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js.map +1 -1
  32. package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js +6 -6
  33. package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js.map +1 -1
  34. package/lib/module/components/page-indicator/utils.js +8 -8
  35. package/lib/module/components/page-indicator/utils.js.map +1 -1
  36. package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js +2 -2
  37. package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js.map +1 -1
  38. package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js +9 -9
  39. package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js.map +1 -1
  40. package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js +2 -2
  41. package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js.map +1 -1
  42. package/lib/module/components/page-indicator/variants/DotIndicator/index.js +3 -3
  43. package/lib/module/components/page-indicator/variants/DotIndicator/index.js.map +1 -1
  44. package/lib/module/components/page-indicator/variants/DotIndicator/utils.js +1 -1
  45. package/lib/module/components/page-indicator/variants/DotIndicator/utils.js.map +1 -1
  46. package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js +1 -1
  47. package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js.map +1 -1
  48. package/lib/module/components/page-indicator/variants/PillIndicator/index.js +5 -5
  49. package/lib/module/components/page-indicator/variants/PillIndicator/index.js.map +1 -1
  50. package/lib/module/components/page-indicator/variants/PillIndicator/utils.js +3 -3
  51. package/lib/module/components/portal/Portal.js +1 -1
  52. package/lib/module/components/portal/PortalContext.js +1 -1
  53. package/lib/module/components/portal/PortalHost.js +1 -1
  54. package/lib/module/components/portal/PortalProvider.js +1 -1
  55. package/lib/module/components/portal/PortalProvider.js.map +1 -1
  56. package/lib/module/components/screen/Screen.js +8 -8
  57. package/lib/module/components/screen/Screen.js.map +1 -1
  58. package/lib/module/components/screen/ScreenContext.js +6 -6
  59. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  60. package/lib/module/components/screen/ScreenFlatList.js +3 -3
  61. package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
  62. package/lib/module/components/screen/ScreenList.js +5 -5
  63. package/lib/module/components/screen/ScreenList.js.map +1 -1
  64. package/lib/module/components/screen/ScreenScrollView.js +6 -6
  65. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  66. package/lib/module/components/screen/parts/BottomSafeArea.js +1 -1
  67. package/lib/module/components/screen/parts/BottomSafeArea.js.map +1 -1
  68. package/lib/module/components/screen/parts/ScreenPlaceholder.js +3 -3
  69. package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
  70. package/lib/module/components/screen/utils.js +3 -3
  71. package/lib/module/components/screen/utils.js.map +1 -1
  72. package/lib/module/components/slot/Slot.js +2 -2
  73. package/lib/module/components/slot/Slot.js.map +1 -1
  74. package/lib/module/components/slot/utils.js +3 -3
  75. package/lib/module/components/slot/utils.js.map +1 -1
  76. package/lib/module/components/spinner/Spinner.js +10 -10
  77. package/lib/module/components/spinner/Spinner.js.map +1 -1
  78. package/lib/module/components/surface/Surface.js +14 -14
  79. package/lib/module/components/surface/Surface.js.map +1 -1
  80. package/lib/module/components/text/Text.js +13 -13
  81. package/lib/module/components/text/Text.js.map +1 -1
  82. package/lib/module/components/toast/Toast.js +46 -46
  83. package/lib/module/components/toast/Toast.js.map +1 -1
  84. package/lib/module/components/toast/ToastProvider.js +32 -32
  85. package/lib/module/components/toast/ToastProvider.js.map +1 -1
  86. package/lib/module/components/toast/parts/ToastAnimatedItem.js +10 -10
  87. package/lib/module/components/toast/parts/ToastAnimatedItem.js.map +1 -1
  88. package/lib/module/components/toast/utils/controller.js +2 -2
  89. package/lib/module/components/toast/utils/controller.js.map +1 -1
  90. package/lib/module/components/toolbar/Toolbar.js +103 -33
  91. package/lib/module/components/toolbar/Toolbar.js.map +1 -1
  92. package/lib/module/context/ThemeProvider.js +5 -5
  93. package/lib/module/context/ThemeProvider.js.map +1 -1
  94. package/lib/module/theme/breakpoints.js.map +1 -1
  95. package/lib/module/theme/defaults/icons.js +11 -11
  96. package/lib/module/theme/defaults/icons.js.map +1 -1
  97. package/lib/module/theme/defaults/image.js +7 -7
  98. package/lib/module/theme/defaults/image.js.map +1 -1
  99. package/lib/module/theme/registry.js +11 -11
  100. package/lib/module/theme/registry.js.map +1 -1
  101. package/lib/module/theme/runtime.js +3 -3
  102. package/lib/module/theme/runtime.js.map +1 -1
  103. package/lib/module/theme/theme.js +9 -9
  104. package/lib/module/theme/theme.js.map +1 -1
  105. package/lib/module/theme/tokens/dark.js +67 -67
  106. package/lib/module/theme/tokens/dark.js.map +1 -1
  107. package/lib/module/theme/tokens/light.js +67 -67
  108. package/lib/module/theme/tokens/primitives.js +417 -417
  109. package/lib/module/utils/accent-utils.js +16 -16
  110. package/lib/module/utils/accent-utils.js.map +1 -1
  111. package/lib/module/utils/color-utils.js +3 -3
  112. package/lib/module/utils/deep-merge.js +1 -1
  113. package/lib/module/utils/resolve-theme-color.js +2 -2
  114. package/lib/module/utils/resolve-theme-color.js.map +1 -1
  115. package/lib/module/utils/typography.js +5 -5
  116. package/lib/module/utils/typography.js.map +1 -1
  117. package/lib/module/utils/unflatten.js +2 -2
  118. package/lib/typescript/src/components/avatar/Avatar.d.ts +1 -1
  119. package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
  120. package/lib/typescript/src/components/avatar/index.d.ts +2 -2
  121. package/lib/typescript/src/components/avatar/types.d.ts +7 -7
  122. package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
  123. package/lib/typescript/src/components/box/Box.d.ts +2 -2
  124. package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
  125. package/lib/typescript/src/components/box/index.d.ts +3 -3
  126. package/lib/typescript/src/components/box/utils.d.ts +7 -7
  127. package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
  128. package/lib/typescript/src/components/button/Button.d.ts +15 -8
  129. package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
  130. package/lib/typescript/src/components/button/index.d.ts +2 -2
  131. package/lib/typescript/src/components/chip/Chip.d.ts +5 -5
  132. package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -1
  133. package/lib/typescript/src/components/chip/index.d.ts +3 -3
  134. package/lib/typescript/src/components/chip/types.d.ts +3 -3
  135. package/lib/typescript/src/components/chip/utils.d.ts +1 -1
  136. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +5 -5
  137. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
  138. package/lib/typescript/src/components/empty-state/index.d.ts +3 -3
  139. package/lib/typescript/src/components/empty-state/types.d.ts +1 -1
  140. package/lib/typescript/src/components/header/Header.d.ts +2 -2
  141. package/lib/typescript/src/components/header/header-buttons.d.ts +3 -3
  142. package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
  143. package/lib/typescript/src/components/header/index.d.ts +6 -6
  144. package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts +19 -2
  145. package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -1
  146. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
  147. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  148. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +4 -4
  149. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  150. package/lib/typescript/src/components/icon/Icon.d.ts +3 -3
  151. package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
  152. package/lib/typescript/src/components/icon/index.d.ts +2 -2
  153. package/lib/typescript/src/components/image/Image.d.ts +1 -1
  154. package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
  155. package/lib/typescript/src/components/image/index.d.ts +2 -2
  156. package/lib/typescript/src/components/image/types.d.ts +1 -1
  157. package/lib/typescript/src/components/index.d.ts +17 -17
  158. package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +10 -10
  159. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts +2 -2
  160. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts.map +1 -1
  161. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +1 -1
  162. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts.map +1 -1
  163. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts +3 -3
  164. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts.map +1 -1
  165. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts +2 -2
  166. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts.map +1 -1
  167. package/lib/typescript/src/components/page-indicator/index.d.ts +3 -3
  168. package/lib/typescript/src/components/page-indicator/utils.d.ts +2 -2
  169. package/lib/typescript/src/components/page-indicator/utils.d.ts.map +1 -1
  170. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts +1 -1
  171. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts.map +1 -1
  172. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts +2 -2
  173. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts.map +1 -1
  174. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts +2 -2
  175. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts.map +1 -1
  176. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +3 -3
  177. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts.map +1 -1
  178. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts.map +1 -1
  179. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts +2 -2
  180. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts.map +1 -1
  181. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +3 -3
  182. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts.map +1 -1
  183. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts +1 -1
  184. package/lib/typescript/src/components/portal/Portal.d.ts +3 -3
  185. package/lib/typescript/src/components/portal/PortalContext.d.ts +1 -1
  186. package/lib/typescript/src/components/portal/PortalHost.d.ts +2 -2
  187. package/lib/typescript/src/components/portal/PortalProvider.d.ts +1 -1
  188. package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
  189. package/lib/typescript/src/components/portal/index.d.ts +7 -7
  190. package/lib/typescript/src/components/screen/Screen.d.ts +10 -10
  191. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  192. package/lib/typescript/src/components/screen/ScreenContext.d.ts +3 -3
  193. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  194. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +3 -3
  195. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  196. package/lib/typescript/src/components/screen/ScreenList.d.ts +5 -5
  197. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  198. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +5 -5
  199. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  200. package/lib/typescript/src/components/screen/index.d.ts +11 -11
  201. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -1
  202. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +3 -3
  203. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
  204. package/lib/typescript/src/components/screen/types.d.ts +2 -2
  205. package/lib/typescript/src/components/screen/utils.d.ts +2 -2
  206. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  207. package/lib/typescript/src/components/slot/Slot.d.ts +2 -2
  208. package/lib/typescript/src/components/slot/Slot.d.ts.map +1 -1
  209. package/lib/typescript/src/components/slot/index.d.ts +3 -3
  210. package/lib/typescript/src/components/slot/utils.d.ts +1 -1
  211. package/lib/typescript/src/components/slot/utils.d.ts.map +1 -1
  212. package/lib/typescript/src/components/spinner/Spinner.d.ts +2 -2
  213. package/lib/typescript/src/components/spinner/Spinner.d.ts.map +1 -1
  214. package/lib/typescript/src/components/spinner/index.d.ts +2 -2
  215. package/lib/typescript/src/components/surface/Surface.d.ts +4 -4
  216. package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
  217. package/lib/typescript/src/components/surface/index.d.ts +2 -2
  218. package/lib/typescript/src/components/text/Text.d.ts +4 -4
  219. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  220. package/lib/typescript/src/components/text/index.d.ts +2 -2
  221. package/lib/typescript/src/components/toast/Toast.d.ts +18 -18
  222. package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -1
  223. package/lib/typescript/src/components/toast/ToastProvider.d.ts +1 -1
  224. package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -1
  225. package/lib/typescript/src/components/toast/index.d.ts +4 -4
  226. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +3 -3
  227. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -1
  228. package/lib/typescript/src/components/toast/types.d.ts +10 -10
  229. package/lib/typescript/src/components/toast/types.d.ts.map +1 -1
  230. package/lib/typescript/src/components/toast/utils/controller.d.ts +2 -2
  231. package/lib/typescript/src/components/toast/utils/controller.d.ts.map +1 -1
  232. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +5 -5
  233. package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -1
  234. package/lib/typescript/src/components/toolbar/index.d.ts +2 -2
  235. package/lib/typescript/src/context/ThemeProvider.d.ts +3 -3
  236. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  237. package/lib/typescript/src/context/index.d.ts +2 -2
  238. package/lib/typescript/src/index.d.ts +3 -3
  239. package/lib/typescript/src/theme/breakpoints.d.ts +2 -2
  240. package/lib/typescript/src/theme/breakpoints.d.ts.map +1 -1
  241. package/lib/typescript/src/theme/defaults/icons.d.ts +1 -1
  242. package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -1
  243. package/lib/typescript/src/theme/defaults/image.d.ts +1 -1
  244. package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -1
  245. package/lib/typescript/src/theme/index.d.ts +14 -14
  246. package/lib/typescript/src/theme/registry.d.ts +2 -2
  247. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  248. package/lib/typescript/src/theme/runtime.d.ts +1 -1
  249. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  250. package/lib/typescript/src/theme/screen-margin.d.ts +2 -2
  251. package/lib/typescript/src/theme/theme.d.ts +2 -2
  252. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  253. package/lib/typescript/src/theme/tokens/dark.d.ts +67 -67
  254. package/lib/typescript/src/theme/tokens/light.d.ts +67 -67
  255. package/lib/typescript/src/theme/tokens/primitives.d.ts +417 -417
  256. package/lib/typescript/src/theme/types.d.ts +84 -84
  257. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  258. package/lib/typescript/src/utils/accent-utils.d.ts +1 -1
  259. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  260. package/lib/typescript/src/utils/resolve-theme-color.d.ts +1 -1
  261. package/lib/typescript/src/utils/resolve-theme-color.d.ts.map +1 -1
  262. package/lib/typescript/src/utils/typography.d.ts +2 -2
  263. package/lib/typescript/src/utils/typography.d.ts.map +1 -1
  264. package/package.json +1 -1
  265. package/src/components/avatar/Avatar.tsx +66 -71
  266. package/src/components/avatar/index.ts +2 -2
  267. package/src/components/avatar/types.ts +7 -12
  268. package/src/components/box/Box.tsx +7 -18
  269. package/src/components/box/index.ts +3 -3
  270. package/src/components/box/utils.ts +59 -81
  271. package/src/components/button/Button.tsx +119 -144
  272. package/src/components/button/index.ts +2 -2
  273. package/src/components/chip/Chip.tsx +107 -143
  274. package/src/components/chip/index.ts +3 -3
  275. package/src/components/chip/types.ts +7 -7
  276. package/src/components/chip/utils.ts +5 -5
  277. package/src/components/empty-state/EmptyState.tsx +44 -60
  278. package/src/components/empty-state/index.ts +3 -3
  279. package/src/components/empty-state/types.ts +1 -1
  280. package/src/components/header/Header.ts +2 -2
  281. package/src/components/header/header-buttons.tsx +10 -18
  282. package/src/components/header/index.ts +6 -6
  283. package/src/components/header/parts/HeaderGradientOverlay.tsx +77 -11
  284. package/src/components/header/variants/LargeTitleHeader/index.tsx +79 -142
  285. package/src/components/header/variants/TitleHeader/index.tsx +45 -63
  286. package/src/components/icon/Icon.tsx +31 -39
  287. package/src/components/icon/index.ts +2 -2
  288. package/src/components/image/Image.tsx +12 -10
  289. package/src/components/image/index.ts +2 -2
  290. package/src/components/image/types.ts +1 -1
  291. package/src/components/index.ts +17 -17
  292. package/src/components/page-indicator/PageIndicator.tsx +14 -14
  293. package/src/components/page-indicator/PageIndicatorRoot.tsx +4 -12
  294. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +17 -35
  295. package/src/components/page-indicator/hooks/use-page-indicator-core.ts +6 -8
  296. package/src/components/page-indicator/hooks/use-page-indicator-progress.ts +10 -30
  297. package/src/components/page-indicator/index.ts +3 -3
  298. package/src/components/page-indicator/utils.ts +20 -48
  299. package/src/components/page-indicator/variants/DotIndicator/InactiveDot.tsx +5 -16
  300. package/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.tsx +21 -63
  301. package/src/components/page-indicator/variants/DotIndicator/TravelingPill.tsx +6 -16
  302. package/src/components/page-indicator/variants/DotIndicator/index.tsx +20 -38
  303. package/src/components/page-indicator/variants/DotIndicator/utils.ts +2 -6
  304. package/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.tsx +12 -50
  305. package/src/components/page-indicator/variants/PillIndicator/index.tsx +19 -41
  306. package/src/components/page-indicator/variants/PillIndicator/utils.ts +4 -4
  307. package/src/components/portal/Portal.tsx +4 -4
  308. package/src/components/portal/PortalContext.tsx +1 -1
  309. package/src/components/portal/PortalHost.tsx +4 -4
  310. package/src/components/portal/PortalProvider.tsx +24 -35
  311. package/src/components/portal/index.ts +7 -7
  312. package/src/components/screen/Screen.tsx +45 -52
  313. package/src/components/screen/ScreenContext.tsx +8 -17
  314. package/src/components/screen/ScreenFlatList.tsx +17 -36
  315. package/src/components/screen/ScreenList.tsx +31 -63
  316. package/src/components/screen/ScreenScrollView.tsx +17 -30
  317. package/src/components/screen/index.ts +11 -11
  318. package/src/components/screen/parts/BottomSafeArea.tsx +5 -6
  319. package/src/components/screen/parts/ScreenPlaceholder.tsx +9 -14
  320. package/src/components/screen/types.ts +2 -2
  321. package/src/components/screen/utils.ts +6 -19
  322. package/src/components/slot/Slot.tsx +5 -20
  323. package/src/components/slot/index.ts +3 -3
  324. package/src/components/slot/utils.ts +5 -8
  325. package/src/components/spinner/Spinner.tsx +19 -52
  326. package/src/components/spinner/index.ts +2 -2
  327. package/src/components/surface/Surface.tsx +34 -43
  328. package/src/components/surface/index.ts +2 -2
  329. package/src/components/text/Text.tsx +75 -85
  330. package/src/components/text/index.ts +2 -2
  331. package/src/components/toast/Toast.tsx +195 -251
  332. package/src/components/toast/ToastProvider.tsx +61 -136
  333. package/src/components/toast/index.ts +4 -4
  334. package/src/components/toast/parts/ToastAnimatedItem.tsx +14 -22
  335. package/src/components/toast/types.ts +11 -14
  336. package/src/components/toast/utils/controller.ts +4 -6
  337. package/src/components/toolbar/Toolbar.tsx +117 -72
  338. package/src/components/toolbar/index.ts +2 -2
  339. package/src/context/ThemeProvider.tsx +13 -28
  340. package/src/context/index.ts +2 -2
  341. package/src/index.tsx +3 -3
  342. package/src/theme/breakpoints.ts +3 -5
  343. package/src/theme/defaults/icons.tsx +15 -30
  344. package/src/theme/defaults/image.tsx +9 -14
  345. package/src/theme/index.ts +14 -14
  346. package/src/theme/registry.ts +30 -49
  347. package/src/theme/runtime.ts +6 -7
  348. package/src/theme/screen-margin.ts +3 -3
  349. package/src/theme/theme.ts +39 -60
  350. package/src/theme/tokens/dark.ts +67 -67
  351. package/src/theme/tokens/light.ts +67 -67
  352. package/src/theme/tokens/primitives.ts +417 -417
  353. package/src/theme/types.ts +123 -135
  354. package/src/utils/accent-utils.ts +21 -30
  355. package/src/utils/color-utils.ts +3 -3
  356. package/src/utils/deep-merge.ts +1 -1
  357. package/src/utils/resolve-theme-color.ts +8 -11
  358. package/src/utils/typography.ts +7 -10
  359. package/src/utils/unflatten.ts +2 -2
@@ -9,30 +9,31 @@ import {
9
9
  type PropsWithChildren,
10
10
  type ReactNode,
11
11
  useMemo,
12
- } from 'react';
13
- import { View } from 'react-native';
14
- import type { ViewProps } from 'react-native-svg/lib/typescript/fabric/utils';
15
- import { StyleSheet, useUnistyles } from 'react-native-unistyles';
16
- import type { ColorToken } from '#theme/types';
17
- import { resolveThemeColor } from '#utils/resolve-theme-color';
18
- import { PortalProvider } from '../portal';
19
- import { ScreenScrollProvider } from './ScreenContext';
20
- import { ScreenFlatList } from './ScreenFlatList';
21
- import { ScreenList } from './ScreenList';
22
- import { ScreenScrollView } from './ScreenScrollView';
23
- import type { ScreenMargins } from './types';
12
+ } from "react";
13
+ import { View } from "react-native";
24
14
 
25
- export type ScreenHeaderProps<T extends ElementType = typeof Fragment> =
26
- PropsWithChildren<
27
- {
28
- /**
29
- * Component to render the header as. Defaults to `Fragment` (no
30
- * wrapper). Use this to cast the header to a different container,
31
- * e.g. `as={View}` any extra props are forwarded to it.
32
- */
33
- as?: T;
34
- } & Omit<ComponentPropsWithoutRef<T>, 'children'>
35
- >;
15
+ import type { ViewProps } from "react-native-svg/lib/typescript/fabric/utils";
16
+ import { StyleSheet, useUnistyles } from "react-native-unistyles";
17
+
18
+ import type { ColorToken } from "#theme/types";
19
+ import { resolveThemeColor } from "#utils/resolve-theme-color";
20
+ import { PortalProvider } from "../portal";
21
+ import { ScreenScrollProvider } from "./ScreenContext";
22
+ import { ScreenFlatList } from "./ScreenFlatList";
23
+ import { ScreenList } from "./ScreenList";
24
+ import { ScreenScrollView } from "./ScreenScrollView";
25
+ import type { ScreenMargins } from "./types";
26
+
27
+ export type ScreenHeaderProps<T extends ElementType = typeof Fragment> = PropsWithChildren<
28
+ {
29
+ /**
30
+ * Component to render the header as. Defaults to `Fragment` (no
31
+ * wrapper). Use this to cast the header to a different container,
32
+ * e.g. `as={View}` — any extra props are forwarded to it.
33
+ */
34
+ as?: T;
35
+ } & Omit<ComponentPropsWithoutRef<T>, "children">
36
+ >;
36
37
 
37
38
  /**
38
39
  * Marker slot identifying the screen's header — its purpose is to let
@@ -54,7 +55,7 @@ function ScreenHeader<T extends ElementType = typeof Fragment>({
54
55
  const Component = as ?? Fragment;
55
56
  return <Component {...rest}>{children}</Component>;
56
57
  }
57
- ScreenHeader.displayName = 'Screen.Header';
58
+ ScreenHeader.displayName = "Screen.Header";
58
59
 
59
60
  /** True if `children` directly contains a `Screen.Header`. */
60
61
  function hasScreenHeader(children: ReactNode): boolean {
@@ -63,8 +64,8 @@ function hasScreenHeader(children: ReactNode): boolean {
63
64
  if (found) return;
64
65
  if (
65
66
  isValidElement(child) &&
66
- typeof child.type !== 'string' &&
67
- (child.type as { displayName?: string }).displayName === 'Screen.Header'
67
+ typeof child.type !== "string" &&
68
+ (child.type as { displayName?: string }).displayName === "Screen.Header"
68
69
  )
69
70
  found = true;
70
71
  });
@@ -74,7 +75,7 @@ function hasScreenHeader(children: ReactNode): boolean {
74
75
  export interface ScreenProps extends ViewProps {
75
76
  children: ReactNode;
76
77
  /** Background color token. Defaults to the `background` token. */
77
- bg?: ColorToken;
78
+ background?: ColorToken;
78
79
  /** Hosted inside a tab navigator? Exposed via `useScreen()`. Default false. */
79
80
  inTabView?: boolean;
80
81
  /**
@@ -89,9 +90,7 @@ export interface ScreenProps extends ViewProps {
89
90
  hasMargins?: boolean;
90
91
  }
91
92
 
92
- type ScreenComponent = ReturnType<
93
- typeof forwardRef<ComponentRef<typeof View>, ScreenProps>
94
- > & {
93
+ type ScreenComponent = ReturnType<typeof forwardRef<ComponentRef<typeof View>, ScreenProps>> & {
95
94
  Header: typeof ScreenHeader;
96
95
  ScrollView: typeof ScreenScrollView;
97
96
  /** @deprecated Use {@link ScreenList} (`Screen.List`) instead. */
@@ -112,29 +111,23 @@ type ScreenComponent = ReturnType<
112
111
  * </Screen>
113
112
  * ```
114
113
  */
115
- const ScreenBase = forwardRef<ComponentRef<typeof View>, ScreenProps>(
116
- function Screen(
117
- { children, bg = 'background', margins, hasMargins, style, ...rest },
118
- _ref
119
- ) {
120
- const hasHeader = useMemo(() => hasScreenHeader(children), [children]);
121
- const resolvedMargins = margins ?? (hasMargins === false ? 'none' : 'all');
122
- const { theme } = useUnistyles();
123
- const resolvedBg = resolveThemeColor(bg, theme) ?? theme.color.background;
114
+ const ScreenBase = forwardRef<ComponentRef<typeof View>, ScreenProps>(function Screen(
115
+ { children, background = "background", margins, hasMargins, style, ...rest },
116
+ _ref
117
+ ) {
118
+ const hasHeader = useMemo(() => hasScreenHeader(children), [children]);
119
+ const resolvedMargins = margins ?? (hasMargins === false ? "none" : "all");
120
+ const { theme } = useUnistyles();
121
+ const resolvedBackground = resolveThemeColor(background, theme) ?? theme.color.background;
124
122
 
125
- return (
126
- <View style={[styles.container, style]} {...rest}>
127
- <ScreenScrollProvider
128
- background={resolvedBg}
129
- margins={resolvedMargins}
130
- hasHeader={hasHeader}
131
- >
132
- <PortalProvider>{children}</PortalProvider>
133
- </ScreenScrollProvider>
134
- </View>
135
- );
136
- }
137
- ) as ScreenComponent;
123
+ return (
124
+ <View style={[styles.container, style]} {...rest}>
125
+ <ScreenScrollProvider background={resolvedBackground} margins={resolvedMargins} hasHeader={hasHeader}>
126
+ <PortalProvider>{children}</PortalProvider>
127
+ </ScreenScrollProvider>
128
+ </View>
129
+ );
130
+ }) as ScreenComponent;
138
131
 
139
132
  ScreenBase.Header = ScreenHeader;
140
133
  ScreenBase.ScrollView = ScreenScrollView;
@@ -1,11 +1,4 @@
1
- import {
2
- createContext,
3
- type ReactNode,
4
- useCallback,
5
- useContext,
6
- useMemo,
7
- useState,
8
- } from 'react';
1
+ import { createContext, type ReactNode, useCallback, useContext, useMemo, useState } from "react";
9
2
 
10
3
  import Animated, {
11
4
  type AnimatedRef,
@@ -14,14 +7,14 @@ import Animated, {
14
7
  useAnimatedRef,
15
8
  useAnimatedScrollHandler,
16
9
  useSharedValue,
17
- } from 'react-native-reanimated';
10
+ } from "react-native-reanimated";
18
11
 
19
- import type { ScreenMargins } from './types';
12
+ import type { ScreenMargins } from "./types";
20
13
 
21
14
  export type ScreenScrollRef = AnimatedRef<Animated.ScrollView>;
22
15
 
23
16
  /** `PortalHost` name shared by `Screen.ScrollView` / `Screen.FlatList` and header variants that portal content into them. */
24
- export const SCREEN_HEADER_PORTAL_HOST = 'screen-header';
17
+ export const SCREEN_HEADER_PORTAL_HOST = "screen-header";
25
18
 
26
19
  export interface ScreenContextValue {
27
20
  /**
@@ -77,9 +70,9 @@ export interface ScreenScrollProviderProps {
77
70
  * scroll containers bind the ref via {@link useScreen}.
78
71
  */
79
72
  export function ScreenScrollProvider({
80
- background = 'transparent',
73
+ background = "transparent",
81
74
  children,
82
- margins = 'all',
75
+ margins = "all",
83
76
  hasHeader = false,
84
77
  }: ScreenScrollProviderProps) {
85
78
  const scrollY = useSharedValue(0);
@@ -127,9 +120,7 @@ export function ScreenScrollProvider({
127
120
  ]
128
121
  );
129
122
 
130
- return (
131
- <ScreenContext.Provider value={value}>{children}</ScreenContext.Provider>
132
- );
123
+ return <ScreenContext.Provider value={value}>{children}</ScreenContext.Provider>;
133
124
  }
134
125
 
135
126
  /**
@@ -145,7 +136,7 @@ export function ScreenScrollProvider({
145
136
  export function useScreen(): ScreenContextValue {
146
137
  const context = useContext(ScreenContext);
147
138
  if (!context) {
148
- throw new Error('useScreen must be used within a Screen component');
139
+ throw new Error("useScreen must be used within a Screen component");
149
140
  }
150
141
  return context;
151
142
  }
@@ -1,24 +1,19 @@
1
- import {
2
- type FlatListProps,
3
- type NativeScrollEvent,
4
- type NativeSyntheticEvent,
5
- View,
6
- } from 'react-native';
1
+ import { type FlatListProps, type NativeScrollEvent, type NativeSyntheticEvent, View } from "react-native";
7
2
 
8
3
  import Animated, {
9
4
  type AnimatedRef,
10
5
  useAnimatedScrollHandler,
11
6
  useComposedEventHandler,
12
- } from 'react-native-reanimated';
13
- import { StyleSheet } from 'react-native-unistyles';
7
+ } from "react-native-reanimated";
8
+ import { StyleSheet } from "react-native-unistyles";
14
9
 
15
- import { resolveScreenMargin } from '#theme/screen-margin';
16
- import { PortalHost } from '../portal';
17
- import { BottomSafeArea } from './parts/BottomSafeArea';
18
- import { renderScreenPlaceholder } from './parts/ScreenPlaceholder';
19
- import { SCREEN_HEADER_PORTAL_HOST, useScreen } from './ScreenContext';
20
- import type { ScreenMargins, ScreenScrollableProps } from './types';
21
- import { hasXMargin, hasYMargin, renderListHeader } from './utils';
10
+ import { resolveScreenMargin } from "#theme/screen-margin";
11
+ import { PortalHost } from "../portal";
12
+ import { BottomSafeArea } from "./parts/BottomSafeArea";
13
+ import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder";
14
+ import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext";
15
+ import type { ScreenMargins, ScreenScrollableProps } from "./types";
16
+ import { hasXMargin, hasYMargin, renderListHeader } from "./utils";
22
17
 
23
18
  /**
24
19
  * @deprecated Use {@link ScreenListProps} (`Screen.List`) instead —
@@ -27,7 +22,7 @@ import { hasXMargin, hasYMargin, renderListHeader } from './utils';
27
22
  * any other FlatList-shaped list (e.g. `FlashList`) via its `as` prop.
28
23
  */
29
24
  export interface ScreenFlatListProps<T>
30
- extends Omit<FlatListProps<T>, 'CellRendererComponent' | 'horizontal'>,
25
+ extends Omit<FlatListProps<T>, "CellRendererComponent" | "horizontal">,
31
26
  ScreenScrollableProps {
32
27
  /**
33
28
  * Extra bottom padding on the list content — clearance for a tab bar or home
@@ -105,16 +100,12 @@ export function ScreenFlatList<T>({
105
100
 
106
101
  const jsScrollHandler = useAnimatedScrollHandler(
107
102
  (event) => {
108
- if (onScroll)
109
- onScroll(event as unknown as NativeSyntheticEvent<NativeScrollEvent>);
103
+ if (onScroll) onScroll(event as unknown as NativeSyntheticEvent<NativeScrollEvent>);
110
104
  },
111
105
  [onScroll]
112
106
  );
113
107
 
114
- const composedHandler = useComposedEventHandler([
115
- scrollHandler,
116
- jsScrollHandler,
117
- ]);
108
+ const composedHandler = useComposedEventHandler([scrollHandler, jsScrollHandler]);
118
109
 
119
110
  // A caller naming its own `bottomInset` has taken the bottom over entirely,
120
111
  // and a horizontal list has no bottom edge to clear.
@@ -147,11 +138,8 @@ export function ScreenFlatList<T>({
147
138
  data={loading ? [] : data}
148
139
  style={[{ backgroundColor: background }, style]}
149
140
  horizontal={horizontal}
150
- contentInsetAdjustmentBehavior={hasHeader ? 'never' : undefined}
151
- contentContainerStyle={[
152
- styles.content(resolvedMargins, hasHeader, bottomInset),
153
- contentContainerStyle,
154
- ]}
141
+ contentInsetAdjustmentBehavior={hasHeader ? "never" : undefined}
142
+ contentContainerStyle={[styles.content(resolvedMargins, hasHeader, bottomInset), contentContainerStyle]}
155
143
  ListHeaderComponent={headerComponent}
156
144
  ListFooterComponent={footerComponent}
157
145
  ListEmptyComponent={placeholder ?? ListEmptyComponent}
@@ -174,15 +162,8 @@ const styles = StyleSheet.create((theme, runtime) => ({
174
162
  scrollContent: {
175
163
  flexGrow: 1,
176
164
  },
177
- content: (
178
- margins: ScreenMargins,
179
- hasHeader: boolean,
180
- bottomInset: number | undefined
181
- ) => {
182
- const { x: marginX, y: marginY } = resolveScreenMargin(
183
- theme,
184
- runtime.breakpoint
185
- );
165
+ content: (margins: ScreenMargins, hasHeader: boolean, bottomInset: number | undefined) => {
166
+ const { x: marginX, y: marginY } = resolveScreenMargin(theme, runtime.breakpoint);
186
167
  return {
187
168
  flexGrow: 1,
188
169
  // The header is absolutely positioned, so the list reserves its full
@@ -4,7 +4,7 @@ import {
4
4
  type ElementType,
5
5
  type ReactElement,
6
6
  useMemo,
7
- } from 'react';
7
+ } from "react";
8
8
  import {
9
9
  FlatList,
10
10
  type NativeScrollEvent,
@@ -12,48 +12,40 @@ import {
12
12
  type StyleProp,
13
13
  View,
14
14
  type ViewStyle,
15
- } from 'react-native';
15
+ } from "react-native";
16
16
 
17
17
  import Animated, {
18
18
  type AnimatedRef,
19
19
  useAnimatedScrollHandler,
20
20
  useComposedEventHandler,
21
- } from 'react-native-reanimated';
22
- import { StyleSheet } from 'react-native-unistyles';
21
+ } from "react-native-reanimated";
22
+ import { StyleSheet } from "react-native-unistyles";
23
23
 
24
- import { resolveScreenMargin } from '#theme/screen-margin';
25
- import { PortalHost } from '../portal';
26
- import { BottomSafeArea } from './parts/BottomSafeArea';
27
- import { renderScreenPlaceholder } from './parts/ScreenPlaceholder';
28
- import { SCREEN_HEADER_PORTAL_HOST, useScreen } from './ScreenContext';
29
- import type { ScreenMargins, ScreenScrollableProps } from './types';
30
- import {
31
- hasXMargin,
32
- hasYMargin,
33
- type ListHeaderComponent,
34
- renderListHeader,
35
- } from './utils';
24
+ import { resolveScreenMargin } from "#theme/screen-margin";
25
+ import { PortalHost } from "../portal";
26
+ import { BottomSafeArea } from "./parts/BottomSafeArea";
27
+ import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder";
28
+ import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext";
29
+ import type { ScreenMargins, ScreenScrollableProps } from "./types";
30
+ import { hasXMargin, hasYMargin, type ListHeaderComponent, renderListHeader } from "./utils";
36
31
 
37
32
  export interface ScreenListRenderItemInfo<T> {
38
33
  item: T;
39
34
  index: number;
40
35
  }
41
36
 
42
- export type ScreenListProps<
43
- T = unknown,
44
- As extends ElementType = typeof FlatList,
45
- > = ScreenScrollableProps &
37
+ export type ScreenListProps<T = unknown, As extends ElementType = typeof FlatList> = ScreenScrollableProps &
46
38
  Omit<
47
39
  ComponentPropsWithoutRef<As>,
48
- | 'data'
49
- | 'renderItem'
50
- | 'keyExtractor'
51
- | 'style'
52
- | 'contentContainerStyle'
53
- | 'onScroll'
54
- | 'ListHeaderComponent'
55
- | 'ListFooterComponent'
56
- | 'ListEmptyComponent'
40
+ | "data"
41
+ | "renderItem"
42
+ | "keyExtractor"
43
+ | "style"
44
+ | "contentContainerStyle"
45
+ | "onScroll"
46
+ | "ListHeaderComponent"
47
+ | "ListFooterComponent"
48
+ | "ListEmptyComponent"
57
49
  | keyof ScreenScrollableProps
58
50
  > & {
59
51
  /**
@@ -108,10 +100,7 @@ export type ScreenListProps<
108
100
  * />
109
101
  * ```
110
102
  */
111
- export function ScreenList<
112
- T = unknown,
113
- As extends ElementType = typeof FlatList,
114
- >({
103
+ export function ScreenList<T = unknown, As extends ElementType = typeof FlatList>({
115
104
  as,
116
105
  data,
117
106
  renderItem,
@@ -136,10 +125,7 @@ export function ScreenList<
136
125
  // not on every render — `as` is arbitrary here (not a fixed module-scope
137
126
  // reference like `Screen.FlatList` uses), so it's memoized on the resolved
138
127
  // component instead of hoisted to module scope.
139
- const AnimatedComponent = useMemo(
140
- () => Animated.createAnimatedComponent(Component),
141
- [Component]
142
- );
128
+ const AnimatedComponent = useMemo(() => Animated.createAnimatedComponent(Component), [Component]);
143
129
 
144
130
  const {
145
131
  background,
@@ -164,16 +150,12 @@ export function ScreenList<
164
150
 
165
151
  const jsScrollHandler = useAnimatedScrollHandler(
166
152
  (event) => {
167
- if (onScroll)
168
- onScroll(event as unknown as NativeSyntheticEvent<NativeScrollEvent>);
153
+ if (onScroll) onScroll(event as unknown as NativeSyntheticEvent<NativeScrollEvent>);
169
154
  },
170
155
  [onScroll]
171
156
  );
172
157
 
173
- const composedHandler = useComposedEventHandler([
174
- scrollHandler,
175
- jsScrollHandler,
176
- ]);
158
+ const composedHandler = useComposedEventHandler([scrollHandler, jsScrollHandler]);
177
159
 
178
160
  // A caller naming its own `bottomInset` has taken the bottom over entirely,
179
161
  // and a horizontal list has no bottom edge to clear.
@@ -202,20 +184,13 @@ export function ScreenList<
202
184
 
203
185
  return (
204
186
  <AnimatedComponent
205
- ref={
206
- isDefaultFlatList
207
- ? (scrollRef as unknown as AnimatedRef<never>)
208
- : undefined
209
- }
187
+ ref={isDefaultFlatList ? (scrollRef as unknown as AnimatedRef<never>) : undefined}
210
188
  data={loading ? [] : data}
211
189
  renderItem={renderItem}
212
190
  style={[{ backgroundColor: background }, style]}
213
191
  horizontal={horizontal}
214
- contentInsetAdjustmentBehavior={hasHeader ? 'never' : undefined}
215
- contentContainerStyle={[
216
- styles.content(resolvedMargins, hasHeader, bottomInset),
217
- contentContainerStyle,
218
- ]}
192
+ contentInsetAdjustmentBehavior={hasHeader ? "never" : undefined}
193
+ contentContainerStyle={[styles.content(resolvedMargins, hasHeader, bottomInset), contentContainerStyle]}
219
194
  ListHeaderComponent={headerComponent}
220
195
  ListFooterComponent={footerComponent}
221
196
  ListEmptyComponent={placeholder ?? ListEmptyComponent}
@@ -227,7 +202,7 @@ export function ScreenList<
227
202
  />
228
203
  );
229
204
  }
230
- ScreenList.displayName = 'Screen.List';
205
+ ScreenList.displayName = "Screen.List";
231
206
 
232
207
  // `resolveScreenMargin` is called *inside* each dynamic function below, not
233
208
  // hoisted to the factory's top level — the Babel plugin only attributes a
@@ -236,15 +211,8 @@ ScreenList.displayName = 'Screen.List';
236
211
  // it would silently drop the dependency, so the margin would freeze at
237
212
  // whatever breakpoint was active on mount and never update on rotation.
238
213
  const styles = StyleSheet.create((theme, runtime) => ({
239
- content: (
240
- margins: ScreenMargins,
241
- hasHeader: boolean,
242
- bottomInset: number | undefined
243
- ) => {
244
- const { x: marginX, y: marginY } = resolveScreenMargin(
245
- theme,
246
- runtime.breakpoint
247
- );
214
+ content: (margins: ScreenMargins, hasHeader: boolean, bottomInset: number | undefined) => {
215
+ const { x: marginX, y: marginY } = resolveScreenMargin(theme, runtime.breakpoint);
248
216
  return {
249
217
  flexGrow: 1,
250
218
  // The header is absolutely positioned, so the list reserves its full
@@ -1,30 +1,23 @@
1
- import { Children, type ReactNode } from 'react';
2
- import {
3
- type NativeScrollEvent,
4
- type NativeSyntheticEvent,
5
- type ScrollViewProps,
6
- View,
7
- } from 'react-native';
1
+ import { Children, type ReactNode } from "react";
2
+ import { type NativeScrollEvent, type NativeSyntheticEvent, type ScrollViewProps, View } from "react-native";
8
3
 
9
4
  import Animated, {
10
5
  type ScrollHandlerProcessed,
11
6
  useAnimatedScrollHandler,
12
7
  useComposedEventHandler,
13
- } from 'react-native-reanimated';
14
- import { StyleSheet } from 'react-native-unistyles';
15
- import { scheduleOnRN } from 'react-native-worklets';
8
+ } from "react-native-reanimated";
9
+ import { StyleSheet } from "react-native-unistyles";
10
+ import { scheduleOnRN } from "react-native-worklets";
16
11
 
17
- import { resolveScreenMargin } from '#theme/screen-margin';
18
- import { PortalHost } from '../portal';
19
- import { BottomSafeArea } from './parts/BottomSafeArea';
20
- import { renderScreenPlaceholder } from './parts/ScreenPlaceholder';
21
- import { SCREEN_HEADER_PORTAL_HOST, useScreen } from './ScreenContext';
22
- import type { ScreenMargins, ScreenScrollableProps } from './types';
23
- import { hasXMargin, hasYMargin } from './utils';
12
+ import { resolveScreenMargin } from "#theme/screen-margin";
13
+ import { PortalHost } from "../portal";
14
+ import { BottomSafeArea } from "./parts/BottomSafeArea";
15
+ import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder";
16
+ import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext";
17
+ import type { ScreenMargins, ScreenScrollableProps } from "./types";
18
+ import { hasXMargin, hasYMargin } from "./utils";
24
19
 
25
- export interface ScreenScrollViewProps
26
- extends Omit<ScrollViewProps, 'horizontal'>,
27
- ScreenScrollableProps {
20
+ export interface ScreenScrollViewProps extends Omit<ScrollViewProps, "horizontal">, ScreenScrollableProps {
28
21
  children?: ReactNode;
29
22
  /**
30
23
  * Reanimated scroll handler for custom scroll-driven animation, composed
@@ -144,7 +137,7 @@ export function ScreenScrollView({
144
137
  ref={scrollRef}
145
138
  style={[{ backgroundColor: background }, style]}
146
139
  horizontal={horizontal}
147
- contentInsetAdjustmentBehavior={hasHeader ? 'never' : undefined}
140
+ contentInsetAdjustmentBehavior={hasHeader ? "never" : undefined}
148
141
  showsVerticalScrollIndicator={false}
149
142
  scrollEventThrottle={16}
150
143
  contentContainerStyle={styles.scrollContent(hasHeader, resolvedMargins)}
@@ -156,12 +149,7 @@ export function ScreenScrollView({
156
149
  <View>
157
150
  <PortalHost name={SCREEN_HEADER_PORTAL_HOST} />
158
151
  </View>
159
- <View
160
- style={[
161
- styles.content(horizontal, resolvedMargins),
162
- contentContainerStyle,
163
- ]}
164
- >
152
+ <View style={[styles.content(horizontal, resolvedMargins), contentContainerStyle]}>
165
153
  {placeholder ?? children}
166
154
  </View>
167
155
  {/* Outside the padded content view so the horizontal margins do not
@@ -187,8 +175,7 @@ const styles = StyleSheet.create((theme, rt) => ({
187
175
  // The header inset and the safe area are structural — they apply
188
176
  // whether or not margins are on; the y margin stacks on top of them.
189
177
  paddingTop:
190
- (hasHeader ? theme.layout.header.height + rt.insets.top : 0) +
191
- (hasYMargin(margins) ? marginY : 0),
178
+ (hasHeader ? theme.layout.header.height + rt.insets.top : 0) + (hasYMargin(margins) ? marginY : 0),
192
179
  // The safe area is `BottomSafeArea`'s job; counting it here as well
193
180
  // would leave a gap the height of the gesture bar.
194
181
  paddingBottom: hasYMargin(margins) ? marginY : 0,
@@ -200,7 +187,7 @@ const styles = StyleSheet.create((theme, rt) => ({
200
187
  return {
201
188
  flexGrow: 1,
202
189
  paddingHorizontal: hasXMargin(margins) ? marginX : 0,
203
- flexDirection: horizontal ? 'row' : 'column',
190
+ flexDirection: horizontal ? "row" : "column",
204
191
  };
205
192
  },
206
193
  }));
@@ -1,11 +1,11 @@
1
- export type { ScreenHeaderProps, ScreenProps } from './Screen';
2
- export { Screen } from './Screen';
3
- export type { ScreenContextValue } from './ScreenContext';
4
- export { useScreen } from './ScreenContext';
5
- export type { ScreenFlatListProps } from './ScreenFlatList';
6
- export { ScreenFlatList } from './ScreenFlatList';
7
- export type { ScreenListProps } from './ScreenList';
8
- export { ScreenList } from './ScreenList';
9
- export type { ScreenScrollViewProps } from './ScreenScrollView';
10
- export { ScreenScrollView } from './ScreenScrollView';
11
- export type { ScreenMargins, ScreenScrollableProps } from './types';
1
+ export type { ScreenHeaderProps, ScreenProps } from "./Screen";
2
+ export { Screen } from "./Screen";
3
+ export type { ScreenContextValue } from "./ScreenContext";
4
+ export { useScreen } from "./ScreenContext";
5
+ export type { ScreenFlatListProps } from "./ScreenFlatList";
6
+ export { ScreenFlatList } from "./ScreenFlatList";
7
+ export type { ScreenListProps } from "./ScreenList";
8
+ export { ScreenList } from "./ScreenList";
9
+ export type { ScreenScrollViewProps } from "./ScreenScrollView";
10
+ export { ScreenScrollView } from "./ScreenScrollView";
11
+ export type { ScreenMargins, ScreenScrollableProps } from "./types";
@@ -1,8 +1,8 @@
1
- import type { ComponentType } from 'react';
1
+ import type { ComponentType } from "react";
2
2
 
3
3
  type SafeAreaViewProps = {
4
4
  edges: { readonly bottom: true };
5
- insetType: 'all';
5
+ insetType: "all";
6
6
  style: { readonly flex: 0 };
7
7
  };
8
8
 
@@ -19,10 +19,9 @@ type SafeAreaViewProps = {
19
19
  * written against.
20
20
  */
21
21
  // eslint-disable-next-line @typescript-eslint/no-require-imports
22
- const { SafeAreaView } =
23
- require('react-native-screens/src/components/safe-area') as {
24
- SafeAreaView: ComponentType<SafeAreaViewProps>;
25
- };
22
+ const { SafeAreaView } = require("react-native-screens/src/components/safe-area") as {
23
+ SafeAreaView: ComponentType<SafeAreaViewProps>;
24
+ };
26
25
 
27
26
  const BOTTOM_EDGE = { bottom: true } as const;
28
27
  const SPACER = { flex: 0 } as const;
@@ -1,10 +1,10 @@
1
- import type { ReactElement, ReactNode } from 'react';
2
- import { View } from 'react-native';
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { View } from "react-native";
3
3
 
4
- import { StyleSheet } from 'react-native-unistyles';
4
+ import { StyleSheet } from "react-native-unistyles";
5
5
 
6
- import { Spinner } from '../../spinner';
7
- import type { ScreenScrollableProps } from '../types';
6
+ import { Spinner } from "../../spinner";
7
+ import type { ScreenScrollableProps } from "../types";
8
8
 
9
9
  /**
10
10
  * Centres a loading/empty placeholder in whatever space the content leaves.
@@ -16,10 +16,7 @@ export function ScreenPlaceholder({ children }: { children: ReactNode }) {
16
16
  }
17
17
 
18
18
  interface PlaceholderInput
19
- extends Pick<
20
- ScreenScrollableProps,
21
- 'loading' | 'LoadingComponent' | 'EmptyComponent'
22
- > {
19
+ extends Pick<ScreenScrollableProps, "loading" | "LoadingComponent" | "EmptyComponent"> {
23
20
  /** Whether the container has nothing to render (empty `data`, no children). */
24
21
  isEmpty: boolean;
25
22
  }
@@ -36,9 +33,7 @@ export function renderScreenPlaceholder({
36
33
  isEmpty,
37
34
  }: PlaceholderInput): ReactElement | null {
38
35
  if (loading) {
39
- return (
40
- <ScreenPlaceholder>{LoadingComponent ?? <Spinner />}</ScreenPlaceholder>
41
- );
36
+ return <ScreenPlaceholder>{LoadingComponent ?? <Spinner />}</ScreenPlaceholder>;
42
37
  }
43
38
  if (isEmpty && EmptyComponent) {
44
39
  return <ScreenPlaceholder>{EmptyComponent}</ScreenPlaceholder>;
@@ -49,7 +44,7 @@ export function renderScreenPlaceholder({
49
44
  const styles = StyleSheet.create(() => ({
50
45
  placeholder: {
51
46
  flexGrow: 1,
52
- alignItems: 'center',
53
- justifyContent: 'center',
47
+ alignItems: "center",
48
+ justifyContent: "center",
54
49
  },
55
50
  }));