react-native-terra-ui 0.1.0 → 0.2.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 (304) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/lib/module/components/avatar/Avatar.js +118 -35
  3. package/lib/module/components/avatar/Avatar.js.map +1 -1
  4. package/lib/module/components/avatar/index.js.map +1 -1
  5. package/lib/module/components/box/Box.js +15 -2
  6. package/lib/module/components/box/Box.js.map +1 -1
  7. package/lib/module/components/box/index.js.map +1 -1
  8. package/lib/module/components/box/utils.js +5 -2
  9. package/lib/module/components/box/utils.js.map +1 -1
  10. package/lib/module/components/button/Button.js +7 -14
  11. package/lib/module/components/button/Button.js.map +1 -1
  12. package/lib/module/components/button/index.js.map +1 -1
  13. package/lib/module/components/chip/Chip.js +372 -0
  14. package/lib/module/components/chip/Chip.js.map +1 -0
  15. package/lib/module/components/chip/index.js +4 -0
  16. package/lib/module/components/chip/index.js.map +1 -0
  17. package/lib/module/components/chip/types.js +2 -0
  18. package/lib/module/components/chip/types.js.map +1 -0
  19. package/lib/module/components/chip/utils.js +36 -0
  20. package/lib/module/components/chip/utils.js.map +1 -0
  21. package/lib/module/components/empty-state/EmptyState.js +200 -0
  22. package/lib/module/components/empty-state/EmptyState.js.map +1 -0
  23. package/lib/module/components/empty-state/index.js +4 -0
  24. package/lib/module/components/empty-state/index.js.map +1 -0
  25. package/lib/module/components/empty-state/types.js +2 -0
  26. package/lib/module/components/empty-state/types.js.map +1 -0
  27. package/lib/module/components/header/Header.js.map +1 -1
  28. package/lib/module/components/header/header-buttons.js +31 -36
  29. package/lib/module/components/header/header-buttons.js.map +1 -1
  30. package/lib/module/components/header/index.js +1 -1
  31. package/lib/module/components/header/index.js.map +1 -1
  32. package/lib/module/components/header/parts/HeaderGradientOverlay.js +38 -0
  33. package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -0
  34. package/lib/module/components/header/variants/LargeTitleHeader/index.js +71 -101
  35. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  36. package/lib/module/components/header/variants/TitleHeader/index.js +34 -65
  37. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  38. package/lib/module/components/icon/Icon.js +21 -9
  39. package/lib/module/components/icon/Icon.js.map +1 -1
  40. package/lib/module/components/icon/index.js.map +1 -1
  41. package/lib/module/components/image/Image.js +54 -0
  42. package/lib/module/components/image/Image.js.map +1 -0
  43. package/lib/module/components/image/index.js +4 -0
  44. package/lib/module/components/image/index.js.map +1 -0
  45. package/lib/module/components/image/types.js +4 -0
  46. package/lib/module/components/image/types.js.map +1 -0
  47. package/lib/module/components/index.js +4 -0
  48. package/lib/module/components/index.js.map +1 -1
  49. package/lib/module/components/page-indicator/PageIndicator.js.map +1 -1
  50. package/lib/module/components/page-indicator/PageIndicatorRoot.js.map +1 -1
  51. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +1 -1
  52. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js.map +1 -1
  53. package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js.map +1 -1
  54. package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js.map +1 -1
  55. package/lib/module/components/page-indicator/index.js.map +1 -1
  56. package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js.map +1 -1
  57. package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js.map +1 -1
  58. package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js.map +1 -1
  59. package/lib/module/components/page-indicator/variants/DotIndicator/index.js.map +1 -1
  60. package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js.map +1 -1
  61. package/lib/module/components/page-indicator/variants/PillIndicator/index.js.map +1 -1
  62. package/lib/module/components/portal/Portal.js +42 -0
  63. package/lib/module/components/portal/Portal.js.map +1 -0
  64. package/lib/module/components/portal/PortalContext.js +1 -16
  65. package/lib/module/components/portal/PortalContext.js.map +1 -1
  66. package/lib/module/components/portal/PortalHost.js +16 -14
  67. package/lib/module/components/portal/PortalHost.js.map +1 -1
  68. package/lib/module/components/portal/PortalProvider.js +51 -19
  69. package/lib/module/components/portal/PortalProvider.js.map +1 -1
  70. package/lib/module/components/portal/index.js +1 -1
  71. package/lib/module/components/portal/index.js.map +1 -1
  72. package/lib/module/components/screen/Screen.js +26 -29
  73. package/lib/module/components/screen/Screen.js.map +1 -1
  74. package/lib/module/components/screen/ScreenContext.js +7 -5
  75. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  76. package/lib/module/components/screen/ScreenFlashList.js +144 -0
  77. package/lib/module/components/screen/ScreenFlashList.js.map +1 -0
  78. package/lib/module/components/screen/ScreenFlatList.js +88 -27
  79. package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
  80. package/lib/module/components/screen/ScreenScrollView.js +101 -34
  81. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  82. package/lib/module/components/screen/index.js +1 -0
  83. package/lib/module/components/screen/index.js.map +1 -1
  84. package/lib/module/components/screen/parts/BottomSafeArea.js +62 -0
  85. package/lib/module/components/screen/parts/BottomSafeArea.js.map +1 -0
  86. package/lib/module/components/screen/parts/ScreenPlaceholder.js +50 -0
  87. package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -0
  88. package/lib/module/components/screen/types.js +4 -0
  89. package/lib/module/components/screen/types.js.map +1 -0
  90. package/lib/module/components/screen/utils.js +12 -9
  91. package/lib/module/components/screen/utils.js.map +1 -1
  92. package/lib/module/components/slot/Slot.js.map +1 -1
  93. package/lib/module/components/slot/index.js.map +1 -1
  94. package/lib/module/components/spinner/Spinner.js +1 -1
  95. package/lib/module/components/spinner/Spinner.js.map +1 -1
  96. package/lib/module/components/spinner/index.js.map +1 -1
  97. package/lib/module/components/surface/Surface.js +16 -9
  98. package/lib/module/components/surface/Surface.js.map +1 -1
  99. package/lib/module/components/surface/index.js.map +1 -1
  100. package/lib/module/components/text/Text.js +25 -7
  101. package/lib/module/components/text/Text.js.map +1 -1
  102. package/lib/module/components/text/index.js.map +1 -1
  103. package/lib/module/components/toast/Toast.js +8 -8
  104. package/lib/module/components/toast/Toast.js.map +1 -1
  105. package/lib/module/components/toast/ToastProvider.js.map +1 -1
  106. package/lib/module/components/toast/index.js.map +1 -1
  107. package/lib/module/components/toolbar/Toolbar.js +268 -0
  108. package/lib/module/components/toolbar/Toolbar.js.map +1 -0
  109. package/lib/module/components/toolbar/index.js +4 -0
  110. package/lib/module/components/toolbar/index.js.map +1 -0
  111. package/lib/module/context/ThemeProvider.js +5 -2
  112. package/lib/module/context/ThemeProvider.js.map +1 -1
  113. package/lib/module/context/index.js.map +1 -1
  114. package/lib/module/index.js.map +1 -1
  115. package/lib/module/{components/icon/utils.js → theme/defaults/icons.js} +1 -1
  116. package/lib/module/theme/defaults/icons.js.map +1 -0
  117. package/lib/module/theme/defaults/image.js +30 -0
  118. package/lib/module/theme/defaults/image.js.map +1 -0
  119. package/lib/module/theme/index.js +6 -6
  120. package/lib/module/theme/index.js.map +1 -1
  121. package/lib/module/theme/{configure.js → registry.js} +23 -30
  122. package/lib/module/theme/registry.js.map +1 -0
  123. package/lib/module/theme/runtime.js +1 -1
  124. package/lib/module/theme/runtime.js.map +1 -1
  125. package/lib/module/theme/theme.js +92 -11
  126. package/lib/module/theme/theme.js.map +1 -1
  127. package/lib/module/theme/tokens/dark.js +59 -68
  128. package/lib/module/theme/tokens/dark.js.map +1 -1
  129. package/lib/module/theme/tokens/light.js +49 -67
  130. package/lib/module/theme/tokens/light.js.map +1 -1
  131. package/lib/module/theme/tokens/primitives.js +241 -20
  132. package/lib/module/theme/tokens/primitives.js.map +1 -1
  133. package/lib/module/utils/accent-utils.js +4 -4
  134. package/lib/module/utils/accent-utils.js.map +1 -1
  135. package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
  136. package/lib/typescript/src/components/avatar/types.d.ts +5 -5
  137. package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
  138. package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
  139. package/lib/typescript/src/components/box/utils.d.ts +6 -1
  140. package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
  141. package/lib/typescript/src/components/button/Button.d.ts +2 -2
  142. package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
  143. package/lib/typescript/src/components/chip/Chip.d.ts +24 -0
  144. package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -0
  145. package/lib/typescript/src/components/chip/index.d.ts +4 -0
  146. package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
  147. package/lib/typescript/src/components/chip/types.d.ts +8 -0
  148. package/lib/typescript/src/components/chip/types.d.ts.map +1 -0
  149. package/lib/typescript/src/components/chip/utils.d.ts +8 -0
  150. package/lib/typescript/src/components/chip/utils.d.ts.map +1 -0
  151. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +45 -0
  152. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -0
  153. package/lib/typescript/src/components/empty-state/index.d.ts +4 -0
  154. package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -0
  155. package/lib/typescript/src/components/empty-state/types.d.ts +6 -0
  156. package/lib/typescript/src/components/empty-state/types.d.ts.map +1 -0
  157. package/lib/typescript/src/components/header/header-buttons.d.ts +27 -0
  158. package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
  159. package/lib/typescript/src/components/header/index.d.ts +1 -1
  160. package/lib/typescript/src/components/header/index.d.ts.map +1 -1
  161. package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts +7 -0
  162. package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -0
  163. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
  164. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  165. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +19 -8
  166. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  167. package/lib/typescript/src/components/icon/Icon.d.ts +1 -1
  168. package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
  169. package/lib/typescript/src/components/image/Image.d.ts +16 -0
  170. package/lib/typescript/src/components/image/Image.d.ts.map +1 -0
  171. package/lib/typescript/src/components/image/index.d.ts +3 -0
  172. package/lib/typescript/src/components/image/index.d.ts.map +1 -0
  173. package/lib/typescript/src/components/image/types.d.ts +7 -0
  174. package/lib/typescript/src/components/image/types.d.ts.map +1 -0
  175. package/lib/typescript/src/components/index.d.ts +4 -0
  176. package/lib/typescript/src/components/index.d.ts.map +1 -1
  177. package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +1 -1
  178. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +1 -1
  179. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +1 -1
  180. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +1 -1
  181. package/lib/typescript/src/components/portal/Portal.d.ts +26 -0
  182. package/lib/typescript/src/components/portal/Portal.d.ts.map +1 -0
  183. package/lib/typescript/src/components/portal/PortalContext.d.ts +11 -14
  184. package/lib/typescript/src/components/portal/PortalContext.d.ts.map +1 -1
  185. package/lib/typescript/src/components/portal/PortalHost.d.ts +9 -4
  186. package/lib/typescript/src/components/portal/PortalHost.d.ts.map +1 -1
  187. package/lib/typescript/src/components/portal/PortalProvider.d.ts +3 -3
  188. package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
  189. package/lib/typescript/src/components/portal/index.d.ts +4 -2
  190. package/lib/typescript/src/components/portal/index.d.ts.map +1 -1
  191. package/lib/typescript/src/components/screen/Screen.d.ts +19 -14
  192. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  193. package/lib/typescript/src/components/screen/ScreenContext.d.ts +12 -9
  194. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  195. package/lib/typescript/src/components/screen/ScreenFlashList.d.ts +43 -0
  196. package/lib/typescript/src/components/screen/ScreenFlashList.d.ts.map +1 -0
  197. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +17 -7
  198. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  199. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +51 -16
  200. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  201. package/lib/typescript/src/components/screen/index.d.ts +3 -0
  202. package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
  203. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +30 -0
  204. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -0
  205. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +22 -0
  206. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -0
  207. package/lib/typescript/src/components/screen/types.d.ts +42 -0
  208. package/lib/typescript/src/components/screen/types.d.ts.map +1 -0
  209. package/lib/typescript/src/components/screen/utils.d.ts +9 -9
  210. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  211. package/lib/typescript/src/components/spinner/Spinner.d.ts +1 -1
  212. package/lib/typescript/src/components/surface/Surface.d.ts +8 -1
  213. package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
  214. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  215. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  216. package/lib/typescript/src/components/toast/Toast.d.ts +1 -1
  217. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +115 -0
  218. package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -0
  219. package/lib/typescript/src/components/toolbar/index.d.ts +3 -0
  220. package/lib/typescript/src/components/toolbar/index.d.ts.map +1 -0
  221. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  222. package/lib/typescript/src/{components/icon/utils.d.ts → theme/defaults/icons.d.ts} +2 -2
  223. package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -0
  224. package/lib/typescript/src/theme/defaults/image.d.ts +4 -0
  225. package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -0
  226. package/lib/typescript/src/theme/index.d.ts +7 -7
  227. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  228. package/lib/typescript/src/theme/{configure.d.ts → registry.d.ts} +1 -1
  229. package/lib/typescript/src/theme/registry.d.ts.map +1 -0
  230. package/lib/typescript/src/theme/theme.d.ts +21 -1
  231. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  232. package/lib/typescript/src/theme/tokens/dark.d.ts +41 -64
  233. package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
  234. package/lib/typescript/src/theme/tokens/light.d.ts +44 -65
  235. package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
  236. package/lib/typescript/src/theme/tokens/primitives.d.ts +228 -17
  237. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  238. package/lib/typescript/src/theme/types.d.ts +66 -36
  239. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  240. package/lib/typescript/src/utils/accent-utils.d.ts +1 -1
  241. package/lib/typescript/src/utils/resolve-theme-color.d.ts +1 -1
  242. package/lib/typescript/src/utils/typography.d.ts +1 -1
  243. package/package.json +28 -12
  244. package/skills/terra-ui/SKILL.md +193 -0
  245. package/skills/terra-ui/references/recipes.md +198 -0
  246. package/skills/terra-ui/references/troubleshooting.md +112 -0
  247. package/src/components/avatar/Avatar.tsx +128 -38
  248. package/src/components/avatar/types.ts +5 -5
  249. package/src/components/box/Box.tsx +13 -1
  250. package/src/components/box/utils.ts +10 -0
  251. package/src/components/button/Button.tsx +7 -15
  252. package/src/components/chip/Chip.tsx +444 -0
  253. package/src/components/chip/index.ts +3 -0
  254. package/src/components/chip/types.ts +15 -0
  255. package/src/components/chip/utils.ts +34 -0
  256. package/src/components/empty-state/EmptyState.tsx +209 -0
  257. package/src/components/empty-state/index.ts +3 -0
  258. package/src/components/empty-state/types.ts +5 -0
  259. package/src/components/header/header-buttons.tsx +33 -45
  260. package/src/components/header/index.ts +2 -0
  261. package/src/components/header/parts/HeaderGradientOverlay.tsx +29 -0
  262. package/src/components/header/variants/LargeTitleHeader/index.tsx +68 -102
  263. package/src/components/header/variants/TitleHeader/index.tsx +47 -56
  264. package/src/components/icon/Icon.tsx +20 -15
  265. package/src/components/image/Image.tsx +48 -0
  266. package/src/components/image/index.ts +2 -0
  267. package/src/components/image/types.ts +7 -0
  268. package/src/components/index.ts +4 -0
  269. package/src/components/portal/Portal.tsx +55 -0
  270. package/src/components/portal/PortalContext.tsx +14 -22
  271. package/src/components/portal/PortalHost.tsx +17 -10
  272. package/src/components/portal/PortalProvider.tsx +58 -21
  273. package/src/components/portal/index.ts +4 -2
  274. package/src/components/screen/Screen.tsx +45 -59
  275. package/src/components/screen/ScreenContext.tsx +19 -12
  276. package/src/components/screen/ScreenFlashList.tsx +196 -0
  277. package/src/components/screen/ScreenFlatList.tsx +100 -39
  278. package/src/components/screen/ScreenScrollView.tsx +114 -53
  279. package/src/components/screen/index.ts +3 -0
  280. package/src/components/screen/parts/BottomSafeArea.tsx +60 -0
  281. package/src/components/screen/parts/ScreenPlaceholder.tsx +55 -0
  282. package/src/components/screen/types.ts +43 -0
  283. package/src/components/screen/utils.ts +29 -15
  284. package/src/components/surface/Surface.tsx +17 -20
  285. package/src/components/text/Text.tsx +23 -5
  286. package/src/components/toast/Toast.tsx +8 -8
  287. package/src/components/toolbar/Toolbar.tsx +353 -0
  288. package/src/components/toolbar/index.ts +6 -0
  289. package/src/context/ThemeProvider.tsx +5 -4
  290. package/src/{components/icon/utils.tsx → theme/defaults/icons.tsx} +1 -1
  291. package/src/theme/defaults/image.tsx +34 -0
  292. package/src/theme/index.ts +1 -1
  293. package/src/theme/{configure.ts → registry.ts} +19 -34
  294. package/src/theme/runtime.ts +1 -1
  295. package/src/theme/theme.ts +127 -13
  296. package/src/theme/tokens/dark.ts +60 -69
  297. package/src/theme/tokens/light.ts +50 -68
  298. package/src/theme/tokens/primitives.ts +248 -20
  299. package/src/theme/types.ts +67 -35
  300. package/src/utils/accent-utils.ts +4 -4
  301. package/lib/module/components/icon/utils.js.map +0 -1
  302. package/lib/module/theme/configure.js.map +0 -1
  303. package/lib/typescript/src/components/icon/utils.d.ts.map +0 -1
  304. package/lib/typescript/src/theme/configure.d.ts.map +0 -1
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { ComponentType } from 'react';
8
8
  import type { ImageStyle, StyleProp } from 'react-native';
