react-native-terra-ui 0.1.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 (379) hide show
  1. package/README.md +70 -0
  2. package/lib/module/components/avatar/Avatar.js +121 -0
  3. package/lib/module/components/avatar/Avatar.js.map +1 -0
  4. package/lib/module/components/avatar/index.js +4 -0
  5. package/lib/module/components/avatar/index.js.map +1 -0
  6. package/lib/module/components/avatar/types.js +4 -0
  7. package/lib/module/components/avatar/types.js.map +1 -0
  8. package/lib/module/components/box/Box.js +49 -0
  9. package/lib/module/components/box/Box.js.map +1 -0
  10. package/lib/module/components/box/index.js +4 -0
  11. package/lib/module/components/box/index.js.map +1 -0
  12. package/lib/module/components/box/utils.js +95 -0
  13. package/lib/module/components/box/utils.js.map +1 -0
  14. package/lib/module/components/button/Button.js +281 -0
  15. package/lib/module/components/button/Button.js.map +1 -0
  16. package/lib/module/components/button/index.js +4 -0
  17. package/lib/module/components/button/index.js.map +1 -0
  18. package/lib/module/components/header/Header.js +25 -0
  19. package/lib/module/components/header/Header.js.map +1 -0
  20. package/lib/module/components/header/header-buttons.js +65 -0
  21. package/lib/module/components/header/header-buttons.js.map +1 -0
  22. package/lib/module/components/header/index.js +7 -0
  23. package/lib/module/components/header/index.js.map +1 -0
  24. package/lib/module/components/header/variants/LargeTitleHeader/index.js +335 -0
  25. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -0
  26. package/lib/module/components/header/variants/TitleHeader/index.js +184 -0
  27. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -0
  28. package/lib/module/components/icon/Icon.js +53 -0
  29. package/lib/module/components/icon/Icon.js.map +1 -0
  30. package/lib/module/components/icon/index.js +4 -0
  31. package/lib/module/components/icon/index.js.map +1 -0
  32. package/lib/module/components/icon/utils.js +188 -0
  33. package/lib/module/components/icon/utils.js.map +1 -0
  34. package/lib/module/components/index.js +16 -0
  35. package/lib/module/components/index.js.map +1 -0
  36. package/lib/module/components/page-indicator/PageIndicator.js +49 -0
  37. package/lib/module/components/page-indicator/PageIndicator.js.map +1 -0
  38. package/lib/module/components/page-indicator/PageIndicatorRoot.js +24 -0
  39. package/lib/module/components/page-indicator/PageIndicatorRoot.js.map +1 -0
  40. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +24 -0
  41. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js.map +1 -0
  42. package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js +20 -0
  43. package/lib/module/components/page-indicator/hooks/use-page-indicator-core.js.map +1 -0
  44. package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js +68 -0
  45. package/lib/module/components/page-indicator/hooks/use-page-indicator-progress.js.map +1 -0
  46. package/lib/module/components/page-indicator/index.js +5 -0
  47. package/lib/module/components/page-indicator/index.js.map +1 -0
  48. package/lib/module/components/page-indicator/utils.js +127 -0
  49. package/lib/module/components/page-indicator/utils.js.map +1 -0
  50. package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js +50 -0
  51. package/lib/module/components/page-indicator/variants/DotIndicator/InactiveDot.js.map +1 -0
  52. package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js +165 -0
  53. package/lib/module/components/page-indicator/variants/DotIndicator/LoadingOrbit.js.map +1 -0
  54. package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js +60 -0
  55. package/lib/module/components/page-indicator/variants/DotIndicator/TravelingPill.js.map +1 -0
  56. package/lib/module/components/page-indicator/variants/DotIndicator/index.js +87 -0
  57. package/lib/module/components/page-indicator/variants/DotIndicator/index.js.map +1 -0
  58. package/lib/module/components/page-indicator/variants/DotIndicator/utils.js +28 -0
  59. package/lib/module/components/page-indicator/variants/DotIndicator/utils.js.map +1 -0
  60. package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js +53 -0
  61. package/lib/module/components/page-indicator/variants/PillIndicator/PillIndicatorDot.js.map +1 -0
  62. package/lib/module/components/page-indicator/variants/PillIndicator/index.js +76 -0
  63. package/lib/module/components/page-indicator/variants/PillIndicator/index.js.map +1 -0
  64. package/lib/module/components/page-indicator/variants/PillIndicator/utils.js +47 -0
  65. package/lib/module/components/page-indicator/variants/PillIndicator/utils.js.map +1 -0
  66. package/lib/module/components/portal/PortalContext.js +20 -0
  67. package/lib/module/components/portal/PortalContext.js.map +1 -0
  68. package/lib/module/components/portal/PortalHost.js +23 -0
  69. package/lib/module/components/portal/PortalHost.js.map +1 -0
  70. package/lib/module/components/portal/PortalProvider.js +40 -0
  71. package/lib/module/components/portal/PortalProvider.js.map +1 -0
  72. package/lib/module/components/portal/index.js +6 -0
  73. package/lib/module/components/portal/index.js.map +1 -0
  74. package/lib/module/components/screen/Screen.js +100 -0
  75. package/lib/module/components/screen/Screen.js.map +1 -0
  76. package/lib/module/components/screen/ScreenContext.js +66 -0
  77. package/lib/module/components/screen/ScreenContext.js.map +1 -0
  78. package/lib/module/components/screen/ScreenFlatList.js +75 -0
  79. package/lib/module/components/screen/ScreenFlatList.js.map +1 -0
  80. package/lib/module/components/screen/ScreenScrollView.js +82 -0
  81. package/lib/module/components/screen/ScreenScrollView.js.map +1 -0
  82. package/lib/module/components/screen/index.js +7 -0
  83. package/lib/module/components/screen/index.js.map +1 -0
  84. package/lib/module/components/screen/utils.js +13 -0
  85. package/lib/module/components/screen/utils.js.map +1 -0
  86. package/lib/module/components/slot/Slot.js +38 -0
  87. package/lib/module/components/slot/Slot.js.map +1 -0
  88. package/lib/module/components/slot/index.js +10 -0
  89. package/lib/module/components/slot/index.js.map +1 -0
  90. package/lib/module/components/slot/utils.js +55 -0
  91. package/lib/module/components/slot/utils.js.map +1 -0
  92. package/lib/module/components/spinner/Spinner.js +132 -0
  93. package/lib/module/components/spinner/Spinner.js.map +1 -0
  94. package/lib/module/components/spinner/index.js +4 -0
  95. package/lib/module/components/spinner/index.js.map +1 -0
  96. package/lib/module/components/surface/Surface.js +74 -0
  97. package/lib/module/components/surface/Surface.js.map +1 -0
  98. package/lib/module/components/surface/index.js +4 -0
  99. package/lib/module/components/surface/index.js.map +1 -0
  100. package/lib/module/components/text/Text.js +67 -0
  101. package/lib/module/components/text/Text.js.map +1 -0
  102. package/lib/module/components/text/index.js +4 -0
  103. package/lib/module/components/text/index.js.map +1 -0
  104. package/lib/module/components/toast/Toast.js +350 -0
  105. package/lib/module/components/toast/Toast.js.map +1 -0
  106. package/lib/module/components/toast/ToastProvider.js +272 -0
  107. package/lib/module/components/toast/ToastProvider.js.map +1 -0
  108. package/lib/module/components/toast/index.js +5 -0
  109. package/lib/module/components/toast/index.js.map +1 -0
  110. package/lib/module/components/toast/parts/ToastAnimatedItem.js +168 -0
  111. package/lib/module/components/toast/parts/ToastAnimatedItem.js.map +1 -0
  112. package/lib/module/components/toast/types.js +4 -0
  113. package/lib/module/components/toast/types.js.map +1 -0
  114. package/lib/module/components/toast/utils/controller.js +19 -0
  115. package/lib/module/components/toast/utils/controller.js.map +1 -0
  116. package/lib/module/context/ThemeProvider.js +66 -0
  117. package/lib/module/context/ThemeProvider.js.map +1 -0
  118. package/lib/module/context/index.js +4 -0
  119. package/lib/module/context/index.js.map +1 -0
  120. package/lib/module/index.js +8 -0
  121. package/lib/module/index.js.map +1 -0
  122. package/lib/module/package.json +1 -0
  123. package/lib/module/theme/configure.js +152 -0
  124. package/lib/module/theme/configure.js.map +1 -0
  125. package/lib/module/theme/index.js +22 -0
  126. package/lib/module/theme/index.js.map +1 -0
  127. package/lib/module/theme/runtime.js +25 -0
  128. package/lib/module/theme/runtime.js.map +1 -0
  129. package/lib/module/theme/theme.js +121 -0
  130. package/lib/module/theme/theme.js.map +1 -0
  131. package/lib/module/theme/tokens/dark.js +109 -0
  132. package/lib/module/theme/tokens/dark.js.map +1 -0
  133. package/lib/module/theme/tokens/light.js +115 -0
  134. package/lib/module/theme/tokens/light.js.map +1 -0
  135. package/lib/module/theme/tokens/primitives.js +228 -0
  136. package/lib/module/theme/tokens/primitives.js.map +1 -0
  137. package/lib/module/theme/types.js +4 -0
  138. package/lib/module/theme/types.js.map +1 -0
  139. package/lib/module/types.js +2 -0
  140. package/lib/module/types.js.map +1 -0
  141. package/lib/module/utils/accent-utils.js +52 -0
  142. package/lib/module/utils/accent-utils.js.map +1 -0
  143. package/lib/module/utils/color-utils.js +53 -0
  144. package/lib/module/utils/color-utils.js.map +1 -0
  145. package/lib/module/utils/deep-merge.js +28 -0
  146. package/lib/module/utils/deep-merge.js.map +1 -0
  147. package/lib/module/utils/resolve-theme-color.js +20 -0
  148. package/lib/module/utils/resolve-theme-color.js.map +1 -0
  149. package/lib/module/utils/typography.js +13 -0
  150. package/lib/module/utils/typography.js.map +1 -0
  151. package/lib/module/utils/unflatten.js +35 -0
  152. package/lib/module/utils/unflatten.js.map +1 -0
  153. package/lib/typescript/package.json +1 -0
  154. package/lib/typescript/src/components/avatar/Avatar.d.ts +3 -0
  155. package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -0
  156. package/lib/typescript/src/components/avatar/index.d.ts +3 -0
  157. package/lib/typescript/src/components/avatar/index.d.ts.map +1 -0
  158. package/lib/typescript/src/components/avatar/types.d.ts +30 -0
  159. package/lib/typescript/src/components/avatar/types.d.ts.map +1 -0
  160. package/lib/typescript/src/components/box/Box.d.ts +12 -0
  161. package/lib/typescript/src/components/box/Box.d.ts.map +1 -0
  162. package/lib/typescript/src/components/box/index.d.ts +4 -0
  163. package/lib/typescript/src/components/box/index.d.ts.map +1 -0
  164. package/lib/typescript/src/components/box/utils.d.ts +39 -0
  165. package/lib/typescript/src/components/box/utils.d.ts.map +1 -0
  166. package/lib/typescript/src/components/button/Button.d.ts +46 -0
  167. package/lib/typescript/src/components/button/Button.d.ts.map +1 -0
  168. package/lib/typescript/src/components/button/index.d.ts +3 -0
  169. package/lib/typescript/src/components/button/index.d.ts.map +1 -0
  170. package/lib/typescript/src/components/header/Header.d.ts +22 -0
  171. package/lib/typescript/src/components/header/Header.d.ts.map +1 -0
  172. package/lib/typescript/src/components/header/header-buttons.d.ts +16 -0
  173. package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -0
  174. package/lib/typescript/src/components/header/index.d.ts +7 -0
  175. package/lib/typescript/src/components/header/index.d.ts.map +1 -0
  176. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +25 -0
  177. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -0
  178. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +28 -0
  179. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -0
  180. package/lib/typescript/src/components/icon/Icon.d.ts +22 -0
  181. package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -0
  182. package/lib/typescript/src/components/icon/index.d.ts +3 -0
  183. package/lib/typescript/src/components/icon/index.d.ts.map +1 -0
  184. package/lib/typescript/src/components/icon/utils.d.ts +4 -0
  185. package/lib/typescript/src/components/icon/utils.d.ts.map +1 -0
  186. package/lib/typescript/src/components/index.d.ts +14 -0
  187. package/lib/typescript/src/components/index.d.ts.map +1 -0
  188. package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +48 -0
  189. package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts.map +1 -0
  190. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts +13 -0
  191. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts.map +1 -0
  192. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +14 -0
  193. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts.map +1 -0
  194. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts +11 -0
  195. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts.map +1 -0
  196. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts +19 -0
  197. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts.map +1 -0
  198. package/lib/typescript/src/components/page-indicator/index.d.ts +4 -0
  199. package/lib/typescript/src/components/page-indicator/index.d.ts.map +1 -0
  200. package/lib/typescript/src/components/page-indicator/utils.d.ts +36 -0
  201. package/lib/typescript/src/components/page-indicator/utils.d.ts.map +1 -0
  202. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts +14 -0
  203. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts.map +1 -0
  204. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts +11 -0
  205. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts.map +1 -0
  206. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts +15 -0
  207. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts.map +1 -0
  208. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +32 -0
  209. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts.map +1 -0
  210. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts +14 -0
  211. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts.map +1 -0
  212. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts +16 -0
  213. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts.map +1 -0
  214. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +28 -0
  215. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts.map +1 -0
  216. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts +21 -0
  217. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts.map +1 -0
  218. package/lib/typescript/src/components/portal/PortalContext.d.ts +19 -0
  219. package/lib/typescript/src/components/portal/PortalContext.d.ts.map +1 -0
  220. package/lib/typescript/src/components/portal/PortalHost.d.ts +7 -0
  221. package/lib/typescript/src/components/portal/PortalHost.d.ts.map +1 -0
  222. package/lib/typescript/src/components/portal/PortalProvider.d.ts +11 -0
  223. package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -0
  224. package/lib/typescript/src/components/portal/index.d.ts +6 -0
  225. package/lib/typescript/src/components/portal/index.d.ts.map +1 -0
  226. package/lib/typescript/src/components/screen/Screen.d.ts +53 -0
  227. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -0
  228. package/lib/typescript/src/components/screen/ScreenContext.d.ts +64 -0
  229. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -0
  230. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +26 -0
  231. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -0
  232. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +36 -0
  233. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -0
  234. package/lib/typescript/src/components/screen/index.d.ts +9 -0
  235. package/lib/typescript/src/components/screen/index.d.ts.map +1 -0
  236. package/lib/typescript/src/components/screen/utils.d.ts +10 -0
  237. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -0
  238. package/lib/typescript/src/components/slot/Slot.d.ts +17 -0
  239. package/lib/typescript/src/components/slot/Slot.d.ts.map +1 -0
  240. package/lib/typescript/src/components/slot/index.d.ts +8 -0
  241. package/lib/typescript/src/components/slot/index.d.ts.map +1 -0
  242. package/lib/typescript/src/components/slot/utils.d.ts +17 -0
  243. package/lib/typescript/src/components/slot/utils.d.ts.map +1 -0
  244. package/lib/typescript/src/components/spinner/Spinner.d.ts +18 -0
  245. package/lib/typescript/src/components/spinner/Spinner.d.ts.map +1 -0
  246. package/lib/typescript/src/components/spinner/index.d.ts +3 -0
  247. package/lib/typescript/src/components/spinner/index.d.ts.map +1 -0
  248. package/lib/typescript/src/components/surface/Surface.d.ts +31 -0
  249. package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -0
  250. package/lib/typescript/src/components/surface/index.d.ts +3 -0
  251. package/lib/typescript/src/components/surface/index.d.ts.map +1 -0
  252. package/lib/typescript/src/components/text/Text.d.ts +23 -0
  253. package/lib/typescript/src/components/text/Text.d.ts.map +1 -0
  254. package/lib/typescript/src/components/text/index.d.ts +3 -0
  255. package/lib/typescript/src/components/text/index.d.ts.map +1 -0
  256. package/lib/typescript/src/components/toast/Toast.d.ts +71 -0
  257. package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -0
  258. package/lib/typescript/src/components/toast/ToastProvider.d.ts +4 -0
  259. package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -0
  260. package/lib/typescript/src/components/toast/index.d.ts +5 -0
  261. package/lib/typescript/src/components/toast/index.d.ts.map +1 -0
  262. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +18 -0
  263. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -0
  264. package/lib/typescript/src/components/toast/types.d.ts +62 -0
  265. package/lib/typescript/src/components/toast/types.d.ts.map +1 -0
  266. package/lib/typescript/src/components/toast/utils/controller.d.ts +5 -0
  267. package/lib/typescript/src/components/toast/utils/controller.d.ts.map +1 -0
  268. package/lib/typescript/src/context/ThemeProvider.d.ts +29 -0
  269. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -0
  270. package/lib/typescript/src/context/index.d.ts +3 -0
  271. package/lib/typescript/src/context/index.d.ts.map +1 -0
  272. package/lib/typescript/src/index.d.ts +4 -0
  273. package/lib/typescript/src/index.d.ts.map +1 -0
  274. package/lib/typescript/src/theme/configure.d.ts +47 -0
  275. package/lib/typescript/src/theme/configure.d.ts.map +1 -0
  276. package/lib/typescript/src/theme/index.d.ts +11 -0
  277. package/lib/typescript/src/theme/index.d.ts.map +1 -0
  278. package/lib/typescript/src/theme/runtime.d.ts +7 -0
  279. package/lib/typescript/src/theme/runtime.d.ts.map +1 -0
  280. package/lib/typescript/src/theme/theme.d.ts +22 -0
  281. package/lib/typescript/src/theme/theme.d.ts.map +1 -0
  282. package/lib/typescript/src/theme/tokens/dark.d.ts +100 -0
  283. package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -0
  284. package/lib/typescript/src/theme/tokens/light.d.ts +106 -0
  285. package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -0
  286. package/lib/typescript/src/theme/tokens/primitives.d.ts +212 -0
  287. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -0
  288. package/lib/typescript/src/theme/types.d.ts +273 -0
  289. package/lib/typescript/src/theme/types.d.ts.map +1 -0
  290. package/lib/typescript/src/types.d.ts +4 -0
  291. package/lib/typescript/src/types.d.ts.map +1 -0
  292. package/lib/typescript/src/utils/accent-utils.d.ts +4 -0
  293. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -0
  294. package/lib/typescript/src/utils/color-utils.d.ts +11 -0
  295. package/lib/typescript/src/utils/color-utils.d.ts.map +1 -0
  296. package/lib/typescript/src/utils/deep-merge.d.ts +11 -0
  297. package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -0
  298. package/lib/typescript/src/utils/resolve-theme-color.d.ts +12 -0
  299. package/lib/typescript/src/utils/resolve-theme-color.d.ts.map +1 -0
  300. package/lib/typescript/src/utils/typography.d.ts +6 -0
  301. package/lib/typescript/src/utils/typography.d.ts.map +1 -0
  302. package/lib/typescript/src/utils/unflatten.d.ts +12 -0
  303. package/lib/typescript/src/utils/unflatten.d.ts.map +1 -0
  304. package/package.json +137 -0
  305. package/src/components/avatar/Avatar.tsx +146 -0
  306. package/src/components/avatar/index.ts +8 -0
  307. package/src/components/avatar/types.ts +35 -0
  308. package/src/components/box/Box.tsx +59 -0
  309. package/src/components/box/index.ts +8 -0
  310. package/src/components/box/utils.ts +181 -0
  311. package/src/components/button/Button.tsx +313 -0
  312. package/src/components/button/index.ts +8 -0
  313. package/src/components/header/Header.ts +22 -0
  314. package/src/components/header/header-buttons.tsx +103 -0
  315. package/src/components/header/index.ts +11 -0
  316. package/src/components/header/variants/LargeTitleHeader/index.tsx +390 -0
  317. package/src/components/header/variants/TitleHeader/index.tsx +194 -0
  318. package/src/components/icon/Icon.tsx +74 -0
  319. package/src/components/icon/index.ts +2 -0
  320. package/src/components/icon/utils.tsx +147 -0
  321. package/src/components/index.ts +13 -0
  322. package/src/components/page-indicator/PageIndicator.tsx +100 -0
  323. package/src/components/page-indicator/PageIndicatorRoot.tsx +41 -0
  324. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +65 -0
  325. package/src/components/page-indicator/hooks/use-page-indicator-core.ts +34 -0
  326. package/src/components/page-indicator/hooks/use-page-indicator-progress.ts +122 -0
  327. package/src/components/page-indicator/index.ts +13 -0
  328. package/src/components/page-indicator/utils.ts +208 -0
  329. package/src/components/page-indicator/variants/DotIndicator/InactiveDot.tsx +70 -0
  330. package/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.tsx +201 -0
  331. package/src/components/page-indicator/variants/DotIndicator/TravelingPill.tsx +80 -0
  332. package/src/components/page-indicator/variants/DotIndicator/index.tsx +145 -0
  333. package/src/components/page-indicator/variants/DotIndicator/utils.ts +28 -0
  334. package/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.tsx +107 -0
  335. package/src/components/page-indicator/variants/PillIndicator/index.tsx +149 -0
  336. package/src/components/page-indicator/variants/PillIndicator/utils.ts +63 -0
  337. package/src/components/portal/PortalContext.tsx +27 -0
  338. package/src/components/portal/PortalHost.tsx +20 -0
  339. package/src/components/portal/PortalProvider.tsx +44 -0
  340. package/src/components/portal/index.ts +5 -0
  341. package/src/components/screen/Screen.tsx +163 -0
  342. package/src/components/screen/ScreenContext.tsx +144 -0
  343. package/src/components/screen/ScreenFlatList.tsx +121 -0
  344. package/src/components/screen/ScreenScrollView.tsx +130 -0
  345. package/src/components/screen/index.ts +8 -0
  346. package/src/components/screen/utils.ts +17 -0
  347. package/src/components/slot/Slot.tsx +56 -0
  348. package/src/components/slot/index.ts +8 -0
  349. package/src/components/slot/utils.ts +61 -0
  350. package/src/components/spinner/Spinner.tsx +153 -0
  351. package/src/components/spinner/index.ts +2 -0
  352. package/src/components/surface/Surface.tsx +100 -0
  353. package/src/components/surface/index.ts +2 -0
  354. package/src/components/text/Text.tsx +115 -0
  355. package/src/components/text/index.ts +2 -0
  356. package/src/components/toast/Toast.tsx +477 -0
  357. package/src/components/toast/ToastProvider.tsx +403 -0
  358. package/src/components/toast/index.ts +26 -0
  359. package/src/components/toast/parts/ToastAnimatedItem.tsx +184 -0
  360. package/src/components/toast/types.ts +75 -0
  361. package/src/components/toast/utils/controller.ts +23 -0
  362. package/src/context/ThemeProvider.tsx +97 -0
  363. package/src/context/index.ts +2 -0
  364. package/src/index.tsx +6 -0
  365. package/src/theme/configure.ts +215 -0
  366. package/src/theme/index.ts +72 -0
  367. package/src/theme/runtime.ts +27 -0
  368. package/src/theme/theme.ts +152 -0
  369. package/src/theme/tokens/dark.ts +117 -0
  370. package/src/theme/tokens/light.ts +123 -0
  371. package/src/theme/tokens/primitives.ts +232 -0
  372. package/src/theme/types.ts +384 -0
  373. package/src/types.ts +1 -0
  374. package/src/utils/accent-utils.ts +58 -0
  375. package/src/utils/color-utils.ts +51 -0
  376. package/src/utils/deep-merge.ts +36 -0
  377. package/src/utils/resolve-theme-color.ts +27 -0
  378. package/src/utils/typography.ts +15 -0
  379. package/src/utils/unflatten.ts +36 -0
