@unif/react-native-design 0.8.2 → 0.10.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 (513) hide show
  1. package/README.md +1 -2
  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 +45 -19
  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 +1 -1
  368. package/lib/typescript/src/icons/data.d.ts.map +1 -1
  369. package/lib/typescript/src/icons/types.d.ts +18 -12
  370. package/lib/typescript/src/icons/types.d.ts.map +1 -1
  371. package/lib/typescript/src/theme/colors.d.ts +9 -3
  372. package/lib/typescript/src/theme/colors.d.ts.map +1 -1
  373. package/lib/typescript/src/theme/index.d.ts +3 -2
  374. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  375. package/lib/typescript/src/theme/scale.d.ts.map +1 -1
  376. package/lib/typescript/src/theme/shadow.d.ts +8 -8
  377. package/lib/typescript/src/theme/shadow.d.ts.map +1 -1
  378. package/lib/typescript/src/theme/tokens.d.ts +7 -3
  379. package/lib/typescript/src/theme/tokens.d.ts.map +1 -1
  380. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts +8 -0
  381. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts.map +1 -0
  382. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts +6 -0
  383. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts.map +1 -0
  384. package/lib/typescript/src/theme/useTheme.d.ts.map +1 -1
  385. package/lib/typescript/src/utils/logger/logger.d.ts.map +1 -1
  386. package/lib/typescript/src/utils/testID/testID.d.ts +6 -3
  387. package/lib/typescript/src/utils/testID/testID.d.ts.map +1 -1
  388. package/package.json +2 -1
  389. package/src/components/business/AvatarWithRing/AvatarWithRing.tsx +5 -4
  390. package/src/components/business/AvatarWithRing/styles.ts +21 -3
  391. package/src/components/business/AvatarWithRing/types.ts +3 -1
  392. package/src/components/business/Decorations/GradientWash.tsx +46 -22
  393. package/src/components/business/Decorations/RadialHalo.tsx +8 -4
  394. package/src/components/business/Decorations/ScreenBackdrop.tsx +23 -5
  395. package/src/components/business/Decorations/index.ts +4 -0
  396. package/src/components/business/Decorations/types.ts +2 -0
  397. package/src/components/business/GlassStats/GlassStats.tsx +8 -4
  398. package/src/components/business/GlassStats/types.ts +6 -0
  399. package/src/components/business/VersionPill/VersionPill.tsx +46 -6
  400. package/src/components/business/VersionPill/styles.ts +1 -1
  401. package/src/components/business/VersionPill/types.ts +13 -1
  402. package/src/components/business/index.ts +1 -0
  403. package/src/components/business/useSvgId.ts +17 -0
  404. package/src/components/ui/Avatar/Avatar.tsx +17 -10
  405. package/src/components/ui/Avatar/styles.ts +7 -7
  406. package/src/components/ui/Avatar/types.ts +3 -1
  407. package/src/components/ui/BlurLayer/BlurLayer.tsx +4 -1
  408. package/src/components/ui/BlurLayer/BlurLayer.web.tsx +7 -1
  409. package/src/components/ui/Button/Button.tsx +2 -1
  410. package/src/components/ui/Button/ButtonBase.tsx +26 -2
  411. package/src/components/ui/Button/styles.ts +27 -25
  412. package/src/components/ui/Button/types.ts +1 -1
  413. package/src/components/ui/Card/Card.tsx +17 -7
  414. package/src/components/ui/Card/styles.ts +5 -0
  415. package/src/components/ui/Card/types.ts +4 -4
  416. package/src/components/ui/Carousel/Carousel.tsx +44 -15
  417. package/src/components/ui/Carousel/index.ts +1 -1
  418. package/src/components/ui/Carousel/types.ts +5 -0
  419. package/src/components/ui/Cell/Cell.tsx +28 -6
  420. package/src/components/ui/Cell/Leading.tsx +2 -2
  421. package/src/components/ui/Cell/List.tsx +14 -8
  422. package/src/components/ui/Cell/styles.ts +8 -5
  423. package/src/components/ui/Cell/types.ts +5 -2
  424. package/src/components/ui/Checkbox/Checkbox.tsx +18 -5
  425. package/src/components/ui/Checkbox/styles.ts +8 -0
  426. package/src/components/ui/Chip/Chip.tsx +20 -5
  427. package/src/components/ui/Chip/types.ts +2 -0
  428. package/src/components/ui/Confirm/ConfirmHost.tsx +26 -10
  429. package/src/components/ui/Confirm/confirm.ts +8 -0
  430. package/src/components/ui/Confirm/types.ts +4 -2
  431. package/src/components/ui/DrawerHeader/DrawerHeader.tsx +18 -12
  432. package/src/components/ui/DrawerHeader/styles.ts +10 -6
  433. package/src/components/ui/DrawerHeader/types.ts +3 -1
  434. package/src/components/ui/Empty/Empty.tsx +5 -4
  435. package/src/components/ui/Empty/types.ts +3 -0
  436. package/src/components/ui/EntryCard/EntryCard.tsx +5 -3
  437. package/src/components/ui/EntryCard/styles.ts +13 -4
  438. package/src/components/ui/EntryCard/types.ts +2 -2
  439. package/src/components/ui/Form/FormRow.tsx +7 -1
  440. package/src/components/ui/Form/styles.ts +2 -0
  441. package/src/components/ui/Form/types.ts +7 -2
  442. package/src/components/ui/Grid/Grid.tsx +42 -25
  443. package/src/components/ui/Grid/styles.ts +8 -20
  444. package/src/components/ui/Grid/types.ts +4 -1
  445. package/src/components/ui/Icon/Icon.tsx +42 -27
  446. package/src/components/ui/IconButton/IconButton.tsx +2 -0
  447. package/src/components/ui/IconButton/types.ts +8 -2
  448. package/src/components/ui/Input/types.ts +3 -2
  449. package/src/components/ui/Logo/Logo.tsx +2 -1
  450. package/src/components/ui/NavBar/NavBar.tsx +16 -2
  451. package/src/components/ui/NavBar/types.ts +5 -1
  452. package/src/components/ui/PasswordInput/PasswordInput.tsx +77 -43
  453. package/src/components/ui/PasswordInput/styles.ts +1 -1
  454. package/src/components/ui/PasswordInput/types.ts +7 -2
  455. package/src/components/ui/Pulse/Pulse.tsx +2 -1
  456. package/src/components/ui/Pulse/PulseDot.tsx +7 -6
  457. package/src/components/ui/Pulse/types.ts +6 -0
  458. package/src/components/ui/Pulse/usePulse.web.ts +50 -33
  459. package/src/components/ui/Radio/Radio.tsx +29 -6
  460. package/src/components/ui/Radio/RadioGroup.tsx +10 -3
  461. package/src/components/ui/Radio/styles.ts +9 -2
  462. package/src/components/ui/Reveal/Reveal.web.tsx +18 -3
  463. package/src/components/ui/Search/Search.tsx +22 -9
  464. package/src/components/ui/Search/types.ts +7 -1
  465. package/src/components/ui/Segmented/Segmented.tsx +8 -3
  466. package/src/components/ui/Segmented/styles.ts +4 -2
  467. package/src/components/ui/Segmented/types.ts +2 -0
  468. package/src/components/ui/Skeleton/Skeleton.tsx +9 -8
  469. package/src/components/ui/Spinner/Spinner.tsx +17 -17
  470. package/src/components/ui/Spinner/Spinner.web.tsx +7 -15
  471. package/src/components/ui/Spinner/shared.ts +37 -0
  472. package/src/components/ui/StatusDot/StatusDot.tsx +21 -3
  473. package/src/components/ui/StatusDot/styles.ts +1 -1
  474. package/src/components/ui/StatusDot/types.ts +14 -1
  475. package/src/components/ui/Stepper/Stepper.tsx +45 -10
  476. package/src/components/ui/Switch/Switch.tsx +4 -10
  477. package/src/components/ui/Switch/Switch.web.tsx +2 -8
  478. package/src/components/ui/Switch/styles.ts +10 -1
  479. package/src/components/ui/TabBar/TabBar.tsx +14 -6
  480. package/src/components/ui/TabBar/styles.ts +9 -21
  481. package/src/components/ui/TabBar/types.ts +3 -0
  482. package/src/components/ui/Tabs/Tabs.tsx +24 -5
  483. package/src/components/ui/Tabs/styles.ts +6 -2
  484. package/src/components/ui/Tabs/types.ts +10 -1
  485. package/src/components/ui/Tag/styles.ts +18 -10
  486. package/src/components/ui/Tag/types.ts +6 -2
  487. package/src/components/ui/TextField/TextFieldBase.tsx +31 -6
  488. package/src/components/ui/Textarea/types.ts +2 -1
  489. package/src/components/ui/Thumbnail/Thumbnail.tsx +14 -3
  490. package/src/components/ui/Thumbnail/styles.ts +6 -2
  491. package/src/components/ui/Toast/ToastHost.tsx +16 -8
  492. package/src/components/ui/Toast/ToastHost.web.tsx +26 -4
  493. package/src/components/ui/Toast/styles.ts +2 -0
  494. package/src/components/ui/Toast/toast.ts +35 -2
  495. package/src/components/ui/Toast/types.ts +1 -1
  496. package/src/components/ui/shared/badgeStyles.ts +36 -0
  497. package/src/icons/data.ts +30 -0
  498. package/src/icons/types.ts +25 -10
  499. package/src/theme/colors.ts +29 -10
  500. package/src/theme/index.ts +10 -1
  501. package/src/theme/scale.ts +5 -1
  502. package/src/theme/shadow.ts +33 -24
  503. package/src/theme/tokens.ts +10 -5
  504. package/src/theme/usePrefersReducedMotion.ts +9 -0
  505. package/src/theme/usePrefersReducedMotion.web.ts +27 -0
  506. package/src/theme/useTheme.ts +15 -0
  507. package/src/utils/logger/logger.ts +5 -1
  508. package/src/utils/testID/testID.ts +6 -3
  509. package/lib/module/components/index.js +0 -5
  510. package/lib/module/components/index.js.map +0 -1
  511. package/lib/typescript/src/components/index.d.ts +0 -3
  512. package/lib/typescript/src/components/index.d.ts.map +0 -1
  513. package/src/components/index.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Text, View } from 'react-native';
