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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/earthlin9/react-native-terra-ui/compare/v0.5.1...v0.6.0) (2026-09-03)
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * **ui:** Box's `bg` style-prop is renamed to `background` for
8
+ clarity and consistency with the rest of the token-prop API. Surface
9
+ (built on Box) and the showcase screens that used `bg` are updated to
10
+ match.
11
+ * **ui:** Button's sm/md/lg sizes now set a fixed `height`
12
+ (36/44/52) instead of `minHeight`, so content taller than that height
13
+ is clipped/centered instead of growing the button. `compact` continues
14
+ to opt out of the fixed height.
15
+
16
+ Also adds a `background` prop that overrides the variant's resolved
17
+ background color (theme token or raw CSS literal); the label/icon/
18
+ spinner foreground auto-picks light or dark for contrast. `border`/
19
+ `borderWidth` still come from `variant`.
20
+ * **ui:** Screen's `bg` prop is renamed to `background`,
21
+ matching Box's rename for consistency across the library's color-prop
22
+ naming.
23
+
24
+ ### Features
25
+
26
+ * **ui:** fixed button height, background override, bg→background rename ([#13](https://github.com/earthlin9/react-native-terra-ui/issues/13)) ([22df267](https://github.com/earthlin9/react-native-terra-ui/commit/22df2674bacc6f03f92bb2945894e566f6f1673f))
27
+
3
28
  ## [0.5.1](https://github.com/earthlin9/react-native-terra-ui/compare/v0.5.0...v0.5.1) (2026-08-30)
4
29
 
5
30
  ### Bug Fixes
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { View } from "react-native-unistyles/components/native/View";
4
4
  import { Text } from "react-native-unistyles/components/native/Text";
5
- import { useState } from 'react';
6
- import { StyleSheet, useUnistyles } from 'react-native-unistyles';
5
+ import { useState } from "react";
6
+ import { StyleSheet, useUnistyles } from "react-native-unistyles";
7
7
  import { Icon } from "../icon/index.js";
8
8
  import { Image } from "../image/index.js";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -23,13 +23,13 @@ const INITIALS_FONT_SIZE = {
23
23
  };
24
24
  function getInitials(name) {
25
25
  const parts = name.trim().split(/\s+/);
26
- const first = parts[0]?.[0] ?? '';
27
- const last = parts.length > 1 ? parts[parts.length - 1]?.[0] ?? '' : '';
26
+ const first = parts[0]?.[0] ?? "";
27
+ const last = parts.length > 1 ? parts[parts.length - 1]?.[0] ?? "" : "";
28
28
  return (first + last).toUpperCase();
29
29
  }
30
30
  function getBorderRadius(shape, sizePx, radiusMd) {
31
- if (shape === 'circle') return sizePx / 2;
32
- if (shape === 'rounded') return radiusMd;
31
+ if (shape === "circle") return sizePx / 2;
32
+ if (shape === "rounded") return radiusMd;
33
33
  return 0;
34
34
  }
35
35
 
@@ -38,19 +38,19 @@ function getBorderRadius(shape, sizePx, radiusMd) {
38
38
  // `'full'` (theme.radius.full) clamps to a circle at any size, same as the
39
39
  // container's computed `sizePx / 2`.
40
40
  function getImageRadius(shape) {
41
- if (shape === 'circle') return 'full';
42
- if (shape === 'rounded') return 'md';
43
- return 'none';
41
+ if (shape === "circle") return "full";
42
+ if (shape === "rounded") return "md";
43
+ return "none";
44
44
  }
45
45
  export function Avatar({
46
- size = 'md',
47
- shape = 'circle',
46
+ size = "md",
47
+ shape = "circle",
48
48
  source,
49
49
  name,
50
50
  fallback,
51
- contentFit = 'cover',
52
- color = 'secondary',
53
- variant = 'solid',
51
+ contentFit = "cover",
52
+ color = "secondary",
53
+ variant = "solid",
54
54
  style,
55
55
  ...rest
56
56
  }) {
@@ -67,12 +67,12 @@ export function Avatar({
67
67
  const sizePx = SIZE_PX[size];
68
68
  const borderRadius = getBorderRadius(shape, sizePx, theme.radius.md);
69
69
  const showFallback = !source || hasError;
70
- const bg = styles.base.backgroundColor ?? '';
71
- const fg = styles.base.color ?? '';
70
+ const bg = styles.base.backgroundColor ?? "";
71
+ const fg = styles.base.color ?? "";
72
72
  const fallbackContent = fallback !== undefined ? fallback : name ? /*#__PURE__*/_jsx(Text, {
73
73
  style: {
74
74
  fontSize: INITIALS_FONT_SIZE[size],
75
- fontWeight: '600',
75
+ fontWeight: "600",
76
76
  color: fg,
77
77
  includeFontPadding: false
78
78
  },
@@ -90,9 +90,9 @@ export function Avatar({
90
90
  height: sizePx,
91
91
  borderRadius,
92
92
  backgroundColor: bg,
93
- alignItems: 'center',
94
- justifyContent: 'center',
95
- overflow: 'hidden'
93
+ alignItems: "center",
94
+ justifyContent: "center",
95
+ overflow: "hidden"
96
96
  }, style],
97
97
  children: showFallback ? fallbackContent : /*#__PURE__*/_jsx(Image, {
98
98
  source: source,
@@ -132,74 +132,74 @@ const styles = StyleSheet.create(theme => {
132
132
  }
133
133
  },
134
134
  compoundVariants: [{
135
- color: 'secondary',
136
- variant: 'solid',
135
+ color: "secondary",
136
+ variant: "solid",
137
137
  styles: {
138
- backgroundColor: c['action.bg.secondary'],
139
- color: c['action.fg.secondary']
138
+ backgroundColor: c["action.bg.secondary"],
139
+ color: c["action.fg.secondary"]
140
140
  }
141
141
  }, {
142
- color: 'secondary',
143
- variant: 'soft',
142
+ color: "secondary",
143
+ variant: "soft",
144
144
  styles: {
145
- backgroundColor: c['action.bg.secondary.subtle'],
146
- color: c['action.fg.secondary.subtle']
145
+ backgroundColor: c["action.bg.secondary.subtle"],
146
+ color: c["action.fg.secondary.subtle"]
147
147
  }
148
148
  }, {
149
- color: 'primary',
150
- variant: 'solid',
149
+ color: "primary",
150
+ variant: "solid",
151
151
  styles: {
152
- backgroundColor: c['action.bg.primary'],
153
- color: c['action.fg.primary']
152
+ backgroundColor: c["action.bg.primary"],
153
+ color: c["action.fg.primary"]
154
154
  }
155
155
  }, {
156
- color: 'primary',
157
- variant: 'soft',
156
+ color: "primary",
157
+ variant: "soft",
158
158
  styles: {
159
- backgroundColor: c['action.bg.primary.subtle'],
160
- color: c['action.fg.primary.subtle']
159
+ backgroundColor: c["action.bg.primary.subtle"],
160
+ color: c["action.fg.primary.subtle"]
161
161
  }
162
162
  }, {
163
- color: 'success',
164
- variant: 'solid',
163
+ color: "success",
164
+ variant: "solid",
165
165
  styles: {
166
- backgroundColor: c['status.success.bg'],
167
- color: c['status.success.fg']
166
+ backgroundColor: c["status.success.bg"],
167
+ color: c["status.success.fg"]
168
168
  }
169
169
  }, {
170
- color: 'success',
171
- variant: 'soft',
170
+ color: "success",
171
+ variant: "soft",
172
172
  styles: {
173
- backgroundColor: c['status.success.bg.subtle'],
174
- color: c['status.success.fg.subtle']
173
+ backgroundColor: c["status.success.bg.subtle"],
174
+ color: c["status.success.fg.subtle"]
175
175
  }
176
176
  }, {
177
- color: 'warning',
178
- variant: 'solid',
177
+ color: "warning",
178
+ variant: "solid",
179
179
  styles: {
180
- backgroundColor: c['status.warning.bg'],
181
- color: c['status.warning.fg']
180
+ backgroundColor: c["status.warning.bg"],
181
+ color: c["status.warning.fg"]
182
182
  }
183
183
  }, {
184
- color: 'warning',
185
- variant: 'soft',
184
+ color: "warning",
185
+ variant: "soft",
186
186
  styles: {
187
- backgroundColor: c['status.warning.bg.subtle'],
188
- color: c['status.warning.fg.subtle']
187
+ backgroundColor: c["status.warning.bg.subtle"],
188
+ color: c["status.warning.fg.subtle"]
189
189
  }
190
190
  }, {
191
- color: 'danger',
192
- variant: 'solid',
191
+ color: "danger",
192
+ variant: "solid",
193
193
  styles: {
194
- backgroundColor: c['status.danger.bg'],
195
- color: c['status.danger.fg']
194
+ backgroundColor: c["status.danger.bg"],
195
+ color: c["status.danger.fg"]
196
196
  }
197
197
  }, {
198
- color: 'danger',
199
- variant: 'soft',
198
+ color: "danger",
199
+ variant: "soft",
200
200
  styles: {
201
- backgroundColor: c['status.danger.bg.subtle'],
202
- color: c['status.danger.fg.subtle']
201
+ backgroundColor: c["status.danger.bg.subtle"],
202
+ color: c["status.danger.fg.subtle"]
203
203
  }
204
204
  }],
205
205
  uni__dependencies: [4]
@@ -1 +1 @@
1
- {"version":3,"names":["useState","StyleSheet","useUnistyles","Icon","Image","jsx","_jsx","SIZE_PX","xs","sm","md","lg","xl","INITIALS_FONT_SIZE","getInitials","name","parts","trim","split","first","last","length","toUpperCase","getBorderRadius","shape","sizePx","radiusMd","getImageRadius","Avatar","size","source","fallback","contentFit","color","variant","style","rest","theme","hasError","setHasError","_styles","styles","useVariants","borderRadius","radius","showFallback","bg","base","backgroundColor","fg","fallbackContent","undefined","Text","fontSize","fontWeight","includeFontPadding","numberOfLines","children","View","width","height","alignItems","justifyContent","overflow","accessibilityLabel","onError","create","c","variants","secondary","primary","success","warning","danger","solid","soft","compoundVariants","uni__dependencies"],"sourceRoot":"../../../../src","sources":["components/avatar/Avatar.tsx"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAGhC,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAIjE,SAASC,IAAI;AACb,SAASC,KAAK;AAAmB,SAAAC,GAAA,IAAAC,IAAA;AAGjC,MAAMC,OAAmC,GAAG;EAC1CC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,kBAA8C,GAAG;EACrDL,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,SAASE,WAAWA,CAACC,IAAY,EAAU;EACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC;EACtC,MAAMC,KAAK,GAAGH,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;EACjC,MAAM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Sheet","useUnistyles","Icon","Image","jsx","_jsx","SIZE_PX","xs","sm","md","lg","xl","INITIALS_FONT_SIZE","getInitials","name","parts","trim","split","first","last","length","toUpperCase","getBorderRadius","shape","sizePx","radiusMd","getImageRadius","Avatar","size","source","fallback","contentFit","color","variant","style","rest","theme","hasError","setHasError","_styles","styles","useVariants","borderRadius","radius","showFallback","bg","base","backgroundColor","fg","fallbackContent","undefined","Text","fontSize","fontWeight","includeFontPadding","numberOfLines","children","View","width","height","alignItems","justifyContent","overflow","accessibilityLabel","onError","create","c","variants","secondary","primary","success","warning","danger","solid","soft","compoundVariants","uni__dependencies"],"sourceRoot":"../../../../src","sources":["components/avatar/Avatar.tsx"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAGhC,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAGjE,SAASC,IAAI;AACb,SAASC,KAAK;AAAmB,SAAAC,GAAA,IAAAC,IAAA;AAGjC,MAAMC,OAAmC,GAAG;EAC1CC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,kBAA8C,GAAG;EACrDL,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,SAASE,WAAWA,CAACC,IAAY,EAAU;EACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC;EACtC,MAAMC,KAAK,GAAGH,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;EACjC,MAAMI,IAAI,GAAGJ,KAAK,CAACK,MAAM,GAAG,CAAC,GAAIL,KAAK,CAACA,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,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ChBO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,mBAAmB,CAAC;UACvClC,KAAK,EAAEkC,CAAC,CAAC,mBAAmB;QAC9B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,SAAS;QAChBC,OAAO,EAAE,MAAM;QACfO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,0BAA0B,CAAC;UAC9ClC,KAAK,EAAEkC,CAAC,CAAC,0BAA0B;QACrC;MACF,CAAC,EACD;QACElC,KAAK,EAAE,SAAS;QAChBC,OAAO,EAAE,OAAO;QAChBO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,mBAAmB,CAAC;UACvClC,KAAK,EAAEkC,CAAC,CAAC,mBAAmB;QAC9B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,SAAS;QAChBC,OAAO,EAAE,MAAM;QACfO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,0BAA0B,CAAC;UAC9ClC,KAAK,EAAEkC,CAAC,CAAC,0BAA0B;QACrC;MACF,CAAC,EACD;QACElC,KAAK,EAAE,QAAQ;QACfC,OAAO,EAAE,OAAO;QAChBO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,kBAAkB,CAAC;UACtClC,KAAK,EAAEkC,CAAC,CAAC,kBAAkB;QAC7B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,QAAQ;QACfC,OAAO,EAAE,MAAM;QACfO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,yBAAyB,CAAC;UAC7ClC,KAAK,EAAEkC,CAAC,CAAC,yBAAyB;QACpC;MACF,CAAC,CACF;MAAAU,iBAAA;IACH;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  import { View } from "react-native-unistyles/components/native/View";
4
- import { forwardRef } from 'react';
5
- import { StyleSheet, useUnistyles } from 'react-native-unistyles';
4
+ import { forwardRef } from "react";
5
+ import { StyleSheet, useUnistyles } from "react-native-unistyles";
6
6
  import { Slot } from "../slot/index.js";
7
7
  import { BOX_STYLE_PROP_KEYS, resolveBoxStyle } from "./utils.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","StyleSheet","useUnistyles","Slot","BOX_STYLE_PROP_KEYS","resolveBoxStyle","jsx","_jsx","STYLE_KEYS","Set","Box","asChild","style","children","rest","ref","theme","styleProps","viewProps","key","Object","keys","value","has","mergedStyle","styles","root","ownerName","slotProps","View","create"],"sourceRoot":"../../../../src","sources":["components/box/Box.tsx"],"mappings":";;;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AAGrD,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,IAAI;AACb,SACEC,mBAAmB,EAEnBC,eAAe;AACA,SAAAC,GAAA,IAAAC,IAAA;AAOjB,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAASL,mBAAwC,CAAC;;AAE5E;AACA;AACA;AACA;AACA,OAAO,MAAMM,GAAG,gBAAGV,UAAU,CAAsC,SAASU,GAAGA,CAC7E;EAAEC,OAAO;EAAEC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EACrCC,GAAG,EACH;EACA,MAAM;IAAEC;EAAM,CAAC,GAAGd,YAAY,CAAC,CAAC;EAEhC,MAAMe,UAAmC,GAAG,CAAC,CAAC;EAC9C,MAAMC,SAAkC,GAAG,CAAC,CAAC;EAC7C,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACP,IAAI,CAAC,EAAE;IACnC,MAAMQ,KAAK,GAAIR,IAAI,CAA6BK,GAAG,CAAC;IACpD,IAAIX,UAAU,CAACe,GAAG,CAACJ,GAAG,CAAC,EAAEF,UAAU,CAACE,GAAG,CAAC,GAAGG,KAAK,CAAC,KAC5CJ,SAAS,CAACC,GAAG,CAAC,GAAGG,KAAK;EAC7B;EAEA,MAAME,WAAW,GAAG,CAClBC,MAAM,CAACC,IAAI,EACXrB,eAAe,CAACY,UAAU,EAAmBD,KAAK,CAAC,EACnDJ,KAAK,CACN;EAED,IAAID,OAAO,EAAE;IACX,oBACEJ,IAAA,CAACJ,IAAI;MACHwB,SAAS,EAAC,KAAK;MACfC,SAAS,EAAE;QAAE,GAAGV,SAAS;QAAEN,KAAK,EAAEY,WAAW;QAAET;MAAI,CAAE;MAAAF,QAAA,EAEpDA;IAAQ,CACL,CAAC;EAEX;EAEA,oBACEN,IAAA,CAACsB,IAAI;IAACd,GAAG,EAAEA,GAAI;IAACH,KAAK,EAAEY,WAAY;IAAA,GAAMN,SAAS;IAAAL,QAAA,EAC/CA;EAAQ,CACL,CAAC;AAEX,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMY,MAAM,GAAGxB,UAAU,CAAC6B,MAAM,CAAC,OAAO;EAAEJ,IAAI,EAAE,CAAC;AAAE,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","StyleSheet","useUnistyles","Slot","BOX_STYLE_PROP_KEYS","resolveBoxStyle","jsx","_jsx","STYLE_KEYS","Set","Box","asChild","style","children","rest","ref","theme","styleProps","viewProps","key","Object","keys","value","has","mergedStyle","styles","root","ownerName","slotProps","View","create"],"sourceRoot":"../../../../src","sources":["components/box/Box.tsx"],"mappings":";;;AAAA,SAA4BA,UAAU,QAAQ,OAAO;AAGrD,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,IAAI;AACb,SAASC,mBAAmB,EAAsBC,eAAe;AAAkB,SAAAC,GAAA,IAAAC,IAAA;AAOnF,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAASL,mBAAwC,CAAC;;AAE5E;AACA;AACA;AACA;AACA,OAAO,MAAMM,GAAG,gBAAGV,UAAU,CAAsC,SAASU,GAAGA,CAC7E;EAAEC,OAAO;EAAEC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,EACrCC,GAAG,EACH;EACA,MAAM;IAAEC;EAAM,CAAC,GAAGd,YAAY,CAAC,CAAC;EAEhC,MAAMe,UAAmC,GAAG,CAAC,CAAC;EAC9C,MAAMC,SAAkC,GAAG,CAAC,CAAC;EAC7C,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACP,IAAI,CAAC,EAAE;IACnC,MAAMQ,KAAK,GAAIR,IAAI,CAA6BK,GAAG,CAAC;IACpD,IAAIX,UAAU,CAACe,GAAG,CAACJ,GAAG,CAAC,EAAEF,UAAU,CAACE,GAAG,CAAC,GAAGG,KAAK,CAAC,KAC5CJ,SAAS,CAACC,GAAG,CAAC,GAAGG,KAAK;EAC7B;EAEA,MAAME,WAAW,GAAG,CAACC,MAAM,CAACC,IAAI,EAAErB,eAAe,CAACY,UAAU,EAAmBD,KAAK,CAAC,EAAEJ,KAAK,CAAC;EAE7F,IAAID,OAAO,EAAE;IACX,oBACEJ,IAAA,CAACJ,IAAI;MAACwB,SAAS,EAAC,KAAK;MAACC,SAAS,EAAE;QAAE,GAAGV,SAAS;QAAEN,KAAK,EAAEY,WAAW;QAAET;MAAI,CAAE;MAAAF,QAAA,EACxEA;IAAQ,CACL,CAAC;EAEX;EAEA,oBACEN,IAAA,CAACsB,IAAI;IAACd,GAAG,EAAEA,GAAI;IAACH,KAAK,EAAEY,WAAY;IAAA,GAAMN,SAAS;IAAAL,QAAA,EAC/CA;EAAQ,CACL,CAAC;AAEX,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMY,MAAM,GAAGxB,UAAU,CAAC6B,MAAM,CAAC,OAAO;EAAEJ,IAAI,EAAE,CAAC;AAAE,CAAC,CAAC,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { StyleSheet } from 'react-native';
3
+ import { StyleSheet } from "react-native";
4
4
  import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
5
5
 
6
6
  /** Strips `readonly` so the style object can be built by mutation. */
@@ -8,19 +8,19 @@ import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
8
8
  /** Token-driven style props accepted by `Box`. */
9
9
 
10
10
  const ALIGN_MAP = {
11
- start: 'flex-start',
12
- center: 'center',
13
- end: 'flex-end',
14
- stretch: 'stretch',
15
- baseline: 'baseline'
11
+ start: "flex-start",
12
+ center: "center",
13
+ end: "flex-end",
14
+ stretch: "stretch",
15
+ baseline: "baseline"
16
16
  };
17
17
  const JUSTIFY_MAP = {
18
- start: 'flex-start',
19
- center: 'center',
20
- end: 'flex-end',
21
- between: 'space-between',
22
- around: 'space-around',
23
- evenly: 'space-evenly'
18
+ start: "flex-start",
19
+ center: "center",
20
+ end: "flex-end",
21
+ between: "space-between",
22
+ around: "space-around",
23
+ evenly: "space-evenly"
24
24
  };
25
25
  const space = (theme, key) => key === undefined ? undefined : theme.spacing[key];
26
26
 
@@ -65,23 +65,23 @@ export function resolveBoxStyle(props, theme) {
65
65
  if (gap !== undefined) style.gap = gap;
66
66
 
67
67
  // Layout
68
- if (props.row !== undefined) style.flexDirection = props.row ? 'row' : 'column';
68
+ if (props.row !== undefined) style.flexDirection = props.row ? "row" : "column";
69
69
  if (props.align !== undefined) style.alignItems = ALIGN_MAP[props.align];
70
70
  if (props.justify !== undefined) {
71
71
  style.justifyContent = JUSTIFY_MAP[props.justify];
72
72
  }
73
- if (props.wrap !== undefined) style.flexWrap = props.wrap ? 'wrap' : 'nowrap';
73
+ if (props.wrap !== undefined) style.flexWrap = props.wrap ? "wrap" : "nowrap";
74
74
  if (props.flex !== undefined) style.flex = props.flex;
75
75
  if (props.alignSelf !== undefined) style.alignSelf = ALIGN_MAP[props.alignSelf];
76
76
 
77
77
  // Visual
78
- if (props.bg !== undefined) {
79
- const bg = resolveThemeColor(props.bg, theme);
80
- if (bg !== undefined) style.backgroundColor = bg;
78
+ if (props.background !== undefined) {
79
+ const background = resolveThemeColor(props.background, theme);
80
+ if (background !== undefined) style.backgroundColor = background;
81
81
  }
82
82
  if (props.radius !== undefined) style.borderRadius = theme.radius[props.radius];
83
83
  if (props.borderWidth !== undefined) {
84
- style.borderWidth = props.borderWidth === 'hairline' ? StyleSheet.hairlineWidth : props.borderWidth;
84
+ style.borderWidth = props.borderWidth === "hairline" ? StyleSheet.hairlineWidth : props.borderWidth;
85
85
  }
86
86
  if (props.borderColor !== undefined) {
87
87
  const borderColor = resolveThemeColor(props.borderColor, theme);
@@ -94,5 +94,5 @@ export function resolveBoxStyle(props, theme) {
94
94
  }
95
95
 
96
96
  /** Keys of {@link BoxStyleProps}, used to split style props from view props. */
97
- export const BOX_STYLE_PROP_KEYS = ['p', 'px', 'py', 'pt', 'pr', 'pb', 'pl', 'm', 'mx', 'my', 'mt', 'mr', 'mb', 'ml', 'gap', 'row', 'align', 'justify', 'wrap', 'flex', 'alignSelf', 'bg', 'radius', 'borderWidth', 'borderColor', 'elevation'];
97
+ export const BOX_STYLE_PROP_KEYS = ["p", "px", "py", "pt", "pr", "pb", "pl", "m", "mx", "my", "mt", "mr", "mb", "ml", "gap", "row", "align", "justify", "wrap", "flex", "alignSelf", "background", "radius", "borderWidth", "borderColor", "elevation"];
98
98
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","resolveThemeColor","ALIGN_MAP","start","center","end","stretch","baseline","JUSTIFY_MAP","between","around","evenly","space","theme","key","undefined","spacing","resolveBoxStyle","props","style","p","px","py","padding","paddingHorizontal","paddingVertical","pt","pr","pb","pl","paddingTop","paddingRight","paddingBottom","paddingLeft","m","mx","my","margin","marginHorizontal","marginVertical","mt","mr","mb","ml","marginTop","marginRight","marginBottom","marginLeft","gap","row","flexDirection","align","alignItems","justify","justifyContent","wrap","flexWrap","flex","alignSelf","bg","backgroundColor","radius","borderRadius","borderWidth","hairlineWidth","borderColor","elevation","Object","assign","BOX_STYLE_PROP_KEYS"],"sourceRoot":"../../../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OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,CACZ","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","resolveThemeColor","ALIGN_MAP","start","center","end","stretch","baseline","JUSTIFY_MAP","between","around","evenly","space","theme","key","undefined","spacing","resolveBoxStyle","props","style","p","px","py","padding","paddingHorizontal","paddingVertical","pt","pr","pb","pl","paddingTop","paddingRight","paddingBottom","paddingLeft","m","mx","my","margin","marginHorizontal","marginVertical","mt","mr","mb","ml","marginTop","marginRight","marginBottom","marginLeft","gap","row","flexDirection","align","alignItems","justify","justifyContent","wrap","flexWrap","flex","alignSelf","background","backgroundColor","radius","borderRadius","borderWidth","hairlineWidth","borderColor","elevation","Object","assign","BOX_STYLE_PROP_KEYS"],"sourceRoot":"../../../../src","sources":["components/box/utils.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,cAAc;AAGzD,SAASC,iBAAiB;;AAM1B;;AAGA;;AAsCA,MAAMC,SAA8D,GAAG;EACrEC,KAAK,EAAE,YAAY;EACnBC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,UAAU;EACfC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE;AACZ,CAAC;AAED,MAAMC,WAAsE,GAAG;EAC7EL,KAAK,EAAE,YAAY;EACnBC,MAAM,EAAE,QAAQ;EAChBC,GAAG,EAAE,UAAU;EACfI,OAAO,EAAE,eAAe;EACxBC,MAAM,EAAE,cAAc;EACtBC,MAAM,EAAE;AACV,CAAC;AAED,MAAMC,KAAK,GAAGA,CAACC,KAAiB,EAAEC,GAA2B,KAC3DA,GAAG,KAAKC,SAAS,GAAGA,SAAS,GAAGF,KAAK,CAACG,OAAO,CAACF,GAAG,CAAC;;AAEpD;AACA,OAAO,SAASG,eAAeA,CAACC,KAAoB,EAAEL,KAAiB,EAAa;EAClF,MAAMM,KAAyB,GAAG,CAAC,CAAC;;EA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K,CAAC+C,WAAW,EAAEpD,KAAK,CAAC;IAC/D,IAAIoD,WAAW,KAAKlD,SAAS,EAAEI,KAAK,CAAC8C,WAAW,GAAGA,WAAW;EAChE;EACA,IAAI/C,KAAK,CAACgD,SAAS,KAAKnD,SAAS,EAAE;IACjCoD,MAAM,CAACC,MAAM,CAACjD,KAAK,EAAEN,KAAK,CAACqD,SAAS,CAAChD,KAAK,CAACgD,SAAS,CAAC,CAAC;EACxD;EAEA,OAAO/C,KAAK;AACd;;AAEA;AACA,OAAO,MAAMkD,mBAAqD,GAAG,CACnE,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAS,EACT,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,WAAW,CACZ","ignoreList":[]}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
4
- import { Children, createContext, forwardRef, useContext } from 'react';
5
- import { StyleSheet, useUnistyles } from 'react-native-unistyles';
4
+ import { Children, createContext, forwardRef, useContext } from "react";
5
+ import { StyleSheet, useUnistyles } from "react-native-unistyles";
6
6
  import { getDefaultRadius } from "../../theme/registry.js";
7
+ import { readableOn } from "../../utils/color-utils.js";
8
+ import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
7
9
  import { Icon } from "../icon/index.js";
8
10
  import { Spinner } from "../spinner/index.js";
9
11
  import { Text } from "../text/index.js";
@@ -11,8 +13,8 @@ import { Text } from "../text/index.js";
11
13
  // ─── Context (lets icons/labels read the resolved foreground + size) ───────────
12
14
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
15
  const ButtonContext = /*#__PURE__*/createContext({
14
- color: '',
15
- size: 'md'
16
+ color: "",
17
+ size: "md"
16
18
  });
17
19
  export const useButtonContext = () => useContext(ButtonContext);
18
20
 
@@ -20,42 +22,42 @@ export const useButtonContext = () => useContext(ButtonContext);
20
22
 
21
23
  function getColors(variant, theme) {
22
24
  const c = theme.color;
23
- const get = key => c[key] ?? '';
25
+ const get = key => c[key] ?? "";
24
26
  switch (variant) {
25
- case 'primary':
27
+ case "primary":
26
28
  return {
27
- bg: get('action.bg.primary'),
28
- border: get('action.bg.primary'),
29
+ bg: get("action.bg.primary"),
30
+ border: get("action.bg.primary"),
29
31
  borderWidth: 0,
30
- fg: get('action.fg.primary')
32
+ fg: get("action.fg.primary")
31
33
  };
32
- case 'secondary':
34
+ case "secondary":
33
35
  return {
34
- bg: get('action.bg.secondary'),
35
- border: get('action.bg.secondary'),
36
+ bg: get("action.bg.secondary"),
37
+ border: get("action.bg.secondary"),
36
38
  borderWidth: 0,
37
- fg: get('action.fg.secondary')
39
+ fg: get("action.fg.secondary")
38
40
  };
39
- case 'outline':
41
+ case "outline":
40
42
  return {
41
- bg: 'transparent',
42
- border: get('border.default'),
43
+ bg: "transparent",
44
+ border: get("border.default"),
43
45
  borderWidth: 1,
44
- fg: get('text.default')
46
+ fg: get("text.default")
45
47
  };
46
- case 'ghost':
48
+ case "ghost":
47
49
  return {
48
- bg: 'transparent',
49
- border: 'transparent',
50
+ bg: "transparent",
51
+ border: "transparent",
50
52
  borderWidth: 0,
51
- fg: get('text.default')
53
+ fg: get("text.default")
52
54
  };
53
- case 'danger':
55
+ case "danger":
54
56
  return {
55
- bg: get('status.danger.bg'),
56
- border: get('status.danger.bg'),
57
+ bg: get("status.danger.bg"),
58
+ border: get("status.danger.bg"),
57
59
  borderWidth: 0,
58
- fg: get('status.danger.fg')
60
+ fg: get("status.danger.fg")
59
61
  };
60
62
  }
61
63
  }
@@ -64,16 +66,16 @@ function getColors(variant, theme) {
64
66
 
65
67
  const LABEL_TYPOGRAPHY = {
66
68
  sm: {
67
- variant: 'label-md',
68
- weight: 'semibold'
69
+ variant: "label-md",
70
+ weight: "semibold"
69
71
  },
70
72
  md: {
71
- variant: 'label-lg',
72
- weight: 'semibold'
73
+ variant: "label-lg",
74
+ weight: "semibold"
73
75
  },
74
76
  lg: {
75
- variant: 'label-lg',
76
- weight: 'bold'
77
+ variant: "label-lg",
78
+ weight: "bold"
77
79
  }
78
80
  };
79
81
  const ButtonLabel = ({
@@ -120,12 +122,12 @@ const ButtonIcon = ({
120
122
  };
121
123
  function renderChildren(children) {
122
124
  return Children.map(children, child => {
123
- if (typeof child === 'string') {
125
+ if (typeof child === "string") {
124
126
  return child.trim().length > 0 ? /*#__PURE__*/_jsx(ButtonLabel, {
125
127
  children: child
126
128
  }) : null;
127
129
  }
128
- if (typeof child === 'number') {
130
+ if (typeof child === "number") {
129
131
  return /*#__PURE__*/_jsx(ButtonLabel, {
130
132
  children: child
131
133
  });
@@ -137,14 +139,15 @@ function renderChildren(children) {
137
139
  // ─── Component ────────────────────────────────────────────────────────────────
138
140
 
139
141
  const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
140
- variant = 'primary',
141
- size = 'md',
142
- radius = getDefaultRadius('button'),
142
+ variant = "primary",
143
+ size = "md",
144
+ radius = getDefaultRadius("button"),
143
145
  isDisabled = false,
144
146
  isLoading = false,
145
147
  isIconOnly = false,
146
148
  fullWidth = true,
147
149
  compact = false,
150
+ background,
148
151
  children,
149
152
  onPress,
150
153
  ...rest
@@ -161,11 +164,14 @@ const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
161
164
  iconOnly: isIconOnly
162
165
  });
163
166
  const {
164
- bg,
167
+ bg: variantBg,
165
168
  border,
166
169
  borderWidth,
167
- fg
170
+ fg: variantFg
168
171
  } = getColors(variant, theme);
172
+ const resolvedBackground = background !== undefined ? resolveThemeColor(background, theme) : undefined;
173
+ const bg = resolvedBackground ?? variantBg;
174
+ const fg = resolvedBackground !== undefined ? readableOn(resolvedBackground) : variantFg;
169
175
  const blocked = isDisabled || isLoading;
170
176
  const {
171
177
  style: externalStyle,
@@ -194,7 +200,7 @@ const ButtonRoot = /*#__PURE__*/forwardRef(function Button({
194
200
  opacity: theme.opacity.pressed
195
201
  } : null, isDisabled ? {
196
202
  opacity: theme.opacity.disabled
197
- } : null, typeof externalStyle === 'function' ? externalStyle(state) : externalStyle],
203
+ } : null, typeof externalStyle === "function" ? externalStyle(state) : externalStyle],
198
204
  children: [isLoading && /*#__PURE__*/_jsx(Spinner, {
199
205
  size: "sm",
200
206
  color: fg
@@ -211,24 +217,24 @@ Button.Label = ButtonLabel;
211
217
 
212
218
  const styles = StyleSheet.create(theme => ({
213
219
  base: {
214
- flexDirection: 'row',
215
- alignItems: 'center',
216
- justifyContent: 'center',
217
- alignSelf: 'flex-start',
220
+ flexDirection: "row",
221
+ alignItems: "center",
222
+ justifyContent: "center",
223
+ alignSelf: "flex-start",
218
224
  variants: {
219
225
  size: {
220
226
  sm: {
221
- minHeight: 36,
227
+ height: 36,
222
228
  paddingHorizontal: 14,
223
229
  gap: 6
224
230
  },
225
231
  md: {
226
- minHeight: 44,
232
+ height: 44,
227
233
  paddingHorizontal: 16,
228
234
  gap: 8
229
235
  },
230
236
  lg: {
231
- minHeight: 52,
237
+ height: 52,
232
238
  paddingHorizontal: 20,
233
239
  gap: 8
234
240
  }
@@ -255,7 +261,7 @@ const styles = StyleSheet.create(theme => ({
255
261
  },
256
262
  fullWidth: {
257
263
  true: {
258
- alignSelf: 'stretch'
264
+ alignSelf: "stretch"
259
265
  },
260
266
  false: {}
261
267
  },
@@ -272,7 +278,7 @@ const styles = StyleSheet.create(theme => ({
272
278
  compact: {
273
279
  paddingHorizontal: 2,
274
280
  paddingVertical: 2,
275
- minHeight: 0
281
+ height: undefined
276
282
  }
277
283
  }));
278
284
  //# sourceMappingURL=Button.js.map