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,15 +1,14 @@
1
- import { type ComponentRef, forwardRef, type ReactNode } from 'react';
2
- import { View, type ViewProps } from 'react-native';
1
+ import { type ComponentRef, forwardRef, type ReactNode } from "react";
2
+ import { View, type ViewProps } from "react-native";
3
3
 
4
- import { StyleSheet } from 'react-native-unistyles';
4
+ import { StyleSheet } from "react-native-unistyles";
5
5
 
6
- import type { ColorToken, TerraIconName, TextVariant } from '#theme/types';
6
+ import type { ColorToken, TerraIconName, TextVariant } from "#theme/types";
7
+ import { Icon } from "../icon";
8
+ import { Text } from "../text";
9
+ import type { EmptyStateSize } from "./types";
7
10
 
8
- import { Icon } from '../icon';
9
- import { Text } from '../text';
10
- import type { EmptyStateSize } from './types';
11
-
12
- export interface EmptyStateProps extends Omit<ViewProps, 'children'> {
11
+ export interface EmptyStateProps extends Omit<ViewProps, "children"> {
13
12
  /** Icon rendered in the circular badge above the title. */
14
13
  icon?: TerraIconName;
15
14
  /** Icon tint. Defaults to `text.subtle`. */
@@ -41,13 +40,10 @@ export interface EmptyStateProps extends Omit<ViewProps, 'children'> {
41
40
  // they stay plain tables here; everything that is a style is a unistyles
42
41
  // variant below.
43
42
 
44
- const TYPOGRAPHY: Record<
45
- EmptyStateSize,
46
- { title: TextVariant; description: TextVariant }
47
- > = {
48
- sm: { title: 'title-sm', description: 'body-sm' },
49
- md: { title: 'title-md', description: 'body-md' },
50
- lg: { title: 'title-lg', description: 'body-lg' },
43
+ const TYPOGRAPHY: Record<EmptyStateSize, { title: TextVariant; description: TextVariant }> = {
44
+ sm: { title: "title-sm", description: "body-sm" },
45
+ md: { title: "title-md", description: "body-md" },
46
+ lg: { title: "title-lg", description: "body-lg" },
51
47
  };
52
48
 
53
49
  const ICON_SIZE: Record<EmptyStateSize, number> = {
@@ -57,14 +53,9 @@ const ICON_SIZE: Record<EmptyStateSize, number> = {
57
53
  };
58
54
 
59
55
  /** Wraps a bare string/number in the slot's themed `Text`; elements pass through. */
60
- function renderSlot(
61
- node: ReactNode,
62
- wrap: (value: ReactNode) => ReactNode
63
- ): ReactNode {
56
+ function renderSlot(node: ReactNode, wrap: (value: ReactNode) => ReactNode): ReactNode {
64
57
  if (node === null || node === undefined || node === false) return null;
65
- return typeof node === 'string' || typeof node === 'number'
66
- ? wrap(node)
67
- : node;
58
+ return typeof node === "string" || typeof node === "number" ? wrap(node) : node;
68
59
  }
69
60
 
70
61
  /**
@@ -81,18 +72,15 @@ function renderSlot(
81
72
  * />
82
73
  * ```
83
74
  */
84
- export const EmptyState = forwardRef<
85
- ComponentRef<typeof View>,
86
- EmptyStateProps
87
- >(function EmptyState(
75
+ export const EmptyState = forwardRef<ComponentRef<typeof View>, EmptyStateProps>(function EmptyState(
88
76
  {
89
77
  icon,
90
- iconColor = 'text.default',
78
+ iconColor = "text.default",
91
79
  media,
92
80
  title,
93
81
  description,
94
82
  action,
95
- size = 'md',
83
+ size = "md",
96
84
  fill = false,
97
85
  style,
98
86
  ...rest
@@ -119,11 +107,7 @@ export const EmptyState = forwardRef<
119
107
  </Text>
120
108
  ))}
121
109
  {renderSlot(description, (value) => (
122
- <Text
123
- variant={typography.description}
124
- color="text.subtle"
125
- align="center"
126
- >
110
+ <Text variant={typography.description} color="text.subtle" align="center">
127
111
  {value}
128
112
  </Text>
129
113
  ))}
@@ -143,66 +127,66 @@ export const EmptyState = forwardRef<
143
127
  // width/height, which keeps it a perfect circle on the spacing scale.
144
128
  const styles = StyleSheet.create((theme) => ({
145
129
  root: {
146
- alignItems: 'center',
147
- justifyContent: 'center',
130
+ alignItems: "center",
131
+ justifyContent: "center",
148
132
  variants: {
149
133
  // `alignSelf` matters as much as `flex` here: a column parent hands its
150
134
  // children the cross-axis size of their content unless they stretch, so
151
135
  // without it the state would fill the height and still be pinned to the
152
136
  // width of its longest line.
153
137
  fill: {
154
- true: { flex: 1, alignSelf: 'stretch' },
138
+ true: { flex: 1, alignSelf: "stretch" },
155
139
  false: {},
156
140
  },
157
141
  size: {
158
142
  sm: {
159
- gap: theme.spacing['2'],
160
- paddingVertical: theme.spacing['4'],
161
- paddingHorizontal: theme.spacing['4'],
143
+ gap: theme.spacing["2"],
144
+ paddingVertical: theme.spacing["4"],
145
+ paddingHorizontal: theme.spacing["4"],
162
146
  },
163
147
  md: {
164
- gap: theme.spacing['3'],
165
- paddingVertical: theme.spacing['6'],
166
- paddingHorizontal: theme.spacing['6'],
148
+ gap: theme.spacing["3"],
149
+ paddingVertical: theme.spacing["6"],
150
+ paddingHorizontal: theme.spacing["6"],
167
151
  },
168
152
  lg: {
169
- gap: theme.spacing['4'],
170
- paddingVertical: theme.spacing['8'],
171
- paddingHorizontal: theme.spacing['6'],
153
+ gap: theme.spacing["4"],
154
+ paddingVertical: theme.spacing["8"],
155
+ paddingHorizontal: theme.spacing["6"],
172
156
  },
173
157
  },
174
158
  },
175
159
  },
176
160
  iconBadge: {
177
- alignItems: 'center',
178
- justifyContent: 'center',
179
- backgroundColor: theme.color['action.bg.primary.subtle'],
161
+ alignItems: "center",
162
+ justifyContent: "center",
163
+ backgroundColor: theme.color["action.bg.primary.subtle"],
180
164
  borderRadius: theme.radius.full,
181
165
  variants: {
182
166
  size: {
183
- sm: { padding: theme.spacing['3'] },
184
- md: { padding: theme.spacing['4'] },
185
- lg: { padding: theme.spacing['5'] },
167
+ sm: { padding: theme.spacing["3"] },
168
+ md: { padding: theme.spacing["4"] },
169
+ lg: { padding: theme.spacing["5"] },
186
170
  },
187
171
  },
188
172
  },
189
173
  text: {
190
- alignItems: 'center',
174
+ alignItems: "center",
191
175
  variants: {
192
176
  size: {
193
- sm: { gap: theme.spacing['1'] },
194
- md: { gap: theme.spacing['1'] },
195
- lg: { gap: theme.spacing['2'] },
177
+ sm: { gap: theme.spacing["1"] },
178
+ md: { gap: theme.spacing["1"] },
179
+ lg: { gap: theme.spacing["2"] },
196
180
  },
197
181
  },
198
182
  },
199
183
  actions: {
200
- alignItems: 'center',
184
+ alignItems: "center",
201
185
  variants: {
202
186
  size: {
203
- sm: { gap: theme.spacing['2'], marginTop: theme.spacing['1'] },
204
- md: { gap: theme.spacing['3'], marginTop: theme.spacing['2'] },
205
- lg: { gap: theme.spacing['3'], marginTop: theme.spacing['2'] },
187
+ sm: { gap: theme.spacing["2"], marginTop: theme.spacing["1"] },
188
+ md: { gap: theme.spacing["3"], marginTop: theme.spacing["2"] },
189
+ lg: { gap: theme.spacing["3"], marginTop: theme.spacing["2"] },
206
190
  },
207
191
  },
208
192
  },
@@ -1,3 +1,3 @@
1
- export type { EmptyStateProps } from './EmptyState';
2
- export { EmptyState } from './EmptyState';
3
- export type { EmptyStateSize } from './types';
1
+ export type { EmptyStateProps } from "./EmptyState";
2
+ export { EmptyState } from "./EmptyState";
3
+ export type { EmptyStateSize } from "./types";
@@ -2,4 +2,4 @@
2
2
  * Overall scale of an empty state — drives the icon size, the typography of the
3
3
  * title/description, and the spacing between them.
4
4
  */
5
- export type EmptyStateSize = 'sm' | 'md' | 'lg';
5
+ export type EmptyStateSize = "sm" | "md" | "lg";
@@ -1,5 +1,5 @@
1
- import { LargeTitleHeader } from './variants/LargeTitleHeader';
2
- import { TitleHeader } from './variants/TitleHeader';
1
+ import { LargeTitleHeader } from "./variants/LargeTitleHeader";
2
+ import { TitleHeader } from "./variants/TitleHeader";
3
3
 
4
4
  /**
5
5
  * Composite header namespace.
@@ -1,6 +1,5 @@
1
- import type { TerraSemanticIconName } from '#theme/types';
2
-
3
- import { Toolbar, type ToolbarButtonProps } from '../toolbar';
1
+ import type { TerraSemanticIconName } from "#theme/types";
2
+ import { Toolbar, type ToolbarButtonProps } from "../toolbar";
4
3
 
5
4
  /**
6
5
  * @deprecated Use {@link Toolbar.Button}. `HeaderButton` is an alias kept for
@@ -30,7 +29,7 @@ export type HeaderButtonProps = ToolbarButtonProps;
30
29
  */
31
30
  export const HeaderButton = Toolbar.Button;
32
31
 
33
- export type HeaderDismissAction = 'back' | 'close' | 'none';
32
+ export type HeaderDismissAction = "back" | "close" | "none";
34
33
 
35
34
  export interface HeaderDismissNavigation {
36
35
  canGoBack?: () => boolean;
@@ -47,21 +46,14 @@ export interface HeaderDismissProps {
47
46
  navigation?: HeaderDismissNavigation;
48
47
  }
49
48
 
50
- const getDismissAccessibilityLabel = (
51
- dismissAction: HeaderDismissAction
52
- ): string => (dismissAction === 'close' ? 'Close' : 'Back');
49
+ const getDismissAccessibilityLabel = (dismissAction: HeaderDismissAction): string =>
50
+ dismissAction === "close" ? "Close" : "Back";
53
51
 
54
- const getDismissIconName = (
55
- dismissAction: HeaderDismissAction
56
- ): TerraSemanticIconName =>
57
- dismissAction === 'close' ? 'navigation.close' : 'navigation.back';
52
+ const getDismissIconName = (dismissAction: HeaderDismissAction): TerraSemanticIconName =>
53
+ dismissAction === "close" ? "navigation.close" : "navigation.back";
58
54
 
59
- export function HeaderDismissButton({
60
- dismissAction = 'none',
61
- navigation,
62
- onDismiss,
63
- }: HeaderDismissProps) {
64
- if (dismissAction === 'none') return null;
55
+ export function HeaderDismissButton({ dismissAction = "none", navigation, onDismiss }: HeaderDismissProps) {
56
+ if (dismissAction === "none") return null;
65
57
 
66
58
  const handlePress = () => {
67
59
  if (onDismiss) {
@@ -69,7 +61,7 @@ export function HeaderDismissButton({
69
61
  return;
70
62
  }
71
63
 
72
- if (dismissAction === 'close' && navigation?.dismiss) {
64
+ if (dismissAction === "close" && navigation?.dismiss) {
73
65
  navigation.dismiss();
74
66
  return;
75
67
  }
@@ -1,4 +1,4 @@
1
- export { Header } from './Header';
1
+ export { Header } from "./Header";
2
2
  export {
3
3
  HeaderButton,
4
4
  type HeaderButtonProps,
@@ -6,8 +6,8 @@ export {
6
6
  HeaderDismissButton,
7
7
  type HeaderDismissNavigation,
8
8
  type HeaderDismissProps,
9
- } from './header-buttons';
10
- export type { LargeTitleHeaderProps } from './variants/LargeTitleHeader';
11
- export { LargeTitleHeader } from './variants/LargeTitleHeader';
12
- export type { TitleHeaderProps } from './variants/TitleHeader';
13
- export { TitleHeader } from './variants/TitleHeader';
9
+ } from "./header-buttons";
10
+ export type { LargeTitleHeaderProps } from "./variants/LargeTitleHeader";
11
+ export { LargeTitleHeader } from "./variants/LargeTitleHeader";
12
+ export type { TitleHeaderProps } from "./variants/TitleHeader";
13
+ export { TitleHeader } from "./variants/TitleHeader";
@@ -1,17 +1,82 @@
1
- import { useId } from 'react';
2
- import Svg, {
3
- Defs,
4
- Rect,
5
- Stop,
6
- LinearGradient as SvgLinearGradient,
7
- } from 'react-native-svg';
1
+ import { useId } from "react";
2
+
3
+ import Svg, { Defs, Rect, Stop, LinearGradient as SvgLinearGradient } from "react-native-svg";
4
+
5
+ /**
6
+ * How far the overlay extends below the bar's bottom edge, in dp.
7
+ *
8
+ * The fade needs more room than the bar alone can give it: confined to the bar,
9
+ * the curve has to be steep enough to read as a band. Overhanging lets the tail
10
+ * finish in open space, so the header releases content instead of cutting it.
11
+ */
12
+ export const HEADER_FADE_EXTENT = 22;
13
+
14
+ /**
15
+ * Where the fade begins, as a fraction of the overlay's height — the bar plus
16
+ * {@link HEADER_FADE_EXTENT}.
17
+ *
18
+ * Sits inside the bar rather than at its bottom edge, so the tint has already
19
+ * begun thinning before content reaches the boundary. That is the trade this
20
+ * value makes: a longer, gentler ramp, paid for with content being faintly
21
+ * visible through the lower part of the bar.
22
+ */
23
+ const FADE_START = 0.45;
24
+
25
+ /**
26
+ * Stops used to approximate the fade curve. Below ~10 the ramp shows as a series
27
+ * of bands on an 8-bit display; above ~14 the extra stops cost SVG parse time
28
+ * with nothing visible in return.
29
+ */
30
+ const FADE_STOPS = 12;
31
+
32
+ /** Ceiling on the fade's opacity — see {@link alphaAt}. */
33
+ const MAX_FADE_ALPHA = 0.95;
34
+
35
+ /**
36
+ * Raised cosine, capped at {@link MAX_FADE_ALPHA}, reaching 0 at the overlay's
37
+ * bottom.
38
+ *
39
+ * The curve's slope is zero at both ends, so neither the start of the fade nor
40
+ * its finish leaves a seam. A two-stop linear ramp has a constant slope that
41
+ * begins and ends abruptly, and those two hard edges are what read as a line
42
+ * drawn across the content rather than the header letting go of it.
43
+ *
44
+ * The cap holds the ramp just short of solid, so the whole overlay reads as one
45
+ * continuous gradient rather than an opaque plateau with a curve bolted on.
46
+ */
47
+ const alphaAt = (t: number) => Math.min((1 + Math.cos(Math.PI * t)) / 2, MAX_FADE_ALPHA);
48
+
49
+ /**
50
+ * Every input is a module constant, so the ramp is built once at load rather
51
+ * than rebuilt per render.
52
+ *
53
+ * The leading stop belongs to this list rather than being a sibling element:
54
+ * `LinearGradient` types its children as a flat `ReactElement[]`, so an element
55
+ * beside a mapped array would nest and fail to type-check.
56
+ */
57
+ const STOPS = [
58
+ { offset: 0, opacity: 1 },
59
+ ...Array.from({ length: FADE_STOPS }, (_, index) => {
60
+ const t = index / (FADE_STOPS - 1);
61
+ return { offset: FADE_START + t * (1 - FADE_START), opacity: alphaAt(t) };
62
+ }),
63
+ ];
8
64
 
9
65
  export interface HeaderGradientOverlayProps {
10
- /** Fill color, fading from fully opaque to 90% opacity along the gradient. */
66
+ /** Fill color, fading to fully transparent along the overlay. */
11
67
  color: string;
12
68
  }
13
69
 
14
- /** Vertical fade-out overlay behind header content, shared by header variants. */
70
+ /**
71
+ * Vertical fade-out overlay behind header content, shared by header variants.
72
+ *
73
+ * Reaches zero rather than stopping short. An overlay ending at partial opacity
74
+ * leaves a hard step wherever it is clipped, and that step is far more visible
75
+ * than the fade it was meant to hide — it is what cuts content off square as it
76
+ * scrolls under the header.
77
+ *
78
+ * Callers size it to overhang the bar by {@link HEADER_FADE_EXTENT}.
79
+ */
15
80
  export function HeaderGradientOverlay({ color }: HeaderGradientOverlayProps) {
16
81
  const gradientId = useId();
17
82
 
@@ -19,8 +84,9 @@ export function HeaderGradientOverlay({ color }: HeaderGradientOverlayProps) {
19
84
  <Svg height="100%" width="100%">
20
85
  <Defs>
21
86
  <SvgLinearGradient id={gradientId} x1="0" y1="0" x2="0" y2="1">
22
- <Stop offset="0" stopColor={color} stopOpacity="1" />
23
- <Stop offset="1" stopColor={color} stopOpacity="0.86" />
87
+ {STOPS.map((stop) => (
88
+ <Stop key={stop.offset} offset={stop.offset} stopColor={color} stopOpacity={stop.opacity} />
89
+ ))}
24
90
  </SvgLinearGradient>
25
91
  </Defs>
26
92
  <Rect width="100%" height="100%" fill={`url(#${gradientId})`} />