@@ -0,0 +1,147 @@
1
+ import Svg, { Circle, Path } from 'react-native-svg';
2
+
3
+ import type {
4
+ TerraIconComponent,
5
+ TerraIconProps,
6
+ TerraSemanticIconName,
7
+ } from '#theme/types';
8
+
9
+ const DEFAULT_SIZE = 20;
10
+ const DEFAULT_COLOR = '#000000';
11
+ const DEFAULT_STROKE_WIDTH = 2;
12
+
13
+ const resolveIconProps = ({
14
+ size = DEFAULT_SIZE,
15
+ color = DEFAULT_COLOR,
16
+ strokeWidth = DEFAULT_STROKE_WIDTH,
17
+ }: TerraIconProps) => ({ color, size, strokeWidth });
18
+
19
+ const strokeProps = (color: string, strokeWidth: number) => ({
20
+ stroke: color,
21
+ strokeWidth,
22
+ strokeLinecap: 'round' as const,
23
+ strokeLinejoin: 'round' as const,
24
+ });
25
+
26
+ const SvgIcon = ({
27
+ size,
28
+ children,
29
+ }: {
30
+ size: number;
31
+ children: React.ReactNode;
32
+ }) => (
33
+ <Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
34
+ {children}
35
+ </Svg>
36
+ );
37
+
38
+ const PathIcon = ({ d, ...props }: TerraIconProps & { d: string }) => {
39
+ const { color, size, strokeWidth } = resolveIconProps(props);
40
+
41
+ return (
42
+ <SvgIcon size={size}>
43
+ <Path d={d} {...strokeProps(color, strokeWidth)} />
44
+ </SvgIcon>
45
+ );
46
+ };
47
+
48
+ // Lucide chevron geometry scaled 20% from the 24×24 viewBox center (45° arms unchanged).
49
+ const NAV_CENTER = 12;
50
+ const NAV_CHEVRON_OPEN = 3 * 1.2;
51
+ const NAV_CHEVRON_ARM = 6 * 1.2;
52
+
53
+ const BackIcon: TerraIconComponent = (props) => (
54
+ <PathIcon
55
+ d={`M${NAV_CENTER + NAV_CHEVRON_OPEN} ${NAV_CENTER + NAV_CHEVRON_ARM}L${NAV_CENTER - NAV_CHEVRON_OPEN} ${NAV_CENTER} ${NAV_CENTER + NAV_CHEVRON_OPEN} ${NAV_CENTER - NAV_CHEVRON_ARM}`}
56
+ {...props}
57
+ />
58
+ );
59
+
60
+ const ForwardIcon: TerraIconComponent = (props) => (
61
+ <PathIcon
62
+ d={`M${NAV_CENTER - NAV_CHEVRON_OPEN} ${NAV_CENTER + NAV_CHEVRON_ARM}L${NAV_CENTER + NAV_CHEVRON_OPEN} ${NAV_CENTER} ${NAV_CENTER - NAV_CHEVRON_OPEN} ${NAV_CENTER - NAV_CHEVRON_ARM}`}
63
+ {...props}
64
+ />
65
+ );
66
+
67
+ const CloseIcon: TerraIconComponent = (props) => (
68
+ <PathIcon d="M18 6L6 18M6 6l12 12" {...props} />
69
+ );
70
+
71
+ const InfoIcon: TerraIconComponent = (props) => {
72
+ const { color, size, strokeWidth } = resolveIconProps(props);
73
+ const stroke = strokeProps(color, strokeWidth);
74
+
75
+ return (
76
+ <SvgIcon size={size}>
77
+ <Circle cx={12} cy={12} r={10} {...stroke} />
78
+ <Path d="M12 16v-4" {...stroke} />
79
+ <Path d="M12 8h.01" {...stroke} />
80
+ </SvgIcon>
81
+ );
82
+ };
83
+
84
+ const SuccessIcon: TerraIconComponent = (props) => {
85
+ const { color, size, strokeWidth } = resolveIconProps(props);
86
+ const stroke = strokeProps(color, strokeWidth);
87
+
88
+ return (
89
+ <SvgIcon size={size}>
90
+ <Circle cx={12} cy={12} r={10} {...stroke} />
91
+ <Path d="m9 12 2 2 4-4" {...stroke} />
92
+ </SvgIcon>
93
+ );
94
+ };
95
+
96
+ const WarningIcon: TerraIconComponent = (props) => {
97
+ const { color, size, strokeWidth } = resolveIconProps(props);
98
+ const stroke = strokeProps(color, strokeWidth);
99
+
100
+ return (
101
+ <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
+ />
106
+ <Path d="M12 9v4" {...stroke} />
107
+ <Path d="M12 17h.01" {...stroke} />
108
+ </SvgIcon>
109
+ );
110
+ };
111
+
112
+ const DangerIcon: TerraIconComponent = (props) => {
113
+ const { color, size, strokeWidth } = resolveIconProps(props);
114
+ const stroke = strokeProps(color, strokeWidth);
115
+
116
+ return (
117
+ <SvgIcon size={size}>
118
+ <Circle cx={12} cy={12} r={10} {...stroke} />
119
+ <Path d="M12 8v4" {...stroke} />
120
+ <Path d="M12 16h.01" {...stroke} />
121
+ </SvgIcon>
122
+ );
123
+ };
124
+
125
+ export const PersonIcon: TerraIconComponent = (props) => {
126
+ const { color, size, strokeWidth } = resolveIconProps(props);
127
+ const stroke = strokeProps(color, strokeWidth);
128
+ const iconSize = size * 0.55;
129
+
130
+ return (
131
+ <Svg width={iconSize} height={iconSize} viewBox="0 0 24 24" fill="none">
132
+ <Circle cx={12} cy={8} r={4} {...stroke} />
133
+ <Path d="M4 20c0-4 3.582-7 8-7s8 3 8 7" {...stroke} />
134
+ </Svg>
135
+ );
136
+ };
137
+
138
+ 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,
146
+ person: PersonIcon,
147
+ };
@@ -0,0 +1,13 @@
1
+ export * from './avatar';
2
+ export * from './box';
3
+ export * from './button';
4
+ export * from './header';
5
+ export * from './icon';
6
+ export * from './page-indicator';
7
+ export * from './portal';
8
+ export * from './screen';
9
+ export * from './slot';
10
+ export * from './spinner';
11
+ export * from './surface';
12
+ export * from './text';
13
+ export * from './toast';
@@ -0,0 +1,100 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+
3
+ import type { SharedValue } from 'react-native-reanimated';
4
+
5
+ import type { ColorToken } from '#theme/types';
6
+ import { DEFAULT_PAGE_INDICATOR_MAX_VISIBLE } from './utils';
7
+ import { DotIndicator } from './variants/DotIndicator';
8
+ import { PillIndicator } from './variants/PillIndicator';
9
+
10
+ export type PageIndicatorVariant = 'pill' | 'dot';
11
+
12
+ type PageIndicatorCoreProps = {
13
+ /** Number of pages represented by the indicator. */
14
+ count: number;
15
+ /**
16
+ * Active page index, or a shared value for scroll-linked motion.
17
+ * Index `0` is the first page; fractional values animate between pages.
18
+ */
19
+ current?: number | SharedValue<number>;
20
+ /** Duration for discrete `current` changes. */
21
+ duration?: number;
22
+ /** Active page color token. */
23
+ activeColor?: ColorToken;
24
+ /** Inactive page color token. */
25
+ inactiveColor?: ColorToken;
26
+ /** Stack dots vertically instead of horizontally. */
27
+ vertical?: boolean;
28
+ /**
29
+ * Maximum dots visible before the track scrolls and edge-scales.
30
+ * Defaults to `5`. Overflow scrolling is off when `count <= maxVisible`.
31
+ */
32
+ maxVisible?: number;
33
+ style?: StyleProp<ViewStyle>;
34
+ };
35
+
36
+ /** Pill indicator — active page widens into a pill. Default when `variant` is omitted. */
37
+ export type PageIndicatorPillProps = PageIndicatorCoreProps & {
38
+ variant?: 'pill';
39
+ loading?: never;
40
+ loadingColor?: never;
41
+ };
42
+
43
+ /** Dot indicator — traveling dot with optional loading ring on the active page. */
44
+ export type PageIndicatorDotProps = PageIndicatorCoreProps & {
45
+ variant: 'dot';
46
+ /** Loading ring color token. */
47
+ loadingColor?: ColorToken;
48
+ /** Renders a ring around the active dot while loading. */
49
+ loading?: boolean;
50
+ };
51
+
52
+ export type PageIndicatorProps = PageIndicatorPillProps | PageIndicatorDotProps;
53
+
54
+ export function PageIndicator(props: PageIndicatorProps) {
55
+ const {
56
+ count,
57
+ current,
58
+ duration,
59
+ activeColor,
60
+ inactiveColor,
61
+ vertical,
62
+ maxVisible = DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
63
+ style,
64
+ } = props;
65
+
66
+ if (props.variant === 'dot') {
67
+ return (
68
+ <DotIndicator
69
+ count={count}
70
+ current={current}
71
+ duration={duration}
72
+ activeColor={activeColor}
73
+ inactiveColor={inactiveColor}
74
+ loading={props.loading}
75
+ loadingColor={props.loadingColor}
76
+ vertical={vertical}
77
+ maxVisible={maxVisible}
78
+ style={style}
79
+ />
80
+ );
81
+ }
82
+
83
+ return (
84
+ <PillIndicator
85
+ count={count}
86
+ current={current}
87
+ duration={duration}
88
+ activeColor={activeColor}
89
+ inactiveColor={inactiveColor}
90
+ vertical={vertical}
91
+ maxVisible={maxVisible}
92
+ style={style}
93
+ />
94
+ );
95
+ }
96
+
97
+ export type { DotIndicatorProps } from './variants/DotIndicator';
98
+ export { DotIndicator } from './variants/DotIndicator';
99
+ export type { PillIndicatorProps } from './variants/PillIndicator';
100
+ export { PillIndicator } from './variants/PillIndicator';
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type StyleProp, View, type ViewStyle } from 'react-native';
3
+
4
+ import { pageIndicatorViewportClipStyle } from './utils';
5
+
6
+ export type PageIndicatorRootProps = {
7
+ children: ReactNode;
8
+ crossSize?: number;
9
+ overflows: boolean;
10
+ style?: StyleProp<ViewStyle>;
11
+ vertical: boolean;
12
+ viewportMainSize: number;
13
+ };
14
+
15
+ /** Non-interactive root with optional overflow clipping. */
16
+ export function PageIndicatorRoot({
17
+ children,
18
+ crossSize,
19
+ overflows,
20
+ style,
21
+ vertical,
22
+ viewportMainSize,
23
+ }: PageIndicatorRootProps) {
24
+ return (
25
+ <View pointerEvents="none" style={style}>
26
+ {overflows ? (
27
+ <View
28
+ style={pageIndicatorViewportClipStyle(
29
+ vertical,
30
+ viewportMainSize,
31
+ crossSize
32
+ )}
33
+ >
34
+ {children}
35
+ </View>
36
+ ) : (
37
+ children
38
+ )}
39
+ </View>
40
+ );
41
+ }
@@ -0,0 +1,65 @@
1
+ import { useMemo } from 'react';
2
+
3
+ import { useUnistyles } from 'react-native-unistyles';
4
+
5
+ import type { ColorToken } from '#theme/types';
6
+
7
+ import { resolveThemeColor } from '#utils/resolve-theme-color';
8
+
9
+ /** Resolved color strings for Reanimated and SVG (worklets cannot use theme tokens). */
10
+ export interface ResolvedColors {
11
+ activeColor: string;
12
+ inactiveColor: string;
13
+ loadingColor: string;
14
+ }
15
+
16
+ export type PageIndicatorColorInput = {
17
+ activeColor?: ColorToken;
18
+ inactiveColor?: ColorToken;
19
+ loadingColor?: ColorToken;
20
+ };
21
+
22
+ const DEFAULT_COLOR_TOKENS: Required<PageIndicatorColorInput> = {
23
+ activeColor: 'text.default',
24
+ inactiveColor: 'text.disabled',
25
+ loadingColor: 'text.disabled',
26
+ };
27
+
28
+ export function usePageIndicatorColors(
29
+ colors: PageIndicatorColorInput = {}
30
+ ): ResolvedColors {
31
+ const { theme } = useUnistyles();
32
+
33
+ return useMemo(
34
+ () => ({
35
+ activeColor:
36
+ resolveThemeColor(
37
+ colors.activeColor ?? DEFAULT_COLOR_TOKENS.activeColor,
38
+ theme
39
+ ) ??
40
+ (theme.color as unknown as Record<string, string | undefined>)[
41
+ 'text.default'
42
+ ] ??
43
+ '',
44
+ inactiveColor:
45
+ resolveThemeColor(
46
+ colors.inactiveColor ?? DEFAULT_COLOR_TOKENS.inactiveColor,
47
+ theme
48
+ ) ??
49
+ (theme.color as unknown as Record<string, string | undefined>)[
50
+ 'text.disabled'
51
+ ] ??
52
+ '',
53
+ loadingColor:
54
+ resolveThemeColor(
55
+ colors.loadingColor ?? DEFAULT_COLOR_TOKENS.loadingColor,
56
+ theme
57
+ ) ??
58
+ (theme.color as unknown as Record<string, string | undefined>)[
59
+ 'text.disabled'
60
+ ] ??
61
+ '',
62
+ }),
63
+ [colors.activeColor, colors.inactiveColor, colors.loadingColor, theme]
64
+ );
65
+ }
@@ -0,0 +1,34 @@
1
+ import type { SharedValue } from 'react-native-reanimated';
2
+ import { isPageIndicatorSharedValue } from '../utils';
3
+ import {
4
+ type PageIndicatorColorInput,
5
+ usePageIndicatorColors,
6
+ } from './use-page-indicator-colors';
7
+ import { usePageIndicatorProgress } from './use-page-indicator-progress';
8
+
9
+ type PageIndicatorVariant = 'pill' | 'dot';
10
+
11
+ export function usePageIndicatorCore(
12
+ count: number,
13
+ current: number | SharedValue<number>,
14
+ variant: PageIndicatorVariant,
15
+ duration: number,
16
+ colors: PageIndicatorColorInput
17
+ ) {
18
+ const scrollLinked = isPageIndicatorSharedValue(current);
19
+ const resolvedColors = usePageIndicatorColors(colors);
20
+ const { progress, pillJump } = usePageIndicatorProgress(
21
+ count,
22
+ scrollLinked ? current : undefined,
23
+ scrollLinked ? undefined : current,
24
+ variant,
25
+ duration
26
+ );
27
+
28
+ return {
29
+ colors: resolvedColors,
30
+ pillJump,
31
+ progress,
32
+ scrollLinked,
33
+ };
34
+ }
@@ -0,0 +1,122 @@
1
+ import { useEffect, useMemo } from 'react';
2
+
3
+ import type { SharedValue } from 'react-native-reanimated';
4
+ import {
5
+ cancelAnimation,
6
+ Easing,
7
+ useSharedValue,
8
+ withTiming,
9
+ } from 'react-native-reanimated';
10
+
11
+ import {
12
+ PAGE_INDICATOR_SINGLE_PAGE_DURATION,
13
+ pageIndicatorPageJumpDistance,
14
+ pageIndicatorPageJumpDuration,
15
+ } from '../utils';
16
+
17
+ function clampPageIndex(page: number, count: number): number {
18
+ if (count <= 0) return 0;
19
+ return Math.min(Math.max(page, 0), count - 1);
20
+ }
21
+
22
+ export interface PillJumpState {
23
+ active: SharedValue<boolean>;
24
+ from: SharedValue<number>;
25
+ to: SharedValue<number>;
26
+ t: SharedValue<number>;
27
+ }
28
+
29
+ /**
30
+ * Returns scroll-linked `progress` when provided; otherwise owns a shared value
31
+ * that animates toward the discrete page index.
32
+ *
33
+ * Single-step pill changes animate `progress` continuously. Multi-step pill
34
+ * jumps cross-fade only the source and target dots — intermediates stay idle.
35
+ */
36
+ export function usePageIndicatorProgress(
37
+ count: number,
38
+ progress: SharedValue<number> | undefined,
39
+ page: number | undefined,
40
+ variant: 'pill' | 'dot' = 'pill',
41
+ duration = PAGE_INDICATOR_SINGLE_PAGE_DURATION
42
+ ): { progress: SharedValue<number>; pillJump: PillJumpState } {
43
+ const internalProgress = useSharedValue(
44
+ page !== undefined ? clampPageIndex(page, count) : 0
45
+ );
46
+ const pillJumpActive = useSharedValue(false);
47
+ const pillJumpFrom = useSharedValue(0);
48
+ const pillJumpTo = useSharedValue(0);
49
+ const pillJumpT = useSharedValue(0);
50
+
51
+ const pillJump = useMemo(
52
+ () => ({
53
+ active: pillJumpActive,
54
+ from: pillJumpFrom,
55
+ to: pillJumpTo,
56
+ t: pillJumpT,
57
+ }),
58
+ [pillJumpActive, pillJumpFrom, pillJumpTo, pillJumpT]
59
+ );
60
+
61
+ useEffect(() => {
62
+ if (page === undefined) return;
63
+
64
+ const target = clampPageIndex(page, count);
65
+ const from = internalProgress.value;
66
+ const distance = pageIndicatorPageJumpDistance(from, target);
67
+
68
+ if (distance === 0) return;
69
+
70
+ cancelAnimation(internalProgress);
71
+ cancelAnimation(pillJumpT);
72
+ pillJumpActive.value = false;
73
+
74
+ if (variant === 'pill' && distance > 1) {
75
+ const jumpDuration = pageIndicatorPageJumpDuration(from, target);
76
+
77
+ internalProgress.value = from;
78
+ pillJumpFrom.value = from;
79
+ pillJumpTo.value = target;
80
+ pillJumpActive.value = true;
81
+ pillJumpT.value = 0;
82
+ pillJumpT.value = withTiming(
83
+ 1,
84
+ {
85
+ duration: jumpDuration,
86
+ easing: Easing.bezier(0.33, 0, 0.15, 1),
87
+ },
88
+ (finished) => {
89
+ 'worklet';
90
+ if (finished) {
91
+ internalProgress.value = target;
92
+ pillJumpActive.value = false;
93
+ }
94
+ }
95
+ );
96
+ return;
97
+ }
98
+
99
+ internalProgress.value = withTiming(target, {
100
+ duration:
101
+ variant === 'dot'
102
+ ? duration
103
+ : pageIndicatorPageJumpDuration(from, target),
104
+ easing: Easing.bezier(0.33, 0, 0.15, 1),
105
+ });
106
+ }, [
107
+ count,
108
+ duration,
109
+ internalProgress,
110
+ page,
111
+ pillJumpActive,
112
+ pillJumpFrom,
113
+ pillJumpT,
114
+ pillJumpTo,
115
+ variant,
116
+ ]);
117
+
118
+ return {
119
+ progress: progress ?? internalProgress,
120
+ pillJump,
121
+ };
122
+ }
@@ -0,0 +1,13 @@
1
+ export type {
2
+ DotIndicatorProps,
3
+ PageIndicatorDotProps,
4
+ PageIndicatorPillProps,
5
+ PageIndicatorProps,
6
+ PageIndicatorVariant,
7
+ PillIndicatorProps,
8
+ } from './PageIndicator';
9
+ export { DotIndicator, PageIndicator, PillIndicator } from './PageIndicator';
10
+ export {
11
+ DEFAULT_PAGE_INDICATOR_MAX_VISIBLE,
12
+ PAGE_INDICATOR_SINGLE_PAGE_DURATION,
13
+ } from './utils';