3
3
  import { Pressable } from 'react-native-gesture-handler';
4
- import { useColors, useThemedStyles } from '../../../theme';
4
+ import { pressedOpacity, r, useColors, useThemedStyles } from '../../../theme';
5
5
  import { createLogger } from '../../../utils/logger';
6
6
  import { childTestID } from '../../../utils/testID';
7
7
  import { Icon } from '../Icon';
@@ -10,6 +10,9 @@ import type { GridProps } from './types';
10
10
 
11
11
  const log = createLogger('Grid');
12
12
 
13
+ // 渲染路径去重集合 —— 同一 columns 值只在首次渲染时告警一次,避免长列表重复刷 log。
14
+ const _warnedColumns = new Set<number>();
15
+
13
16
  /**
14
17
  * 图标入口宫格 —— 首页 / 分类落地页。1..6 列。
15
18
  * 每格:图标 + 小标签,纵向居中。
@@ -21,44 +24,58 @@ export function Grid({
21
24
  columns = 4,
22
25
  onPress,
23
26
  card = true,
27
+ style,
24
28
  testID,
25
29
  }: GridProps): React.JSX.Element {
26
30
  const c = useColors();
27
31
  const styles = useThemedStyles(makeStyles);
28
- if (![1, 2, 3, 4, 5, 6].includes(columns)) {
32
+ if (![1, 2, 3, 4, 5, 6].includes(columns) && !_warnedColumns.has(columns)) {
33
+ _warnedColumns.add(columns);
29
34
  log.warn(`columns 仅支持 1..6,传入 ${columns},已 fallback 为 4 列`);
30
35
  }
31
36
  const cellWidth = colWidth(columns);
32
37
  return (
33
- <View style={[styles.wrap, card && styles.card]} testID={testID}>
38
+ <View style={[styles.wrap, card && styles.card, style]} testID={testID}>
34
39
  <View style={styles.inner}>
35
40
  {items.map((item) => {
36
41
  const itemTestID = childTestID(testID, item.id, item.testID);
42
+ const cellContent = (
43
+ <>
44
+ <View>
45
+ {/* 28pt 介于 icon.md(26) / icon.lg(30) 之间的设计稿专定字形尺寸 */}
46
+ <Icon name={item.icon} size={r(28)} color={c.foregroundMuted} />
47
+ {item.badge != null ? (
48
+ <View style={styles.badge}>
49
+ <Text style={styles.badgeText}>{item.badge}</Text>
50
+ </View>
51
+ ) : null}
52
+ </View>
53
+ <Text style={styles.label} numberOfLines={1}>
54
+ {item.label}
55
+ </Text>
56
+ </>
57
+ );
37
58
  return (
38
59
  <View key={item.id} style={cellWidth}>
39
- <Pressable
40
- onPress={() => onPress?.(item)}
41
- accessibilityRole="button"
42
- accessibilityLabel={item.label}
43
- testID={itemTestID}
44
- style={({ pressed }) => [
45
- styles.cell,
46
- { opacity: pressed ? 0.7 : 1 },
47
- ]}
48
- >
49
- <View>
50
- {/* 28pt 介于 icon.md(26) / icon.lg(30) 之间的设计稿专定字号 */}
51
- <Icon name={item.icon} size={28} color={c.foregroundMuted} />
52
- {item.badge != null ? (
53
- <View style={styles.badge}>
54
- <Text style={styles.badgeText}>{item.badge}</Text>
55
- </View>
56
- ) : null}
60
+ {onPress ? (
61
+ // 有 onPress 才挂 Pressable + button 语义,纯展示宫格不播报 button
62
+ <Pressable
63
+ onPress={() => onPress(item)}
64
+ accessibilityRole="button"
65
+ accessibilityLabel={item.label}
66
+ testID={itemTestID}
67
+ style={({ pressed }) => [
68
+ styles.cell,
69
+ { opacity: pressed ? pressedOpacity : 1 },
70
+ ]}
71
+ >
72
+ {cellContent}
73
+ </Pressable>
74
+ ) : (
75
+ <View style={styles.cell} testID={itemTestID}>
76
+ {cellContent}
57
77
  </View>
58
- <Text style={styles.label} numberOfLines={1}>
59
- {item.label}
60
- </Text>
61
- </Pressable>
78
+ )}
62
79
  </View>
63
80
  );
