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
@@ -6,21 +6,15 @@ import {
6
6
  type ReactNode,
7
7
  useContext,
8
8
  useMemo,
9
- } from 'react';
10
- import {
11
- Pressable,
12
- type PressableProps,
13
- View,
14
- type ViewProps,
15
- } from 'react-native';
16
-
17
- import { StyleSheet } from 'react-native-unistyles';
9
+ } from "react";
10
+ import { Pressable, type PressableProps, View, type ViewProps } from "react-native";
18
11
 
19
- import type { ColorToken, SpacingKey, TerraIconName } from '#theme/types';
20
- import { resolveThemeColor } from '#utils/resolve-theme-color';
12
+ import { StyleSheet } from "react-native-unistyles";
21
13
 
22
- import { Icon } from '../icon';
23
- import { Text } from '../text';
14
+ import type { ColorToken, SpacingKey, TerraIconName } from "#theme/types";
15
+ import { resolveThemeColor } from "#utils/resolve-theme-color";
16
+ import { Icon } from "../icon";
17
+ import { Text } from "../text";
24
18
 
25
19
  // ─── Context (lets Toolbar.Button inherit the group's paint) ──────────────────
26
20
  //
@@ -35,33 +29,65 @@ interface ToolbarGroupContextValue {
35
29
  /** Foreground token inherited by each button's icon and label. */
36
30
  tint: ColorToken;
37
31
  /**
38
- * True inside a {@link ToolbarGroup}. Adjacent buttons share a cell edge, so
39
- * a horizontal `hitSlop` would reach into a neighbour's bounds and steal
40
- * taps from it grouped buttons expand vertically only.
32
+ * True inside a {@link ToolbarGroup}. Selects the `grouped` style variant: the
33
+ * cell sheds its own width, padding, border and shadow, because the capsule
34
+ * supplies all four for the whole group.
41
35
  */
42
36
  isGrouped: boolean;
43
37
  }
44
38
 
45
39
  /** Non-null default, so a bare `Toolbar.Button` still paints its own circle. */
46
40
  const ToolbarGroupContext = createContext<ToolbarGroupContextValue>({
47
- background: 'surface.default',
48
- tint: 'text.default',
41
+ background: "surface.default",
42
+ tint: "text.default",
49
43
  isGrouped: false,
50
44
  });
51
45
 
52
- /** Square cell of an icon-only item, in dp. */
53
- const ITEM_SIZE = 40;
46
+ /**
47
+ * Square cell of an icon-only item, in dp. Just under Apple's 44pt minimum
48
+ * touch target; `HIT_SLOP` carries the cell past it.
49
+ */
50
+ const ITEM_SIZE = 42;
51
+
52
+ /** Horizontal padding of an item that owns its footprint, in dp. */
53
+ const ITEM_PADDING = 10;
54
+
55
+ /**
56
+ * How far a filled cell is inset inside the capsule, per edge, in dp. A fill
57
+ * flush with the capsule's own height would collide with its rounded end caps;
58
+ * the inset keeps the two curves clear of one another.
59
+ */
60
+ const FILLED_INSET = 4;
61
+
62
+ /** Cell of a grouped item that paints its own fill, in dp. */
63
+ const FILLED_ITEM_SIZE = ITEM_SIZE - FILLED_INSET * 2;
64
+
65
+ /** Horizontal padding inside the capsule's end caps, in dp. */
66
+ const CAPSULE_PADDING = 10;
67
+
68
+ /**
69
+ * Item count from which a capsule takes {@link CAPSULE_PADDING_EXTRA}. A lone
70
+ * item sits in a capsule barely wider than itself and needs no extra room; from
71
+ * two up the run reads as a bar, and end caps sized for one look pinched.
72
+ */
73
+ const CAPSULE_WIDE_ITEMS = 2;
74
+
75
+ /** Additional end-cap padding at {@link CAPSULE_WIDE_ITEMS} items or more, in dp. */
76
+ const CAPSULE_PADDING_EXTRA = 4;
54
77
 
