@unif/react-native-design 0.8.1 → 0.9.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 (512) hide show
  1. package/README.md +3 -4
  2. package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js +6 -4
  3. package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js.map +1 -1
  4. package/lib/module/components/business/AvatarWithRing/styles.js +15 -3
  5. package/lib/module/components/business/AvatarWithRing/styles.js.map +1 -1
  6. package/lib/module/components/business/Decorations/GradientWash.js +50 -36
  7. package/lib/module/components/business/Decorations/GradientWash.js.map +1 -1
  8. package/lib/module/components/business/Decorations/RadialHalo.js +10 -4
  9. package/lib/module/components/business/Decorations/RadialHalo.js.map +1 -1
  10. package/lib/module/components/business/Decorations/ScreenBackdrop.js +22 -14
  11. package/lib/module/components/business/Decorations/ScreenBackdrop.js.map +1 -1
  12. package/lib/module/components/business/Decorations/index.js +3 -0
  13. package/lib/module/components/business/Decorations/index.js.map +1 -1
  14. package/lib/module/components/business/GlassStats/GlassStats.js +7 -4
  15. package/lib/module/components/business/GlassStats/GlassStats.js.map +1 -1
  16. package/lib/module/components/business/GlassStats/types.js +2 -0
  17. package/lib/module/components/business/VersionPill/VersionPill.js +23 -5
  18. package/lib/module/components/business/VersionPill/VersionPill.js.map +1 -1
  19. package/lib/module/components/business/VersionPill/styles.js +1 -1
  20. package/lib/module/components/business/index.js.map +1 -1
  21. package/lib/module/components/business/useSvgId.js +20 -0
  22. package/lib/module/components/business/useSvgId.js.map +1 -0
  23. package/lib/module/components/ui/Avatar/Avatar.js +13 -8
  24. package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
  25. package/lib/module/components/ui/Avatar/styles.js +7 -7
  26. package/lib/module/components/ui/Avatar/styles.js.map +1 -1
  27. package/lib/module/components/ui/BlurLayer/BlurLayer.js +5 -1
  28. package/lib/module/components/ui/BlurLayer/BlurLayer.js.map +1 -1
  29. package/lib/module/components/ui/BlurLayer/BlurLayer.web.js +7 -1
  30. package/lib/module/components/ui/BlurLayer/BlurLayer.web.js.map +1 -1
  31. package/lib/module/components/ui/Button/Button.js +2 -1
  32. package/lib/module/components/ui/Button/Button.js.map +1 -1
  33. package/lib/module/components/ui/Button/ButtonBase.js +36 -2
  34. package/lib/module/components/ui/Button/ButtonBase.js.map +1 -1
  35. package/lib/module/components/ui/Button/styles.js +27 -25
  36. package/lib/module/components/ui/Button/styles.js.map +1 -1
  37. package/lib/module/components/ui/Card/Card.js +17 -8
  38. package/lib/module/components/ui/Card/Card.js.map +1 -1
  39. package/lib/module/components/ui/Card/styles.js +6 -1
  40. package/lib/module/components/ui/Card/styles.js.map +1 -1
  41. package/lib/module/components/ui/Carousel/Carousel.js +36 -6
  42. package/lib/module/components/ui/Carousel/Carousel.js.map +1 -1
  43. package/lib/module/components/ui/Cell/Cell.js +23 -5
  44. package/lib/module/components/ui/Cell/Cell.js.map +1 -1
  45. package/lib/module/components/ui/Cell/Leading.js +2 -2
  46. package/lib/module/components/ui/Cell/Leading.js.map +1 -1
  47. package/lib/module/components/ui/Cell/List.js +10 -5
  48. package/lib/module/components/ui/Cell/List.js.map +1 -1
  49. package/lib/module/components/ui/Cell/styles.js +7 -6
  50. package/lib/module/components/ui/Cell/styles.js.map +1 -1
  51. package/lib/module/components/ui/Checkbox/Checkbox.js +10 -8
  52. package/lib/module/components/ui/Checkbox/Checkbox.js.map +1 -1
  53. package/lib/module/components/ui/Checkbox/styles.js +9 -1
  54. package/lib/module/components/ui/Checkbox/styles.js.map +1 -1
  55. package/lib/module/components/ui/Chip/Chip.js +19 -5
  56. package/lib/module/components/ui/Chip/Chip.js.map +1 -1
  57. package/lib/module/components/ui/Confirm/ConfirmHost.js +28 -11
  58. package/lib/module/components/ui/Confirm/ConfirmHost.js.map +1 -1
  59. package/lib/module/components/ui/Confirm/confirm.js +6 -0
  60. package/lib/module/components/ui/Confirm/confirm.js.map +1 -1
  61. package/lib/module/components/ui/DrawerHeader/DrawerHeader.js +14 -9
  62. package/lib/module/components/ui/DrawerHeader/DrawerHeader.js.map +1 -1
  63. package/lib/module/components/ui/DrawerHeader/styles.js +10 -6
  64. package/lib/module/components/ui/DrawerHeader/styles.js.map +1 -1
  65. package/lib/module/components/ui/Empty/Empty.js +5 -4
  66. package/lib/module/components/ui/Empty/Empty.js.map +1 -1
  67. package/lib/module/components/ui/EntryCard/EntryCard.js +5 -3
  68. package/lib/module/components/ui/EntryCard/EntryCard.js.map +1 -1
  69. package/lib/module/components/ui/EntryCard/styles.js +4 -4
  70. package/lib/module/components/ui/EntryCard/styles.js.map +1 -1
  71. package/lib/module/components/ui/Form/FormRow.js +1 -0
  72. package/lib/module/components/ui/Form/FormRow.js.map +1 -1
  73. package/lib/module/components/ui/Form/styles.js +3 -1
  74. package/lib/module/components/ui/Form/styles.js.map +1 -1
  75. package/lib/module/components/ui/Grid/Grid.js +39 -24
  76. package/lib/module/components/ui/Grid/Grid.js.map +1 -1
  77. package/lib/module/components/ui/Grid/styles.js +35 -46
  78. package/lib/module/components/ui/Grid/styles.js.map +1 -1
  79. package/lib/module/components/ui/Icon/Icon.js +46 -29
  80. package/lib/module/components/ui/Icon/Icon.js.map +1 -1
  81. package/lib/module/components/ui/IconButton/IconButton.js +2 -0
  82. package/lib/module/components/ui/IconButton/IconButton.js.map +1 -1
  83. package/lib/module/components/ui/Logo/Logo.js +2 -1
  84. package/lib/module/components/ui/Logo/Logo.js.map +1 -1
  85. package/lib/module/components/ui/NavBar/NavBar.js +15 -3
  86. package/lib/module/components/ui/NavBar/NavBar.js.map +1 -1
  87. package/lib/module/components/ui/PasswordInput/PasswordInput.js +43 -14
  88. package/lib/module/components/ui/PasswordInput/PasswordInput.js.map +1 -1
  89. package/lib/module/components/ui/PasswordInput/styles.js +1 -1
  90. package/lib/module/components/ui/Pulse/Pulse.js +2 -1
  91. package/lib/module/components/ui/Pulse/Pulse.js.map +1 -1
  92. package/lib/module/components/ui/Pulse/PulseDot.js +8 -10
  93. package/lib/module/components/ui/Pulse/PulseDot.js.map +1 -1
  94. package/lib/module/components/ui/Pulse/types.js +2 -0
  95. package/lib/module/components/ui/Pulse/usePulse.web.js +51 -30
  96. package/lib/module/components/ui/Pulse/usePulse.web.js.map +1 -1
  97. package/lib/module/components/ui/Radio/Radio.js +19 -5
  98. package/lib/module/components/ui/Radio/Radio.js.map +1 -1
  99. package/lib/module/components/ui/Radio/RadioGroup.js +10 -6
  100. package/lib/module/components/ui/Radio/RadioGroup.js.map +1 -1
  101. package/lib/module/components/ui/Radio/styles.js +10 -3
  102. package/lib/module/components/ui/Radio/styles.js.map +1 -1
  103. package/lib/module/components/ui/Reveal/Reveal.web.js +18 -3
  104. package/lib/module/components/ui/Reveal/Reveal.web.js.map +1 -1
  105. package/lib/module/components/ui/Search/Search.js +26 -10
  106. package/lib/module/components/ui/Search/Search.js.map +1 -1
  107. package/lib/module/components/ui/Segmented/Segmented.js +40 -30
  108. package/lib/module/components/ui/Segmented/Segmented.js.map +1 -1
  109. package/lib/module/components/ui/Segmented/styles.js +4 -2
  110. package/lib/module/components/ui/Segmented/styles.js.map +1 -1
  111. package/lib/module/components/ui/Skeleton/Skeleton.js +9 -8
  112. package/lib/module/components/ui/Skeleton/Skeleton.js.map +1 -1
  113. package/lib/module/components/ui/Spinner/Spinner.js +15 -16
  114. package/lib/module/components/ui/Spinner/Spinner.js.map +1 -1
  115. package/lib/module/components/ui/Spinner/Spinner.web.js +10 -14
  116. package/lib/module/components/ui/Spinner/Spinner.web.js.map +1 -1
  117. package/lib/module/components/ui/Spinner/shared.js +31 -0
  118. package/lib/module/components/ui/Spinner/shared.js.map +1 -0
  119. package/lib/module/components/ui/StatusDot/StatusDot.js +21 -4
  120. package/lib/module/components/ui/StatusDot/StatusDot.js.map +1 -1
  121. package/lib/module/components/ui/StatusDot/styles.js +1 -1
  122. package/lib/module/components/ui/StatusDot/types.js +2 -0
  123. package/lib/module/components/ui/Stepper/Stepper.js +46 -10
  124. package/lib/module/components/ui/Stepper/Stepper.js.map +1 -1
  125. package/lib/module/components/ui/Switch/Switch.js +6 -11
  126. package/lib/module/components/ui/Switch/Switch.js.map +1 -1
  127. package/lib/module/components/ui/Switch/Switch.web.js +2 -8
  128. package/lib/module/components/ui/Switch/Switch.web.js.map +1 -1
  129. package/lib/module/components/ui/Switch/styles.js +12 -3
  130. package/lib/module/components/ui/Switch/styles.js.map +1 -1
  131. package/lib/module/components/ui/TabBar/TabBar.js +10 -6
  132. package/lib/module/components/ui/TabBar/TabBar.js.map +1 -1
  133. package/lib/module/components/ui/TabBar/styles.js +28 -39
  134. package/lib/module/components/ui/TabBar/styles.js.map +1 -1
  135. package/lib/module/components/ui/Tabs/Tabs.js +19 -5
  136. package/lib/module/components/ui/Tabs/Tabs.js.map +1 -1
  137. package/lib/module/components/ui/Tabs/styles.js +6 -2
  138. package/lib/module/components/ui/Tabs/styles.js.map +1 -1
  139. package/lib/module/components/ui/Tabs/types.js +2 -0
  140. package/lib/module/components/ui/Tag/styles.js +15 -14
  141. package/lib/module/components/ui/Tag/styles.js.map +1 -1
  142. package/lib/module/components/ui/TextField/TextFieldBase.js +24 -6
  143. package/lib/module/components/ui/TextField/TextFieldBase.js.map +1 -1
  144. package/lib/module/components/ui/Thumbnail/Thumbnail.js +11 -3
  145. package/lib/module/components/ui/Thumbnail/Thumbnail.js.map +1 -1
  146. package/lib/module/components/ui/Thumbnail/styles.js +6 -2
  147. package/lib/module/components/ui/Thumbnail/styles.js.map +1 -1
  148. package/lib/module/components/ui/Toast/ToastHost.js +16 -5
  149. package/lib/module/components/ui/Toast/ToastHost.js.map +1 -1
  150. package/lib/module/components/ui/Toast/ToastHost.web.js +21 -4
  151. package/lib/module/components/ui/Toast/ToastHost.web.js.map +1 -1
  152. package/lib/module/components/ui/Toast/styles.js +2 -0
  153. package/lib/module/components/ui/Toast/styles.js.map +1 -1
  154. package/lib/module/components/ui/Toast/toast.js +23 -3
  155. package/lib/module/components/ui/Toast/toast.js.map +1 -1
  156. package/lib/module/components/ui/shared/badgeStyles.js +31 -0
  157. package/lib/module/components/ui/shared/badgeStyles.js.map +1 -0
  158. package/lib/module/icons/data.js +43 -18
  159. package/lib/module/icons/data.js.map +1 -1
  160. package/lib/module/theme/colors.js +28 -10
  161. package/lib/module/theme/colors.js.map +1 -1
  162. package/lib/module/theme/index.js +6 -2
  163. package/lib/module/theme/index.js.map +1 -1
  164. package/lib/module/theme/scale.js +9 -1
  165. package/lib/module/theme/scale.js.map +1 -1
  166. package/lib/module/theme/shadow.js +24 -41
  167. package/lib/module/theme/shadow.js.map +1 -1
  168. package/lib/module/theme/tokens.js +10 -5
  169. package/lib/module/theme/tokens.js.map +1 -1
  170. package/lib/module/theme/usePrefersReducedMotion.js +12 -0
  171. package/lib/module/theme/usePrefersReducedMotion.js.map +1 -0
  172. package/lib/module/theme/usePrefersReducedMotion.web.js +25 -0
  173. package/lib/module/theme/usePrefersReducedMotion.web.js.map +1 -0
  174. package/lib/module/theme/useTheme.js +13 -0
  175. package/lib/module/theme/useTheme.js.map +1 -1
  176. package/lib/module/utils/logger/logger.js +5 -1
  177. package/lib/module/utils/logger/logger.js.map +1 -1
  178. package/lib/module/utils/testID/testID.js +6 -3
  179. package/lib/module/utils/testID/testID.js.map +1 -1
  180. package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts +1 -1
  181. package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts.map +1 -1
  182. package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts +5 -5
  183. package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts.map +1 -1
  184. package/lib/typescript/src/components/business/AvatarWithRing/types.d.ts +3 -1
  185. package/lib/typescript/src/components/business/AvatarWithRing/types.d.ts.map +1 -1
  186. package/lib/typescript/src/components/business/Decorations/GradientWash.d.ts +25 -0
  187. package/lib/typescript/src/components/business/Decorations/GradientWash.d.ts.map +1 -1
  188. package/lib/typescript/src/components/business/Decorations/RadialHalo.d.ts.map +1 -1
  189. package/lib/typescript/src/components/business/Decorations/ScreenBackdrop.d.ts +1 -1
  190. package/lib/typescript/src/components/business/Decorations/ScreenBackdrop.d.ts.map +1 -1
  191. package/lib/typescript/src/components/business/Decorations/index.d.ts +1 -1
  192. package/lib/typescript/src/components/business/Decorations/index.d.ts.map +1 -1
  193. package/lib/typescript/src/components/business/Decorations/types.d.ts +2 -0
  194. package/lib/typescript/src/components/business/Decorations/types.d.ts.map +1 -1
  195. package/lib/typescript/src/components/business/GlassStats/GlassStats.d.ts +1 -1
  196. package/lib/typescript/src/components/business/GlassStats/GlassStats.d.ts.map +1 -1
  197. package/lib/typescript/src/components/business/GlassStats/styles.d.ts +2 -2
  198. package/lib/typescript/src/components/business/GlassStats/types.d.ts +5 -0
  199. package/lib/typescript/src/components/business/GlassStats/types.d.ts.map +1 -1
  200. package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts +1 -1
  201. package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts.map +1 -1
  202. package/lib/typescript/src/components/business/VersionPill/styles.d.ts +1 -1
  203. package/lib/typescript/src/components/business/VersionPill/styles.d.ts.map +1 -1
  204. package/lib/typescript/src/components/business/VersionPill/types.d.ts +13 -1
  205. package/lib/typescript/src/components/business/VersionPill/types.d.ts.map +1 -1
  206. package/lib/typescript/src/components/business/index.d.ts +1 -1
  207. package/lib/typescript/src/components/business/index.d.ts.map +1 -1
  208. package/lib/typescript/src/components/business/useSvgId.d.ts +12 -0
  209. package/lib/typescript/src/components/business/useSvgId.d.ts.map +1 -0
  210. package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts +1 -1
  211. package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts.map +1 -1
  212. package/lib/typescript/src/components/ui/Avatar/styles.d.ts +1 -1
  213. package/lib/typescript/src/components/ui/Avatar/styles.d.ts.map +1 -1
  214. package/lib/typescript/src/components/ui/Avatar/types.d.ts +3 -1
  215. package/lib/typescript/src/components/ui/Avatar/types.d.ts.map +1 -1
  216. package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.d.ts +1 -1
  217. package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.d.ts.map +1 -1
  218. package/lib/typescript/src/components/ui/BlurLayer/BlurLayer.web.d.ts.map +1 -1
  219. package/lib/typescript/src/components/ui/Button/Button.d.ts +1 -1
  220. package/lib/typescript/src/components/ui/Button/Button.d.ts.map +1 -1
  221. package/lib/typescript/src/components/ui/Button/ButtonBase.d.ts.map +1 -1
  222. package/lib/typescript/src/components/ui/Button/styles.d.ts +2 -1
  223. package/lib/typescript/src/components/ui/Button/styles.d.ts.map +1 -1
  224. package/lib/typescript/src/components/ui/Button/types.d.ts +1 -1
  225. package/lib/typescript/src/components/ui/Button/types.d.ts.map +1 -1
  226. package/lib/typescript/src/components/ui/Card/Card.d.ts.map +1 -1
  227. package/lib/typescript/src/components/ui/Card/styles.d.ts +2 -0
  228. package/lib/typescript/src/components/ui/Card/styles.d.ts.map +1 -1
  229. package/lib/typescript/src/components/ui/Card/types.d.ts +4 -4
  230. package/lib/typescript/src/components/ui/Card/types.d.ts.map +1 -1
  231. package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts +4 -11
  232. package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts.map +1 -1
  233. package/lib/typescript/src/components/ui/Carousel/index.d.ts +1 -1
  234. package/lib/typescript/src/components/ui/Carousel/index.d.ts.map +1 -1
  235. package/lib/typescript/src/components/ui/Carousel/types.d.ts +4 -0
  236. package/lib/typescript/src/components/ui/Carousel/types.d.ts.map +1 -1
  237. package/lib/typescript/src/components/ui/Cell/Cell.d.ts.map +1 -1
  238. package/lib/typescript/src/components/ui/Cell/List.d.ts.map +1 -1
  239. package/lib/typescript/src/components/ui/Cell/styles.d.ts +1 -1
  240. package/lib/typescript/src/components/ui/Cell/styles.d.ts.map +1 -1
  241. package/lib/typescript/src/components/ui/Cell/types.d.ts +5 -2
  242. package/lib/typescript/src/components/ui/Cell/types.d.ts.map +1 -1
  243. package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
  244. package/lib/typescript/src/components/ui/Checkbox/styles.d.ts +6 -0
  245. package/lib/typescript/src/components/ui/Checkbox/styles.d.ts.map +1 -1
  246. package/lib/typescript/src/components/ui/Chip/Chip.d.ts +4 -3
  247. package/lib/typescript/src/components/ui/Chip/Chip.d.ts.map +1 -1
  248. package/lib/typescript/src/components/ui/Chip/types.d.ts +2 -0
  249. package/lib/typescript/src/components/ui/Chip/types.d.ts.map +1 -1
  250. package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts.map +1 -1
  251. package/lib/typescript/src/components/ui/Confirm/confirm.d.ts.map +1 -1
  252. package/lib/typescript/src/components/ui/Confirm/types.d.ts +4 -2
  253. package/lib/typescript/src/components/ui/Confirm/types.d.ts.map +1 -1
  254. package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts +1 -1
  255. package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts.map +1 -1
  256. package/lib/typescript/src/components/ui/DrawerHeader/styles.d.ts.map +1 -1
  257. package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts +3 -1
  258. package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts.map +1 -1
  259. package/lib/typescript/src/components/ui/Empty/Empty.d.ts +2 -2
  260. package/lib/typescript/src/components/ui/Empty/Empty.d.ts.map +1 -1
  261. package/lib/typescript/src/components/ui/Empty/types.d.ts +3 -0
  262. package/lib/typescript/src/components/ui/Empty/types.d.ts.map +1 -1
  263. package/lib/typescript/src/components/ui/EntryCard/EntryCard.d.ts.map +1 -1
  264. package/lib/typescript/src/components/ui/EntryCard/styles.d.ts.map +1 -1
  265. package/lib/typescript/src/components/ui/EntryCard/types.d.ts +2 -2
  266. package/lib/typescript/src/components/ui/EntryCard/types.d.ts.map +1 -1
  267. package/lib/typescript/src/components/ui/Form/FormRow.d.ts.map +1 -1
  268. package/lib/typescript/src/components/ui/Form/styles.d.ts +1 -0
  269. package/lib/typescript/src/components/ui/Form/styles.d.ts.map +1 -1
  270. package/lib/typescript/src/components/ui/Form/types.d.ts +7 -2
  271. package/lib/typescript/src/components/ui/Form/types.d.ts.map +1 -1
  272. package/lib/typescript/src/components/ui/Grid/Grid.d.ts +1 -1
  273. package/lib/typescript/src/components/ui/Grid/Grid.d.ts.map +1 -1
  274. package/lib/typescript/src/components/ui/Grid/styles.d.ts.map +1 -1
  275. package/lib/typescript/src/components/ui/Grid/types.d.ts +4 -1
  276. package/lib/typescript/src/components/ui/Grid/types.d.ts.map +1 -1
  277. package/lib/typescript/src/components/ui/Icon/Icon.d.ts.map +1 -1
  278. package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts +1 -1
  279. package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts.map +1 -1
  280. package/lib/typescript/src/components/ui/IconButton/types.d.ts +7 -2
  281. package/lib/typescript/src/components/ui/IconButton/types.d.ts.map +1 -1
  282. package/lib/typescript/src/components/ui/Input/Input.d.ts +16 -16
  283. package/lib/typescript/src/components/ui/Input/types.d.ts +3 -2
  284. package/lib/typescript/src/components/ui/Input/types.d.ts.map +1 -1
  285. package/lib/typescript/src/components/ui/Logo/Logo.d.ts.map +1 -1
  286. package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts +8 -1
  287. package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts.map +1 -1
  288. package/lib/typescript/src/components/ui/NavBar/types.d.ts +5 -1
  289. package/lib/typescript/src/components/ui/NavBar/types.d.ts.map +1 -1
  290. package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts +13 -5
  291. package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts.map +1 -1
  292. package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts +1 -1
  293. package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts.map +1 -1
  294. package/lib/typescript/src/components/ui/PasswordInput/types.d.ts +7 -2
  295. package/lib/typescript/src/components/ui/PasswordInput/types.d.ts.map +1 -1
  296. package/lib/typescript/src/components/ui/Pulse/Pulse.d.ts +1 -1
  297. package/lib/typescript/src/components/ui/Pulse/Pulse.d.ts.map +1 -1
  298. package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts +1 -1
  299. package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts.map +1 -1
  300. package/lib/typescript/src/components/ui/Pulse/types.d.ts +5 -0
  301. package/lib/typescript/src/components/ui/Pulse/types.d.ts.map +1 -1
  302. package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts +12 -8
  303. package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts.map +1 -1
  304. package/lib/typescript/src/components/ui/Radio/Radio.d.ts.map +1 -1
  305. package/lib/typescript/src/components/ui/Radio/RadioGroup.d.ts.map +1 -1
  306. package/lib/typescript/src/components/ui/Radio/styles.d.ts +4 -2
  307. package/lib/typescript/src/components/ui/Radio/styles.d.ts.map +1 -1
  308. package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts +9 -0
  309. package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts.map +1 -1
  310. package/lib/typescript/src/components/ui/Search/Search.d.ts +16 -15
  311. package/lib/typescript/src/components/ui/Search/Search.d.ts.map +1 -1
  312. package/lib/typescript/src/components/ui/Search/types.d.ts +3 -1
  313. package/lib/typescript/src/components/ui/Search/types.d.ts.map +1 -1
  314. package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts +1 -1
  315. package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts.map +1 -1
  316. package/lib/typescript/src/components/ui/Segmented/styles.d.ts +1 -1
  317. package/lib/typescript/src/components/ui/Segmented/styles.d.ts.map +1 -1
  318. package/lib/typescript/src/components/ui/Segmented/types.d.ts +2 -0
  319. package/lib/typescript/src/components/ui/Segmented/types.d.ts.map +1 -1
  320. package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts +3 -2
  321. package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts.map +1 -1
  322. package/lib/typescript/src/components/ui/Spinner/Spinner.d.ts.map +1 -1
  323. package/lib/typescript/src/components/ui/Spinner/Spinner.web.d.ts.map +1 -1
  324. package/lib/typescript/src/components/ui/Spinner/shared.d.ts +5 -0
  325. package/lib/typescript/src/components/ui/Spinner/shared.d.ts.map +1 -0
  326. package/lib/typescript/src/components/ui/StatusDot/StatusDot.d.ts +1 -5
  327. package/lib/typescript/src/components/ui/StatusDot/StatusDot.d.ts.map +1 -1
  328. package/lib/typescript/src/components/ui/StatusDot/styles.d.ts +1 -1
  329. package/lib/typescript/src/components/ui/StatusDot/types.d.ts +13 -1
  330. package/lib/typescript/src/components/ui/StatusDot/types.d.ts.map +1 -1
  331. package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts.map +1 -1
  332. package/lib/typescript/src/components/ui/Switch/Switch.d.ts.map +1 -1
  333. package/lib/typescript/src/components/ui/Switch/Switch.web.d.ts.map +1 -1
  334. package/lib/typescript/src/components/ui/Switch/styles.d.ts +7 -1
  335. package/lib/typescript/src/components/ui/Switch/styles.d.ts.map +1 -1
  336. package/lib/typescript/src/components/ui/TabBar/TabBar.d.ts +2 -2
  337. package/lib/typescript/src/components/ui/TabBar/TabBar.d.ts.map +1 -1
  338. package/lib/typescript/src/components/ui/TabBar/styles.d.ts.map +1 -1
  339. package/lib/typescript/src/components/ui/TabBar/types.d.ts +3 -0
  340. package/lib/typescript/src/components/ui/TabBar/types.d.ts.map +1 -1
  341. package/lib/typescript/src/components/ui/Tabs/Tabs.d.ts +1 -1
  342. package/lib/typescript/src/components/ui/Tabs/Tabs.d.ts.map +1 -1
  343. package/lib/typescript/src/components/ui/Tabs/styles.d.ts.map +1 -1
  344. package/lib/typescript/src/components/ui/Tabs/types.d.ts +9 -1
  345. package/lib/typescript/src/components/ui/Tabs/types.d.ts.map +1 -1
  346. package/lib/typescript/src/components/ui/Tag/styles.d.ts +2 -1
  347. package/lib/typescript/src/components/ui/Tag/styles.d.ts.map +1 -1
  348. package/lib/typescript/src/components/ui/Tag/types.d.ts +6 -2
  349. package/lib/typescript/src/components/ui/Tag/types.d.ts.map +1 -1
  350. package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts +16 -16
  351. package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts.map +1 -1
  352. package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts +16 -16
  353. package/lib/typescript/src/components/ui/Textarea/types.d.ts +2 -1
  354. package/lib/typescript/src/components/ui/Textarea/types.d.ts.map +1 -1
  355. package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts.map +1 -1
  356. package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts +3 -0
  357. package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts.map +1 -1
  358. package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts.map +1 -1
  359. package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts.map +1 -1
  360. package/lib/typescript/src/components/ui/Toast/styles.d.ts.map +1 -1
  361. package/lib/typescript/src/components/ui/Toast/toast.d.ts +0 -5
  362. package/lib/typescript/src/components/ui/Toast/toast.d.ts.map +1 -1
  363. package/lib/typescript/src/components/ui/Toast/types.d.ts +1 -1
  364. package/lib/typescript/src/components/ui/Toast/types.d.ts.map +1 -1
  365. package/lib/typescript/src/components/ui/shared/badgeStyles.d.ts +27 -0
  366. package/lib/typescript/src/components/ui/shared/badgeStyles.d.ts.map +1 -0
  367. package/lib/typescript/src/icons/data.d.ts.map +1 -1
  368. package/lib/typescript/src/icons/types.d.ts +18 -12
  369. package/lib/typescript/src/icons/types.d.ts.map +1 -1
  370. package/lib/typescript/src/theme/colors.d.ts +9 -3
  371. package/lib/typescript/src/theme/colors.d.ts.map +1 -1
  372. package/lib/typescript/src/theme/index.d.ts +3 -2
  373. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  374. package/lib/typescript/src/theme/scale.d.ts.map +1 -1
  375. package/lib/typescript/src/theme/shadow.d.ts +8 -8
  376. package/lib/typescript/src/theme/shadow.d.ts.map +1 -1
  377. package/lib/typescript/src/theme/tokens.d.ts +7 -3
  378. package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
  379. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts +8 -0
  380. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts.map +1 -0
  381. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts +6 -0
  382. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts.map +1 -0
  383. package/lib/typescript/src/theme/useTheme.d.ts.map +1 -1
  384. package/lib/typescript/src/utils/logger/logger.d.ts.map +1 -1
  385. package/lib/typescript/src/utils/testID/testID.d.ts +6 -3
  386. package/lib/typescript/src/utils/testID/testID.d.ts.map +1 -1
  387. package/package.json +2 -1
  388. package/src/components/business/AvatarWithRing/AvatarWithRing.tsx +5 -4
  389. package/src/components/business/AvatarWithRing/styles.ts +21 -3
  390. package/src/components/business/AvatarWithRing/types.ts +3 -1
  391. package/src/components/business/Decorations/GradientWash.tsx +46 -22
  392. package/src/components/business/Decorations/RadialHalo.tsx +8 -4
  393. package/src/components/business/Decorations/ScreenBackdrop.tsx +23 -5
  394. package/src/components/business/Decorations/index.ts +4 -0
  395. package/src/components/business/Decorations/types.ts +2 -0
  396. package/src/components/business/GlassStats/GlassStats.tsx +8 -4
  397. package/src/components/business/GlassStats/types.ts +6 -0
  398. package/src/components/business/VersionPill/VersionPill.tsx +46 -6
  399. package/src/components/business/VersionPill/styles.ts +1 -1
  400. package/src/components/business/VersionPill/types.ts +13 -1
  401. package/src/components/business/index.ts +1 -0
  402. package/src/components/business/useSvgId.ts +17 -0
  403. package/src/components/ui/Avatar/Avatar.tsx +17 -10
  404. package/src/components/ui/Avatar/styles.ts +7 -7
  405. package/src/components/ui/Avatar/types.ts +3 -1
  406. package/src/components/ui/BlurLayer/BlurLayer.tsx +4 -1
  407. package/src/components/ui/BlurLayer/BlurLayer.web.tsx +7 -1
  408. package/src/components/ui/Button/Button.tsx +2 -1
  409. package/src/components/ui/Button/ButtonBase.tsx +26 -2
  410. package/src/components/ui/Button/styles.ts +27 -25
  411. package/src/components/ui/Button/types.ts +1 -1
  412. package/src/components/ui/Card/Card.tsx +17 -7
  413. package/src/components/ui/Card/styles.ts +5 -0
  414. package/src/components/ui/Card/types.ts +4 -4
  415. package/src/components/ui/Carousel/Carousel.tsx +44 -15
  416. package/src/components/ui/Carousel/index.ts +1 -1
  417. package/src/components/ui/Carousel/types.ts +5 -0
  418. package/src/components/ui/Cell/Cell.tsx +28 -6
  419. package/src/components/ui/Cell/Leading.tsx +2 -2
  420. package/src/components/ui/Cell/List.tsx +14 -8
  421. package/src/components/ui/Cell/styles.ts +8 -5
  422. package/src/components/ui/Cell/types.ts +5 -2
  423. package/src/components/ui/Checkbox/Checkbox.tsx +18 -5
  424. package/src/components/ui/Checkbox/styles.ts +8 -0
  425. package/src/components/ui/Chip/Chip.tsx +20 -5
  426. package/src/components/ui/Chip/types.ts +2 -0
  427. package/src/components/ui/Confirm/ConfirmHost.tsx +26 -10
  428. package/src/components/ui/Confirm/confirm.ts +8 -0
  429. package/src/components/ui/Confirm/types.ts +4 -2
  430. package/src/components/ui/DrawerHeader/DrawerHeader.tsx +18 -12
  431. package/src/components/ui/DrawerHeader/styles.ts +10 -6
  432. package/src/components/ui/DrawerHeader/types.ts +3 -1
  433. package/src/components/ui/Empty/Empty.tsx +5 -4
  434. package/src/components/ui/Empty/types.ts +3 -0
  435. package/src/components/ui/EntryCard/EntryCard.tsx +5 -3
  436. package/src/components/ui/EntryCard/styles.ts +13 -4
  437. package/src/components/ui/EntryCard/types.ts +2 -2
  438. package/src/components/ui/Form/FormRow.tsx +7 -1
  439. package/src/components/ui/Form/styles.ts +2 -0
  440. package/src/components/ui/Form/types.ts +7 -2
  441. package/src/components/ui/Grid/Grid.tsx +42 -25
  442. package/src/components/ui/Grid/styles.ts +8 -20
  443. package/src/components/ui/Grid/types.ts +4 -1
  444. package/src/components/ui/Icon/Icon.tsx +42 -27
  445. package/src/components/ui/IconButton/IconButton.tsx +2 -0
  446. package/src/components/ui/IconButton/types.ts +8 -2
  447. package/src/components/ui/Input/types.ts +3 -2
  448. package/src/components/ui/Logo/Logo.tsx +2 -1
  449. package/src/components/ui/NavBar/NavBar.tsx +16 -2
  450. package/src/components/ui/NavBar/types.ts +5 -1
  451. package/src/components/ui/PasswordInput/PasswordInput.tsx +77 -43
  452. package/src/components/ui/PasswordInput/styles.ts +1 -1
  453. package/src/components/ui/PasswordInput/types.ts +7 -2
  454. package/src/components/ui/Pulse/Pulse.tsx +2 -1
  455. package/src/components/ui/Pulse/PulseDot.tsx +7 -6
  456. package/src/components/ui/Pulse/types.ts +6 -0
  457. package/src/components/ui/Pulse/usePulse.web.ts +50 -33
  458. package/src/components/ui/Radio/Radio.tsx +29 -6
  459. package/src/components/ui/Radio/RadioGroup.tsx +10 -3
  460. package/src/components/ui/Radio/styles.ts +9 -2
  461. package/src/components/ui/Reveal/Reveal.web.tsx +18 -3
  462. package/src/components/ui/Search/Search.tsx +22 -9
  463. package/src/components/ui/Search/types.ts +7 -1
  464. package/src/components/ui/Segmented/Segmented.tsx +8 -3
  465. package/src/components/ui/Segmented/styles.ts +4 -2
  466. package/src/components/ui/Segmented/types.ts +2 -0
  467. package/src/components/ui/Skeleton/Skeleton.tsx +9 -8
  468. package/src/components/ui/Spinner/Spinner.tsx +17 -17
  469. package/src/components/ui/Spinner/Spinner.web.tsx +7 -15
  470. package/src/components/ui/Spinner/shared.ts +37 -0
  471. package/src/components/ui/StatusDot/StatusDot.tsx +21 -3
  472. package/src/components/ui/StatusDot/styles.ts +1 -1
  473. package/src/components/ui/StatusDot/types.ts +14 -1
  474. package/src/components/ui/Stepper/Stepper.tsx +45 -10
  475. package/src/components/ui/Switch/Switch.tsx +4 -10
  476. package/src/components/ui/Switch/Switch.web.tsx +2 -8
  477. package/src/components/ui/Switch/styles.ts +10 -1
  478. package/src/components/ui/TabBar/TabBar.tsx +14 -6
  479. package/src/components/ui/TabBar/styles.ts +9 -21
  480. package/src/components/ui/TabBar/types.ts +3 -0
  481. package/src/components/ui/Tabs/Tabs.tsx +24 -5
  482. package/src/components/ui/Tabs/styles.ts +6 -2
  483. package/src/components/ui/Tabs/types.ts +10 -1
  484. package/src/components/ui/Tag/styles.ts +18 -10
  485. package/src/components/ui/Tag/types.ts +6 -2
  486. package/src/components/ui/TextField/TextFieldBase.tsx +31 -6
  487. package/src/components/ui/Textarea/types.ts +2 -1
  488. package/src/components/ui/Thumbnail/Thumbnail.tsx +14 -3
  489. package/src/components/ui/Thumbnail/styles.ts +6 -2
  490. package/src/components/ui/Toast/ToastHost.tsx +16 -8
  491. package/src/components/ui/Toast/ToastHost.web.tsx +26 -4
  492. package/src/components/ui/Toast/styles.ts +2 -0
  493. package/src/components/ui/Toast/toast.ts +35 -2
  494. package/src/components/ui/Toast/types.ts +1 -1
  495. package/src/components/ui/shared/badgeStyles.ts +36 -0
  496. package/src/icons/data.ts +27 -0
  497. package/src/icons/types.ts +25 -10
  498. package/src/theme/colors.ts +29 -10
  499. package/src/theme/index.ts +10 -1
  500. package/src/theme/scale.ts +5 -1
  501. package/src/theme/shadow.ts +33 -24
  502. package/src/theme/tokens.ts +10 -5
  503. package/src/theme/usePrefersReducedMotion.ts +9 -0
  504. package/src/theme/usePrefersReducedMotion.web.ts +27 -0
  505. package/src/theme/useTheme.ts +15 -0
  506. package/src/utils/logger/logger.ts +5 -1
  507. package/src/utils/testID/testID.ts +6 -3
  508. package/lib/module/components/index.js +0 -5
  509. package/lib/module/components/index.js.map +0 -1
  510. package/lib/typescript/src/components/index.d.ts +0 -3
  511. package/lib/typescript/src/components/index.d.ts.map +0 -1
  512. package/src/components/index.ts +0 -2
