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
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { useEffect } from "react";
2
2
 
3
3
  import Animated, {
4
4
  Extrapolation,
@@ -8,32 +8,25 @@ import Animated, {
8
8
  useAnimatedStyle,
9
9
  useFrameCallback,
10
10
  useSharedValue,
11
- } from 'react-native-reanimated';
12
- import Svg, { Circle } from 'react-native-svg';
11
+ } from "react-native-reanimated";
12
+ import Svg, { Circle } from "react-native-svg";
13
13
 
14
- import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from './utils';
14
+ import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils";
15
15
 
16
16
  const ORBIT_ARCS = [
17
- { id: 'arc-1', arcDegrees: 120, duration: 800, delay: 0 },
18
- { id: 'arc-2', arcDegrees: 60, duration: 1200, delay: 50 },
19
- { id: 'arc-3', arcDegrees: 30, duration: 1600, delay: 200 },
17
+ { id: "arc-1", arcDegrees: 120, duration: 800, delay: 0 },
18
+ { id: "arc-2", arcDegrees: 60, duration: 1200, delay: 50 },
19
+ { id: "arc-3", arcDegrees: 30, duration: 1600, delay: 200 },
20
20
  ] as const;
21
21
 
22
- const ORBIT_LOOP_DURATION = Math.max(
23
- ...ORBIT_ARCS.map((arc) => arc.delay + arc.duration)
24
- );
22
+ const ORBIT_LOOP_DURATION = Math.max(...ORBIT_ARCS.map((arc) => arc.delay + arc.duration));
25
23
 
26
24
  const ORBIT_SETTLE_THRESHOLD = 0.04;
27
25
 
28
26
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
29
27
 