55
- /** Touch expansion outside the cell, in dp. */
78
+ /**
79
+ * Touch expansion outside the cell, in dp — uniform on all four sides, grouped
80
+ * or not. Safe inside a capsule because its 20dp item gap exceeds two
81
+ * neighbouring 8dp expansions, so no item can steal a tap aimed at the next.
82
+ */
56
83
  const HIT_SLOP = 8;
57
84
 
58
85
  /** Typographic role of a text item's label. */
59
- const LABEL_VARIANT = 'label-md';
86
+ const LABEL_VARIANT = "label-md";
60
87
 
61
88
  // ─── Button ───────────────────────────────────────────────────────────────────
62
89
 
63
- interface ToolbarButtonBaseProps
64
- extends Omit<PressableProps, 'children' | 'style'> {
90
+ interface ToolbarButtonBaseProps extends Omit<PressableProps, "children" | "style"> {
65
91
  /** Icon to render, before the label when both are given. */
66
92
  icon?: TerraIconName;
67
93
  /** Icon size in density-independent pixels. Defaults to `20`. */
@@ -88,7 +114,7 @@ interface ToolbarButtonBaseProps
88
114
  * pinned over a hero image) without a wrapper view. Supports `Pressable`'s
89
115
  * function form for press-state styling.
90
116
  */
91
- style?: PressableProps['style'];
117
+ style?: PressableProps["style"];
92
118
  }
93
119
 
94
120
  /**
@@ -124,19 +150,20 @@ export function ToolbarButton({
124
150
  style,
125
151
  ...rest
126
152
  }: ToolbarButtonProps) {
127
- const {
128
- background: groupBackground,
129
- tint: groupTint,
130
- isGrouped,
131
- } = useContext(ToolbarGroupContext);
153
+ const { background: groupBackground, tint: groupTint, isGrouped } = useContext(ToolbarGroupContext);
132
154
 
133
155
  // Tokens, not resolved values: `Icon` and `Text` each resolve against the
134
156
  // live theme, so they keep their own subscriptions.
135
157
  const fg = tint ?? groupTint;
136
158
  const bg = background ?? groupBackground;
137
- const shape = Children.count(children) > 0 ? 'label' : 'icon';
159
+ const shape = Children.count(children) > 0 ? "label" : "icon";
160
+ // A grouped cell normally shrinks to its glyph, which is invisible while it is
161
+ // transparent but shows as a lozenge the width of that glyph the moment the
162
+ // cell paints. An explicit `background` therefore has to buy the footprint
163
+ // back — see the `filled` variant.
164
+ const isFilled = isGrouped && background !== undefined;
138
165
 
139
- styles.useVariants({ shape, grouped: isGrouped });
166
+ styles.useVariants({ shape, grouped: isGrouped, filled: isFilled });
140
167
 
141
168
  // Read during render rather than inside the `style` callback below. The
142
169
  // callback can run after sibling buttons have rendered, and `useVariants` is
@@ -156,7 +183,7 @@ export function ToolbarButton({
156
183
  style={(state) => [
157
184
  cell,
158
185
  styles.fill(bg, state.pressed),
159
- typeof style === 'function' ? style(state) : style,
186
+ typeof style === "function" ? style(state) : style,
160
187
  ]}
161
188
  >
162
189
  {icon !== undefined && <Icon size={iconSize} color={fg} name={icon} />}
@@ -168,14 +195,14 @@ export function ToolbarButton({
168
195
  /** Auto-wraps text children in the button's tint, as `Chip` does its label. */