9
- import type { DeepPartial } from '#utils/deep-merge';
9
+ import type { DeepPartial } from '../utils/deep-merge';
10
10
  /** Spacing scale keys (dp, 4dp base unit). Read as `gap={3}` → string '3'. */
11
11
  export type SpacingKey = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '12' | '14' | '16' | '20' | '24' | '32';
12
12
  /** Border-radius scale keys. */
@@ -52,6 +52,16 @@ export interface Typography {
52
52
  * (e.g. { regular: 'Inter-Regular', semibold: 'Inter-SemiBold' }).
53
53
  */
54
54
  fonts: Record<FontWeightToken, string>;
55
+ /**
56
+ * Weight token → italic font-family name. Optional per weight.
57
+ * Custom fonts can't be slanted via `fontStyle: 'italic'` (that's a no-op
58
+ * for a non-system `fontFamily` on iOS/Android) — point each weight at its
59
+ * dedicated italic file (e.g. { bold: 'Inter-BoldItalic' }) to make
60
+ * `<Text italic />` render correctly. Weights left unset fall back to the
61
+ * upright family in `fonts`. Not needed for the system font, which can
62
+ * synthesize italic on its own.
63
+ */
64
+ fontsItalic?: Partial<Record<FontWeightToken, string>>;
55
65
  variants: Record<RoleTextVariant, TypeStyle>;
56
66
  }
