react-native-terra-ui 0.5.1 → 0.6.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 (357) hide show
  1. package/CHANGELOG.md +25 -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 +2 -2
  18. package/lib/module/components/header/parts/HeaderGradientOverlay.js.map +1 -1
  19. package/lib/module/components/header/variants/LargeTitleHeader/index.js +58 -58
  20. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  21. package/lib/module/components/header/variants/TitleHeader/index.js +27 -27
  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 +25 -25
  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/light.js +67 -67
  107. package/lib/module/theme/tokens/primitives.js +417 -417
  108. package/lib/module/utils/accent-utils.js +16 -16
  109. package/lib/module/utils/accent-utils.js.map +1 -1
  110. package/lib/module/utils/color-utils.js +3 -3
  111. package/lib/module/utils/deep-merge.js +1 -1
  112. package/lib/module/utils/resolve-theme-color.js +2 -2
  113. package/lib/module/utils/resolve-theme-color.js.map +1 -1
  114. package/lib/module/utils/typography.js +5 -5
  115. package/lib/module/utils/typography.js.map +1 -1
  116. package/lib/module/utils/unflatten.js +2 -2
  117. package/lib/typescript/src/components/avatar/Avatar.d.ts +1 -1
  118. package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
  119. package/lib/typescript/src/components/avatar/index.d.ts +2 -2
  120. package/lib/typescript/src/components/avatar/types.d.ts +7 -7
  121. package/lib/typescript/src/components/avatar/types.d.ts.map +1 -1
  122. package/lib/typescript/src/components/box/Box.d.ts +2 -2
  123. package/lib/typescript/src/components/box/Box.d.ts.map +1 -1
  124. package/lib/typescript/src/components/box/index.d.ts +3 -3
  125. package/lib/typescript/src/components/box/utils.d.ts +7 -7
  126. package/lib/typescript/src/components/box/utils.d.ts.map +1 -1
  127. package/lib/typescript/src/components/button/Button.d.ts +15 -8
  128. package/lib/typescript/src/components/button/Button.d.ts.map +1 -1
  129. package/lib/typescript/src/components/button/index.d.ts +2 -2
  130. package/lib/typescript/src/components/chip/Chip.d.ts +5 -5
  131. package/lib/typescript/src/components/chip/Chip.d.ts.map +1 -1
  132. package/lib/typescript/src/components/chip/index.d.ts +3 -3
  133. package/lib/typescript/src/components/chip/types.d.ts +3 -3
  134. package/lib/typescript/src/components/chip/utils.d.ts +1 -1
  135. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +5 -5
  136. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
  137. package/lib/typescript/src/components/empty-state/index.d.ts +3 -3
  138. package/lib/typescript/src/components/empty-state/types.d.ts +1 -1
  139. package/lib/typescript/src/components/header/Header.d.ts +2 -2
  140. package/lib/typescript/src/components/header/header-buttons.d.ts +3 -3
  141. package/lib/typescript/src/components/header/header-buttons.d.ts.map +1 -1
  142. package/lib/typescript/src/components/header/index.d.ts +6 -6
  143. package/lib/typescript/src/components/header/parts/HeaderGradientOverlay.d.ts.map +1 -1
  144. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +1 -1
  145. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  146. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +4 -4
  147. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  148. package/lib/typescript/src/components/icon/Icon.d.ts +3 -3
  149. package/lib/typescript/src/components/icon/Icon.d.ts.map +1 -1
  150. package/lib/typescript/src/components/icon/index.d.ts +2 -2
  151. package/lib/typescript/src/components/image/Image.d.ts +1 -1
  152. package/lib/typescript/src/components/image/Image.d.ts.map +1 -1
  153. package/lib/typescript/src/components/image/index.d.ts +2 -2
  154. package/lib/typescript/src/components/image/types.d.ts +1 -1
  155. package/lib/typescript/src/components/index.d.ts +17 -17
  156. package/lib/typescript/src/components/page-indicator/PageIndicator.d.ts +10 -10
  157. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts +2 -2
  158. package/lib/typescript/src/components/page-indicator/PageIndicatorRoot.d.ts.map +1 -1
  159. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts +1 -1
  160. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-colors.d.ts.map +1 -1
  161. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts +3 -3
  162. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-core.d.ts.map +1 -1
  163. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts +2 -2
  164. package/lib/typescript/src/components/page-indicator/hooks/use-page-indicator-progress.d.ts.map +1 -1
  165. package/lib/typescript/src/components/page-indicator/index.d.ts +3 -3
  166. package/lib/typescript/src/components/page-indicator/utils.d.ts +2 -2
  167. package/lib/typescript/src/components/page-indicator/utils.d.ts.map +1 -1
  168. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts +1 -1
  169. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/InactiveDot.d.ts.map +1 -1
  170. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts +2 -2
  171. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.d.ts.map +1 -1
  172. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts +2 -2
  173. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/TravelingPill.d.ts.map +1 -1
  174. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts +3 -3
  175. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/index.d.ts.map +1 -1
  176. package/lib/typescript/src/components/page-indicator/variants/DotIndicator/utils.d.ts.map +1 -1
  177. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts +2 -2
  178. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.d.ts.map +1 -1
  179. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts +3 -3
  180. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/index.d.ts.map +1 -1
  181. package/lib/typescript/src/components/page-indicator/variants/PillIndicator/utils.d.ts +1 -1
  182. package/lib/typescript/src/components/portal/Portal.d.ts +3 -3
  183. package/lib/typescript/src/components/portal/PortalContext.d.ts +1 -1
  184. package/lib/typescript/src/components/portal/PortalHost.d.ts +2 -2
  185. package/lib/typescript/src/components/portal/PortalProvider.d.ts +1 -1
  186. package/lib/typescript/src/components/portal/PortalProvider.d.ts.map +1 -1
  187. package/lib/typescript/src/components/portal/index.d.ts +7 -7
  188. package/lib/typescript/src/components/screen/Screen.d.ts +10 -10
  189. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  190. package/lib/typescript/src/components/screen/ScreenContext.d.ts +3 -3
  191. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  192. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +3 -3
  193. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  194. package/lib/typescript/src/components/screen/ScreenList.d.ts +5 -5
  195. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  196. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +5 -5
  197. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  198. package/lib/typescript/src/components/screen/index.d.ts +11 -11
  199. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +1 -1
  200. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +3 -3
  201. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
  202. package/lib/typescript/src/components/screen/types.d.ts +2 -2
  203. package/lib/typescript/src/components/screen/utils.d.ts +2 -2
  204. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  205. package/lib/typescript/src/components/slot/Slot.d.ts +2 -2
  206. package/lib/typescript/src/components/slot/Slot.d.ts.map +1 -1
  207. package/lib/typescript/src/components/slot/index.d.ts +3 -3
  208. package/lib/typescript/src/components/slot/utils.d.ts +1 -1
  209. package/lib/typescript/src/components/slot/utils.d.ts.map +1 -1
  210. package/lib/typescript/src/components/spinner/Spinner.d.ts +2 -2
  211. package/lib/typescript/src/components/spinner/Spinner.d.ts.map +1 -1
  212. package/lib/typescript/src/components/spinner/index.d.ts +2 -2
  213. package/lib/typescript/src/components/surface/Surface.d.ts +4 -4
  214. package/lib/typescript/src/components/surface/Surface.d.ts.map +1 -1
  215. package/lib/typescript/src/components/surface/index.d.ts +2 -2
  216. package/lib/typescript/src/components/text/Text.d.ts +4 -4
  217. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  218. package/lib/typescript/src/components/text/index.d.ts +2 -2
  219. package/lib/typescript/src/components/toast/Toast.d.ts +18 -18
  220. package/lib/typescript/src/components/toast/Toast.d.ts.map +1 -1
  221. package/lib/typescript/src/components/toast/ToastProvider.d.ts +1 -1
  222. package/lib/typescript/src/components/toast/ToastProvider.d.ts.map +1 -1
  223. package/lib/typescript/src/components/toast/index.d.ts +4 -4
  224. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts +3 -3
  225. package/lib/typescript/src/components/toast/parts/ToastAnimatedItem.d.ts.map +1 -1
  226. package/lib/typescript/src/components/toast/types.d.ts +10 -10
  227. package/lib/typescript/src/components/toast/types.d.ts.map +1 -1
  228. package/lib/typescript/src/components/toast/utils/controller.d.ts +2 -2
  229. package/lib/typescript/src/components/toast/utils/controller.d.ts.map +1 -1
  230. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +5 -5
  231. package/lib/typescript/src/components/toolbar/Toolbar.d.ts.map +1 -1
  232. package/lib/typescript/src/components/toolbar/index.d.ts +2 -2
  233. package/lib/typescript/src/context/ThemeProvider.d.ts +3 -3
  234. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  235. package/lib/typescript/src/context/index.d.ts +2 -2
  236. package/lib/typescript/src/index.d.ts +3 -3
  237. package/lib/typescript/src/theme/breakpoints.d.ts +2 -2
  238. package/lib/typescript/src/theme/breakpoints.d.ts.map +1 -1
  239. package/lib/typescript/src/theme/defaults/icons.d.ts +1 -1
  240. package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -1
  241. package/lib/typescript/src/theme/defaults/image.d.ts +1 -1
  242. package/lib/typescript/src/theme/defaults/image.d.ts.map +1 -1
  243. package/lib/typescript/src/theme/index.d.ts +14 -14
  244. package/lib/typescript/src/theme/registry.d.ts +2 -2
  245. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  246. package/lib/typescript/src/theme/runtime.d.ts +1 -1
  247. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  248. package/lib/typescript/src/theme/screen-margin.d.ts +2 -2
  249. package/lib/typescript/src/theme/theme.d.ts +2 -2
  250. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  251. package/lib/typescript/src/theme/tokens/dark.d.ts +67 -67
  252. package/lib/typescript/src/theme/tokens/light.d.ts +67 -67
  253. package/lib/typescript/src/theme/tokens/primitives.d.ts +417 -417
  254. package/lib/typescript/src/theme/types.d.ts +84 -84
  255. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  256. package/lib/typescript/src/utils/accent-utils.d.ts +1 -1
  257. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  258. package/lib/typescript/src/utils/resolve-theme-color.d.ts +1 -1
  259. package/lib/typescript/src/utils/resolve-theme-color.d.ts.map +1 -1
  260. package/lib/typescript/src/utils/typography.d.ts +2 -2
  261. package/lib/typescript/src/utils/typography.d.ts.map +1 -1
  262. package/package.json +1 -1
  263. package/src/components/avatar/Avatar.tsx +66 -71
  264. package/src/components/avatar/index.ts +2 -2
  265. package/src/components/avatar/types.ts +7 -12
  266. package/src/components/box/Box.tsx +7 -18
  267. package/src/components/box/index.ts +3 -3
  268. package/src/components/box/utils.ts +59 -81
  269. package/src/components/button/Button.tsx +119 -144
  270. package/src/components/button/index.ts +2 -2
  271. package/src/components/chip/Chip.tsx +107 -143
  272. package/src/components/chip/index.ts +3 -3
  273. package/src/components/chip/types.ts +7 -7
  274. package/src/components/chip/utils.ts +5 -5
  275. package/src/components/empty-state/EmptyState.tsx +44 -60
  276. package/src/components/empty-state/index.ts +3 -3
  277. package/src/components/empty-state/types.ts +1 -1
  278. package/src/components/header/Header.ts +2 -2
  279. package/src/components/header/header-buttons.tsx +10 -18
  280. package/src/components/header/index.ts +6 -6
  281. package/src/components/header/parts/HeaderGradientOverlay.tsx +3 -7
  282. package/src/components/header/variants/LargeTitleHeader/index.tsx +75 -139
  283. package/src/components/header/variants/TitleHeader/index.tsx +40 -62
  284. package/src/components/icon/Icon.tsx +31 -39
  285. package/src/components/icon/index.ts +2 -2
  286. package/src/components/image/Image.tsx +12 -10
  287. package/src/components/image/index.ts +2 -2
  288. package/src/components/image/types.ts +1 -1
  289. package/src/components/index.ts +17 -17
  290. package/src/components/page-indicator/PageIndicator.tsx +14 -14
  291. package/src/components/page-indicator/PageIndicatorRoot.tsx +4 -12
  292. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +17 -35
  293. package/src/components/page-indicator/hooks/use-page-indicator-core.ts +6 -8
  294. package/src/components/page-indicator/hooks/use-page-indicator-progress.ts +10 -30
  295. package/src/components/page-indicator/index.ts +3 -3
  296. package/src/components/page-indicator/utils.ts +20 -48
  297. package/src/components/page-indicator/variants/DotIndicator/InactiveDot.tsx +5 -16
  298. package/src/components/page-indicator/variants/DotIndicator/LoadingOrbit.tsx +21 -63
  299. package/src/components/page-indicator/variants/DotIndicator/TravelingPill.tsx +6 -16
  300. package/src/components/page-indicator/variants/DotIndicator/index.tsx +20 -38
  301. package/src/components/page-indicator/variants/DotIndicator/utils.ts +2 -6
  302. package/src/components/page-indicator/variants/PillIndicator/PillIndicatorDot.tsx +12 -50
  303. package/src/components/page-indicator/variants/PillIndicator/index.tsx +19 -41
  304. package/src/components/page-indicator/variants/PillIndicator/utils.ts +4 -4
  305. package/src/components/portal/Portal.tsx +4 -4
  306. package/src/components/portal/PortalContext.tsx +1 -1
  307. package/src/components/portal/PortalHost.tsx +4 -4
  308. package/src/components/portal/PortalProvider.tsx +24 -35
  309. package/src/components/portal/index.ts +7 -7
  310. package/src/components/screen/Screen.tsx +45 -52
  311. package/src/components/screen/ScreenContext.tsx +8 -17
  312. package/src/components/screen/ScreenFlatList.tsx +17 -36
  313. package/src/components/screen/ScreenList.tsx +31 -63
  314. package/src/components/screen/ScreenScrollView.tsx +17 -30
  315. package/src/components/screen/index.ts +11 -11
  316. package/src/components/screen/parts/BottomSafeArea.tsx +5 -6
  317. package/src/components/screen/parts/ScreenPlaceholder.tsx +9 -14
  318. package/src/components/screen/types.ts +2 -2
  319. package/src/components/screen/utils.ts +6 -19
  320. package/src/components/slot/Slot.tsx +5 -20
  321. package/src/components/slot/index.ts +3 -3
  322. package/src/components/slot/utils.ts +5 -8
  323. package/src/components/spinner/Spinner.tsx +19 -52
  324. package/src/components/spinner/index.ts +2 -2
  325. package/src/components/surface/Surface.tsx +34 -43
  326. package/src/components/surface/index.ts +2 -2
  327. package/src/components/text/Text.tsx +75 -85
  328. package/src/components/text/index.ts +2 -2
  329. package/src/components/toast/Toast.tsx +195 -251
  330. package/src/components/toast/ToastProvider.tsx +61 -136
  331. package/src/components/toast/index.ts +4 -4
  332. package/src/components/toast/parts/ToastAnimatedItem.tsx +14 -22
  333. package/src/components/toast/types.ts +11 -14
  334. package/src/components/toast/utils/controller.ts +4 -6
  335. package/src/components/toolbar/Toolbar.tsx +42 -61
  336. package/src/components/toolbar/index.ts +2 -2
  337. package/src/context/ThemeProvider.tsx +13 -28
  338. package/src/context/index.ts +2 -2
  339. package/src/index.tsx +3 -3
  340. package/src/theme/breakpoints.ts +3 -5
  341. package/src/theme/defaults/icons.tsx +15 -30
  342. package/src/theme/defaults/image.tsx +9 -14
  343. package/src/theme/index.ts +14 -14
  344. package/src/theme/registry.ts +30 -49
  345. package/src/theme/runtime.ts +6 -7
  346. package/src/theme/screen-margin.ts +3 -3
  347. package/src/theme/theme.ts +39 -60
  348. package/src/theme/tokens/dark.ts +67 -67
  349. package/src/theme/tokens/light.ts +67 -67
  350. package/src/theme/tokens/primitives.ts +417 -417
  351. package/src/theme/types.ts +123 -135
  352. package/src/utils/accent-utils.ts +21 -30
  353. package/src/utils/color-utils.ts +3 -3
  354. package/src/utils/deep-merge.ts +1 -1
  355. package/src/utils/resolve-theme-color.ts +8 -11
  356. package/src/utils/typography.ts +7 -10
  357. package/src/utils/unflatten.ts +2 -2