30
- function computeSweepArcState(
31
- clock: number,
32
- delay: number,
33
- duration: number,
34
- arcDegrees: number
35
- ) {
36
- 'worklet';
28
+ function computeSweepArcState(clock: number, delay: number, duration: number, arcDegrees: number) {
29
+ "worklet";
37
30
  const elapsed = clock * ORBIT_LOOP_DURATION;
38
31
  const localProgress = Math.min(Math.max((elapsed - delay) / duration, 0), 1);
39
32
  const leadTravel = 360 + arcDegrees;
@@ -53,23 +46,11 @@ interface SweepArcProps {
53
46
  clock: SharedValue<number>;
54
47
  }
55
48
 
56
- function SweepArc({
57
- color,
58
- arcDegrees,
59
- duration,
60
- delay,
61
- clock,
62
- }: SweepArcProps) {
63
- const { ringSize, ringStroke, ringRadius, ringCircumference } =
64
- DOT_INDICATOR_GEOMETRY;
49
+ function SweepArc({ color, arcDegrees, duration, delay, clock }: SweepArcProps) {
50
+ const { ringSize, ringStroke, ringRadius, ringCircumference } = DOT_INDICATOR_GEOMETRY;
65
51
 
66
52
  const containerStyle = useAnimatedStyle(() => {
67
- const { tailVisible, visibleDegrees } = computeSweepArcState(
68
- clock.value,
69
- delay,
70
- duration,
71
- arcDegrees
72
- );
53
+ const { tailVisible, visibleDegrees } = computeSweepArcState(clock.value, delay, duration, arcDegrees);
73
54
 
74
55
  return {
75
56
  opacity: visibleDegrees > 0.01 ? 1 : 0,
@@ -78,12 +59,7 @@ function SweepArc({
78
59
  });
79
60
 
80
61
  const animatedProps = useAnimatedProps(() => {
81
- const { visibleDegrees } = computeSweepArcState(
82
- clock.value,
83
- delay,
84
- duration,
85
- arcDegrees
86
- );
62
+ const { visibleDegrees } = computeSweepArcState(clock.value, delay, duration, arcDegrees);
87
63
  const dash = (ringCircumference * visibleDegrees) / 360;
88
64
 
89
65
  return { strokeDasharray: [dash, ringCircumference] };
@@ -92,10 +68,7 @@ function SweepArc({
92
68
  return (
93
69
  <Animated.View
94
70
  pointerEvents="none"
95
- style={[
96
- { position: 'absolute', width: ringSize, height: ringSize },
97
- containerStyle,
98
- ]}
71
+ style={[{ position: "absolute", width: ringSize, height: ringSize }, containerStyle]}
99
72
  >
100
73
  <Svg width={ringSize} height={ringSize}>
101
74
  <AnimatedCircle
@@ -121,13 +94,7 @@ interface LoadingOrbitProps {
121
94
  vertical: boolean;
122
95
  }
123
96
 
124
- export function LoadingOrbit({
125
- color,
126
- count,
127
- loading,
128
- progress,
129
- vertical,
130
- }: LoadingOrbitProps) {
97
+ export function LoadingOrbit({ color, count, loading, progress, vertical }: LoadingOrbitProps) {
131
98
  const { dotSize, slot, crossSize, ringSize } = DOT_INDICATOR_GEOMETRY;
132
99
  const crossOffset = (crossSize - ringSize) / 2;
133
100
  const clock = useSharedValue(0);
@@ -140,10 +107,7 @@ export function LoadingOrbit({
140
107
  const frameCallback = useFrameCallback((frame) => {
141
108
  if (!loadingActive.value) return;
142
109
 
143
- const activeIndex = Math.min(
144
- Math.max(Math.round(progress.value), 0),
145
- count - 1
146
- );
110
+ const activeIndex = Math.min(Math.max(Math.round(progress.value), 0), count - 1);
147
111
  const settleDistance = Math.abs(progress.value - activeIndex);
148
112
 
149
113
  if (settleDistance >= ORBIT_SETTLE_THRESHOLD) return;
@@ -157,19 +121,13 @@ export function LoadingOrbit({
157
121
  }, [frameCallback, loading]);
158
122
 
159
123
  const containerStyle = useAnimatedStyle(() => {
160
- const activeIndex = Math.min(
161
- Math.max(Math.round(progress.value), 0),
162
- count - 1
163
- );
124
+ const activeIndex = Math.min(Math.max(Math.round(progress.value), 0), count - 1);
164
125
  const settleDistance = Math.abs(progress.value - activeIndex);
165
- const mainOffset =
166
- pageIndicatorDotCenter(activeIndex, slot, dotSize) - ringSize / 2;
126
+ const mainOffset = pageIndicatorDotCenter(activeIndex, slot, dotSize) - ringSize / 2;
167
127
 
168
128
  return {
169
129
  ...(vertical ? { top: mainOffset } : { left: mainOffset }),
170
- opacity: loadingActive.value
171
- ? interpolate(settleDistance, [0, 0.12], [1, 0], Extrapolation.CLAMP)
172
- : 0,
130
+ opacity: loadingActive.value ? interpolate(settleDistance, [0, 0.12], [1, 0], Extrapolation.CLAMP) : 0,
173
131
  };
174
132
  });
175
133
 
@@ -178,7 +136,7 @@ export function LoadingOrbit({
178
136
  pointerEvents="none"
179
137
  style={[
180
138
  {
181
- position: 'absolute',
139
+ position: "absolute",
182
140
  ...(vertical
183
141
  ? { left: crossOffset, width: ringSize, height: ringSize }
184
142
  : { top: crossOffset, width: ringSize, height: ringSize }),
@@ -3,9 +3,9 @@ import Animated, {
3
3
  interpolate,
4
4
  type SharedValue,
5
5
  useAnimatedStyle,
6
- } from 'react-native-reanimated';
6
+ } from "react-native-reanimated";
7
7
 
8
- import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from './utils';
8
+ import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils";
9
9
 
10
10
  interface TravelingPillProps {
11
11
  activeColor: string;
@@ -19,21 +19,13 @@ interface TravelingPillProps {
19
19
  * its leading edge advances first (stretch), then its trailing edge catches up
20
20
  * (collapse).
21
21
  */
22
- export function TravelingPill({
23
- activeColor,
24
- count,
25
- progress,
26
- vertical,
27
- }: TravelingPillProps) {
22
+ export function TravelingPill({ activeColor, count, progress, vertical }: TravelingPillProps) {
28
23
  const { dotSize, slot, crossSize } = DOT_INDICATOR_GEOMETRY;
29
24
  const crossOffset = (crossSize - dotSize) / 2;
30
25
 
31
26
  const animatedStyle = useAnimatedStyle(() => {
32
27
  const maxSegment = Math.max(0, count - 2);
33
- const segment = Math.min(
34
- Math.max(Math.floor(progress.value), 0),
35
- maxSegment
36
- );
28
+ const segment = Math.min(Math.max(Math.floor(progress.value), 0), maxSegment);
37
29
  const frac = progress.value - segment;
38
30
 
39
31
  const from = pageIndicatorDotCenter(segment, slot, dotSize);
@@ -65,10 +57,8 @@ export function TravelingPill({
65
57
  pointerEvents="none"
66
58
  style={[
67
59
  {
68
- position: 'absolute',
69
- ...(vertical
70
- ? { left: crossOffset, width: dotSize }
71
- : { top: crossOffset, height: dotSize }),
60
+ position: "absolute",
61
+ ...(vertical ? { left: crossOffset, width: dotSize } : { top: crossOffset, height: dotSize }),
72
62
  borderRadius: 999,
73
63
  backgroundColor: activeColor,
74
64
  zIndex: 2,
@@ -1,13 +1,12 @@
1
- import { useMemo } from 'react';
2
- import type { StyleProp, ViewStyle } from 'react-native';
1
+ import { useMemo } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
3
 
4
- import type { SharedValue } from 'react-native-reanimated';
5
- import Animated, { useAnimatedStyle } from 'react-native-reanimated';
4
+ import type { SharedValue } from "react-native-reanimated";
5
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
6
6
 
7
- import type { ColorToken } from '#theme/types';
8
-
9
- import { usePageIndicatorCore } from '../../hooks/use-page-indicator-core';
10
- import { PageIndicatorRoot } from '../../PageIndicatorRoot';
7
+ import type { ColorToken } from "#theme/types";
8
+ import { usePageIndicatorCore } from "../../hooks/use-page-indicator-core";
9
+ import { PageIndicatorRoot } from "../../PageIndicatorRoot";
11
10
  import {
12
11
  computePageIndicatorWindowTranslate,
13
12
  DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
@@ -15,12 +14,11 @@ import {
15
14
  pageIndicatorAxisTranslateStyle,
16
15
  pageIndicatorTrackMainSize,
17
16
  pageIndicatorViewportMainSize,
18
- } from '../../utils';
19
-
20
- import { InactiveDot } from './InactiveDot';
21
- import { LoadingOrbit } from './LoadingOrbit';
22
- import { TravelingPill } from './TravelingPill';
23
- import { DOT_INDICATOR_GEOMETRY } from './utils';
17
+ } from "../../utils";
18
+ import { InactiveDot } from "./InactiveDot";
19
+ import { LoadingOrbit } from "./LoadingOrbit";
20
+ import { TravelingPill } from "./TravelingPill";
21
+ import { DOT_INDICATOR_GEOMETRY } from "./utils";
24
22
 
25
23
  export interface DotIndicatorProps {
26
24
  /** Number of pages represented by the indicator. */
@@ -62,37 +60,21 @@ export function DotIndicator({
62
60
  maxVisible = DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
63
61
  style,
64
62
  }: DotIndicatorProps) {
65
- const { colors, progress } = usePageIndicatorCore(
66
- count,
67
- current,
68
- 'dot',
69
- duration,
70
- { activeColor, inactiveColor, loadingColor }
71
- );
63
+ const { colors, progress } = usePageIndicatorCore(count, current, "dot", duration, {
64
+ activeColor,
65
+ inactiveColor,
66
+ loadingColor,
67
+ });
72
68
 
73
69
  const { dotSize, slot, crossSize, inactiveOpacity } = DOT_INDICATOR_GEOMETRY;
74
- const viewportMainSize = pageIndicatorViewportMainSize(
75
- count,
76
- slot,
77
- dotSize,
78
- maxVisible
79
- );
70
+ const viewportMainSize = pageIndicatorViewportMainSize(count, slot, dotSize, maxVisible);
80
71
  const fullTrackMainSize = pageIndicatorTrackMainSize(count, slot, dotSize);
81
72
  const overflows = count > maxVisible;
82
73
 
83
- const indices = useMemo(
84
- () => Array.from({ length: count }, (_, index) => index),
85
- [count]
86
- );
74
+ const indices = useMemo(() => Array.from({ length: count }, (_, index) => index), [count]);
87
75
 
88
76
  const trackStyle = useAnimatedStyle(() => {
89
- const translate = computePageIndicatorWindowTranslate(
90
- count,
91
- progress.value,
92
- slot,
93
- dotSize,
94
- maxVisible
95
- );
77
+ const translate = computePageIndicatorWindowTranslate(count, progress.value, slot, dotSize, maxVisible);
96
78
 
97
79
  return pageIndicatorAxisTranslateStyle(vertical, translate);
98
80
  });
@@ -18,11 +18,7 @@ export const DOT_INDICATOR_GEOMETRY = {
18
18
  } as const;
19
19
 
20
20
  /** Main-axis center of dot `index` within the track. */
21
- export function pageIndicatorDotCenter(
22
- index: number,
23
- slot: number,
24
- dotSize: number
25
- ): number {
26
- 'worklet';
21
+ export function pageIndicatorDotCenter(index: number, slot: number, dotSize: number): number {
22
+ "worklet";
27
23
  return index * slot + dotSize / 2;
28
24
  }
@@ -4,17 +4,16 @@ import Animated, {
4
4
  interpolateColor,
5
5
  type SharedValue,
6
6
  useAnimatedStyle,
7
- } from 'react-native-reanimated';
8
-
9
- import type { PillJumpState } from '../../hooks/use-page-indicator-progress';
10
- import { pageIndicatorWindowScale } from '../../utils';
7
+ } from "react-native-reanimated";
11
8
 
9
+ import type { PillJumpState } from "../../hooks/use-page-indicator-progress";
10
+ import { pageIndicatorWindowScale } from "../../utils";
12
11
  import {
13
12
  PILL_INDICATOR_GEOMETRY,
14
13
  pillIndicatorDotDistance,
15
14
  pillIndicatorJumpDisplayProgress,
16
15
  readPillJumpState,
17
- } from './utils';
16
+ } from "./utils";
18
17
 
19
18
  interface PillIndicatorDotProps {
20
19
  activeColor: string;
@@ -39,8 +38,7 @@ export function PillIndicatorDot({
39
38
  progress,
40
39
  vertical,
41
40
  }: PillIndicatorDotProps) {
42
- const { dotSize, activeWidth, inactiveOpacity, inactiveScale, slot } =
43
- PILL_INDICATOR_GEOMETRY;
41
+ const { dotSize, activeWidth, inactiveOpacity, inactiveScale, slot } = PILL_INDICATOR_GEOMETRY;
44
42
 
45
43
  const animatedStyle = useAnimatedStyle(() => {
46
44
  const jump = readPillJumpState(pillJump);
@@ -51,55 +49,19 @@ export function PillIndicatorDot({
51
49
  jump.to,
52
50
  jump.t
53
51
  );
54
- const distance = pillIndicatorDotDistance(
55
- index,
56
- progress.value,
57
- jump.active,
58
- jump.from,
59
- jump.to,
60
- jump.t
61
- );
52
+ const distance = pillIndicatorDotDistance(index, progress.value, jump.active, jump.from, jump.to, jump.t);
62
53
 
63
- const mainSize = interpolate(
64
- distance,
65
- [0, 1],
66
- [activeWidth, dotSize],
67
- Extrapolation.CLAMP
68
- );
69
- const activeScale = interpolate(
70
- distance,
71
- [0, 1],
72
- [1, inactiveScale],
73
- Extrapolation.CLAMP
74
- );
54
+ const mainSize = interpolate(distance, [0, 1], [activeWidth, dotSize], Extrapolation.CLAMP);
55
+ const activeScale = interpolate(distance, [0, 1], [1, inactiveScale], Extrapolation.CLAMP);
75
56
  const edgeScale = overflows
76
- ? pageIndicatorWindowScale(
77
- index,
78
- displayProgress,
79
- count,
80
- slot,
81
- dotSize,
82
- maxVisible,
83
- activeWidth
84
- )
57
+ ? pageIndicatorWindowScale(index, displayProgress, count, slot, dotSize, maxVisible, activeWidth)
85
58
  : 1;
86
59
 
87
60
  return {
88
- ...(vertical
89
- ? { width: dotSize, height: mainSize }
90
- : { width: mainSize, height: dotSize }),
91
- opacity: interpolate(
92
- distance,
93
- [0, 1],
94
- [1, inactiveOpacity],
95
- Extrapolation.CLAMP
96
- ),
61
+ ...(vertical ? { width: dotSize, height: mainSize } : { width: mainSize, height: dotSize }),
62
+ opacity: interpolate(distance, [0, 1], [1, inactiveOpacity], Extrapolation.CLAMP),
97
63
  transform: [{ scale: activeScale * edgeScale }],
98
- backgroundColor: interpolateColor(
99
- distance,
100
- [0, 1],
101
- [activeColor, inactiveColor]
102
- ),
64
+ backgroundColor: interpolateColor(distance, [0, 1], [activeColor, inactiveColor]),
103
65
  };
104
66
  });
105
67
 
@@ -1,13 +1,12 @@
1
- import { useMemo } from 'react';
2
- import type { StyleProp, ViewStyle } from 'react-native';
1
+ import { useMemo } from "react";
2
+ import type { StyleProp, ViewStyle } from "react-native";
3
3
 
4
- import type { SharedValue } from 'react-native-reanimated';
5
- import Animated, { useAnimatedStyle } from 'react-native-reanimated';
4
+ import type { SharedValue } from "react-native-reanimated";
5
+ import Animated, { useAnimatedStyle } from "react-native-reanimated";
6
6
 
7
- import type { ColorToken } from '#theme/types';
8
-
9
- import { usePageIndicatorCore } from '../../hooks/use-page-indicator-core';
10
- import { PageIndicatorRoot } from '../../PageIndicatorRoot';
7
+ import type { ColorToken } from "#theme/types";
8
+ import { usePageIndicatorCore } from "../../hooks/use-page-indicator-core";
9
+ import { PageIndicatorRoot } from "../../PageIndicatorRoot";
11
10
  import {
12
11
  computePageIndicatorWindowTranslate,
13
12
  DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
@@ -15,13 +14,9 @@ import {
15
14
  pageIndicatorAxisTranslateStyle,
16
15
  pageIndicatorTrackMainSize,
17
16
  pageIndicatorViewportMainSize,
18
- } from '../../utils';
19
-
20
- import { PillIndicatorDot } from './PillIndicatorDot';
21
- import {
22
- PILL_INDICATOR_GEOMETRY,
23
- pillIndicatorJumpDisplayProgress,
24
- } from './utils';
17
+ } from "../../utils";
18
+ import { PillIndicatorDot } from "./PillIndicatorDot";
19
+ import { PILL_INDICATOR_GEOMETRY, pillIndicatorJumpDisplayProgress } from "./utils";
25
20
 
26
21
  export interface PillIndicatorProps {
27
22
  /** Number of pages represented by the indicator. */
@@ -57,34 +52,17 @@ export function PillIndicator({
57
52
  maxVisible = DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
58
53
  style,
59
54
  }: PillIndicatorProps) {
60
- const { colors, pillJump, progress } = usePageIndicatorCore(
61
- count,
62
- current,
63
- 'pill',
64
- duration,
65
- { activeColor, inactiveColor }
66
- );
55
+ const { colors, pillJump, progress } = usePageIndicatorCore(count, current, "pill", duration, {
56
+ activeColor,
57
+ inactiveColor,
58
+ });
67
59
 
68
60
  const { dotSize, gap, slot, activeWidth } = PILL_INDICATOR_GEOMETRY;
69
- const viewportMainSize = pageIndicatorViewportMainSize(
70
- count,
71
- slot,
72
- dotSize,
73
- maxVisible,
74
- activeWidth
75
- );
76
- const fullTrackMainSize = pageIndicatorTrackMainSize(
77
- count,
78
- slot,
79
- dotSize,
80
- activeWidth
81
- );
61
+ const viewportMainSize = pageIndicatorViewportMainSize(count, slot, dotSize, maxVisible, activeWidth);
62
+ const fullTrackMainSize = pageIndicatorTrackMainSize(count, slot, dotSize, activeWidth);
82
63
  const overflows = count > maxVisible;
83
64
 
84
- const indices = useMemo(
85
- () => Array.from({ length: count }, (_, index) => index),
86
- [count]
87
- );
65
+ const indices = useMemo(() => Array.from({ length: count }, (_, index) => index), [count]);
88
66
 
89
67
  const trackStyle = useAnimatedStyle(() => {
90
68
  const displayProgress = pillIndicatorJumpDisplayProgress(
@@ -117,8 +95,8 @@ export function PillIndicator({
117
95
  <Animated.View
118
96
  style={[
119
97
  {
120
- flexDirection: vertical ? 'column' : 'row',
121
- alignItems: 'center',
98
+ flexDirection: vertical ? "column" : "row",
99
+ alignItems: "center",
122
100
  gap,
123
101
  ...(overflows
124
102
  ? vertical
@@ -1,4 +1,4 @@
1
- import type { PillJumpState } from '../../hooks/use-page-indicator-progress';
1
+ import type { PillJumpState } from "../../hooks/use-page-indicator-progress";
2
2
 
3
3
  const DOT_SIZE = 8;
4
4
  const GAP = 8;
@@ -16,7 +16,7 @@ export const PILL_INDICATOR_GEOMETRY = {
16
16
  export type PillIndicatorGeometry = typeof PILL_INDICATOR_GEOMETRY;
17
17
 
18
18
  export function readPillJumpState(jump: PillJumpState) {
19
- 'worklet';
19
+ "worklet";
20
20
  return {
21
21
  active: jump.active.value,
22
22
  from: jump.from.value,
@@ -33,7 +33,7 @@ export function pillIndicatorDotDistance(
33
33
  jumpTo: number,
34
34
  jumpT: number
35
35
  ): number {
36
- 'worklet';
36
+ "worklet";
37
37
  if (!jumpActive) {
38
38
  return Math.min(Math.abs(progress - index), 1);
39
39
  }
@@ -57,7 +57,7 @@ export function pillIndicatorJumpDisplayProgress(
57
57
  jumpTo: number,
58
58
  jumpT: number
59
59
  ): number {
60
- 'worklet';
60
+ "worklet";
61
61
  if (!jumpActive) return progress;
62
62
  return jumpFrom + jumpT * (jumpTo - jumpFrom);
63
63
  }
@@ -1,8 +1,8 @@
1
- import { type FC, type ReactNode, useContext, useEffect, useRef } from 'react';
1
+ import { type FC, type ReactNode, useContext, useEffect, useRef } from "react";
2
2
 
3
- import { PortalContext } from './PortalContext';
4
- import { PortalHost, type PortalHostProps } from './PortalHost';
5
- import { PortalProvider, type PortalProviderProps } from './PortalProvider';
3
+ import { PortalContext } from "./PortalContext";
4
+ import { PortalHost, type PortalHostProps } from "./PortalHost";
5
+ import { PortalProvider, type PortalProviderProps } from "./PortalProvider";
6
6
 
7
7
  let nextPortalKey = 1;
8
8
 
@@ -1,4 +1,4 @@
1
- import { createContext, type ReactNode } from 'react';
1
+ import { createContext, type ReactNode } from "react";
2
2
 
3
3
  export interface PortalEntry {
4
4
  key: number;
@@ -1,9 +1,9 @@
1
- import { Fragment, useContext } from 'react';
2
- import { View, type ViewProps } from 'react-native';
1
+ import { Fragment, useContext } from "react";
2
+ import { View, type ViewProps } from "react-native";
3
3
 
4
- import { PortalContext } from './PortalContext';
4
+ import { PortalContext } from "./PortalContext";
5
5
 
6
- export type PortalHostProps = Omit<ViewProps, 'children'> & {
6
+ export type PortalHostProps = Omit<ViewProps, "children"> & {
7
7
  /** Renders every `Portal` registered under this host name, in insertion order. */
8
8
  name: string;
9
9
  };
@@ -1,10 +1,6 @@
1
- import { type ReactNode, useCallback, useMemo, useState } from 'react';
1
+ import { type ReactNode, useCallback, useMemo, useState } from "react";
2
2
 
3
- import {
4
- PortalContext,
5
- type PortalContextValue,
6
- type PortalStore,
7
- } from './PortalContext';
3
+ import { PortalContext, type PortalContextValue, type PortalStore } from "./PortalContext";
8
4
 
9
5
  export interface PortalProviderProps {
10
6
  children: ReactNode;
@@ -18,36 +14,31 @@ export interface PortalProviderProps {
18
14
  export function PortalProvider({ children }: PortalProviderProps) {
19
15
  const [portals, setPortals] = useState<PortalStore>({});
20
16
 
21
- const upsertPortal = useCallback(
22
- (hostName: string, key: number, node: ReactNode) => {
23
- setPortals((prev) => {
24
- const hostPortals = prev[hostName] ?? [];
25
- const existingIndex = hostPortals.findIndex(
26
- (entry) => entry.key === key
27
- );
28
-
29
- if (existingIndex === -1) {
30
- return {
31
- ...prev,
32
- [hostName]: [...hostPortals, { key, node }],
33
- };
34
- }
35
-
36
- if (hostPortals[existingIndex]?.node === node) {
37
- return prev;
38
- }
39
-
40
- const nextHostPortals = [...hostPortals];
41
- nextHostPortals[existingIndex] = { key, node };
17
+ const upsertPortal = useCallback((hostName: string, key: number, node: ReactNode) => {
18
+ setPortals((prev) => {
19
+ const hostPortals = prev[hostName] ?? [];
20
+ const existingIndex = hostPortals.findIndex((entry) => entry.key === key);
42
21
 
22
+ if (existingIndex === -1) {
43
23
  return {
44
24
  ...prev,
45
- [hostName]: nextHostPortals,
25
+ [hostName]: [...hostPortals, { key, node }],
46
26
  };
47
- });
48
- },
49
- []
50
- );
27
+ }
28
+
29
+ if (hostPortals[existingIndex]?.node === node) {
30
+ return prev;
31
+ }
32
+
33
+ const nextHostPortals = [...hostPortals];
34
+ nextHostPortals[existingIndex] = { key, node };
35
+
36
+ return {
37
+ ...prev,
38
+ [hostName]: nextHostPortals,
39
+ };
40
+ });
41
+ }, []);
51
42
 
52
43
  const removePortal = useCallback((hostName: string, key: number) => {
53
44
  setPortals((prev) => {
@@ -75,7 +66,5 @@ export function PortalProvider({ children }: PortalProviderProps) {
75
66
  [portals, removePortal, upsertPortal]
76
67
  );
77
68
 
78
- return (
79
- <PortalContext.Provider value={value}>{children}</PortalContext.Provider>
80
- );
69
+ return <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;
81
70
  }
@@ -1,7 +1,7 @@
1
- export type { PortalProps } from './Portal';
2
- export { Portal } from './Portal';
3
- export type { PortalContextValue, PortalEntry } from './PortalContext';
4
- export type { PortalHostProps } from './PortalHost';
5
- export { PortalHost } from './PortalHost';
6
- export type { PortalProviderProps } from './PortalProvider';
7
- export { PortalProvider } from './PortalProvider';
1
+ export type { PortalProps } from "./Portal";
2
+ export { Portal } from "./Portal";
3
+ export type { PortalContextValue, PortalEntry } from "./PortalContext";
4
+ export type { PortalHostProps } from "./PortalHost";
5
+ export { PortalHost } from "./PortalHost";
6
+ export type { PortalProviderProps } from "./PortalProvider";
7
+ export { PortalProvider } from "./PortalProvider";