@@ -1,5 +1,5 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import { Text, View } from 'react-native';
1
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { AccessibilityInfo, Text, View } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
  import Animated, {
5
5
  cancelAnimation,
@@ -9,6 +9,7 @@ import Animated, {
9
9
  withTiming,
10
10
  } from 'react-native-reanimated';
11
11
  import { useColors, useThemedStyles, motion, space } from '../../../theme';
12
+ import { childTestID } from '../../../utils/testID';
12
13
  import { dotColorFor, makeStyles } from './styles';
13
14
  import { _subs } from './toast';
14
15
  import type { Subscriber, ToastEntry, ToastHostProps } from './types';
@@ -42,8 +43,18 @@ export function ToastHost({
42
43
  };
43
44
  }, []);
44
45
 
46
+ // 退场完成只清「仍是自己」的 entry:withTiming 完成回调经 runOnJS 跨线程异步投递,
47
+ // 投递到执行之间若来了新 toast,无 id 守卫的 setEntry(null) 会把新 toast 瞬时清掉([M-14])。
48
+ const dismissIfCurrent = useCallback((id: number) => {
49
+ setEntry((cur) => (cur?.id === id ? null : cur));
50
+ }, []);
51
+
45
52
  useEffect(() => {
46
53
  if (!entry) return;
54
+ // [M-15] toast 出现时主动播报 —— 容器 pointerEvents="none" + 3s 自动消失,
55
+ // SR 用户对一闪而过的反馈本无任何感知通道。
56
+ AccessibilityInfo.announceForAccessibility(entry.message);
57
+ const id = entry.id;
47
58
  // 进入方向:top 从上(-8)滑入,bottom / center 从下(8)滑入
48
59
  const from = entry.position === 'top' ? -8 : 8;
49
60
  cancelAnimation(op);
@@ -56,7 +67,7 @@ export function ToastHost({
56
67
  dismissTimer.current = setTimeout(() => {
57
68
  op.value = withTiming(0, { duration: motion.base });
58
69
  ty.value = withTiming(from, { duration: motion.base }, (finished) => {
59
- if (finished) runOnJS(setEntry)(null);
70
+ if (finished) runOnJS(dismissIfCurrent)(id);
60
71
  });
61
72
  }, entry.duration);
62
73
 
@@ -65,7 +76,7 @@ export function ToastHost({
65
76
  cancelAnimation(op);
66
77
  cancelAnimation(ty);
67
78
  };
68
- }, [entry, op, ty]);
79
+ }, [entry, op, ty, dismissIfCurrent]);
69
80
 
70
81
  const animatedStyle = useAnimatedStyle(() => ({
71
82
  opacity: op.value,
@@ -90,10 +101,7 @@ export function ToastHost({
90
101
  {dotColor ? (
91
102
  <View style={[styles.dot, { backgroundColor: dotColor }]} />
92
103
  ) : null}
93
- <Text
94
- style={styles.text}
95
- testID={testID ? `${testID}-text` : undefined}
96
- >
104
+ <Text style={styles.text} testID={childTestID(testID, 'text')}>
97
105
  {entry.message}
98
106
  </Text>
99
107
  </Animated.View>
@@ -1,6 +1,13 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { Text, View } from 'react-native';
3
- import { useColors, useThemedStyles, motion } from '../../../theme';
2
+ import { AccessibilityInfo, Text, View } from 'react-native';
3
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
+ import {
5
+ motion,
6
+ space,
7
+ useColors,
8
+ usePrefersReducedMotion,
9
+ useThemedStyles,
10
+ } from '../../../theme';
4
11
  import { dotColorFor, makeStyles } from './styles';
5
12
  import { _subs } from './toast';
6
13
  import type { Subscriber, ToastEntry, ToastHostProps } from './types';
@@ -20,6 +27,8 @@ export function ToastHost({
20
27
  }: ToastHostProps = {}): React.JSX.Element | null {
21
28
  const c = useColors();
22
29
  const styles = useThemedStyles(makeStyles);
30
+ const insets = useSafeAreaInsets();
31
+ const reduced = usePrefersReducedMotion();
23
32
  const [entry, setEntry] = useState<ToastEntry | null>(null);
24
33
  const [visible, setVisible] = useState(false);
25
34
  const dismissTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
@@ -39,6 +48,8 @@ export function ToastHost({
39
48
  useEffect(() => {
40
49
  // entry=null:上一轮 effect 的 cleanup 已清 timer/RAF,这里无需重复。
41
50
  if (!entry) return;
51
+ // [M-15] web 同样主动播报(RN-Web announceForAccessibility 注入 aria-live region)。
52
+ AccessibilityInfo.announceForAccessibility(entry.message);
42
53
 
43
54
  // cancelled 标志:entry 快速连续切换 / 组件卸载时,cleanup 置 true。RAF 与
44
55
  // timer 回调执行前都检查它 —— cancelAnimationFrame 在部分浏览器不保证取消
@@ -77,15 +88,26 @@ export function ToastHost({
77
88
 
78
89
  if (!entry) return null;
79
90
 
91
+ // 位置:top=顶部(safe-area + 间距)/ center=屏幕居中 / bottom=底部(默认),复刻 native 版。
92
+ // 此前 web 完全未注入定位,position 参数被静默忽略、垂直位置随挂载次序漂移([H-6])。
93
+ const posStyle =
94
+ entry.position === 'top'
95
+ ? { top: insets.top + space[10] }
96
+ : entry.position === 'center'
97
+ ? { top: 0, bottom: 0, justifyContent: 'center' as const }
98
+ : { bottom: insets.bottom + space[10] };
99
+
80
100
  const dotColor = dotColorFor(entry.kind, c);
81
101
  const animatedWebStyle: React.CSSProperties = {
82
102
  opacity: visible ? 1 : 0,
83
103
  transform: visible ? 'translateY(0px)' : 'translateY(8px)',
84
- transition: `opacity ${motion.base}ms ease-out, transform ${motion.base}ms ease-out`,
104
+ transition: reduced
105
+ ? 'none'
106
+ : `opacity ${motion.base}ms ease-out, transform ${motion.base}ms ease-out`,
85
107
  };
86
108
 
87
109
  return (
88
- <View style={styles.host} pointerEvents="none" testID={testID}>
110
+ <View style={[styles.host, posStyle]} pointerEvents="none" testID={testID}>
89
111
  <div style={animatedWebStyle}>
90
112
  <View style={styles.toast}>
91
113
  {dotColor ? (
@@ -14,6 +14,8 @@ export const makeStyles = (c: ColorTokens) =>
14
14
  // zIndex: toast 浮层 —— 盖在 Screen 内容之上(navigator / overlay 之下)。
15
15
  // 同级兄弟节点无 z 顺序需求,但作为 absolute 浮岛对其他屏内 absolute 节点
16
16
  // 需要显式 200 抢占,保留并锁数值。
17
+ // 注意:confirm() 的原生 Modal 是 window 级,永远盖在 toast 之上 —— confirm
18
+ // 打开期间到达的 toast 不可见,勿把 toast 当作 confirm 显示期间的反馈通道。
17
19
  zIndex: 200,
18
20
  },
19
21
  toast: {
@@ -3,22 +3,55 @@
3
3
  *
4
4
  * 文件名故意小写 `toast.ts`,host 组件叫 `ToastHost.tsx`,避免 APFS 大小写冲突。
5
5
  */
6
+ import { createLogger } from '../../../utils/logger';
6
7
  import type { Subscriber, ToastEntry, ToastInput, ToastKind } from './types';
7
8
 
9
+ const log = createLogger('toast');
10
+
8
11
  let _id = 0;
9
12
  export const _subs = new Set<Subscriber>();
10
13
 
14
+ const DEFAULT_DURATION = 3000;
15
+ // [L-55] duration 合法域:[1, 2^31)。INT32_MAX = 2^31-1 = 2147483647,
16
+ // setTimeout 内部用 int32 存储,超出会溢出变成 0 立即触发。
17
+ const MAX_DURATION = 2147483647;
18
+
19
+ /** [L-55] 钳制 duration 到 [1, 2^31),域外回落 DEFAULT_DURATION 并 dev warn。 */
20
+ function clampDuration(raw: number | undefined): number {
21
+ if (raw == null) return DEFAULT_DURATION;
22
+ if (!Number.isFinite(raw) || raw < 1 || raw >= MAX_DURATION) {
23
+ log.warn(
24
+ `toast duration(${raw}) 超出合法域 [1, 2^31),已回落 ${DEFAULT_DURATION}ms。`
25
+ );
26
+ return DEFAULT_DURATION;
27
+ }
28
+ return Math.trunc(raw);
29
+ }
30
+
11
31
  function emit(input: ToastInput, kind: ToastKind = 'info') {
12
32
  const entry: ToastEntry =
13
33
  typeof input === 'string'
14
- ? { id: ++_id, message: input, kind, duration: 3000, position: 'bottom' }
34
+ ? {
35
+ id: ++_id,
36
+ message: input,
37
+ kind,
38
+ duration: DEFAULT_DURATION,
39
+ position: 'bottom',
40
+ }
15
41
  : {
16
42
  id: ++_id,
17
43
  message: input.message,
18
44
  kind: input.kind ?? kind,
19
- duration: input.duration ?? 3000,
45
+ duration: clampDuration(input.duration),
20
46
  position: input.position ?? 'bottom',
21
47
  };
48
+ // 未挂 <ToastHost />:消息无人接收,告警提示集成漏挂(对照 confirm 重入告警的纪律)。
49
+ if (_subs.size === 0) {
50
+ log.warn(
51
+ 'toast() 调用时未挂载 <ToastHost />,消息被丢弃。请在 app 根附近挂一次 <ToastHost />。'
52
+ );
53
+ return;
54
+ }
22
55
  _subs.forEach((s) => s(entry));
23
56
  }
24
57
 
@@ -23,7 +23,7 @@ export type ToastInput =
23
23
  };
24
24
 
25
25
  export type ToastEntry = {
26
- /** 唯一 id(自增),用于动画切换识别 */
26
+ /** 唯一 id(自增)—— 退场守卫用:ToastHost 只清「仍是当前」的 toast,避免清掉竞态期到达的新 toast */
27
27
  id: number;
28
28
  /** 消息文本 */
29
29
  message: string;
@@ -0,0 +1,36 @@
1
+ import { StyleSheet } from 'react-native';
2
+ import {
3
+ fw,
4
+ r,
5
+ radius,
6
+ space,
7
+ type as t,
8
+ type ColorTokens,
9
+ } from '../../../theme';
10
+
11
+ /**
12
+ * 角标样式工厂 —— Grid/TabBar 等组件图标右上角小红点共用。
13
+ * @param c 颜色 token
14
+ * @param top 角标纵向偏移(不同场景基点不同:Grid 图标 r(-6) / TabBar 图标 r(-3))
15
+ */
16
+ export const badgeStyles = (c: ColorTokens, top: number) =>
17
+ StyleSheet.create({
18
+ badge: {
19
+ position: 'absolute',
20
+ top,
21
+ right: r(-10),
22
+ minWidth: r(16),
23
+ height: r(16),
24
+ borderRadius: radius.md,
25
+ backgroundColor: c.error,
26
+ paddingHorizontal: space[1],
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ },
30
+ badgeText: {
31
+ color: c.onError,
32
+ fontSize: t.nano,
33
+ fontWeight: fw.bold,
34
+ lineHeight: 12,
35
+ },
36
+ });
package/src/icons/data.ts CHANGED
@@ -166,6 +166,7 @@ export const ICONS: Record<IconName, IconDef> = {
166
166
  cy: 16.3,
167
167
  r: 0.95,
168
168
  fill: 'currentColor',
169
+ stroke: 'none',
169
170
  },
170
171
  ],
171
172
  },
@@ -235,6 +236,7 @@ export const ICONS: Record<IconName, IconDef> = {
235
236
  {
236
237
  kind: 'path',
237
238
  d: 'M6 10v4M10 10v4M14 10v4M18 10v4',
239
+ opacity: 0.55,
238
240
  },
239
241
  ],
240
242
  },
@@ -252,6 +254,7 @@ export const ICONS: Record<IconName, IconDef> = {
252
254
  {
253
255
  kind: 'path',
254
256
  d: 'M8 10v4M12 10v4M16 10v4',
257
+ opacity: 0.55,
255
258
  },
256
259
  ],
257
260
  },
@@ -459,6 +462,7 @@ export const ICONS: Record<IconName, IconDef> = {
459
462
  cy: 13,
460
463
  r: 0.9,
461
464
  fill: 'currentColor',
465
+ stroke: 'none',
462
466
  },
463
467
  {
464
468
  kind: 'circle',
@@ -466,6 +470,7 @@ export const ICONS: Record<IconName, IconDef> = {
466
470
  cy: 13,
467
471
  r: 0.9,
468
472
  fill: 'currentColor',
473
+ stroke: 'none',
469
474
  },
470
475
  {
471
476
  kind: 'circle',
@@ -473,6 +478,7 @@ export const ICONS: Record<IconName, IconDef> = {
473
478
  cy: 13,
474
479
  r: 0.9,
475
480
  fill: 'currentColor',
481
+ stroke: 'none',
476
482
  },
477
483
  {
478
484
  kind: 'circle',
@@ -480,6 +486,7 @@ export const ICONS: Record<IconName, IconDef> = {
480
486
  cy: 17,
481
487
  r: 0.9,
482
488
  fill: 'currentColor',
489
+ stroke: 'none',
483
490
  },
484
491
  {
485
492
  kind: 'circle',
@@ -487,6 +494,7 @@ export const ICONS: Record<IconName, IconDef> = {
487
494
  cy: 17,
488
495
  r: 0.9,
489
496
  fill: 'currentColor',
497
+ stroke: 'none',
490
498
  },
491
499
  {
492
500
  kind: 'circle',
@@ -494,6 +502,7 @@ export const ICONS: Record<IconName, IconDef> = {
494
502
  cy: 17,
495
503
  r: 0.9,
496
504
  fill: 'currentColor',
505
+ stroke: 'none',
497
506
  },
498
507
  ],
499
508
  },
@@ -880,6 +889,7 @@ export const ICONS: Record<IconName, IconDef> = {
880
889
  kind: 'path',
881
890
  d: 'M8.8 11.4v1.2l3.4 1.3V10.1z',
882
891
  fill: 'currentColor',
892
+ stroke: 'none',
883
893
  },
884
894
  {
885
895
  kind: 'path',
@@ -910,6 +920,7 @@ export const ICONS: Record<IconName, IconDef> = {
910
920
  kind: 'path',
911
921
  d: 'M12 8.5l1.2 2.42 2.68.39-1.94 1.89.46 2.67L12 14.61l-2.4 1.26.46-2.67L8.12 11.31l2.68-.39z',
912
922
  fill: 'currentColor',
923
+ stroke: 'none',
913
924
  },
914
925
  ],
915
926
  },
@@ -983,6 +994,7 @@ export const ICONS: Record<IconName, IconDef> = {
983
994
  cy: 20,
984
995
  r: 0.7,
985
996
  fill: 'currentColor',
997
+ stroke: 'none',
986
998
  },
987
999
  ],
988
1000
  },
@@ -1789,6 +1801,7 @@ export const ICONS: Record<IconName, IconDef> = {
1789
1801
  cy: 17.6,
1790
1802
  r: 0.9,
1791
1803
  fill: 'currentColor',
1804
+ stroke: 'none',
1792
1805
  },
1793
1806
  {
1794
1807
  kind: 'path',
@@ -1939,6 +1952,7 @@ export const ICONS: Record<IconName, IconDef> = {
1939
1952
  height: 8,
1940
1953
  rx: 2,
1941
1954
  fill: 'currentColor',
1955
+ stroke: 'none',
1942
1956
  },
1943
1957
  ],
1944
1958
  },
@@ -1957,6 +1971,7 @@ export const ICONS: Record<IconName, IconDef> = {
1957
1971
  cy: 12,
1958
1972
  r: 6,
1959
1973
  fill: 'currentColor',
1974
+ stroke: 'none',
1960
1975
  },
1961
1976
  ],
1962
1977
  },
@@ -2059,6 +2074,8 @@ export const ICONS: Record<IconName, IconDef> = {
2059
2074
  width: 12,
2060
2075
  height: 12,
2061
2076
  rx: 1.5,
2077
+ fill: 'currentColor',
2078
+ stroke: 'none',
2062
2079
  },
2063
2080
  ],
2064
2081
  },
@@ -2091,6 +2108,7 @@ export const ICONS: Record<IconName, IconDef> = {
2091
2108
  kind: 'path',
2092
2109
  d: 'M19.2 2.5l.55 1.55 1.55.55-1.55.55-.55 1.55-.55-1.55-1.55-.55 1.55-.55z',
2093
2110
  fill: 'currentColor',
2111
+ stroke: 'none',
2094
2112
  },
2095
2113
  ],
2096
2114
  },
@@ -2175,6 +2193,7 @@ export const ICONS: Record<IconName, IconDef> = {
2175
2193
  cy: 16.5,
2176
2194
  r: 0.75,
2177
2195
  fill: 'currentColor',
2196
+ stroke: 'none',
2178
2197
  },
2179
2198
  ],
2180
2199
  },
@@ -2274,6 +2293,14 @@ export const ICONS: Record<IconName, IconDef> = {
2274
2293
  kind: 'path',
2275
2294
  d: 'M6 7l1 13a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-13',
2276
2295
  },
2296
+ {
2297
+ kind: 'path',
2298
+ d: 'M10 11v6',
2299
+ },
2300
+ {
2301
+ kind: 'path',
2302
+ d: 'M14 11v6',
2303
+ },
2277
2304
  ],
2278
2305
  },
2279
2306
  'undo': {
@@ -1,19 +1,34 @@
1
- /** 图标清单的稳定类型;path 数据由脚本生成。 */
1
+ /** 图标清单的稳定类型;几何与样式数据由 scripts/build-icons.js 生成。 */
2
+
3
+ /** 元素共享的可选样式属性(脚本从 svg 抽取,Icon 渲染端透传)。 */
4
+ type IconElementStyle = {
5
+ /** `currentColor` → 渲染时换成主题 stroke 色;缺省则继承 Svg 根的 `fill="none"`。 */
6
+ readonly fill?: string;
7
+ /** 元素不透明度(svg `opacity`),用于次要笔画(如格线 .55)。 */
8
+ readonly opacity?: number;
9
+ /** `'none'` = 该元素不描边(纯 fill 的圆点/方块),覆盖 Svg 根的 stroke 继承。 */
10
+ readonly stroke?: 'none';
11
+ };
12
+
13
+ // readonly 防止消费端原地改 ICONS 的元素数据污染模块级单例。
2
14
  export type IconElement =
3
- | { kind: 'path'; d: string; fill?: string }
4
- | { kind: 'circle'; cx: number; cy: number; r: number; fill?: string }
5
- | {
15
+ | (Readonly<{ kind: 'path'; d: string }> & IconElementStyle)
16
+ | (Readonly<{ kind: 'circle'; cx: number; cy: number; r: number }> &
17
+ IconElementStyle)
18
+ | (Readonly<{
6
19
  kind: 'rect';
7
20
  x: number;
8
21
  y: number;
9
22
  width: number;
10
23
  height: number;
24
+ // ry 未被 build-icons.js 抽取(脚本只取 rx),不在生成物中 —— 此处不声明,
25
+ // 保持类型与生成端契约一致,防渲染端出现永远不可达的 ry 分支。
11
26
  rx?: number;
12
- ry?: number;
13
- fill?: string;
14
- };
27
+ }> &
28
+ IconElementStyle);
15
29
 
16
- export type IconDef = {
30
+ export type IconDef = Readonly<{
17
31
  strokeWidth: number;
18
- elements: IconElement[];
19
- };
32
+ // readonly 数组:防止消费端 push/splice ICONS 的 elements 污染单例。
33
+ elements: readonly IconElement[];
34
+ }>;
@@ -1,8 +1,12 @@
1
1
  // Role-based color tokens —— role 名固定,亮/暗主题切的是 role 指向哪个 hex。
2
2
 
3
+ /** 品牌橙 hex —— 跨文件(colors 亮/暗 primary、glassActiveFg、avatarGradient、shadow BRAND)
4
+ * 共用同一来源,改品牌色只改这一处。 */
5
+ export const BRAND_ORANGE = '#EB6E00';
6
+
3
7
  export const lightColors = {
4
8
  // Brand
5
- primary: '#EB6E00',
9
+ primary: BRAND_ORANGE,
6
10
  primaryPressed: '#D06200',
7
11
  primaryContainer: '#FFF5EB',
8
12
  primaryContainerSubtle: '#FFF8F0',
@@ -48,6 +52,7 @@ export const lightColors = {
48
52
  inverseOnSurface: '#FFFFFF',
49
53
 
50
54
  // Misc
55
+ /** 亮色 0.5:标准遮挡强度,背景内容隐退但保留可感知轮廓,符合 iOS/MD 规范建议。 */
51
56
  scrim: 'rgba(0,0,0,0.5)',
52
57
  /** Sheet backdrop —— sheet 之下浅灰 tint,合规态高对比度让 sheet 焦点突出。
53
58
  * 跟通用 scrim(黑半透"普通遮挡")区分:这是"焦点引导"。 */
@@ -57,11 +62,11 @@ export const lightColors = {
57
62
  /** 玻璃容器内部分隔线 —— 暗色翻成对应低透白,保证暗底可见。 */
58
63
  glassSeparator: 'rgba(0,0,0,0.08)',
59
64
  /** 浮动玻璃胶囊外区 tint(TabBar 滚动玻璃门)。
60
- * 数值配合 blurAmount=25 让"玻璃门外区滚动内容透过模糊显示"达成。
65
+ * 数值配合 blur.strong(blurAmount=40) 让"玻璃门外区滚动内容透过模糊显示"达成。
61
66
  * 跟 glassTintLight 区分:此 token 给"玻璃门外区"语义。 */
62
67
  glassSurface: 'rgba(255,255,255,0.20)',
63
68
  /** TabBar 玻璃门 tint —— 跟 glassSurface 区分,真机实测 0.20 太厚看不清滚动内容,
64
- * TabBar 场景配合 blurAmount=15 主导,语义不同不可复用同一个 alpha。 */
69
+ * TabBar 场景配合 blur.soft(blurAmount=10) 主导,语义不同不可复用同一个 alpha。 */
65
70
  tabBarGlassTint: 'rgba(255,255,255,0.10)',
66
71
  /** 玻璃胶囊边框(亮 0.18 / 暗 0.14 白透)。 */
67
72
  glassBorder: 'rgba(255,255,255,0.18)',
@@ -72,7 +77,7 @@ export const lightColors = {
72
77
  glassStatsHighlight: 'rgba(255,255,255,0.65)',
73
78
  /** 玻璃胶囊 active 段文字 / icon 色。亮色同 primary;暗色 #FFB068
74
79
  * 更浅一档的橙,在半透深灰玻璃上分量更轻。 */
75
- glassActiveFg: '#EB6E00',
80
+ glassActiveFg: BRAND_ORANGE,
76
81
  /** 品牌橙 active 容器底 —— TabBar active 段比 brandTint10 多 2% 视觉权重。 */
77
82
  brandTint12: 'rgba(235,110,0,0.12)',
78
83
 
@@ -89,7 +94,10 @@ export const lightColors = {
89
94
  /** Me 屏 QR / 扫码按钮背景 —— scanBtn 要在 hero 上"凸起被看到"。 */
90
95
  qrBg: 'rgba(255,255,255,0.55)',
91
96
 
92
- // Hero gradient stops —— Me 屏顶部暖橙 → 浅黄 → background 三段渐变
97
+ // Hero gradient stops —— Me 屏顶部暖橙 → 浅黄 → background 三段渐变。
98
+ // 历史驻留:渐变序列按约定应进 palettes.ts,但 heroGradient 驻 ColorTokens 可随主题
99
+ // 自动切换(消费方无需手动 scheme 分支);迁 palettes 会让消费方须手写 scheme 判断,
100
+ // 属人体工程学回退。新渐变序列一律进 palettes.ts,不要往 colors.ts 追加。
93
101
  /** Hero 渐变第 1 段:暖橙起色。 */
94
102
  heroGradient0: '#FFE3C8',
95
103
  /** Hero 渐变第 2 段(0.55 offset):浅黄过渡。 */
@@ -108,7 +116,7 @@ export type ColorTokens = { [K in keyof typeof lightColors]: string };
108
116
 
109
117
  export const darkColors: ColorTokens = {
110
118
  // Brand
111
- primary: '#EB6E00',
119
+ primary: BRAND_ORANGE,
112
120
  primaryPressed: '#D06200',
113
121
  primaryContainer: '#3D1F00',
114
122
  primaryContainerSubtle: '#2A1500',
@@ -153,6 +161,8 @@ export const darkColors: ColorTokens = {
153
161
  inverseOnSurface: '#000000',
154
162
 
155
163
  // Misc
164
+ /** 暗色加深至 0.7(亮色 0.5):暗色环境底图对比度低、亮部元素更"抢眼",
165
+ * scrim 需更重才能有效压住背景,让前景 sheet / modal 焦点突出。 */
156
166
  scrim: 'rgba(0,0,0,0.7)',
157
167
  /** Sheet backdrop 暗色:沿用亮色同值,合规态保持浅 tint(打破暗色默认深底)让焦点
158
168
  * 聚焦在协议 sheet 上。 */
@@ -160,15 +170,21 @@ export const darkColors: ColorTokens = {
160
170
  // 暗色 0.06 白透,凸起感由 glassBar 暗色黑 0.35 shadow 补
161
171
  glassTintLight: 'rgba(255,255,255,0.06)',
162
172
  glassSeparator: 'rgba(255,255,255,0.10)',
163
- // 深灰半透 0.30,配合 blurAmount=25 让"玻璃门"语义达成
173
+ // 深灰半透 0.30,配合 blur.strong(blurAmount=40) 让"玻璃门"语义达成
164
174
  glassSurface: 'rgba(28,28,30,0.30)',
165
- // 配合 blurAmount=15 让内容透过模糊带 alpha 染色
175
+ // 配合 blur.soft(blurAmount=10) 让内容透过模糊带 alpha 染色
166
176
  tabBarGlassTint: 'rgba(28,28,30,0.18)',
167
177
  glassBorder: 'rgba(255,255,255,0.14)',
168
178
  glassHighlight: 'rgba(255,255,255,0.24)',
179
+ // 暗色降至 0.10(亮色 0.65):暗色 BlurView 背景本身已深,顶部高光过强会破坏玻璃质感
180
+ // 的"透视感"——0.10 轻轻描出上沿即足以传达"凸起"层级。
181
+ // 注:亮色"比 glassHighlight 更强(0.65>0.28)"在暗色刻意反转(0.10<0.24),
182
+ // 两端各自以视觉效果为准,非笔误。
169
183
  glassStatsHighlight: 'rgba(255,255,255,0.10)',
170
184
  // 浅橙,半透深灰玻璃上品牌色更亮起,视觉重量比纯品牌橙轻一档
171
185
  glassActiveFg: '#FFB068',
186
+ // 暗色 brandTint12 与 brandTint14 同值(0.22):亮色 10/12/14 三档在暗底视觉差微弱,
187
+ // 两档合一后对比度差异仍可感知;若后续设计需要恢复阶梯可将 brandTint12 改为 0.18-0.20。
172
188
  brandTint12: 'rgba(235,110,0,0.22)',
173
189
 
174
190
  // Icon faint —— 暗底反相成白色 alpha,数值跟亮色一致
@@ -183,6 +199,7 @@ export const darkColors: ColorTokens = {
183
199
 
184
200
  // Hero gradient stops —— 品牌橙 alpha 渐变。
185
201
  // react-native-svg <Stop stopColor> 支持 rgba 字符串,最终 alpha = rgba.a × stopOpacity。
202
+ // 历史驻留(同亮色注释):新渐变序列一律进 palettes.ts。
186
203
  heroGradient0: 'rgba(235,110,0,0.18)',
187
204
  heroGradient1: 'rgba(235,110,0,0.06)',
188
205
  heroGradient2: '#0A0A0A',
@@ -192,5 +209,7 @@ export const darkColors: ColorTokens = {
192
209
  glassPillBorder: 'rgba(255,255,255,0.12)',
193
210
  };
194
211
 
195
- /** 头像品牌渐变 —— 浅橙 → 主品牌橙,135° 对角线渐变。亮 / 暗共用。 */
196
- export const avatarGradient = ['#F49443', '#EB6E00'] as const;
212
+ /** 头像品牌渐变 —— 浅橙 → 主品牌橙,135° 对角线渐变。亮 / 暗共用。
213
+ * 历史驻留:渐变序列按约定应进 palettes.ts,但亮/暗共用无需 scheme 分支且消费面稳定,
214
+ * 迁移无收益。新渐变序列一律进 palettes.ts。 */
215
+ export const avatarGradient = ['#F49443', BRAND_ORANGE] as const;
@@ -1,4 +1,9 @@
1
- export { lightColors, darkColors, avatarGradient } from './colors';
1
+ export {
2
+ lightColors,
3
+ darkColors,
4
+ avatarGradient,
5
+ BRAND_ORANGE,
6
+ } from './colors';
2
7
  export type { ColorTokens } from './colors';
3
8
 
4
9
  export { warmOrangePalette } from './palettes';
@@ -8,10 +13,13 @@ export type { ShadowTokens } from './shadow';
8
13
 
9
14
  export { ThemeProvider, ThemeContext } from './ThemeProvider';
10
15
  export type { ColorScheme, ThemeContextValue } from './ThemeProvider';
16
+ // ThemeContext 为内部用途导出:若需子树强制主题,优先用 <ThemeProvider forceScheme> 嵌套。
17
+ // 直接自挂 Provider 须保证 value 引用稳定(每渲染新对象会打穿 useThemedStyles 缓存)。
11
18
 
12
19
  export { useTheme, useColors, useShadow } from './useTheme';
13
20
  export { useThemedStyles } from './useThemedStyles';
14
21
  export type { StylesMaker } from './useThemedStyles';
22
+ export { usePrefersReducedMotion } from './usePrefersReducedMotion';
15
23
 
16
24
  export {
17
25
  fontMono,
@@ -25,6 +33,7 @@ export {
25
33
  dim,
26
34
  fixed,
27
35
  motion,
36
+ pressedOpacity,
28
37
  } from './tokens';
29
38
 
30
39
  export { blur } from './blur';
@@ -7,10 +7,14 @@ const DESIGN_WIDTH = 402;
7
7
  * 0.3 对中文字号最友好(避免大屏字过大、小屏字过小)。 */
8
8
  const FONT_FACTOR = 0.3;
9
9
 
10
+ // 取短边而非宽度:横屏/iPad 启动时 width 会是长边(iPhone 17 Pro 874pt),
11
+ // 导致所有 r() 尺寸约翻倍。Math.min(w, h) 使竖屏行为完全不变,
12
+ // 同时收口横屏启动与 iPad Split View(window 宽可能小于 DESIGN_WIDTH)两个场景。
13
+ const { width: _w, height: _h } = Dimensions.get('window');
10
14
  const w =
11
15
  Platform.OS === 'web'
12
16
  ? DESIGN_WIDTH
13
- : Dimensions.get('window').width || DESIGN_WIDTH;
17
+ : Math.min(_w || DESIGN_WIDTH, _h || DESIGN_WIDTH) || DESIGN_WIDTH;
14
18
 
15
19
  /** 实际缩放比。 */
16
20
  const ratio = w / DESIGN_WIDTH;