64
81
  })}
@@ -7,6 +7,7 @@ import {
7
7
  type as t,
8
8
  type ColorTokens,
9
9
  } from '../../../theme';
10
+ import { badgeStyles } from '../shared/badgeStyles';
10
11
 
11
12
  /**
12
13
  * 预生成 1..6 列的宽度规则,避免 render 时创建 `{ width: pct }` 内联对象
@@ -39,8 +40,10 @@ export const colWidth = (columns: number) => {
39
40
  }
40
41
  };
41
42
 
42
- export const makeStyles = (c: ColorTokens) =>
43
- StyleSheet.create({
43
+ export const makeStyles = (c: ColorTokens) => {
44
+ // Grid 图标容器上边缘偏移 r(-6):图标高 r(28),角标圆心对齐图标右上角
45
+ const badge = badgeStyles(c, r(-6));
46
+ return StyleSheet.create({
44
47
  wrap: {
45
48
  width: '100%',
46
49
  },
@@ -67,22 +70,7 @@ export const makeStyles = (c: ColorTokens) =>
67
70
  fontWeight: fw.medium,
68
71
  color: c.foreground,
69
72
  },
70
- badge: {
71
- position: 'absolute',
72
- top: r(-6),
73
- right: r(-10),
74
- minWidth: r(16),
75
- height: r(16),
76
- borderRadius: radius.md,
77
- backgroundColor: c.error,
78
- paddingHorizontal: space[1],
79
- alignItems: 'center',
80
- justifyContent: 'center',
81
- },
82
- badgeText: {
83
- color: c.onError,
84
- fontSize: t.nano,
85
- fontWeight: fw.bold,
86
- lineHeight: 12,
87
- },
73
+ badge: badge.badge,
74
+ badgeText: badge.badgeText,
88
75
  });
76
+ };
@@ -1,3 +1,4 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
1
2
  import type { IconName } from '../Icon';
2
3
 
3
4
  export type GridItem = {
@@ -14,12 +15,14 @@ export type GridProps = {
14
15
  items: GridItem[];
15
16
  /**
16
17
  * 列数 1..6;默认 4。
17
- * ⚠️ 类型外的值(如 `7`)会**静默**回退到 4 列 — 业务应在传入前自行校验。
18
+ * ⚠️ 类型外的值(如 `7`)会**告警**(dev log.warn)并回退到 4 列 — 业务应在传入前自行校验。
18
19
  */