57
67
  /**
@@ -60,6 +70,7 @@ export interface Typography {
60
70
  */
61
71
  export interface ThemeColor {
62
72
  background: string;
73
+ shadow: string;
63
74
  'surface.default': string;
64
75
  'surface.raised': string;
65
76
  'surface.sunken': string;
@@ -85,40 +96,46 @@ export interface ThemeColor {
85
96
  'action.bg.primary.active': string;
86
97
  'action.bg.primary.disabled': string;
87
98
  'action.fg.primary': string;
88
- 'action.bg.subtle': string;
89
- 'action.bg.subtle.hover': string;
90
- 'action.bg.subtle.active': string;
91
- 'action.bg.subtle.disabled': string;
92
- 'action.fg.subtle': string;
93
- 'action.bg.neutral': string;
94
- 'action.bg.neutral.hover': string;
95
- 'action.bg.neutral.active': string;
96
- 'action.bg.neutral.disabled': string;
97
- 'action.fg.neutral': string;
98
- 'status.bg.success': string;
99
- 'status.bg.success.subtle': string;
100
- 'status.border.success': string;
101
- 'status.border.success.subtle': string;
102
- 'status.fg.success': string;
103
- 'status.fg.success.subtle': string;
104
- 'status.bg.warning': string;
105
- 'status.bg.warning.subtle': string;
106
- 'status.border.warning': string;
107
- 'status.border.warning.subtle': string;
108
- 'status.fg.warning': string;
109
- 'status.fg.warning.subtle': string;
110
- 'status.bg.danger': string;
111
- 'status.bg.danger.subtle': string;
112
- 'status.border.danger': string;
113
- 'status.border.danger.subtle': string;
114
- 'status.fg.danger': string;
115
- 'status.fg.danger.subtle': string;
116
- 'status.bg.info': string;
117
- 'status.bg.info.subtle': string;
118
- 'status.border.info': string;
119
- 'status.border.info.subtle': string;
120
- 'status.fg.info': string;
121
- 'status.fg.info.subtle': string;
99
+ 'action.bg.primary.subtle': string;
100
+ 'action.bg.primary.subtle.hover': string;
101
+ 'action.bg.primary.subtle.active': string;
102
+ 'action.bg.primary.subtle.disabled': string;
103
+ 'action.fg.primary.subtle': string;
104
+ 'action.bg.secondary': string;
105
+ 'action.fg.secondary': string;
106
+ 'action.bg.secondary.subtle': string;
107
+ 'action.bg.secondary.subtle.hover': string;
108
+ 'action.bg.secondary.subtle.active': string;
109
+ 'action.bg.secondary.subtle.disabled': string;
110
+ 'action.fg.secondary.subtle': string;
111
+ 'status.success': string;
112
+ 'status.success.bg': string;
113
+ 'status.success.bg.subtle': string;
114
+ 'status.success.border': string;
115
+ 'status.success.border.subtle': string;
116
+ 'status.success.fg': string;
117
+ 'status.success.fg.subtle': string;
118
+ 'status.warning': string;
119
+ 'status.warning.bg': string;
120
+ 'status.warning.bg.subtle': string;
121
+ 'status.warning.border': string;
122
+ 'status.warning.border.subtle': string;
123
+ 'status.warning.fg': string;
124
+ 'status.warning.fg.subtle': string;
125
+ 'status.danger': string;
126
+ 'status.danger.bg': string;
127
+ 'status.danger.bg.subtle': string;
128
+ 'status.danger.border': string;
129
+ 'status.danger.border.subtle': string;
130
+ 'status.danger.fg': string;
131
+ 'status.danger.fg.subtle': string;
132
+ 'status.info': string;
133
+ 'status.info.bg': string;
134
+ 'status.info.bg.subtle': string;
135
+ 'status.info.border': string;
136
+ 'status.info.border.subtle': string;
137
+ 'status.info.fg': string;
138
+ 'status.info.fg.subtle': string;
122
139
  }
123
140
  /** State-layer opacities for disabled / pressed feedback. */
124
141
  export interface OpacityTokens {
@@ -195,6 +212,10 @@ export interface TerraImageProps {
195
212
  style?: StyleProp<ImageStyle>;
196
213
  accessibilityLabel?: string;
197
214
  contentFit?: TerraImageContentFit;
215
+ /** Shown while `source` is loading (and if it fails to resolve). */
216
+ placeholder?: {
217
+ uri: string;
218
+ } | number;
198
219
  onError?: () => void;
199
220
  }
200
221
  export type TerraImageComponent = ComponentType<TerraImageProps>;
@@ -218,9 +239,18 @@ export type ThemeRadiusOverride = DeepPartial<TerraTheme['radius']> & {
218
239
  */
219
240
  base?: number;
220
241
  };
242
+ export type ThemeSpacingOverride = DeepPartial<TerraTheme['spacing']> & {
243
+ /**
244
+ * Base spacing unit in dp. Every step's value is its key multiplied by this
245
+ * base (e.g. `'5'` → `5 × base`). Per-step spacing overrides still win over
246
+ * the derived value.
247
+ */
248
+ base?: number;
249
+ };
221
250
  /** Theme override accepted at configure time. */
222
- export type TerraThemeOverride = DeepPartial<Omit<TerraTheme, 'radius'>> & {
251
+ export type TerraThemeOverride = DeepPartial<Omit<TerraTheme, 'radius' | 'spacing'>> & {
223
252
  radius?: ThemeRadiusOverride;
253
+ spacing?: ThemeSpacingOverride;
224
254
  };
225
255
  /** Default props for the Button component. A per-instance prop still wins. */
226
256
  export interface ButtonDefaults {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2EAA2E;IAC3E,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1,4 +1,4 @@
1
- import type { Accent, NormalizedAccent } from '#theme/types';
1
+ import type { Accent, NormalizedAccent } from '../theme/types';
2
2
  /** Normalizes any accent input into per-scheme partial-theme overrides. */
3
3
  export declare function normalizeAccent(accent: Accent): NormalizedAccent;
4
4
  //# sourceMappingURL=accent-utils.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ColorToken, TerraTheme } from '#theme/types';
1
+ import type { ColorToken, TerraTheme } from '../theme/types';
2
2
  /**
3
3
  * Resolves a {@link ColorToken} to a concrete color string using the theme.
4
4
  * Raw literals pass through unchanged.
@@ -1,4 +1,4 @@
1
- import type { FontWeightToken } from '#theme/types';
1
+ import type { FontWeightToken } from '../theme/types';
2
2
  /** RN's sentinel for the platform default font (SF on iOS, Roboto on Android). */
3
3
  export declare const SYSTEM_FONT = "System";
4
4
  /** Numeric fontWeight applied when a weight token maps to the system font. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-terra-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Themeable React Native UI components built on react-native-unistyles",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -23,15 +23,18 @@
23
23
  "files": [
24
24
  "src",
25
25
  "lib",
26
+ "skills",
27
+ "CHANGELOG.md",
26
28
  "!**/__tests__",
27
29
  "!**/__fixtures__",
28
30
  "!**/__mocks__",
29
31
  "!**/.*"
30
32
  ],
31
33
  "scripts": {
32
- "build": "bob build",
34
+ "build": "bob build && tsc-alias -p tsconfig.build.json --outDir lib/typescript",
33
35
  "clean": "del-cli lib",
34
- "prepare": "bob build",
36
+ "prepare": "bob build && tsc-alias -p tsconfig.build.json --outDir lib/typescript",
37
+ "release": "release-it",
35
38
  "typecheck": "tsc",
36
39
  "lint": "biome check .",
37
40
  "test": "jest"
@@ -59,30 +62,39 @@
59
62
  "@jest/globals": "^29.7.0",
60
63
  "@react-native/babel-preset": "0.85.0",
61
64
  "@react-native/jest-preset": "0.85.0",
65
+ "@release-it/conventional-changelog": "^12.0.0",
66
+ "@shopify/flash-list": "^2.3.2",
62
67
  "@testing-library/react-native": "^13.3.3",
63
68
  "@types/react": "^19.2.0",
64
69
  "babel-plugin-module-resolver": "^5.0.3",
65
70
  "del-cli": "^7.0.0",
66
71
  "jest": "^29.7.0",
67
- "react": "19.2.0",
68
- "react-native": "0.83.6",
72
+ "react": "19.2.3",
73
+ "react-native": "0.85.3",
69
74
  "react-native-builder-bob": "^0.42.1",
70
75
  "react-native-edge-to-edge": "1.8.1",
71
- "react-native-nitro-modules": "0.35.9",
72
- "react-native-reanimated": "^4.4.1",
73
- "react-native-safe-area-context": "^5.8.0",
76
+ "react-native-nitro-modules": "0.36.1",
77
+ "react-native-reanimated": "4.4.3",
78
+ "react-native-safe-area-context": "5.7.0",
79
+ "react-native-screens": "4.25.2",
74
80
  "react-native-svg": "15.15.4",
75
- "react-native-unistyles": "^3.2.5",
76
- "react-test-renderer": "19.2.0",
81
+ "react-native-unistyles": "^3.3.0",
82
+ "react-native-worklets": "0.10.0",
83
+ "react-test-renderer": "19.2.3",
84
+ "release-it": "^21.0.2",
85
+ "tsc-alias": "^1.9.1",
77
86
  "typescript": "^6.0.3"
78
87
  },
79
88
  "peerDependencies": {
89
+ "@shopify/flash-list": ">=2.0.0",
80
90
  "react": "*",
81
91
  "react-native": "*",
82
92
  "react-native-reanimated": ">=4.0.0",
83
93
  "react-native-safe-area-context": ">=4.0.0",
94
+ "react-native-screens": ">=4.16.0",
84
95
  "react-native-svg": ">=15.0.0",
85
- "react-native-unistyles": ">=3.0.0"
96
+ "react-native-unistyles": ">=3.0.0",
97
+ "react-native-worklets": ">=0.8.0"
86
98
  },
87
99
  "react-native-builder-bob": {
88
100
  "source": "src",
@@ -91,7 +103,8 @@
91
103
  [
92
104
  "module",
93
105
  {
94
- "esm": true
106
+ "esm": true,
107
+ "configFile": true
95
108
  }
96
109
  ],
97
110
  [
@@ -110,6 +123,9 @@
110
123
  "modulePathIgnorePatterns": [
111
124
  "<rootDir>/lib/"
112
125
  ],
126
+ "transformIgnorePatterns": [
127
+ "node_modules/(?!((jest-)?react-native|@react-native(-community)?|@shopify/flash-list|react-native-screens)/)"
128
+ ],
113
129
  "collectCoverageFrom": [
114
130
  "src/theme/**/*.ts",
115
131
  "src/utils/**/*.ts",
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: terra-ui
3
+ description: Build React Native UI with react-native-terra-ui — setup, component selection, theming, and the traps. Use when writing screens or components in an app that depends on react-native-terra-ui.
4
+ ---
5
+
6
+ # Terra UI
7
+
8
+ `react-native-terra-ui` is a themed React Native component library built on Unistyles v3.
9
+
10
+ **This skill ships inside the package**, so it describes the version you have installed.
11
+ Check it with `node -p "require('react-native-terra-ui/package.json').version"`.
12
+
13
+ **Do not guess prop names.** The package publishes both `src` and TypeScript
14
+ declarations, so the real props are on disk — read
15
+ `node_modules/react-native-terra-ui/lib/typescript/src/components/<name>/` or the `src`
16
+ next to it. Every prop carries a JSDoc line with its default. This skill deliberately does
17
+ not restate props, because a copy would drift from the types.
18
+
19
+ ## Before You Write A Screen
20
+
21
+ Four things break most often, in this order:
22
+
23
+ 1. **Expo Go does not work.** Unistyles v3 needs native modules — use a development build
24
+ (`npx expo run:ios`, or an EAS dev client). If components render unstyled or the app
25
+ crashes at startup, check this first.
26
+ 2. **The Babel plugin must list the library.** `react-native-unistyles/plugin` needs
27
+ `autoProcessImports: ['react-native-terra-ui']` so the library's own stylesheets are
28
+ processed, and `react-native-worklets/plugin` must be **last**. Without it, styles
29
+ freeze at whichever theme was active when they were created.
30
+ 3. **`TerraUIProvider` wraps the app once**, near the root. It supplies `SafeAreaProvider`
31
+ and accent state. It does **not** include `ToastProvider` — add that separately if you
32
+ use toasts.
33
+ 4. **Import order decides whether your theme config wins.** See below.
34
+
35
+ ## Import Order Is Load-Bearing
36
+
37
+ | Entry | Side effect |
38
+ |---|---|
39
+ | `react-native-terra-ui/theme` | none — safe anywhere |
40
+ | `react-native-terra-ui` | auto-calls `configureTerraUI()` with defaults **if not already configured** |
41
+
42
+ So a custom theme must be configured *before* the first root-entry import. The pattern:
43
+
44
+ ```ts
45
+ // terra-ui.ts — imports from /theme only, so it has no side effects of its own
46
+ import { configureTerraUI, type TerraTheme } from 'react-native-terra-ui/theme';
47
+
48
+ declare module 'react-native-unistyles' {
49
+ interface UnistylesThemes { light: TerraTheme; dark: TerraTheme }
50
+ }
51
+
52
+ configureTerraUI({ /* shared, accents, defaultAccent, icons, image, components */ });
53
+ ```
54
+
55
+ ```js
56
+ // index.js — the bootstrap goes FIRST
57
+ import './terra-ui';
58
+ import 'expo-router/entry';
59
+ ```
60
+
61
+ Get this wrong and there is no error — the defaults silently win. If your fonts, accent, or
62
+ component defaults appear to be ignored, this is why.
63
+
64
+ Skip all of it if the default theme is fine; just wrap in `TerraUIProvider`.
65
+
66
+ ## Styling Rules
67
+
68
+ Styles must go through Unistyles, not React Native's `StyleSheet`:
69
+
70
+ ```tsx
71
+ import { StyleSheet } from 'react-native-unistyles'; // ✅ not from 'react-native'
72
+
73
+ const styles = StyleSheet.create((theme, rt) => ({
74
+ card: {
75
+ backgroundColor: theme.color['surface.default'], // flat, dotted keys
76
+ padding: theme.spacing['4'], // string keys, 4dp base
77
+ borderRadius: theme.radius.md,
78
+ paddingTop: rt.insets.top,
79
+ },
80
+ }));
81
+ ```
82
+
83
+ - **Colors are flat dotted string keys** — `theme.color['surface.default']`,
84
+ `theme.color['status.danger.fg']`. The one exception is `theme.color.background`.
85
+ - Semantic tokens only. There is no palette export — that is deliberate.
86
+ - Put theme and variant decisions **inside** `StyleSheet.create`. Do not destructure
87
+ `theme` from `useUnistyles()` to build a style object; it defeats the native styling
88
+ path and stops updating on theme change.
89
+ - Use `variants` / `compoundVariants` rather than conditional style arrays.
90
+ - Runtime values (`insets`, screen size) come from the second `(theme, rt)` argument, never
91
+ `Dimensions.get()`. No breakpoints are configured by default.
92
+ - Outside a stylesheet, turn a token into a color with
93
+ `resolveThemeColor(token, theme)` from `react-native-terra-ui/theme`. It passes raw
94
+ literals (`#7c3aed`, `rgba(…)`, `transparent`) straight through.
95
+
96
+ ## Choosing A Component
97
+
98
+ | Need | Use | Not |
99
+ |---|---|---|
100
+ | A screen container with margins + background | `Screen` | a bare `View` |
101
+ | A scrolling screen body | `Screen.ScrollView` / `.FlatList` / `.FlashList` | a plain `ScrollView` — these reserve the header inset |
102
+ | A nav bar | `Screen.Header as={Header.Title}` (or `as={Header.LargeTitle}`) | a custom absolute view |
103
+ | Icon actions in a header | `Toolbar.Button`, grouped in `Toolbar.Group` | `Button` with `isIconOnly` |
104
+ | A labelled action | `Button` | `Toolbar.Button` |
105
+ | A tag / status pill | `Chip` | `Button variant="ghost"` |
106
+ | A plain themed box with token props | `Box` | `Surface`, unless you want its configured radius + elevation |
107
+ | An elevated card | `Surface` | `Box` + hand-rolled shadow |
108
+ | Text | `Text` with a `variant` | RN `Text` |
109
+
110
+ `Box` is the only family exposing token style props (`p`, `px`, `gap`, `bg`, `radius`,
111
+ `row`, `align`, `justify`, `flex`, `elevation`, …). `Surface` extends it minus `bg`.
112
+ Everything else takes explicit props.
113
+
114
+ `Screen.Header` is a **polymorphic marker slot**, not a wrapper. Render the header through
115
+ `as`, and any extra props forward to it:
116
+
117
+ ```tsx
118
+ <Screen.Header as={Header.LargeTitle} title="Library" caption="24 items" />
119
+ ```
120
+
121
+ Nesting the header as a child still works and appears throughout older code, but `as` is
122
+ the current form. Either way the slot must be a **direct** child of `Screen` — that is how
123
+ `Screen` detects a header and drops its top safe-area edge.
124
+
125
+ `Header.LargeTitle` collapses on scroll, so it also has to be paired with one of the
126
+ `Screen` scroll containers — it reads scroll position from their shared context.
127
+
128
+ ## Icons Are Registered By You
129
+
130
+ The library ships only eight semantic icons: `navigation.back`, `navigation.forward`,
131
+ `navigation.close`, `status.info`, `status.success`, `status.warning`, `status.danger`,
132
+ `person`.
133
+
134
+ Everything else is yours, registered by name through declaration merging plus the `icons`
135
+ map. Both halves are required — types alone will not render, and a name that is not
136
+ registered logs a dev warning and renders **nothing**:
137
+
138
+ ```ts
139
+ // terra-ui-icons.d.ts
140
+ import type { TerraIconComponent } from 'react-native-terra-ui/theme';
141
+
142
+ declare global {
143
+ namespace TerraUI {
144
+ interface IconRegistry { add: TerraIconComponent; share: TerraIconComponent }
145
+ }
146
+ }
147
+ declare module 'react-native-terra-ui/theme' {
148
+ interface TerraIconRegistry extends TerraUI.IconRegistry {}
149
+ }
150
+ declare module 'react-native-terra-ui' {
151
+ interface TerraIconRegistry extends TerraUI.IconRegistry {}
152
+ }
153
+ ```
154
+
155
+ ```ts
156
+ // in configureTerraUI
157
+ import { Plus, Share } from 'lucide-react-native';
158
+ configureTerraUI({ icons: { add: Plus, share: Share } });
159
+ ```
160
+
161
+ If an icon is invisible, check that it is in **both** places.
162
+
163
+ ## Theme Switching
164
+
165
+ Runtime switching goes through the library, not React state:
166
+
167
+ ```tsx
168
+ const { theme, scheme, setScheme, accent, setAccent } = useTheme(); // under TerraUIProvider
169
+ ```
170
+
171
+ `setScheme` disables system-adaptive theming. `setAccent` takes a name registered in
172
+ `configureTerraUI({ accents })`. Re-rendering a provider with a different theme object is
173
+ not how this works — Unistyles resolves styles natively.
174
+
175
+ ## Compound Components
176
+
177
+ Sub-components hang off the parent: `Screen.Header` / `.ScrollView` / `.FlatList` /
178
+ `.FlashList`, `Header.Title` / `.LargeTitle`, `Button.Icon` / `.Label`,
179
+ `Chip.Icon`, `Toast.Title` / `.Description` / `.Action` / `.Close` / `.Icon`,
180
+ `Toolbar.Group` / `.Button`, `Portal.Provider` / `.Host`.
181
+
182
+ They inherit color and size from the parent through context, so
183
+ `<Chip color="success"><Chip.Icon name="status.success" />Done</Chip>` needs no color on
184
+ the icon. An explicit prop on the child always wins.
185
+
186
+ Content goes through `children`, not `label`/`icon`/`items` props. Text children are
187
+ auto-wrapped in themed `Text` where the component supports a label.
188
+
189
+ ## References
190
+
191
+ - `references/recipes.md` — working screen, header, toolbar, list, and toast snippets.
192
+ - `references/troubleshooting.md` — symptom → cause for the failures above.
193
+ - Full guide: https://github.com/earthling-std/react-native-terra-ui#readme