169
196
  function renderLabel(children: ReactNode, tint: ColorToken): ReactNode {
170
197
  return Children.map(children, (child) => {
171
- if (typeof child === 'string') {
198
+ if (typeof child === "string") {
172
199
  return child.trim().length > 0 ? (
173
200
  <Text variant={LABEL_VARIANT} color={tint} weight="bold">
174
201
  {child}
175
202
  </Text>
176
203
  ) : null;
177
204
  }
178
- if (typeof child === 'number') {
205
+ if (typeof child === "number") {
179
206
  return (
180
207
  <Text variant={LABEL_VARIANT} color={tint} weight="bold">
181
208
  {child}
@@ -216,27 +243,23 @@ export interface ToolbarGroupProps extends ViewProps {
216
243
  * </Toolbar.Group>
217
244
  * ```
218
245
  */
219
- export const ToolbarGroup = forwardRef<
220
- ComponentRef<typeof View>,
221
- ToolbarGroupProps
222
- >(function ToolbarGroup(
223
- {
224
- background = 'surface.default',
225
- tint = 'text.default',
226
- children,
227
- style,
228
- ...rest
229
- },
246
+ export const ToolbarGroup = forwardRef<ComponentRef<typeof View>, ToolbarGroupProps>(function ToolbarGroup(
247
+ { background = "surface.default", tint = "text.default", children, style, ...rest },
230
248
  ref
231
249
  ) {
232
250
  const context = useMemo<ToolbarGroupContextValue>(
233
- () => ({ background: 'transparent', tint, isGrouped: true }),
251
+ () => ({ background: "transparent", tint, isGrouped: true }),
234
252
  [tint]
235
253
  );
236
254
 
255
+ // `Children.count` treats a fragment as a single child, so items wrapped in
256
+ // one keep the tighter padding. Walking the tree to flatten them would cost a
257
+ // traversal per render to settle 4dp, which is not a trade worth making.
258
+ const isCrowded = Children.count(children) >= CAPSULE_WIDE_ITEMS;
259
+
237
260
  return (
238
261
  <ToolbarGroupContext.Provider value={context}>
239
- <View ref={ref} style={[styles.capsule(background), style]} {...rest}>
262
+ <View ref={ref} style={[styles.capsule(background, isCrowded), style]} {...rest}>
240
263
  {children}
241
264
  </View>
242
265
  </ToolbarGroupContext.Provider>
@@ -271,15 +294,16 @@ export interface ToolbarProps extends ViewProps {
271
294
  * </Toolbar>
272
295
  * ```
273
296
  */
274
- const ToolbarRoot = forwardRef<ComponentRef<typeof View>, ToolbarProps>(
275
- function Toolbar({ gap = '2', children, style, ...rest }, ref) {
276
- return (
277
- <View ref={ref} style={[styles.row(gap), style]} {...rest}>
278
- {children}
279
- </View>
280
- );
281
- }
282
- );
297
+ const ToolbarRoot = forwardRef<ComponentRef<typeof View>, ToolbarProps>(function Toolbar(
298
+ { gap = "2", children, style, ...rest },
299
+ ref
300
+ ) {
301
+ return (
302
+ <View ref={ref} style={[styles.row(gap), style]} {...rest}>
303
+ {children}
304
+ </View>
305
+ );
306
+ });
283
307
 
284
308
  type ToolbarComponent = typeof ToolbarRoot & {
285
309
  Group: typeof ToolbarGroup;
@@ -294,22 +318,22 @@ Toolbar.Button = ToolbarButton;
294
318
 
295
319
  const styles = StyleSheet.create((theme) => ({
296
320
  row: (gap: SpacingKey) => ({
297
- flexDirection: 'row',
298
- alignItems: 'center',
321
+ flexDirection: "row",
322
+ alignItems: "center",
299
323
  gap: theme.spacing[gap],
300
324
  }),
301
325
  // `background` is an open `ColorToken` — it accepts raw literals, so it cannot
302
326
  // be enumerated as a variant. Resolving inside the factory keeps the fill tied
303
327
  // to the live theme.
304
- capsule: (background: ColorToken) => ({
305
- flexDirection: 'row',
306
- alignItems: 'center',
307
- gap: theme.spacing['5'],
308
- paddingHorizontal: 10,
328
+ capsule: (background: ColorToken, isCrowded: boolean) => ({
329
+ flexDirection: "row",
330
+ alignItems: "center",
331
+ gap: theme.spacing["5"],
332
+ paddingHorizontal: CAPSULE_PADDING + (isCrowded ? CAPSULE_PADDING_EXTRA : 0),
309
333
  borderRadius: theme.radius.full,
310
334
  backgroundColor: resolveThemeColor(background, theme),
311
335
  borderWidth: StyleSheet.hairlineWidth,
312
- borderColor: theme.color['border.subtle'],
336
+ borderColor: theme.color["border.subtle"],
313
337
  ...theme.elevation.xs,
314
338
  }),
315
339
  // Geometry is two finite axes, so it belongs in `variants` rather than in
@@ -318,32 +342,53 @@ const styles = StyleSheet.create((theme) => ({
318
342
  // supplies it.
319
343
  button: {
320
344
  height: ITEM_SIZE,
321
- flexDirection: 'row',
322
- alignItems: 'center',
323
- justifyContent: 'center',
345
+ flexDirection: "row",
346
+ alignItems: "center",
347
+ justifyContent: "center",
324
348
  borderRadius: theme.radius.full,
325
349
  variants: {
326
350
  shape: {
327
351
  icon: { width: ITEM_SIZE },
328
- label: { gap: theme.spacing['1'] },
352
+ label: { gap: theme.spacing["1"] },
329
353
  },
330
354
  grouped: {
331
355
  true: { paddingHorizontal: 0 },
332
356
  false: {
333
357
  minWidth: ITEM_SIZE,
334
- paddingHorizontal: 10,
358
+ paddingHorizontal: ITEM_PADDING,
335
359
  borderWidth: StyleSheet.hairlineWidth,
336
- borderColor: theme.color['border.subtle'],
360
+ borderColor: theme.color["border.subtle"],
337
361
  ...theme.elevation.xs,
338
362
  },
339
363
  },
364
+ // Only meaningful inside a capsule: a standalone cell already owns its
365
+ // footprint, so painting it a different colour changes nothing but paint.
366
+ filled: {
367
+ true: {},
368
+ false: {},
369
+ },
340
370
  },
341
371
  compoundVariants: [
342
372
  {
343
- shape: 'icon',
373
+ shape: "icon",
344
374
  grouped: true,
375
+ filled: false,
345
376
  styles: { width: undefined },
346
377
  },
378
+ // A filled cell takes its footprint back, inset from the capsule's height
379
+ // so its curve clears the capsule's own.
380
+ {
381
+ shape: "icon",
382
+ grouped: true,
383
+ filled: true,
384
+ styles: { width: FILLED_ITEM_SIZE, height: FILLED_ITEM_SIZE },
385
+ },
386
+ {
387
+ shape: "label",
388
+ grouped: true,
389
+ filled: true,
390
+ styles: { height: FILLED_ITEM_SIZE, paddingHorizontal: ITEM_PADDING },
391
+ },
347
392
  ],
348
393
  },
349
394
  // Split from `button` so the open-ended fill and the press state stay in the
@@ -2,5 +2,5 @@ export type {
2
2
  ToolbarButtonProps,
3
3
  ToolbarGroupProps,
4
4
  ToolbarProps,
5
- } from './Toolbar';
6
- export { Toolbar } from './Toolbar';
5
+ } from "./Toolbar";
6
+ export { Toolbar } from "./Toolbar";
@@ -1,20 +1,12 @@
1
- import {
2
- createContext,
3
- type PropsWithChildren,
4
- useCallback,
5
- useContext,
6
- useMemo,
7
- useState,
8
- } from 'react';
9
- import { SafeAreaProvider } from 'react-native-safe-area-context';
10
- import { useUnistyles } from 'react-native-unistyles';
11
- import { bootstrapTerraUI } from '../theme/registry';
12
- import { applyAccent, applyScheme, getCurrentAccent } from '../theme/runtime';
13
- import {
14
- type ResolvedScreenMargin,
15
- resolveScreenMargin,
16
- } from '../theme/screen-margin';
17
- import type { Scheme, TerraTheme } from '../theme/types';
1
+ import { createContext, type PropsWithChildren, useCallback, useContext, useMemo, useState } from "react";
2
+
3
+ import { SafeAreaProvider } from "react-native-safe-area-context";
4
+ import { useUnistyles } from "react-native-unistyles";
5
+
6
+ import { bootstrapTerraUI } from "../theme/registry";
7
+ import { applyAccent, applyScheme, getCurrentAccent } from "../theme/runtime";
8
+ import { type ResolvedScreenMargin, resolveScreenMargin } from "../theme/screen-margin";
9
+ import type { Scheme, TerraTheme } from "../theme/types";
18
10
 
19
11
  // Ensure the default theme is registered on first import. An app that calls
20
12
  // `configureTerraUI` itself still wins, whichever module the bundler evaluates
@@ -37,19 +29,14 @@ const ThemeContext = createContext<ThemeContextValue | null>(null);
37
29
  * </TerraUIProvider>
38
30
  */
39
31
  export const TerraUIProvider = ({ children }: PropsWithChildren) => {
40
- const [accent, setAccentState] = useState<string | undefined>(() =>
41
- getCurrentAccent()
42
- );
32
+ const [accent, setAccentState] = useState<string | undefined>(() => getCurrentAccent());
43
33
 
44
34
  const setAccent = useCallback((name: string) => {
45
35
  applyAccent(name);
46
36
  setAccentState(name);
47
37
  }, []);
48
38
 
49
- const value = useMemo<ThemeContextValue>(
50
- () => ({ accent, setAccent }),
51
- [accent, setAccent]
52
- );
39
+ const value = useMemo<ThemeContextValue>(() => ({ accent, setAccent }), [accent, setAccent]);
53
40
 
54
41
  return (
55
42
  <ThemeContext.Provider value={value}>
@@ -85,7 +72,7 @@ export function useTheme(): UseThemeResult {
85
72
 
86
73
  return {
87
74
  theme,
88
- scheme: (rt.themeName ?? 'light') as Scheme,
75
+ scheme: (rt.themeName ?? "light") as Scheme,
89
76
  setScheme,
90
77
  accent: ctx?.accent,
91
78
  setAccent: ctx?.setAccent ?? noopSetAccent,
@@ -105,8 +92,6 @@ export function useScreenMargin(): ResolvedScreenMargin {
105
92
 
106
93
  const noopSetAccent = (_name: string): void => {
107
94
  if (__DEV__) {
108
- console.warn(
109
- '[react-native-terra-ui] setAccent called outside <TerraUIProvider>.'
110
- );
95
+ console.warn("[react-native-terra-ui] setAccent called outside <TerraUIProvider>.");
111
96
  }
112
97
  };
@@ -1,2 +1,2 @@
1
- export type { UseThemeResult } from './ThemeProvider';
2
- export { TerraUIProvider, useScreenMargin, useTheme } from './ThemeProvider';
1
+ export type { UseThemeResult } from "./ThemeProvider";
2
+ export { TerraUIProvider, useScreenMargin, useTheme } from "./ThemeProvider";
package/src/index.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  // biome-ignore-all assist/source/organizeImports: ./context must be first so it
2
2
  // configures the default theme before any StyleSheet.create runs.
3
- export * from './context';
3
+ export * from "./context";
4
4
 
5
- export * from './components';
6
- export * from './theme';
5
+ export * from "./components";
6
+ export * from "./theme";
@@ -1,4 +1,4 @@
1
- import type { UnistylesBreakpoints } from 'react-native-unistyles';
1
+ import type { UnistylesBreakpoints } from "react-native-unistyles";
2
2
 
3
3
  /**
4
4
  * Viewport-width breakpoints (dp), registered with Unistyles via
@@ -16,7 +16,7 @@ export const breakpoints = {
16
16
  export type AppBreakpoints = typeof breakpoints;
17
17
  export type BreakpointName = keyof AppBreakpoints;
18
18
 
19
- declare module 'react-native-unistyles' {
19
+ declare module "react-native-unistyles" {
20
20
  export interface UnistylesBreakpoints extends AppBreakpoints {}
21
21
  }
22
22
 
@@ -35,7 +35,5 @@ export function resolveBreakpointValue<T>(
35
35
  values: Record<BreakpointName, T>,
36
36
  breakpoint: keyof UnistylesBreakpoints | undefined
37
37
  ): T {
38
- return breakpoint !== undefined && breakpoint in values
39
- ? values[breakpoint as BreakpointName]
40
- : values.xs;
38
+ return breakpoint !== undefined && breakpoint in values ? values[breakpoint as BreakpointName] : values.xs;
41
39
  }
@@ -1,13 +1,9 @@
1
- import Svg, { Circle, Path } from 'react-native-svg';
1
+ import Svg, { Circle, Path } from "react-native-svg";
2
2
 
3
- import type {
4
- TerraIconComponent,
5
- TerraIconProps,
6
- TerraSemanticIconName,
7
- } from '../types';
3
+ import type { TerraIconComponent, TerraIconProps, TerraSemanticIconName } from "../types";
8
4
 
9
5
  const DEFAULT_SIZE = 20;
10
- const DEFAULT_COLOR = '#000000';
6
+ const DEFAULT_COLOR = "#000000";
11
7
  const DEFAULT_STROKE_WIDTH = 2;
12
8
 
13
9
  const resolveIconProps = ({
@@ -19,17 +15,11 @@ const resolveIconProps = ({
19
15
  const strokeProps = (color: string, strokeWidth: number) => ({
20
16
  stroke: color,
21
17
  strokeWidth,
22
- strokeLinecap: 'round' as const,
23
- strokeLinejoin: 'round' as const,
18
+ strokeLinecap: "round" as const,
19
+ strokeLinejoin: "round" as const,
24
20
  });
25
21
 
26
- const SvgIcon = ({
27
- size,
28
- children,
29
- }: {
30
- size: number;
31
- children: React.ReactNode;
32
- }) => (
22
+ const SvgIcon = ({ size, children }: { size: number; children: React.ReactNode }) => (
33
23
  <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
34
24
  {children}
35
25
  </Svg>
@@ -64,9 +54,7 @@ const ForwardIcon: TerraIconComponent = (props) => (
64
54
  />
65
55
  );
66
56
 
67
- const CloseIcon: TerraIconComponent = (props) => (
68
- <PathIcon d="M18 6L6 18M6 6l12 12" {...props} />
69
- );
57
+ const CloseIcon: TerraIconComponent = (props) => <PathIcon d="M18 6L6 18M6 6l12 12" {...props} />;
70
58
 
71
59
  const InfoIcon: TerraIconComponent = (props) => {
72
60
  const { color, size, strokeWidth } = resolveIconProps(props);
@@ -99,10 +87,7 @@ const WarningIcon: TerraIconComponent = (props) => {
99
87
 
100
88
  return (
101
89
  <SvgIcon size={size}>
102
- <Path
103
- d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"
104
- {...stroke}
105
- />
90
+ <Path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" {...stroke} />
106
91
  <Path d="M12 9v4" {...stroke} />
107
92
  <Path d="M12 17h.01" {...stroke} />
108
93
  </SvgIcon>
@@ -136,12 +121,12 @@ export const PersonIcon: TerraIconComponent = (props) => {
136
121
  };
137
122
 
138
123
  export const defaultIcons: Record<TerraSemanticIconName, TerraIconComponent> = {
139
- 'navigation.back': BackIcon,
140
- 'navigation.forward': ForwardIcon,
141
- 'navigation.close': CloseIcon,
142
- 'status.info': InfoIcon,
143
- 'status.success': SuccessIcon,
144
- 'status.warning': WarningIcon,
145
- 'status.danger': DangerIcon,
124
+ "navigation.back": BackIcon,
125
+ "navigation.forward": ForwardIcon,
126
+ "navigation.close": CloseIcon,
127
+ "status.info": InfoIcon,
128
+ "status.success": SuccessIcon,
129
+ "status.warning": WarningIcon,
130
+ "status.danger": DangerIcon,
146
131
  person: PersonIcon,
147
132
  };
@@ -1,20 +1,17 @@
1
- import { createElement } from 'react';
2
- import { Image, Platform } from 'react-native';
1
+ import { createElement } from "react";
2
+ import { Image, Platform } from "react-native";
3
3
 
4
- import type { TerraImageComponent, TerraImageContentFit } from '../types';
4
+ import type { TerraImageComponent, TerraImageContentFit } from "../types";
5
5
 
6
6
  const CONTENT_FIT_MAP = {
7
- cover: 'cover',
8
- contain: 'contain',
9
- fill: 'stretch',
10
- } as const satisfies Record<
11
- TerraImageContentFit,
12
- 'cover' | 'contain' | 'stretch'
13
- >;
7
+ cover: "cover",
8
+ contain: "contain",
9
+ fill: "stretch",
10
+ } as const satisfies Record<TerraImageContentFit, "cover" | "contain" | "stretch">;
14
11
 
15
12
  /** Default image implementation, backed by React Native's `Image`. */
16
13
  export const defaultImage: TerraImageComponent = ({
17
- contentFit = 'cover',
14
+ contentFit = "cover",
18
15
  source,
19
16
  style,
20
17
  accessibilityLabel,
@@ -29,9 +26,7 @@ export const defaultImage: TerraImageComponent = ({
29
26
  // `defaultSource` (iOS only) and `loadingIndicatorSource` (Android only).
30
27
  // Only one may be set — Android's Image throws outright when it is handed
31
28
  // both — so the placeholder goes to whichever this platform reads.
32
- ...(Platform.OS === 'android'
33
- ? { loadingIndicatorSource: placeholder }
34
- : { defaultSource: placeholder }),
29
+ ...(Platform.OS === "android" ? { loadingIndicatorSource: placeholder } : { defaultSource: placeholder }),
35
30
  resizeMode: CONTENT_FIT_MAP[contentFit],
36
31
  onError: onError ? () => onError() : undefined,
37
32
  });
@@ -6,15 +6,15 @@
6
6
  // resolved `defaultLightTheme` / `defaultDarkTheme` are the public surface.
7
7
 
8
8
  // ─── Utilities (color resolution + accent/merge/typography helpers) ──────────
9
- export { normalizeAccent } from '#utils/accent-utils';
10
- export { readableOn, shade, withAlpha } from '#utils/color-utils';
11
- export type { DeepPartial } from '#utils/deep-merge';
12
- export { deepMerge } from '#utils/deep-merge';
13
- export { resolveThemeColor } from '#utils/resolve-theme-color';
14
- export { FONT_WEIGHT_VALUE, SYSTEM_FONT } from '#utils/typography';
9
+ export { normalizeAccent } from "#utils/accent-utils";
10
+ export { readableOn, shade, withAlpha } from "#utils/color-utils";
11
+ export type { DeepPartial } from "#utils/deep-merge";
12
+ export { deepMerge } from "#utils/deep-merge";
13
+ export { resolveThemeColor } from "#utils/resolve-theme-color";
14
+ export { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
15
15
  // ─── Breakpoints ─────────────────────────────────────────────────────────────
16
- export type { AppBreakpoints, BreakpointName } from './breakpoints';
17
- export { breakpoints, resolveBreakpointValue } from './breakpoints';
16
+ export type { AppBreakpoints, BreakpointName } from "./breakpoints";
17
+ export { breakpoints, resolveBreakpointValue } from "./breakpoints";
18
18
  // ─── Config + runtime ───────────────────────────────────────────────────────
19
19
  export {
20
20
  configureTerraUI,
@@ -26,12 +26,12 @@ export {
26
26
  getRequiredIcon,
27
27
  getSurfaceElevation,
28
28
  resolveTheme,
29
- } from './registry';
30
- export { applyAccent, applyScheme, getCurrentAccent } from './runtime';
31
- export type { ResolvedScreenMargin } from './screen-margin';
32
- export { resolveScreenMargin } from './screen-margin';
29
+ } from "./registry";
30
+ export { applyAccent, applyScheme, getCurrentAccent } from "./runtime";
31
+ export type { ResolvedScreenMargin } from "./screen-margin";
32
+ export { resolveScreenMargin } from "./screen-margin";
33
33
  // ─── Default themes ───────────────────────────────────────────────────────────
34
- export { defaultDarkTheme, defaultLightTheme } from './theme';
34
+ export { defaultDarkTheme, defaultLightTheme } from "./theme";
35
35
  // ─── Types ────────────────────────────────────────────────────────────────────
36
36
  export type {
37
37
  Accent,
@@ -74,4 +74,4 @@ export type {
74
74
  ThemeRadiusOverride,
75
75
  TypeStyle,
76
76
  Typography,
77
- } from './types';
77
+ } from "./types";