19
20
  columns?: 1 | 2 | 3 | 4 | 5 | 6;
20
21
  onPress?: (item: GridItem) => void;
21
22
  /** 是否套白色卡片;传 false 则背景透明 */
22
23
  card?: boolean;
24
+ /** 容器附加样式(margin / position 等布局微调)。 */
25
+ style?: StyleProp<ViewStyle>;
23
26
  /** 容器 testID;item testID 会自动派生为 `${testID}-${item.id}` */
24
27
  testID?: string;
25
28
  };
@@ -2,15 +2,18 @@ import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import Svg, { Circle, Path, Rect } from 'react-native-svg';
4
4
  import { ICONS, type IconDef } from '../../../icons';
5
- import { useColors } from '../../../theme';
5
+ import { r, useColors } from '../../../theme';
6
6
  import { createLogger } from '../../../utils/logger';
7
7
  import type { IconProps } from './types';
8
8
 
9
9
  const log = createLogger('Icon');
10
10
 
11
+ // 模块级去重集合:同一未知 name 只警一次,避免列表场景告警风暴。
12
+ const warnedNames = new Set<string>();
13
+
11
14
  export function Icon({
12
15
  name,
13
- size = 18,
16
+ size = r(18),
14
17
  color,
15
18
  strokeWidth,
16
19
  style,
@@ -20,7 +23,10 @@ export function Icon({
20
23
  const stroke = color ?? c.foregroundMuted;
21
24
  const def: IconDef | undefined = ICONS[name];
22
25
  if (!def) {
23
- log.warn(`unknown icon: ${name}`);
26
+ if (!warnedNames.has(name)) {
27
+ warnedNames.add(name);
28
+ log.warn(`unknown icon: ${name}`);
29
+ }
24
30
  return (
25
31
  <View
26
32
  style={[{ width: size, height: size }, style]}
@@ -50,31 +56,40 @@ export function Icon({
50
56
  strokeLinejoin="round"
51
57
  >
52
58
  {def.elements.map((el, i) => {
53
- const fill =
54
- el.fill === 'currentColor' ? stroke : (el.fill ?? 'none');
55
- if (el.kind === 'path') {
56
- return <Path key={i} d={el.d} fill={fill} />;
57
- }
58
- if (el.kind === 'circle') {
59
- return (
60
- <Circle key={i} cx={el.cx} cy={el.cy} r={el.r} fill={fill} />
61
- );
62
- }
63
- if (el.kind === 'rect') {
64
- return (
65
- <Rect
66
- key={i}
67
- x={el.x}
68
- y={el.y}
69
- width={el.width}
70
- height={el.height}
71
- rx={el.rx}
72
- ry={el.ry}
73
- fill={fill}
74
- />
75
- );
59
+ // fill:currentColor → 主题 stroke 色;其余原样;缺省继承根 fill="none"。
60
+ // opacity / stroke:透传源 svg 的元素级覆盖(stroke="none" = fill 不继承根描边)
61
+ const elProps = {
62
+ fill: el.fill === 'currentColor' ? stroke : (el.fill ?? 'none'),
63
+ opacity: el.opacity,
64
+ stroke: el.stroke,
65
+ };
66
+ switch (el.kind) {
67
+ case 'path':
68
+ return <Path key={i} d={el.d} {...elProps} />;
69
+ case 'circle':
70
+ return (
71
+ <Circle key={i} cx={el.cx} cy={el.cy} r={el.r} {...elProps} />
72
+ );
73
+ case 'rect':
74
+ // ry 不被 build-icons.js 抽取,不在 IconElement 类型中 —— 此处不传。
75
+ return (
76
+ <Rect
77
+ key={i}
78
+ x={el.x}
79
+ y={el.y}
80
+ width={el.width}
81
+ height={el.height}
82
+ rx={el.rx}
83
+ {...elProps}
84
+ />
85
+ );
86
+ default: {
87
+ // 穷尽兜底:未来若 build-icons.js 新增 kind(如 line/ellipse),
88
+ // TypeScript 会在此行报错提示渲染端同步处理,防静默渲染空。
89
+ const _exhaustive: never = el;
90
+ return _exhaustive;
91
+ }
76
92
  }
77
- return null;
78
93
  })}
79
94
  </Svg>
80
95
  </View>
@@ -19,6 +19,7 @@ export function IconButton({
19
19
  variant = 'ghost',
20
20
  color,
21
21
  disabled,
22
+ loading,
22
23
  accessibilityLabel,
23
24
  accessibilityHint,
24
25
  style,
@@ -30,6 +31,7 @@ export function IconButton({
30
31
  onPress={onPress}
31
32
  size={size}
32
33
  variant={variant}
34
+ loading={loading}
33
35
  disabled={disabled}
34
36
  accessibilityLabel={accessibilityLabel}
35
37
  accessibilityHint={accessibilityHint}
@@ -2,6 +2,9 @@ import type { StyleProp, ViewStyle } from 'react-native';
2
2
  import type { IconName } from '../Icon';
3
3
  import type { ButtonSize, ButtonVariant } from '../Button/types';
4
4
 
5
+ /** IconButton 支持的视觉变体:排除 'text'——text 撕除高度,与 square 方形布局语义冲突。 */
6
+ export type IconButtonVariant = Exclude<ButtonVariant, 'text'>;
7
+
5
8
  export type IconButtonProps = {
6
9
  /** 图标名 */
7
10
  icon: IconName;
@@ -9,14 +12,17 @@ export type IconButtonProps = {
9
12
  onPress?: () => void;
10
13
  /** 尺寸,默认 'md'(28 / 36 / 44 方形) */
11
14
  size?: ButtonSize;
12
- /** 视觉变体,默认 'ghost'(透明底,适合 header right-tray 场景) */
13
- variant?: ButtonVariant;
15
+ /** 视觉变体,默认 'ghost'(透明底,适合 header right-tray 场景)
16
+ * 不支持 'text'——text variant 撕除高度,与 square 方形布局冲突。 */
17
+ variant?: IconButtonVariant;
14
18
  /** Icon 颜色 override —— 不传走 variant.palette.fg(品牌一致默认);
15
19
  * caller 显式控制 icon 色场景(eg NavBar 内部按 variant 推导出 foreground /
16
20
  * onPrimary)。仅影响 icon 色,bg/border 仍由 variant palette 决定。 */
17
21
  color?: string;
18
22
  /** 整体禁用:opacity 0.5 + 不响应 */
19
23
  disabled?: boolean;
24
+ /** 加载态:显示 ActivityIndicator 替代 icon,自动 disabled */
25
+ loading?: boolean;
20
26
  /** **必填** — 无文本提示语义,SR 需要 */
21
27
  accessibilityLabel: string;
22
28
  /** SR 朗读 label 后的行为说明 hint。仅在"行为不显然"时加。 */
@@ -17,9 +17,10 @@ export type InputProps = Omit<
17
17
  leading?: ReactNode;
18
18
  /** 可选的后置插槽(清除按钮、眼睛切换等) */
19
19
  trailing?: ReactNode;
20
- /** 错误信息 —— 容器进入错误态并在下方显示 */
20
+ /** 错误信息 —— 容器进入错误态并在下方显示。
21
+ * 空串 `""` / undefined 都不进 error 态(truthy 判定),与 TextFieldBase 保持一致。[L-96] */
21
22
  error?: string;
22
- /** 覆盖单行高度,默认 44(hitTarget) */
23
+ /** 覆盖单行高度,默认 control.lg(r(44),随设备缩放) */
23
24
  height?: number;
24
25
  /** 容器外层样式(含 leading/trailing 整个 wrap) */
25
26
  containerStyle?: StyleProp<ViewStyle>;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Image } from 'react-native';
3
+ import { r } from '../../../theme';
3
4
  import type { LogoProps } from './types';
4
5
 
5
6
  /**
@@ -13,7 +14,7 @@ import type { LogoProps } from './types';
13
14
  */
14
15
  export function Logo({
15
16
  source,
16
- size = 64,
17
+ size = r(64),
17
18
  borderRadius,
18
19
  label = 'Logo',
19
20
  style,
@@ -6,9 +6,14 @@ import { isSlot } from './isSlot';
6
6
  import { makeStyles } from './styles';
7
7
  import type { NavBarProps, NavBarSlotConfig } from './types';
8
8
 
9
- /** NavBarSlotConfig → IconButton(variant='ghost' + 外部 tint)。
10
- * accessibilityLabel 必填(IconButton 强制),fallback 到 icon 名。 */
9
+ /** NavBarSlotConfig → IconButton(variant='ghost' + 外部 tint)。 */
11
10
  function renderSlot(slot: NavBarSlotConfig, tint: string) {
11
+ // [L-50] 缺 accessibilityLabel 时 dev 告警 —— 回退读英文 icon 名(如 "menu")体验不佳。
12
+ if (!slot.accessibilityLabel && typeof __DEV__ !== 'undefined' && __DEV__) {
13
+ console.warn(
14
+ `NavBar slot(icon="${slot.icon}")未传 accessibilityLabel,SR 将读出 icon 名,请传人类可读短语。`
15
+ );
16
+ }
12
17
  return (
13
18
  <IconButton
14
19
  icon={slot.icon}
@@ -30,12 +35,20 @@ function resolveSlot(
30
35
  return slot;
31
36
  }
32
37
 
38
+ /**
39
+ * 安全区归属:NavBar **不**内置 top safe-area inset。
40
+ * 宿主页面负责处理(推荐做法:在屏幕根容器或 Stack.Screen header 里
41
+ * 用 `<SafeAreaView edges={['top']}>` 包住 NavBar,或配合
42
+ * `react-navigation` 的 `headerStatusBarHeight` 选项)。
43
+ * 这样 NavBar 可在任何场景复用(modal、底部抽屉 header 等不需要 top inset)。
44
+ */
33
45
  export function NavBar({
34
46
  title,
35
47
  subtitle,
36
48
  left,
37
49
  right,
38
50
  variant = 'default',
51
+ style,
39
52
  testID,
40
53
  }: NavBarProps) {
41
54
  const c = useColors();
@@ -53,6 +66,7 @@ export function NavBar({
53
66
  styles.bar,
54
67
  isBrand && styles.barBrand,
55
68
  isTransparent && styles.barTransparent,
69
+ style,
56
70
  ]}
57
71
  testID={testID}
58
72
  >
@@ -1,10 +1,12 @@
1
1
  import type { ReactNode } from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
2
3
  import type { IconName } from '../Icon';
3
4
 
4
5
  export type NavBarSlotConfig = {
5
6
  icon: IconName;
6
7
  onPress?: () => void;
7
- /** 屏幕阅读器读出的功能描述(icon-only 必填) */
8
+ /** 屏幕阅读器读出的功能描述。强烈建议传 —— icon-only 按钮无文字,缺省时 SR 回退
9
+ * 读英文 icon 名(如 "menu")且 dev 下告警。请传人类可读短语(如「返回」「更多」)。 */
8
10
  accessibilityLabel?: string;
9
11
  };
10
12
 
@@ -26,6 +28,8 @@ export type NavBarProps = {
26
28
  * 'transparentLight' variant。
27
29
  */
28
30
  variant?: 'default' | 'brand' | 'transparent';
31
+ /** 容器附加样式(margin / position 等布局微调)。 */
32
+ style?: StyleProp<ViewStyle>;
29
33
  /** E2E / 测试定位 */
30
34
  testID?: string;
31
35
  };
@@ -1,50 +1,84 @@
1
- import React, { useState } from 'react';
1
+ import React, { forwardRef, useState } from 'react';
2
2
  import { Pressable } from 'react-native-gesture-handler';
3
3
  import { Icon } from '../Icon';
4
4
  import { Input } from '../Input';
5
- import { useColors } from '../../../theme';
5
+ import { control, fixed, r, useColors } from '../../../theme';
6
+ import { childTestID } from '../../../utils/testID';
6
7
  import { styles } from './styles';
8
+ import type { TextInputRef } from '../TextField/TextFieldBase';
7
9
  import type { PasswordInputProps } from './types';
8
10
 
9
- /** 密码 Input —— Input + leading lock + trailing eye 切换明文 / 密文。
10
- * showPw 内部 useState,caller 只关心 value/onChangeText。
11
- * a11y:label 已表达"显示/隐藏密码"意图,不再加 accessibilityHint(避免
12
- * SR 朗读 over-hint,见 CLAUDE.md a11y 规范)。 */
13
- export function PasswordInput({
14
- value,
15
- onChangeText,
16
- placeholder = '请输入密码',
17
- testID,
18
- inputProps,
19
- }: PasswordInputProps): React.JSX.Element {
20
- const c = useColors();
21
- const [showPw, setShowPw] = useState(false);
11
+ /**
12
+ * 密码 Input —— Input + leading lock + trailing eye 切换明文 / 密文。
13
+ *
14
+ * [L-32] 增强:
15
+ * - forwardRef<TextInput> —— 业务表单 focus() 聚焦
16
+ * - inputProps 类型改为 Omit<TextInputProps,'secureTextEntry'>
17
+ * - 补 textContentType='password' / autoComplete='current-password' / autoCapitalize='none' 默认值
18
+ * - 暴露 error / disabled 透传给底层 Input
19
+ *
20
+ * showPw 内部 useState,caller 只关心 value/onChangeText。
21
+ * a11y:label 已表达"显示/隐藏密码"意图,不再加 accessibilityHint(避免 SR 朗读 over-hint)。
22
+ */
23
+ export const PasswordInput = forwardRef<TextInputRef, PasswordInputProps>(
24
+ function PasswordInput(
25
+ {
26
+ value,
27
+ onChangeText,
28
+ placeholder = '请输入密码',
29
+ testID,
30
+ error,
31
+ disabled,
32
+ inputProps,
33
+ },
34
+ ref
35
+ ): React.JSX.Element {
36
+ const c = useColors();
37
+ const [showPw, setShowPw] = useState(false);
22
38
 
23
- return (
24
- <Input
25
- testID={testID}
26
- value={value}
27
- onChangeText={onChangeText}
28
- placeholder={placeholder}
29
- {...inputProps}
30
- secureTextEntry={!showPw}
31
- leading={<Icon name="lock" size={18} color={c.iconFaint40} />}
32
- trailing={
33
- <Pressable
34
- testID={testID ? `${testID}-toggle` : undefined}
35
- style={styles.eyeBtn}
36
- onPress={() => setShowPw((v) => !v)}
37
- accessibilityRole="button"
38
- accessibilityLabel={showPw ? '隐藏密码' : '显示密码'}
39
- hitSlop={8}
40
- >
41
- <Icon
42
- name={showPw ? 'eye' : 'eye-off'}
43
- size={16}
44
- color={c.iconFaint40}
45
- />
46
- </Pressable>
47
- }
48
- />
49
- );
50
- }
39
+ return (
40
+ <Input
41
+ ref={ref}
42
+ testID={testID}
43
+ value={value}
44
+ onChangeText={onChangeText}
45
+ placeholder={placeholder}
46
+ error={error}
47
+ disabled={disabled}
48
+ // [L-32] 补 textContentType / autoComplete / autoCapitalize 默认值 —— 提升密码自动填充体验
49
+ textContentType="password"
50
+ autoComplete="current-password"
51
+ autoCapitalize="none"
52
+ {...inputProps}
53
+ // secureTextEntry 在 inputProps spread 之后覆盖,确保组件自管不被 caller 干扰
54
+ secureTextEntry={!showPw}
55
+ leading={<Icon name="lock" size={r(18)} color={c.iconFaint40} />}
56
+ trailing={
57
+ <Pressable
58
+ testID={childTestID(testID, 'toggle')}
59
+ style={styles.eyeBtn}
60
+ onPress={() => setShowPw((v) => !v)}
61
+ accessibilityRole="button"
62
+ accessibilityLabel={showPw ? '隐藏密码' : '显示密码'}
63
+ // [M-7] eye icon r(16)≈16pt;Input 高 control.md≈36pt 限制垂直扩展
64
+ // vertical 走 (44-control.md)/2≈4;horizontal 走 (44-16)/2=14
65
+ hitSlop={{
66
+ top: Math.round((fixed.hitTarget - control.md) / 2),
67
+ bottom: Math.round((fixed.hitTarget - control.md) / 2),
68
+ left: Math.round((fixed.hitTarget - r(16)) / 2),
69
+ right: Math.round((fixed.hitTarget - r(16)) / 2),
70
+ }}
71
+ >
72
+ <Icon
73
+ name={showPw ? 'eye' : 'eye-off'}
74
+ size={r(16)}
75
+ color={c.iconFaint40}
76
+ />
77
+ </Pressable>
78
+ }
79
+ />
80
+ );
81
+ }
82
+ );
83
+
84
+ PasswordInput.displayName = 'PasswordInput';
@@ -1,7 +1,7 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
  import { space } from '../../../theme';
3
3
 
4
- /** eye Pressable hit area 微间距,跟 ForgotPassword 同款 4px。 */
4
+ /** eye Pressable hit area 微间距 4px。 */
5
5
  export const styles = StyleSheet.create({
6
6
  eyeBtn: { paddingHorizontal: space['1'] },
7
7
  });
@@ -6,7 +6,12 @@ export type PasswordInputProps = {
6
6
  /** 默认 "请输入密码" */
7
7
  placeholder?: string;
8
8
  testID?: string;
9
+ /** 错误信息 —— 传入时 Input 进入 error 态并在下方显示 */
10
+ error?: string;
11
+ /** 整体禁用:等价于 editable=false + 视觉变灰 */
12
+ disabled?: boolean;
9
13
  /** 透传给底层 Input 的其他 RN TextInput 属性(maxLength / autoFocus 等)。
10
- * ⚠ 不要传 secureTextEntry,组件自管;传了会被组件内部覆盖。 */
11
- inputProps?: Partial<TextInputProps>;
14
+ * ⚠ 不要传 secureTextEntry,组件自管;传了会被组件内部覆盖。
15
+ * [L-32] 类型显式 Omit<TextInputProps,'secureTextEntry'> 封堵传入歧义 */
16
+ inputProps?: Omit<TextInputProps, 'secureTextEntry'>;
12
17
  };
@@ -5,12 +5,13 @@ import type { PulseProps } from './types';
5
5
 
6
6
  export function Pulse({
7
7
  children,
8
+ style,
8
9
  testID,
9
10
  ...opts
10
11
  }: PulseProps & { children: React.ReactNode }): React.JSX.Element {
11
12
  const animatedStyle = usePulse(opts);
12
13
  return (
13
- <Animated.View style={animatedStyle} testID={testID}>
14
+ <Animated.View style={[animatedStyle, style]} testID={testID}>
14
15
  {children}
15
16
  </Animated.View>
16
17
  );
@@ -1,21 +1,21 @@
1
1
  import React from 'react';
2
2
  import Animated from 'react-native-reanimated';
3
- import { useColors } from '../../../theme';
3
+ import { r, useColors } from '../../../theme';
4
4
  import { usePulse } from './usePulse';
5
5
  import type { PulseDotProps } from './types';
6
6
 
7
7
  export function PulseDot({
8
- size = 6,
8
+ size = r(6),
9
9
  color,
10
10
  from = 0.5,
11
- to = 1,
12
- duration = 700,
13
- delay = 0,
11
+ style,
14
12
  testID,
13
+ ...opts
15
14
  }: PulseDotProps = {}): React.JSX.Element {
16
15
  const c = useColors();
17
16
  const fill = color ?? c.primary;
18
- const animatedStyle = usePulse({ from, to, duration, delay });
17
+ // [L-93] 只显式覆盖 from(默认 0.5 usePulse 0.6 不同),其余 opts 透传 usePulse。
18
+ const animatedStyle = usePulse({ from, ...opts });
19
19
  return (
20
20
  <Animated.View
21
21
  style={[
@@ -26,6 +26,7 @@ export function PulseDot({
26
26
  backgroundColor: fill,
27
27
  },
28
28
  animatedStyle,
29
+ style,
29
30
  ]}
30
31
  testID={testID}
31
32
  accessibilityElementsHidden
@@ -1,3 +1,5 @@
1
+ import type { StyleProp, ViewStyle } from 'react-native';
2
+
1
3
  export type PulseOptions = {
2
4
  /** 透明度下界(默认 0.6) */
3
5
  from?: number;
@@ -12,11 +14,15 @@ export type PulseOptions = {
12
14
  export type PulseDotProps = PulseOptions & {
13
15
  size?: number;
14
16
  color?: string;
17
+ /** 容器附加样式(margin / position 等布局微调)。 */
18
+ style?: StyleProp<ViewStyle>;
15
19
  /** E2E / 测试定位 */
16
20
  testID?: string;
17
21
  };
18
22
 
19
23
  export type PulseProps = PulseOptions & {
24
+ /** 容器附加样式(margin / position 等布局微调)。 */
25
+ style?: StyleProp<ViewStyle>;
20
26
  /** E2E / 测试定位 */
21
27
  testID?: string;
22
28
  };