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,14 +1,14 @@
1
- import type { ComponentRef } from 'react';
2
- import { forwardRef } from 'react';
3
- import { View, type ViewProps } from 'react-native';
1
+ import type { ComponentRef } from "react";
2
+ import { forwardRef } from "react";
3
+ import { View, type ViewProps } from "react-native";
4
4
 
5
- import { StyleSheet, useUnistyles } from 'react-native-unistyles';
5
+ import { StyleSheet, useUnistyles } from "react-native-unistyles";
6
6
 
7
- import { getIcon } from '#theme/registry';
8
- import type { ColorToken, TerraIconName } from '#theme/types';
9
- import { resolveThemeColor } from '#utils/resolve-theme-color';
7
+ import { getIcon } from "#theme/registry";
8
+ import type { ColorToken, TerraIconName } from "#theme/types";
9
+ import { resolveThemeColor } from "#utils/resolve-theme-color";
10
10
 
11
- export interface IconProps extends Omit<ViewProps, 'children'> {
11
+ export interface IconProps extends Omit<ViewProps, "children"> {
12
12
  /** Semantic or configured icon name from the theme registry. */
13
13
  name: TerraIconName;
14
14
  /** Icon size in density-independent pixels. Defaults to `20`. */
@@ -27,39 +27,31 @@ export interface IconProps extends Omit<ViewProps, 'children'> {
27
27
  * <Icon name="navigation.close" size={24} color="text.default" />
28
28
  * ```
29
29
  */
30
- export const Icon = forwardRef<ComponentRef<typeof View>, IconProps>(
31
- function Icon(
32
- { name, size = 20, color = 'text.default', strokeWidth, style, ...rest },
33
- ref
34
- ) {
35
- const { theme } = useUnistyles();
36
- const IconComponent = getIcon(name);
30
+ export const Icon = forwardRef<ComponentRef<typeof View>, IconProps>(function Icon(
31
+ { name, size = 20, color = "text.default", strokeWidth, style, ...rest },
32
+ ref
33
+ ) {
34
+ const { theme } = useUnistyles();
35
+ const IconComponent = getIcon(name);
37
36
 
38
- if (!IconComponent) {
39
- if (__DEV__) {
40
- console.warn(`[react-native-terra-ui] Unknown icon "${name}".`);
41
- }
42
- return null;
37
+ if (!IconComponent) {
38
+ if (__DEV__) {
39
+ console.warn(`[react-native-terra-ui] Unknown icon "${name}".`);
43
40
  }
41
+ return null;
42
+ }
44
43
 
45
- const resolvedColor =
46
- resolveThemeColor(color, theme) ??
47
- (theme.color as unknown as Record<string, string | undefined>)[
48
- 'text.default'
49
- ] ??
50
- '';
44
+ const resolvedColor =
45
+ resolveThemeColor(color, theme) ??
46
+ (theme.color as unknown as Record<string, string | undefined>)["text.default"] ??
47
+ "";
51
48
 
52
- return (
53
- <View ref={ref} style={[styles.container(size), style]} {...rest}>
54
- <IconComponent
55
- color={resolvedColor}
56
- size={size}
57
- strokeWidth={strokeWidth}
58
- />
59
- </View>
60
- );
61
- }
62
- );
49
+ return (
50
+ <View ref={ref} style={[styles.container(size), style]} {...rest}>
51
+ <IconComponent color={resolvedColor} size={size} strokeWidth={strokeWidth} />
52
+ </View>
53
+ );
54
+ });
63
55
 
64
56
  // ─── Styles ───────────────────────────────────────────────────────────────────
65
57
  //
@@ -73,7 +65,7 @@ const styles = StyleSheet.create(() => ({
73
65
  container: (size: number) => ({
74
66
  width: size,
75
67
  height: size,
76
- alignItems: 'center',
77
- justifyContent: 'center',
68
+ alignItems: "center",
69
+ justifyContent: "center",
78
70
  }),
79
71
  }));
@@ -1,2 +1,2 @@
1
- export type { IconProps } from './Icon';
2
- export { Icon } from './Icon';
1
+ export type { IconProps } from "./Icon";
2
+ export { Icon } from "./Icon";
@@ -1,8 +1,10 @@
1
- import { View } from 'react-native';
2
- import { StyleSheet } from 'react-native-unistyles';
3
- import { getImageComponent } from '#theme/registry';
4
- import type { RadiusKey } from '#theme/types';
5
- import type { ImageProps } from './types';
1
+ import { View } from "react-native";
2
+
3
+ import { StyleSheet } from "react-native-unistyles";
4
+
5
+ import { getImageComponent } from "#theme/registry";
6
+ import type { RadiusKey } from "#theme/types";
7
+ import type { ImageProps } from "./types";
6
8
 
7
9
  /**
8
10
  * Renders the image implementation configured via
@@ -18,10 +20,10 @@ import type { ImageProps } from './types';
18
20
  * ```
19
21
  */
20
22
  export function Image({
21
- contentFit = 'cover',
23
+ contentFit = "cover",
22
24
  width,
23
25
  height,
24
- radius = 'none',
26
+ radius = "none",
25
27
  style,
26
28
  // Defaults to `contentFit` here (rather than leaving it to each backend's
27
29
  // own default) so a same-resolution placeholder never renders smaller than
@@ -48,10 +50,10 @@ const styles = StyleSheet.create((_theme) => ({
48
50
  ...(w ? { width: w } : {}),
49
51
  ...(h ? { height: h } : {}),
50
52
  borderRadius: _theme.radius[r],
51
- overflow: 'hidden',
53
+ overflow: "hidden",
52
54
  }),
53
55
  image: {
54
- width: '100%',
55
- height: '100%',
56
+ width: "100%",
57
+ height: "100%",
56
58
  },
57
59
  }));
@@ -1,2 +1,2 @@
1
- export { Image } from './Image';
2
- export type { ImageProps } from './types';
1
+ export { Image } from "./Image";
2
+ export type { ImageProps } from "./types";
@@ -1,4 +1,4 @@
1
- import type { RadiusKey, TerraImageProps } from '#theme/types';
1
+ import type { RadiusKey, TerraImageProps } from "#theme/types";
2
2
 
3
3
  export interface ImageProps extends TerraImageProps {
4
4
  width?: number;
@@ -1,17 +1,17 @@
1
- export * from './avatar';
2
- export * from './box';
3
- export * from './button';
4
- export * from './chip';
5
- export * from './empty-state';
6
- export * from './header';
7
- export * from './icon';
8
- export * from './image';
9
- export * from './page-indicator';
10
- export * from './portal';
11
- export * from './screen';
12
- export * from './slot';
13
- export * from './spinner';
14
- export * from './surface';
15
- export * from './text';
16
- export * from './toast';
17
- export * from './toolbar';
1
+ export * from "./avatar";
2
+ export * from "./box";
3
+ export * from "./button";
4
+ export * from "./chip";
5
+ export * from "./empty-state";
6
+ export * from "./header";
7
+ export * from "./icon";
8
+ export * from "./image";
9
+ export * from "./page-indicator";
10
+ export * from "./portal";
11
+ export * from "./screen";
12
+ export * from "./slot";
13
+ export * from "./spinner";
14
+ export * from "./surface";
15
+ export * from "./text";
16
+ export * from "./toast";
17
+ export * from "./toolbar";
@@ -1,13 +1,13 @@
1
- import type { StyleProp, ViewStyle } from 'react-native';
1
+ import type { StyleProp, ViewStyle } from "react-native";
2
2
 
3
- import type { SharedValue } from 'react-native-reanimated';
3
+ import type { SharedValue } from "react-native-reanimated";
4
4
 
5
- import type { ColorToken } from '#theme/types';
6
- import { DEFAULT_PAGE_INDICATOR_MAX_VISIBLE } from './utils';
7
- import { DotIndicator } from './variants/DotIndicator';
8
- import { PillIndicator } from './variants/PillIndicator';
5
+ import type { ColorToken } from "#theme/types";
6
+ import { DEFAULT_PAGE_INDICATOR_MAX_VISIBLE } from "./utils";
7
+ import { DotIndicator } from "./variants/DotIndicator";
8
+ import { PillIndicator } from "./variants/PillIndicator";
9
9
 
10
- export type PageIndicatorVariant = 'pill' | 'dot';
10
+ export type PageIndicatorVariant = "pill" | "dot";
11
11
 
12
12
  type PageIndicatorCoreProps = {
13
13
  /** Number of pages represented by the indicator. */
@@ -35,14 +35,14 @@ type PageIndicatorCoreProps = {
35
35
 
36
36
  /** Pill indicator — active page widens into a pill. Default when `variant` is omitted. */
37
37
  export type PageIndicatorPillProps = PageIndicatorCoreProps & {
38
- variant?: 'pill';
38
+ variant?: "pill";
39
39
  loading?: never;
40
40
  loadingColor?: never;
41
41
  };
42
42
 
43
43
  /** Dot indicator — traveling dot with optional loading ring on the active page. */
44
44
  export type PageIndicatorDotProps = PageIndicatorCoreProps & {
45
- variant: 'dot';
45
+ variant: "dot";
46
46
  /** Loading ring color token. */
47
47
  loadingColor?: ColorToken;
48
48
  /** Renders a ring around the active dot while loading. */
@@ -63,7 +63,7 @@ export function PageIndicator(props: PageIndicatorProps) {
63
63
  style,
64
64
  } = props;
65
65
 
66
- if (props.variant === 'dot') {
66
+ if (props.variant === "dot") {
67
67
  return (
68
68
  <DotIndicator
69
69
  count={count}
@@ -94,7 +94,7 @@ export function PageIndicator(props: PageIndicatorProps) {
94
94
  );
95
95
  }
96
96
 
97
- export type { DotIndicatorProps } from './variants/DotIndicator';
98
- export { DotIndicator } from './variants/DotIndicator';
99
- export type { PillIndicatorProps } from './variants/PillIndicator';
100
- export { PillIndicator } from './variants/PillIndicator';
97
+ export type { DotIndicatorProps } from "./variants/DotIndicator";
98
+ export { DotIndicator } from "./variants/DotIndicator";
99
+ export type { PillIndicatorProps } from "./variants/PillIndicator";
100
+ export { PillIndicator } from "./variants/PillIndicator";
@@ -1,7 +1,7 @@
1
- import type { ReactNode } from 'react';
2
- import { type StyleProp, View, type ViewStyle } from 'react-native';
1
+ import type { ReactNode } from "react";
2
+ import { type StyleProp, View, type ViewStyle } from "react-native";
3
3
 
4
- import { pageIndicatorViewportClipStyle } from './utils';
4
+ import { pageIndicatorViewportClipStyle } from "./utils";
5
5
 
6
6
  export type PageIndicatorRootProps = {
7
7
  children: ReactNode;
@@ -24,15 +24,7 @@ export function PageIndicatorRoot({
24
24
  return (
25
25
  <View pointerEvents="none" style={style}>
26
26
  {overflows ? (
27
- <View
28
- style={pageIndicatorViewportClipStyle(
29
- vertical,
30
- viewportMainSize,
31
- crossSize
32
- )}
33
- >
34
- {children}
35
- </View>
27
+ <View style={pageIndicatorViewportClipStyle(vertical, viewportMainSize, crossSize)}>{children}</View>
36
28
  ) : (
37
29
  children
38
30
  )}
@@ -1,10 +1,9 @@
1
- import { useMemo } from 'react';
1
+ import { useMemo } from "react";
2
2
 
3
- import { useUnistyles } from 'react-native-unistyles';
3
+ import { useUnistyles } from "react-native-unistyles";
4
4
 
5
- import type { ColorToken } from '#theme/types';
6
-
7
- import { resolveThemeColor } from '#utils/resolve-theme-color';
5
+ import type { ColorToken } from "#theme/types";
6
+ import { resolveThemeColor } from "#utils/resolve-theme-color";
8
7
 
9
8
  /** Resolved color strings for Reanimated and SVG (worklets cannot use theme tokens). */
10
9
  export interface ResolvedColors {
@@ -20,45 +19,28 @@ export type PageIndicatorColorInput = {
20
19
  };
21
20
 
22
21
  const DEFAULT_COLOR_TOKENS: Required<PageIndicatorColorInput> = {
23
- activeColor: 'text.default',
24
- inactiveColor: 'text.disabled',
25
- loadingColor: 'text.disabled',
22
+ activeColor: "text.default",
23
+ inactiveColor: "text.disabled",
24
+ loadingColor: "text.disabled",
26
25
  };
27
26
 
28
- export function usePageIndicatorColors(
29
- colors: PageIndicatorColorInput = {}
30
- ): ResolvedColors {
27
+ export function usePageIndicatorColors(colors: PageIndicatorColorInput = {}): ResolvedColors {
31
28
  const { theme } = useUnistyles();
32
29
 
33
30
  return useMemo(
34
31
  () => ({
35
32
  activeColor:
36
- resolveThemeColor(
37
- colors.activeColor ?? DEFAULT_COLOR_TOKENS.activeColor,
38
- theme
39
- ) ??
40
- (theme.color as unknown as Record<string, string | undefined>)[
41
- 'text.default'
42
- ] ??
43
- '',
33
+ resolveThemeColor(colors.activeColor ?? DEFAULT_COLOR_TOKENS.activeColor, theme) ??
34
+ (theme.color as unknown as Record<string, string | undefined>)["text.default"] ??
35
+ "",
44
36
  inactiveColor:
45
- resolveThemeColor(
46
- colors.inactiveColor ?? DEFAULT_COLOR_TOKENS.inactiveColor,
47
- theme
48
- ) ??
49
- (theme.color as unknown as Record<string, string | undefined>)[
50
- 'text.disabled'
51
- ] ??
52
- '',
37
+ resolveThemeColor(colors.inactiveColor ?? DEFAULT_COLOR_TOKENS.inactiveColor, theme) ??
38
+ (theme.color as unknown as Record<string, string | undefined>)["text.disabled"] ??
39
+ "",
53
40
  loadingColor:
54
- resolveThemeColor(
55
- colors.loadingColor ?? DEFAULT_COLOR_TOKENS.loadingColor,
56
- theme
57
- ) ??
58
- (theme.color as unknown as Record<string, string | undefined>)[
59
- 'text.disabled'
60
- ] ??
61
- '',
41
+ resolveThemeColor(colors.loadingColor ?? DEFAULT_COLOR_TOKENS.loadingColor, theme) ??
42
+ (theme.color as unknown as Record<string, string | undefined>)["text.disabled"] ??
43
+ "",
62
44
  }),
63
45
  [colors.activeColor, colors.inactiveColor, colors.loadingColor, theme]
64
46
  );
@@ -1,12 +1,10 @@
1
- import type { SharedValue } from 'react-native-reanimated';
2
- import { isPageIndicatorSharedValue } from '../utils';
3
- import {
4
- type PageIndicatorColorInput,
5
- usePageIndicatorColors,
6
- } from './use-page-indicator-colors';
7
- import { usePageIndicatorProgress } from './use-page-indicator-progress';
1
+ import type { SharedValue } from "react-native-reanimated";
8
2
 
9
- type PageIndicatorVariant = 'pill' | 'dot';
3
+ import { isPageIndicatorSharedValue } from "../utils";
4
+ import { type PageIndicatorColorInput, usePageIndicatorColors } from "./use-page-indicator-colors";
5
+ import { usePageIndicatorProgress } from "./use-page-indicator-progress";
6
+
7
+ type PageIndicatorVariant = "pill" | "dot";
10
8
 
11
9
  export function usePageIndicatorCore(
12
10
  count: number,
@@ -1,18 +1,13 @@
1
- import { useEffect, useMemo } from 'react';
1
+ import { useEffect, useMemo } from "react";
2
2
 
3
- import type { SharedValue } from 'react-native-reanimated';
4
- import {
5
- cancelAnimation,
6
- Easing,
7
- useSharedValue,
8
- withTiming,
9
- } from 'react-native-reanimated';
3
+ import type { SharedValue } from "react-native-reanimated";
4
+ import { cancelAnimation, Easing, useSharedValue, withTiming } from "react-native-reanimated";
10
5
 
11
6
  import {
12
7
  PAGE_INDICATOR_SINGLE_PAGE_DURATION,
13
8
  pageIndicatorPageJumpDistance,
14
9
  pageIndicatorPageJumpDuration,
15
- } from '../utils';
10
+ } from "../utils";
16
11
 
17
12
  function clampPageIndex(page: number, count: number): number {
18
13
  if (count <= 0) return 0;
@@ -37,12 +32,10 @@ export function usePageIndicatorProgress(
37
32
  count: number,
38
33
  progress: SharedValue<number> | undefined,
39
34
  page: number | undefined,
40
- variant: 'pill' | 'dot' = 'pill',
35
+ variant: "pill" | "dot" = "pill",
41
36
  duration = PAGE_INDICATOR_SINGLE_PAGE_DURATION
42
37
  ): { progress: SharedValue<number>; pillJump: PillJumpState } {
43
- const internalProgress = useSharedValue(
44
- page !== undefined ? clampPageIndex(page, count) : 0
45
- );
38
+ const internalProgress = useSharedValue(page !== undefined ? clampPageIndex(page, count) : 0);
46
39
  const pillJumpActive = useSharedValue(false);
47
40
  const pillJumpFrom = useSharedValue(0);
48
41
  const pillJumpTo = useSharedValue(0);
@@ -71,7 +64,7 @@ export function usePageIndicatorProgress(
71
64
  cancelAnimation(pillJumpT);
72
65
  pillJumpActive.value = false;
73
66
 
74
- if (variant === 'pill' && distance > 1) {
67
+ if (variant === "pill" && distance > 1) {
75
68
  const jumpDuration = pageIndicatorPageJumpDuration(from, target);
76
69
 
77
70
  internalProgress.value = from;
@@ -86,7 +79,7 @@ export function usePageIndicatorProgress(
86
79
  easing: Easing.bezier(0.33, 0, 0.15, 1),
87
80
  },
88
81
  (finished) => {
89
- 'worklet';
82
+ "worklet";
90
83
  if (finished) {
91
84
  internalProgress.value = target;
92
85
  pillJumpActive.value = false;
@@ -97,23 +90,10 @@ export function usePageIndicatorProgress(
97
90
  }
98
91
 
99
92
  internalProgress.value = withTiming(target, {
100
- duration:
101
- variant === 'dot'
102
- ? duration
103
- : pageIndicatorPageJumpDuration(from, target),
93
+ duration: variant === "dot" ? duration : pageIndicatorPageJumpDuration(from, target),
104
94
  easing: Easing.bezier(0.33, 0, 0.15, 1),
105
95
  });
106
- }, [
107
- count,
108
- duration,
109
- internalProgress,
110
- page,
111
- pillJumpActive,
112
- pillJumpFrom,
113
- pillJumpT,
114
- pillJumpTo,
115
- variant,
116
- ]);
96
+ }, [count, duration, internalProgress, page, pillJumpActive, pillJumpFrom, pillJumpT, pillJumpTo, variant]);
117
97
 
118
98
  return {
119
99
  progress: progress ?? internalProgress,
@@ -5,9 +5,9 @@ export type {
5
5
  PageIndicatorProps,
6
6
  PageIndicatorVariant,
7
7
  PillIndicatorProps,
8
- } from './PageIndicator';
9
- export { DotIndicator, PageIndicator, PillIndicator } from './PageIndicator';
8
+ } from "./PageIndicator";
9
+ export { DotIndicator, PageIndicator, PillIndicator } from "./PageIndicator";
10
10
  export {
11
11
  DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
12
12
  PAGE_INDICATOR_SINGLE_PAGE_DURATION,
13
- } from './utils';
13
+ } from "./utils";
@@ -1,6 +1,6 @@
1
- import type { ViewStyle } from 'react-native';
1
+ import type { ViewStyle } from "react-native";
2
2
 
3
- import type { SharedValue } from 'react-native-reanimated';
3
+ import type { SharedValue } from "react-native-reanimated";
4
4
 
5
5
  /** Duration for a single-page `current` transition. */
6
6
  export const PAGE_INDICATOR_SINGLE_PAGE_DURATION = 600;
@@ -19,10 +19,7 @@ const CENTERED_SCALE = [1, 0.9, 0.65, 0.5] as const;
19
19
  const WINDOW_TAIL_SCALE = 0.5;
20
20
 
21
21
  /** Absolute page delta between two indices. */
22
- export function pageIndicatorPageJumpDistance(
23
- from: number,
24
- to: number
25
- ): number {
22
+ export function pageIndicatorPageJumpDistance(from: number, to: number): number {
26
23
  return Math.abs(to - from);
27
24
  }
28
25
 
@@ -31,16 +28,12 @@ export function pageIndicatorPageJumpDistance(
31
28
  * snappy; longer jumps get more time (capped) so the pill does not blur
32
29
  * through intermediate dots.
33
30
  */
34
- export function pageIndicatorPageJumpDuration(
35
- from: number,
36
- to: number
37
- ): number {
31
+ export function pageIndicatorPageJumpDuration(from: number, to: number): number {
38
32
  const distance = pageIndicatorPageJumpDistance(from, to);
39
33
  if (distance <= 1) return PAGE_INDICATOR_SINGLE_PAGE_DURATION;
40
34
 
41
35
  return Math.min(
42
- PAGE_INDICATOR_SINGLE_PAGE_DURATION +
43
- PAGE_INDICATOR_MULTI_PAGE_DURATION_STEP * (distance - 1),
36
+ PAGE_INDICATOR_SINGLE_PAGE_DURATION + PAGE_INDICATOR_MULTI_PAGE_DURATION_STEP * (distance - 1),
44
37
  PAGE_INDICATOR_MULTI_PAGE_DURATION_MAX
45
38
  );
46
39
  }
@@ -48,19 +41,14 @@ export function pageIndicatorPageJumpDuration(
48
41
  export function isPageIndicatorSharedValue(
49
42
  value: number | SharedValue<number>
50
43
  ): value is SharedValue<number> {
51
- return typeof value === 'object' && value !== null && 'value' in value;
44
+ return typeof value === "object" && value !== null && "value" in value;
52
45
  }
53
46
 
54
47
  /** Transform style for overflow track scrolling along the main axis. */
55
- export function pageIndicatorAxisTranslateStyle(
56
- vertical: boolean,
57
- translate: number
58
- ) {
59
- 'worklet';
48
+ export function pageIndicatorAxisTranslateStyle(vertical: boolean, translate: number) {
49
+ "worklet";
60
50
  return {
61
- transform: vertical
62
- ? [{ translateY: translate }]
63
- : [{ translateX: translate }],
51
+ transform: vertical ? [{ translateY: translate }] : [{ translateX: translate }],
64
52
  };
65
53
  }
66
54
 
@@ -74,23 +62,19 @@ export function pageIndicatorViewportClipStyle(
74
62
  return {
75
63
  height: viewportMainSize,
76
64
  ...(crossSize !== undefined ? { width: crossSize } : {}),
77
- overflow: 'hidden',
65
+ overflow: "hidden",
78
66
  };
79
67
  }
80
68
 
81
69
  return {
82
70
  width: viewportMainSize,
83
71
  ...(crossSize !== undefined ? { height: crossSize } : {}),
84
- overflow: 'hidden',
72
+ overflow: "hidden",
85
73
  };
86
74
  }
87
75
 
88
- function scaleCurveValue(
89
- curve: readonly number[],
90
- distance: number,
91
- tailScale: number
92
- ): number {
93
- 'worklet';
76
+ function scaleCurveValue(curve: readonly number[], distance: number, tailScale: number): number {
77
+ "worklet";
94
78
  if (distance < curve.length) return curve[distance] ?? tailScale;
95
79
  return tailScale;
96
80
  }
@@ -101,7 +85,7 @@ export function pageIndicatorWindowSlotScale(
101
85
  activeSlot: number,
102
86
  maxVisible: number
103
87
  ): number {
104
- 'worklet';
88
+ "worklet";
105
89
  if (positionInWindow === activeSlot) return 1;
106
90
 
107
91
  const dist = Math.abs(positionInWindow - activeSlot);
@@ -157,19 +141,13 @@ export function computePageIndicatorWindowTranslate(
157
141
  maxVisible: number,
158
142
  activeMainSize = dotSize
159
143
  ): number {
160
- 'worklet';
144
+ "worklet";
161
145
  if (count <= maxVisible) return 0;
162
146
 
163
- const viewportMainSize = Math.max(
164
- dotSize,
165
- (maxVisible - 1) * slot + activeMainSize
166
- );
147
+ const viewportMainSize = Math.max(dotSize, (maxVisible - 1) * slot + activeMainSize);
167
148
  const trackMainSize = Math.max(dotSize, (count - 1) * slot + activeMainSize);
168
149
  const activeCenter = progress * slot + activeMainSize / 2;
169
- const offset = Math.min(
170
- Math.max(activeCenter - viewportMainSize / 2, 0),
171
- trackMainSize - viewportMainSize
172
- );
150
+ const offset = Math.min(Math.max(activeCenter - viewportMainSize / 2, 0), trackMainSize - viewportMainSize);
173
151
 
174
152
  return -offset;
175
153
  }
@@ -183,7 +161,7 @@ export function pageIndicatorWindowScale(
183
161
  maxVisible: number,
184
162
  activeMainSize = dotSize
185
163
  ): number {
186
- 'worklet';
164
+ "worklet";
187
165
  if (count <= maxVisible) return 1;
188
166
 
189
167
  const translate = computePageIndicatorWindowTranslate(
@@ -195,14 +173,8 @@ export function pageIndicatorWindowScale(
195
173
  activeMainSize
196
174
  );
197
175
  const visibleStart = -translate / slot;
198
- const activeSlot = Math.min(
199
- Math.max(Math.round(displayProgress - visibleStart), 0),
200
- maxVisible - 1
201
- );
202
- const positionInWindow = Math.min(
203
- Math.max(Math.round(index - visibleStart), 0),
204
- maxVisible - 1
205
- );
176
+ const activeSlot = Math.min(Math.max(Math.round(displayProgress - visibleStart), 0), maxVisible - 1);
177
+ const positionInWindow = Math.min(Math.max(Math.round(index - visibleStart), 0), maxVisible - 1);
206
178
 
207
179
  return pageIndicatorWindowSlotScale(positionInWindow, activeSlot, maxVisible);
208
180
  }
@@ -1,11 +1,7 @@
1
- import Animated, {
2
- type SharedValue,
3
- useAnimatedStyle,
4
- } from 'react-native-reanimated';
1
+ import Animated, { type SharedValue, useAnimatedStyle } from "react-native-reanimated";
5
2
 
6
- import { pageIndicatorWindowScale } from '../../utils';
7
-
8
- import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from './utils';
3
+ import { pageIndicatorWindowScale } from "../../utils";
4
+ import { DOT_INDICATOR_GEOMETRY, pageIndicatorDotCenter } from "./utils";
9
5
 
10
6
  interface InactiveDotProps {
11
7
  color: string;
@@ -34,14 +30,7 @@ export function InactiveDot({
34
30
  const animatedStyle = useAnimatedStyle(() => {
35
31
  const center = pageIndicatorDotCenter(index, slot, dotSize);
36
32
  const windowScale = overflows
37
- ? pageIndicatorWindowScale(
38
- index,
39
- progress.value,
40
- count,
41
- slot,
42
- dotSize,
43
- maxVisible
44
- )
33
+ ? pageIndicatorWindowScale(index, progress.value, count, slot, dotSize, maxVisible)
45
34
  : 1;
46
35
 
47
36
  return {
@@ -56,7 +45,7 @@ export function InactiveDot({
56
45
  <Animated.View
57
46
  style={[
58
47
  {
59
- position: 'absolute',
48
+ position: "absolute",
60
49
  width: dotSize,
61
50
  height: dotSize,
62
51
  borderRadius: 999,