@@ -1,22 +1,11 @@
1
- import {
2
- createContext,
3
- useCallback,
4
- useContext,
5
- useEffect,
6
- useMemo,
7
- useReducer,
8
- useRef,
9
- } from 'react';
10
- import { Keyboard, Platform } from 'react-native';
11
-
12
- import Animated, {
13
- useAnimatedStyle,
14
- useSharedValue,
15
- withTiming,
16
- } from 'react-native-reanimated';
17
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
18
- import { ToastAnimatedItem } from './parts/ToastAnimatedItem';
19
- import { DefaultToast } from './Toast';
1
+ import { createContext, useCallback, useContext, useEffect, useMemo, useReducer, useRef } from "react";
2
+ import { Keyboard, Platform } from "react-native";
3
+
4
+ import Animated, { useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
5
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
6
+
7
+ import { ToastAnimatedItem } from "./parts/ToastAnimatedItem";
8
+ import { DefaultToast } from "./Toast";
20
9
  import type {
21
10
  ToastComponentProps,
22
11
  ToastDuration,
@@ -28,14 +17,14 @@ import type {
28
17
  ToastShowConfig,
29
18
  ToastShowOptions,
30
19
  ToastShowOptionsWithComponent,
31
- } from './types';
32
- import { setToastManager } from './utils/controller';
20
+ } from "./types";
21
+ import { setToastManager } from "./utils/controller";
33
22
 
34
23
  type ToastAction =
35
- | { type: 'show'; item: ToastItem }
36
- | { type: 'hide'; ids: ToastId[] }
37
- | { type: 'hideAll' }
38
- | { type: 'hidePlacement'; placement: ToastPlacement };
24
+ | { type: "show"; item: ToastItem }
25
+ | { type: "hide"; ids: ToastId[] }
26
+ | { type: "hideAll" }
27
+ | { type: "hidePlacement"; placement: ToastPlacement };
39
28
 
40
29
  const DEFAULT_DURATION = 4000;
41
30
  const DEFAULT_MAX_VISIBLE_TOASTS = 3;
@@ -44,24 +33,18 @@ const ToastManagerContext = createContext<ToastManager | null>(null);
44
33
 
45
34
  function toastReducer(state: ToastItem[], action: ToastAction): ToastItem[] {
46
35
  switch (action.type) {
47
- case 'show':
48
- return [
49
- ...state.filter((toast) => toast.id !== action.item.id),
50
- action.item,
51
- ];
52
- case 'hide':
36
+ case "show":
37
+ return [...state.filter((toast) => toast.id !== action.item.id), action.item];
38
+ case "hide":
53
39
  return state.filter((toast) => !action.ids.some((id) => id === toast.id));
54
- case 'hideAll':
40
+ case "hideAll":
55
41
  return [];
56
- case 'hidePlacement':
42
+ case "hidePlacement":
57
43
  return state.filter((toast) => toast.placement !== action.placement);
58
44
  }
59
45
  }
60
46
 
61
- function createDefaultToastComponent(
62
- config: ToastShowConfig,
63
- manager: ToastManager
64
- ) {
47
+ function createDefaultToastComponent(config: ToastShowConfig, manager: ToastManager) {
65
48
  return ({ id, hide }: ToastComponentProps) => (
66
49
  <DefaultToast
67
50
  id={id}
@@ -77,25 +60,15 @@ function createDefaultToastComponent(
77
60
  );
78
61
  }
79
62
 
80
- function isCustomToast(
81
- options: ToastShowOptions
82
- ): options is ToastShowOptionsWithComponent {
83
- return (
84
- typeof options === 'object' && options !== null && 'component' in options
85
- );
63
+ function isCustomToast(options: ToastShowOptions): options is ToastShowOptionsWithComponent {
64
+ return typeof options === "object" && options !== null && "component" in options;
86
65
  }
87
66
 
88
- function normalizePlacement(
89
- placement: ToastPlacement | undefined,
90
- fallback: ToastPlacement
91
- ): ToastPlacement {
67
+ function normalizePlacement(placement: ToastPlacement | undefined, fallback: ToastPlacement): ToastPlacement {
92
68
  return placement ?? fallback;
93
69
  }
94
70
 
95
- function normalizeDuration(
96
- duration: ToastDuration | undefined,
97
- fallback: number
98
- ): ToastDuration {
71
+ function normalizeDuration(duration: ToastDuration | undefined, fallback: number): ToastDuration {
99
72
  return duration ?? fallback;
100
73
  }
101
74
 
@@ -105,7 +78,7 @@ function toastId(counter: number): ToastId {
105
78
 
106
79
  export function ToastProvider({
107
80
  children,
108
- defaultPlacement = 'top',
81
+ defaultPlacement = "top",
109
82
  defaultDuration = DEFAULT_DURATION,
110
83
  maxVisibleToasts = DEFAULT_MAX_VISIBLE_TOASTS,
111
84
  offset,
@@ -113,9 +86,7 @@ export function ToastProvider({
113
86
  const [toasts, dispatch] = useReducer(toastReducer, []);
114
87
  const toastsRef = useRef<ToastItem[]>([]);
115
88
  const counterRef = useRef(0);
116
- const timeoutsRef = useRef<Map<ToastId, ReturnType<typeof setTimeout>>>(
117
- new Map()
118
- );
89
+ const timeoutsRef = useRef<Map<ToastId, ReturnType<typeof setTimeout>>>(new Map());
119
90
 
120
91
  useEffect(() => {
121
92
  toastsRef.current = toasts;
@@ -127,26 +98,19 @@ export function ToastProvider({
127
98
  timeoutsRef.current.delete(id);
128
99
  }, []);
129
100
 
130
- const hide = useCallback<ToastManager['hide']>(
101
+ const hide = useCallback<ToastManager["hide"]>(
131
102
  (id) => {
132
- if (id === 'all') {
103
+ if (id === "all") {
133
104
  for (const toast of toastsRef.current) {
134
105
  clearToastTimeout(toast.id);
135
106
  toast.onHide?.();
136
107
  }
137
108
  toastsRef.current = [];
138
- dispatch({ type: 'hideAll' });
109
+ dispatch({ type: "hideAll" });
139
110
  return;
140
111
  }
141
112
  const lastToastId = toastsRef.current[toastsRef.current.length - 1]?.id;
142
- const ids =
143
- id === undefined
144
- ? lastToastId
145
- ? [lastToastId]
146
- : []
147
- : Array.isArray(id)
148
- ? id
149
- : [id];
113
+ const ids = id === undefined ? (lastToastId ? [lastToastId] : []) : Array.isArray(id) ? id : [id];
150
114
 
151
115
  if (ids.length === 0) return;
152
116
 
@@ -154,34 +118,29 @@ export function ToastProvider({
154
118
  clearToastTimeout(toastId);
155
119
  toastsRef.current.find((toast) => toast.id === toastId)?.onHide?.();
156
120
  }
157
- toastsRef.current = toastsRef.current.filter(
158
- (toast) => !ids.some((toastId) => toastId === toast.id)
159
- );
160
- dispatch({ type: 'hide', ids });
121
+ toastsRef.current = toastsRef.current.filter((toast) => !ids.some((toastId) => toastId === toast.id));
122
+ dispatch({ type: "hide", ids });
161
123
  },
162
124
  [clearToastTimeout]
163
125
  );
164
126
 
165
127
  const managerRef = useRef<ToastManager>({
166
- show: () => '',
128
+ show: () => "",
167
129
  hide,
168
130
  });
169
131
 
170
- const show = useCallback<ToastManager['show']>(
132
+ const show = useCallback<ToastManager["show"]>(
171
133
  (options) => {
172
134
  const nextId =
173
- typeof options === 'object' && options !== null && 'id' in options
135
+ typeof options === "object" && options !== null && "id" in options
174
136
  ? (options.id ?? toastId(counterRef.current++))
175
137
  : toastId(counterRef.current++);
176
138
 
177
139
  const item =
178
- typeof options === 'string'
140
+ typeof options === "string"
179
141
  ? {
180
142
  id: nextId,
181
- component: createDefaultToastComponent(
182
- { label: options },
183
- managerRef.current
184
- ),
143
+ component: createDefaultToastComponent({ label: options }, managerRef.current),
185
144
  duration: defaultDuration,
186
145
  placement: defaultPlacement,
187
146
  }
@@ -190,60 +149,36 @@ export function ToastProvider({
190
149
  id: nextId,
191
150
  component: options.component,
192
151
  duration: normalizeDuration(options.duration, defaultDuration),
193
- placement: normalizePlacement(
194
- options.placement,
195
- defaultPlacement
196
- ),
152
+ placement: normalizePlacement(options.placement, defaultPlacement),
197
153
  onHide: options.onHide,
198
154
  }
199
155
  : {
200
156
  id: nextId,
201
- component: createDefaultToastComponent(
202
- options,
203
- managerRef.current
204
- ),
157
+ component: createDefaultToastComponent(options, managerRef.current),
205
158
  duration: normalizeDuration(options.duration, defaultDuration),
206
- placement: normalizePlacement(
207
- options.placement,
208
- defaultPlacement
209
- ),
159
+ placement: normalizePlacement(options.placement, defaultPlacement),
210
160
  onHide: options.onHide,
211
161
  };
212
162
 
213
- const oppositePlacement = item.placement === 'top' ? 'bottom' : 'top';
214
- const oppositeToasts = toastsRef.current.filter(
215
- (t) => t.placement === oppositePlacement
216
- );
163
+ const oppositePlacement = item.placement === "top" ? "bottom" : "top";
164
+ const oppositeToasts = toastsRef.current.filter((t) => t.placement === oppositePlacement);
217
165
  if (oppositeToasts.length > 0) {
218
166
  for (const t of oppositeToasts) {
219
167
  clearToastTimeout(t.id);
220
168
  t.onHide?.();
221
169
  }
222
- toastsRef.current = toastsRef.current.filter(
223
- (t) => t.placement !== oppositePlacement
224
- );
225
- dispatch({ type: 'hidePlacement', placement: oppositePlacement });
170
+ toastsRef.current = toastsRef.current.filter((t) => t.placement !== oppositePlacement);
171
+ dispatch({ type: "hidePlacement", placement: oppositePlacement });
226
172
  }
227
173
 
228
174
  clearToastTimeout(item.id);
229
- toastsRef.current = [
230
- ...toastsRef.current.filter((toast) => toast.id !== item.id),
231
- item,
232
- ];
233
- dispatch({ type: 'show', item });
234
- if (
235
- typeof options === 'object' &&
236
- options !== null &&
237
- 'onShow' in options
238
- ) {
175
+ toastsRef.current = [...toastsRef.current.filter((toast) => toast.id !== item.id), item];
176
+ dispatch({ type: "show", item });
177
+ if (typeof options === "object" && options !== null && "onShow" in options) {
239
178
  options.onShow?.();
240
179
  }
241
180
 
242
- if (
243
- item.duration !== 'persistent' &&
244
- Number.isFinite(item.duration) &&
245
- item.duration > 0
246
- ) {
181
+ if (item.duration !== "persistent" && Number.isFinite(item.duration) && item.duration > 0) {
247
182
  const timeout = setTimeout(() => hide(item.id), item.duration);
248
183
  timeoutsRef.current.set(item.id, timeout);
249
184
  }
@@ -267,8 +202,8 @@ export function ToastProvider({
267
202
  };
268
203
  }, [manager]);
269
204
 
270
- const topToasts = toasts.filter((toast) => toast.placement === 'top');
271
- const bottomToasts = toasts.filter((toast) => toast.placement === 'bottom');
205
+ const topToasts = toasts.filter((toast) => toast.placement === "top");
206
+ const bottomToasts = toasts.filter((toast) => toast.placement === "bottom");
272
207
 
273
208
  return (
274
209
  <ToastManagerContext.Provider value={manager}>
@@ -296,32 +231,22 @@ interface ToastViewportProps {
296
231
  toasts: ToastItem[];
297
232
  manager: ToastManager;
298
233
  maxVisibleToasts: number;
299
- offset?: ToastProviderProps['offset'];
234
+ offset?: ToastProviderProps["offset"];
300
235
  }
301
236
 
302
- function ToastViewport({
303
- placement,
304
- toasts,
305
- manager,
306
- maxVisibleToasts,
307
- offset,
308
- }: ToastViewportProps) {
237
+ function ToastViewport({ placement, toasts, manager, maxVisibleToasts, offset }: ToastViewportProps) {
309
238
  const safeAreaInsets = useSafeAreaInsets();
310
239
  const heights = useSharedValue<Record<ToastId, number>>({});
311
240
  const total = useSharedValue(0);
312
241
  const keyboardHeight = useSharedValue(0);
313
242
 
314
- const baseBottom =
315
- offset?.bottom ?? safeAreaInsets.bottom + (Platform.OS === 'ios' ? 6 : 12);
316
- const baseTop =
317
- offset?.top ?? safeAreaInsets.top + (Platform.OS === 'ios' ? 0 : 12);
243
+ const baseBottom = offset?.bottom ?? safeAreaInsets.bottom + (Platform.OS === "ios" ? 6 : 12);
244
+ const baseTop = offset?.top ?? safeAreaInsets.top + (Platform.OS === "ios" ? 0 : 12);
318
245
 
319
246
  useEffect(() => {
320
- if (placement !== 'bottom') return;
321
- const showEvent =
322
- Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
323
- const hideEvent =
324
- Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
247
+ if (placement !== "bottom") return;
248
+ const showEvent = Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow";
249
+ const hideEvent = Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide";
325
250
  const showSub = Keyboard.addListener(showEvent, (e) => {
326
251
  keyboardHeight.value = withTiming(e.endCoordinates.height);
327
252
  });
@@ -334,10 +259,10 @@ function ToastViewport({
334
259
  };
335
260
  }, [keyboardHeight, placement]);
336
261
 
337
- const gap = Platform.OS === 'ios' ? 6 : 12;
262
+ const gap = Platform.OS === "ios" ? 6 : 12;
338
263
 
339
264
  const keyboardStyle = useAnimatedStyle(() => {
340
- if (placement === 'top') return { top: baseTop };
265
+ if (placement === "top") return { top: baseTop };
341
266
  if (keyboardHeight.value > 0) {
342
267
  return { bottom: keyboardHeight.value + gap };
343
268
  }
@@ -363,7 +288,7 @@ function ToastViewport({
363
288
  pointerEvents="box-none"
364
289
  style={[
365
290
  {
366
- position: 'absolute',
291
+ position: "absolute",
367
292
  zIndex: 9999,
368
293
  elevation: 9999,
369
294
  left: offset?.left ?? safeAreaInsets.left + 12,
@@ -397,7 +322,7 @@ function ToastViewport({
397
322
  export function useToast(): ToastManager {
398
323
  const manager = useContext(ToastManagerContext);
399
324
  if (!manager) {
400
- throw new Error('useToast must be used within <TerraUIProvider>.');
325
+ throw new Error("useToast must be used within <TerraUIProvider>.");
401
326
  }
402
327
  return manager;
403
328
  }
@@ -8,9 +8,9 @@ export type {
8
8
  ToastProps,
9
9
  ToastTitleProps,
10
10
  ToastVariant,
11
- } from './Toast';
12
- export { DefaultToast, Toast } from './Toast';
13
- export { ToastProvider, useToast } from './ToastProvider';
11
+ } from "./Toast";
12
+ export { DefaultToast, Toast } from "./Toast";
13
+ export { ToastProvider, useToast } from "./ToastProvider";
14
14
  export type {
15
15
  ToastActionHelpers,
16
16
  ToastComponentProps,
@@ -23,4 +23,4 @@ export type {
23
23
  ToastShowConfig,
24
24
  ToastShowOptions,
25
25
  ToastShowOptionsWithComponent,
26
- } from './types';
26
+ } from "./types";
@@ -1,5 +1,5 @@
1
- import type { ReactElement } from 'react';
2
- import { StyleSheet, View } from 'react-native';
1
+ import type { ReactElement } from "react";
2
+ import { StyleSheet, View } from "react-native";
3
3
 
4
4
  import Animated, {
5
5
  Easing,
@@ -10,9 +10,9 @@ import Animated, {
10
10
  useAnimatedStyle,
11
11
  withSpring,
12
12
  withTiming,
13
- } from 'react-native-reanimated';
13
+ } from "react-native-reanimated";
14
14
 
15
- import type { ToastId, ToastPlacement } from '../types';
15
+ import type { ToastId, ToastPlacement } from "../types";
16
16
 
17
17
  export interface ToastAnimatedItemProps {
18
18
  children: ReactElement;
@@ -91,17 +91,12 @@ export function ToastAnimatedItem({
91
91
  const containerStyle = useAnimatedStyle(() => {
92
92
  const heightEntries = Object.entries(heights.value);
93
93
  const lastToastId = heightEntries[heightEntries.length - 1]?.[0];
94
- const lastToastHeight = lastToastId
95
- ? heights.value[lastToastId]
96
- : undefined;
94
+ const lastToastHeight = lastToastId ? heights.value[lastToastId] : undefined;
97
95
  const totalValue = total.value;
98
- const sign = placement === 'top' ? 1 : -1;
96
+ const sign = placement === "top" ? 1 : -1;
99
97
 
100
98
  const inputRange = [totalValue - 1, totalValue - 2];
101
- const opacityInputRange = [
102
- totalValue - maxVisibleToasts,
103
- totalValue - maxVisibleToasts - 1,
104
- ];
99
+ const opacityInputRange = [totalValue - maxVisibleToasts, totalValue - maxVisibleToasts - 1];
105
100
 
106
101
  const opacity = interpolate(index, opacityInputRange, opacityValue);
107
102
  const translateY = interpolate(
@@ -122,7 +117,7 @@ export function ToastAnimatedItem({
122
117
  mass: 3,
123
118
  })
124
119
  : undefined,
125
- pointerEvents: opacity === 0 ? 'none' : 'auto',
120
+ pointerEvents: opacity === 0 ? "none" : "auto",
126
121
  opacity: withTiming(opacity, opacityTimingConfig),
127
122
  transform: [
128
123
  { translateY: withTiming(translateY, translateYTimingConfig) },
@@ -134,13 +129,10 @@ export function ToastAnimatedItem({
134
129
 
135
130
  return (
136
131
  <Animated.View
137
- entering={placement === 'top' ? enteringTop : enteringBottom}
138
- exiting={placement === 'top' ? exitingTop : exitingBottom}
132
+ entering={placement === "top" ? enteringTop : enteringBottom}
133
+ exiting={placement === "top" ? exitingTop : exitingBottom}
139
134
  pointerEvents="box-none"
140
- style={[
141
- styles.position,
142
- placement === 'top' ? styles.top : styles.bottom,
143
- ]}
135
+ style={[styles.position, placement === "top" ? styles.top : styles.bottom]}
144
136
  >
145
137
  <Animated.View style={containerStyle}>{children}</Animated.View>
146
138
  <View
@@ -157,7 +149,7 @@ export function ToastAnimatedItem({
157
149
  };
158
150
  }}
159
151
  >
160
- {process.env.NODE_ENV === 'test' ? null : children}
152
+ {process.env.NODE_ENV === "test" ? null : children}
161
153
  </View>
162
154
  </Animated.View>
163
155
  );
@@ -165,7 +157,7 @@ export function ToastAnimatedItem({
165
157
 
166
158
  const styles = StyleSheet.create({
167
159
  position: {
168
- position: 'absolute',
160
+ position: "absolute",
169
161
  left: 0,
170
162
  right: 0,
171
163
  },
@@ -176,7 +168,7 @@ const styles = StyleSheet.create({
176
168
  bottom: 0,
177
169
  },
178
170
  measurement: {
179
- position: 'absolute',
171
+ position: "absolute",
180
172
  left: 0,
181
173
  right: 0,
182
174
  opacity: 0,
@@ -1,17 +1,17 @@
1
- import type { ReactElement, ReactNode } from 'react';
1
+ import type { ReactElement, ReactNode } from "react";
2
2
 
3
- import type { ToastProps, ToastVariant } from './Toast';
3
+ import type { ToastProps, ToastVariant } from "./Toast";
4
4
 
5
5
  export type ToastId = string;
6
- export type ToastDuration = number | 'persistent';
7
- export type ToastPlacement = 'top' | 'bottom';
6
+ export type ToastDuration = number | "persistent";
7
+ export type ToastPlacement = "top" | "bottom";
8
8
 
9
9
  export interface ToastActionHelpers {
10
- show: ToastManager['show'];
11
- hide: ToastManager['hide'];
10
+ show: ToastManager["show"];
11
+ hide: ToastManager["hide"];
12
12
  }
13
13
 
14
- export interface ToastShowConfig extends Pick<ToastProps, 'variant'> {
14
+ export interface ToastShowConfig extends Pick<ToastProps, "variant"> {
15
15
  id?: ToastId;
16
16
  label?: ReactNode;
17
17
  description?: ReactNode;
@@ -28,8 +28,8 @@ export interface ToastShowConfig extends Pick<ToastProps, 'variant'> {
28
28
  export interface ToastComponentProps {
29
29
  id: ToastId;
30
30
  index: number;
31
- hide: ToastManager['hide'];
32
- show: ToastManager['show'];
31
+ hide: ToastManager["hide"];
32
+ show: ToastManager["show"];
33
33
  }
34
34
 
35
35
  export interface ToastShowOptionsWithComponent {
@@ -41,10 +41,7 @@ export interface ToastShowOptionsWithComponent {
41
41
  onHide?: () => void;
42
42
  }
43
43
 
44
- export type ToastShowOptions =
45
- | ToastShowConfig
46
- | ToastShowOptionsWithComponent
47
- | string;
44
+ export type ToastShowOptions = ToastShowConfig | ToastShowOptionsWithComponent | string;
48
45
 
49
46
  export interface ToastItem {
50
47
  id: ToastId;
@@ -56,7 +53,7 @@ export interface ToastItem {
56
53
 
57
54
  export interface ToastManager {
58
55
  show: (options: ToastShowOptions) => ToastId;
59
- hide: (id?: ToastId | ToastId[] | 'all') => void;
56
+ hide: (id?: ToastId | ToastId[] | "all") => void;
60
57
  }
61
58
 
62
59
  export interface ToastProviderProps {
@@ -1,4 +1,4 @@
1
- import type { ToastId, ToastManager, ToastShowOptions } from '../types';
1
+ import type { ToastId, ToastManager, ToastShowOptions } from "../types";
2
2
 
3
3
  let activeManager: ToastManager | null = null;
4
4
 
@@ -9,15 +9,13 @@ export function setToastManager(manager: ToastManager | null): void {
9
9
  export function showToast(options: ToastShowOptions): ToastId {
10
10
  if (!activeManager) {
11
11
  if (__DEV__) {
12
- console.warn(
13
- '[react-native-terra-ui] Toast.show() called before <TerraUIProvider> mounted.'
14
- );
12
+ console.warn("[react-native-terra-ui] Toast.show() called before <TerraUIProvider> mounted.");
15
13
  }
16
- return '';
14
+ return "";
17
15
  }
18
16
  return activeManager.show(options);
19
17
  }
20
18
 
21
- export function hideToast(id?: ToastId | ToastId[] | 'all'): void {
19
+ export function hideToast(id?: ToastId | ToastId[] | "all"): void {
22
20
  activeManager?.hide(id);
23
21
  }