@unif/react-native-design 0.20.0 → 0.21.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 (562) hide show
  1. package/README.md +68 -12
  2. package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js +4 -5
  3. package/lib/module/components/business/AvatarWithRing/AvatarWithRing.js.map +1 -1
  4. package/lib/module/components/business/AvatarWithRing/styles.js +10 -9
  5. package/lib/module/components/business/AvatarWithRing/styles.js.map +1 -1
  6. package/lib/module/components/business/VersionPill/VersionPill.js +32 -15
  7. package/lib/module/components/business/VersionPill/VersionPill.js.map +1 -1
  8. package/lib/module/components/business/VersionPill/content.js +30 -0
  9. package/lib/module/components/business/VersionPill/content.js.map +1 -0
  10. package/lib/module/components/business/VersionPill/styles.js +4 -0
  11. package/lib/module/components/business/VersionPill/styles.js.map +1 -1
  12. package/lib/module/components/business/useSvgId.js +17 -8
  13. package/lib/module/components/business/useSvgId.js.map +1 -1
  14. package/lib/module/components/ui/Avatar/Avatar.js +22 -29
  15. package/lib/module/components/ui/Avatar/Avatar.js.map +1 -1
  16. package/lib/module/components/ui/Button/Button.js +40 -23
  17. package/lib/module/components/ui/Button/Button.js.map +1 -1
  18. package/lib/module/components/ui/Button/ButtonBase.js +13 -13
  19. package/lib/module/components/ui/Button/ButtonBase.js.map +1 -1
  20. package/lib/module/components/ui/Carousel/Carousel.js +68 -40
  21. package/lib/module/components/ui/Carousel/Carousel.js.map +1 -1
  22. package/lib/module/components/ui/Carousel/behavior.js +60 -0
  23. package/lib/module/components/ui/Carousel/behavior.js.map +1 -0
  24. package/lib/module/components/ui/Carousel/styles.js +6 -8
  25. package/lib/module/components/ui/Carousel/styles.js.map +1 -1
  26. package/lib/module/components/ui/Cell/Cell.js +76 -65
  27. package/lib/module/components/ui/Cell/Cell.js.map +1 -1
  28. package/lib/module/components/ui/Cell/Leading.js +11 -5
  29. package/lib/module/components/ui/Cell/Leading.js.map +1 -1
  30. package/lib/module/components/ui/Cell/content.js +34 -0
  31. package/lib/module/components/ui/Cell/content.js.map +1 -0
  32. package/lib/module/components/ui/Checkbox/Checkbox.js +25 -8
  33. package/lib/module/components/ui/Checkbox/Checkbox.js.map +1 -1
  34. package/lib/module/components/ui/Confirm/ConfirmHost.js +49 -25
  35. package/lib/module/components/ui/Confirm/ConfirmHost.js.map +1 -1
  36. package/lib/module/components/ui/Confirm/confirm.js +15 -29
  37. package/lib/module/components/ui/Confirm/confirm.js.map +1 -1
  38. package/lib/module/components/ui/Confirm/labels.js +10 -0
  39. package/lib/module/components/ui/Confirm/labels.js.map +1 -0
  40. package/lib/module/components/ui/Confirm/store.js +113 -0
  41. package/lib/module/components/ui/Confirm/store.js.map +1 -0
  42. package/lib/module/components/ui/Confirm/styles.js +4 -0
  43. package/lib/module/components/ui/Confirm/styles.js.map +1 -1
  44. package/lib/module/components/ui/DrawerHeader/DrawerHeader.js +17 -25
  45. package/lib/module/components/ui/DrawerHeader/DrawerHeader.js.map +1 -1
  46. package/lib/module/components/ui/Grid/Grid.js +26 -9
  47. package/lib/module/components/ui/Grid/Grid.js.map +1 -1
  48. package/lib/module/components/ui/Grid/accessibility.js +13 -0
  49. package/lib/module/components/ui/Grid/accessibility.js.map +1 -0
  50. package/lib/module/components/ui/IconButton/IconButton.js +16 -3
  51. package/lib/module/components/ui/IconButton/IconButton.js.map +1 -1
  52. package/lib/module/components/ui/Input/Input.js +8 -5
  53. package/lib/module/components/ui/Input/Input.js.map +1 -1
  54. package/lib/module/components/ui/Logo/Logo.js +22 -4
  55. package/lib/module/components/ui/Logo/Logo.js.map +1 -1
  56. package/lib/module/components/ui/NavBar/NavBar.js +23 -14
  57. package/lib/module/components/ui/NavBar/NavBar.js.map +1 -1
  58. package/lib/module/components/ui/NavBar/isSlot.js +297 -4
  59. package/lib/module/components/ui/NavBar/isSlot.js.map +1 -1
  60. package/lib/module/components/ui/PasswordInput/PasswordInput.js +61 -66
  61. package/lib/module/components/ui/PasswordInput/PasswordInput.js.map +1 -1
  62. package/lib/module/components/ui/Pulse/Pulse.js +1 -1
  63. package/lib/module/components/ui/Pulse/Pulse.js.map +1 -1
  64. package/lib/module/components/ui/Pulse/PulseDot.js +5 -7
  65. package/lib/module/components/ui/Pulse/PulseDot.js.map +1 -1
  66. package/lib/module/components/ui/Pulse/index.js +1 -1
  67. package/lib/module/components/ui/Pulse/index.js.map +1 -1
  68. package/lib/module/components/ui/Pulse/normalizePulseOptions.js +45 -0
  69. package/lib/module/components/ui/Pulse/normalizePulseOptions.js.map +1 -0
  70. package/lib/module/components/ui/Pulse/usePulse.js +61 -24
  71. package/lib/module/components/ui/Pulse/usePulse.js.map +1 -1
  72. package/lib/module/components/ui/Pulse/usePulseDriver.js +44 -0
  73. package/lib/module/components/ui/Pulse/usePulseDriver.js.map +1 -0
  74. package/lib/module/components/ui/Pulse/usePulseDriver.web.js +67 -0
  75. package/lib/module/components/ui/Pulse/usePulseDriver.web.js.map +1 -0
  76. package/lib/module/components/ui/Radio/Radio.js +31 -14
  77. package/lib/module/components/ui/Radio/Radio.js.map +1 -1
  78. package/lib/module/components/ui/Radio/RadioGroup.js +15 -2
  79. package/lib/module/components/ui/Radio/RadioGroup.js.map +1 -1
  80. package/lib/module/components/ui/Reveal/Reveal.js +4 -3
  81. package/lib/module/components/ui/Reveal/Reveal.js.map +1 -1
  82. package/lib/module/components/ui/Reveal/Reveal.web.js +55 -32
  83. package/lib/module/components/ui/Reveal/Reveal.web.js.map +1 -1
  84. package/lib/module/components/ui/Reveal/webTransition.js +157 -0
  85. package/lib/module/components/ui/Reveal/webTransition.js.map +1 -0
  86. package/lib/module/components/ui/Search/Search.js +85 -58
  87. package/lib/module/components/ui/Search/Search.js.map +1 -1
  88. package/lib/module/components/ui/Segmented/Segmented.js +4 -2
  89. package/lib/module/components/ui/Segmented/Segmented.js.map +1 -1
  90. package/lib/module/components/ui/Skeleton/Skeleton.js +5 -7
  91. package/lib/module/components/ui/Skeleton/Skeleton.js.map +1 -1
  92. package/lib/module/components/ui/Spinner/Spinner.js +18 -11
  93. package/lib/module/components/ui/Spinner/Spinner.js.map +1 -1
  94. package/lib/module/components/ui/Spinner/Spinner.web.js +18 -14
  95. package/lib/module/components/ui/Spinner/Spinner.web.js.map +1 -1
  96. package/lib/module/components/ui/Spinner/shared.js +6 -0
  97. package/lib/module/components/ui/Spinner/shared.js.map +1 -1
  98. package/lib/module/components/ui/Stepper/Stepper.js +131 -99
  99. package/lib/module/components/ui/Stepper/Stepper.js.map +1 -1
  100. package/lib/module/components/ui/Stepper/StepperPressable.js +4 -0
  101. package/lib/module/components/ui/Stepper/StepperPressable.js.map +1 -0
  102. package/lib/module/components/ui/Stepper/StepperPressable.web.js +4 -0
  103. package/lib/module/components/ui/Stepper/StepperPressable.web.js.map +1 -0
  104. package/lib/module/components/ui/Stepper/accessibility.js +30 -0
  105. package/lib/module/components/ui/Stepper/accessibility.js.map +1 -0
  106. package/lib/module/components/ui/Stepper/accessibility.types.js +4 -0
  107. package/lib/module/components/ui/Stepper/accessibility.types.js.map +1 -0
  108. package/lib/module/components/ui/Stepper/accessibility.web.js +57 -0
  109. package/lib/module/components/ui/Stepper/accessibility.web.js.map +1 -0
  110. package/lib/module/components/ui/Stepper/layout.js +28 -0
  111. package/lib/module/components/ui/Stepper/layout.js.map +1 -0
  112. package/lib/module/components/ui/Stepper/normalizeStepper.js +53 -0
  113. package/lib/module/components/ui/Stepper/normalizeStepper.js.map +1 -0
  114. package/lib/module/components/ui/Stepper/styles.js +9 -2
  115. package/lib/module/components/ui/Stepper/styles.js.map +1 -1
  116. package/lib/module/components/ui/Switch/Switch.js +45 -19
  117. package/lib/module/components/ui/Switch/Switch.js.map +1 -1
  118. package/lib/module/components/ui/Switch/Switch.web.js +47 -20
  119. package/lib/module/components/ui/Switch/Switch.web.js.map +1 -1
  120. package/lib/module/components/ui/Switch/styles.js +12 -5
  121. package/lib/module/components/ui/Switch/styles.js.map +1 -1
  122. package/lib/module/components/ui/Tag/Tag.js +3 -2
  123. package/lib/module/components/ui/Tag/Tag.js.map +1 -1
  124. package/lib/module/components/ui/TextField/TextFieldBase.js +131 -86
  125. package/lib/module/components/ui/TextField/TextFieldBase.js.map +1 -1
  126. package/lib/module/components/ui/TextField/TextFieldSlot.js +82 -0
  127. package/lib/module/components/ui/TextField/TextFieldSlot.js.map +1 -0
  128. package/lib/module/components/ui/TextField/normalize.js +238 -0
  129. package/lib/module/components/ui/TextField/normalize.js.map +1 -0
  130. package/lib/module/components/ui/TextField/styles.js +31 -0
  131. package/lib/module/components/ui/TextField/styles.js.map +1 -1
  132. package/lib/module/components/ui/TextField/useErrorAnnouncement.js +27 -0
  133. package/lib/module/components/ui/TextField/useErrorAnnouncement.js.map +1 -0
  134. package/lib/module/components/ui/TextField/useTextFieldValue.js +66 -0
  135. package/lib/module/components/ui/TextField/useTextFieldValue.js.map +1 -0
  136. package/lib/module/components/ui/TextField/valueState.js +93 -0
  137. package/lib/module/components/ui/TextField/valueState.js.map +1 -0
  138. package/lib/module/components/ui/Textarea/Textarea.js +7 -3
  139. package/lib/module/components/ui/Textarea/Textarea.js.map +1 -1
  140. package/lib/module/components/ui/Thumbnail/Thumbnail.js +67 -48
  141. package/lib/module/components/ui/Thumbnail/Thumbnail.js.map +1 -1
  142. package/lib/module/components/ui/Thumbnail/normalize.js +58 -0
  143. package/lib/module/components/ui/Thumbnail/normalize.js.map +1 -0
  144. package/lib/module/components/ui/Thumbnail/styles.js +6 -11
  145. package/lib/module/components/ui/Thumbnail/styles.js.map +1 -1
  146. package/lib/module/components/ui/Toast/ToastHost.js +64 -21
  147. package/lib/module/components/ui/Toast/ToastHost.js.map +1 -1
  148. package/lib/module/components/ui/Toast/ToastHost.web.js +73 -24
  149. package/lib/module/components/ui/Toast/ToastHost.web.js.map +1 -1
  150. package/lib/module/components/ui/Toast/store.js +110 -0
  151. package/lib/module/components/ui/Toast/store.js.map +1 -0
  152. package/lib/module/components/ui/Toast/toast.js +17 -7
  153. package/lib/module/components/ui/Toast/toast.js.map +1 -1
  154. package/lib/module/components/ui/index.js.map +1 -1
  155. package/lib/module/components/ui/shared/ImageAttempt.js +28 -0
  156. package/lib/module/components/ui/shared/ImageAttempt.js.map +1 -0
  157. package/lib/module/components/ui/shared/a11y.js +21 -0
  158. package/lib/module/components/ui/shared/a11y.js.map +1 -0
  159. package/lib/module/components/ui/shared/accessibilityName.js +9 -0
  160. package/lib/module/components/ui/shared/accessibilityName.js.map +1 -0
  161. package/lib/module/components/ui/shared/selectImageAttemptSource.js +5 -0
  162. package/lib/module/components/ui/shared/selectImageAttemptSource.js.map +1 -0
  163. package/lib/module/components/ui/shared/selectImageAttemptSource.shared.js +13 -0
  164. package/lib/module/components/ui/shared/selectImageAttemptSource.shared.js.map +1 -0
  165. package/lib/module/components/ui/shared/selectImageAttemptSource.web.js +5 -0
  166. package/lib/module/components/ui/shared/selectImageAttemptSource.web.js.map +1 -0
  167. package/lib/module/icons/data.js +1 -1
  168. package/lib/module/icons/data.js.map +1 -1
  169. package/lib/module/theme/ThemeProvider.js +14 -4
  170. package/lib/module/theme/ThemeProvider.js.map +1 -1
  171. package/lib/module/theme/fontScale.js +13 -0
  172. package/lib/module/theme/fontScale.js.map +1 -0
  173. package/lib/module/theme/index.js +2 -4
  174. package/lib/module/theme/index.js.map +1 -1
  175. package/lib/module/theme/themeContext.js +15 -0
  176. package/lib/module/theme/themeContext.js.map +1 -0
  177. package/lib/module/theme/themeDiagnostics.js +29 -0
  178. package/lib/module/theme/themeDiagnostics.js.map +1 -0
  179. package/lib/module/theme/usePrefersReducedMotion.js +11 -4
  180. package/lib/module/theme/usePrefersReducedMotion.js.map +1 -1
  181. package/lib/module/theme/usePrefersReducedMotion.web.js +5 -2
  182. package/lib/module/theme/usePrefersReducedMotion.web.js.map +1 -1
  183. package/lib/module/theme/useTheme.js +12 -25
  184. package/lib/module/theme/useTheme.js.map +1 -1
  185. package/lib/module/theme/useThemedStyles.js +9 -6
  186. package/lib/module/theme/useThemedStyles.js.map +1 -1
  187. package/lib/module/utils/imageSource.js +198 -0
  188. package/lib/module/utils/imageSource.js.map +1 -0
  189. package/lib/typescript/manual-tests/runtime-api/RuntimeApiScreen.d.ts +12 -0
  190. package/lib/typescript/manual-tests/runtime-api/RuntimeApiScreen.d.ts.map +1 -0
  191. package/lib/typescript/src/components/business/AvatarWithRing/AvatarWithRing.d.ts.map +1 -1
  192. package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts +8 -7
  193. package/lib/typescript/src/components/business/AvatarWithRing/styles.d.ts.map +1 -1
  194. package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts +1 -1
  195. package/lib/typescript/src/components/business/VersionPill/VersionPill.d.ts.map +1 -1
  196. package/lib/typescript/src/components/business/VersionPill/content.d.ts +19 -0
  197. package/lib/typescript/src/components/business/VersionPill/content.d.ts.map +1 -0
  198. package/lib/typescript/src/components/business/VersionPill/index.d.ts +1 -1
  199. package/lib/typescript/src/components/business/VersionPill/index.d.ts.map +1 -1
  200. package/lib/typescript/src/components/business/VersionPill/styles.d.ts +4 -0
  201. package/lib/typescript/src/components/business/VersionPill/styles.d.ts.map +1 -1
  202. package/lib/typescript/src/components/business/VersionPill/types.d.ts +6 -2
  203. package/lib/typescript/src/components/business/VersionPill/types.d.ts.map +1 -1
  204. package/lib/typescript/src/components/business/index.d.ts +1 -1
  205. package/lib/typescript/src/components/business/index.d.ts.map +1 -1
  206. package/lib/typescript/src/components/business/useSvgId.d.ts +6 -5
  207. package/lib/typescript/src/components/business/useSvgId.d.ts.map +1 -1
  208. package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts +2 -2
  209. package/lib/typescript/src/components/ui/Avatar/Avatar.d.ts.map +1 -1
  210. package/lib/typescript/src/components/ui/Avatar/types.d.ts +6 -2
  211. package/lib/typescript/src/components/ui/Avatar/types.d.ts.map +1 -1
  212. package/lib/typescript/src/components/ui/Button/Button.d.ts +1 -1
  213. package/lib/typescript/src/components/ui/Button/Button.d.ts.map +1 -1
  214. package/lib/typescript/src/components/ui/Button/ButtonBase.d.ts +5 -3
  215. package/lib/typescript/src/components/ui/Button/ButtonBase.d.ts.map +1 -1
  216. package/lib/typescript/src/components/ui/Button/types.d.ts +5 -3
  217. package/lib/typescript/src/components/ui/Button/types.d.ts.map +1 -1
  218. package/lib/typescript/src/components/ui/Carousel/Carousel.d.ts.map +1 -1
  219. package/lib/typescript/src/components/ui/Carousel/behavior.d.ts +25 -0
  220. package/lib/typescript/src/components/ui/Carousel/behavior.d.ts.map +1 -0
  221. package/lib/typescript/src/components/ui/Carousel/styles.d.ts +4 -6
  222. package/lib/typescript/src/components/ui/Carousel/styles.d.ts.map +1 -1
  223. package/lib/typescript/src/components/ui/Carousel/types.d.ts +14 -6
  224. package/lib/typescript/src/components/ui/Carousel/types.d.ts.map +1 -1
  225. package/lib/typescript/src/components/ui/Cell/Cell.d.ts +1 -1
  226. package/lib/typescript/src/components/ui/Cell/Cell.d.ts.map +1 -1
  227. package/lib/typescript/src/components/ui/Cell/Leading.d.ts +2 -3
  228. package/lib/typescript/src/components/ui/Cell/Leading.d.ts.map +1 -1
  229. package/lib/typescript/src/components/ui/Cell/content.d.ts +18 -0
  230. package/lib/typescript/src/components/ui/Cell/content.d.ts.map +1 -0
  231. package/lib/typescript/src/components/ui/Cell/index.d.ts +1 -1
  232. package/lib/typescript/src/components/ui/Cell/index.d.ts.map +1 -1
  233. package/lib/typescript/src/components/ui/Cell/types.d.ts +66 -30
  234. package/lib/typescript/src/components/ui/Cell/types.d.ts.map +1 -1
  235. package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts +1 -1
  236. package/lib/typescript/src/components/ui/Checkbox/Checkbox.d.ts.map +1 -1
  237. package/lib/typescript/src/components/ui/Checkbox/types.d.ts +12 -3
  238. package/lib/typescript/src/components/ui/Checkbox/types.d.ts.map +1 -1
  239. package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts +6 -3
  240. package/lib/typescript/src/components/ui/Confirm/ConfirmHost.d.ts.map +1 -1
  241. package/lib/typescript/src/components/ui/Confirm/confirm.d.ts +10 -4
  242. package/lib/typescript/src/components/ui/Confirm/confirm.d.ts.map +1 -1
  243. package/lib/typescript/src/components/ui/Confirm/labels.d.ts +6 -0
  244. package/lib/typescript/src/components/ui/Confirm/labels.d.ts.map +1 -0
  245. package/lib/typescript/src/components/ui/Confirm/store.d.ts +44 -0
  246. package/lib/typescript/src/components/ui/Confirm/store.d.ts.map +1 -0
  247. package/lib/typescript/src/components/ui/Confirm/styles.d.ts +3 -0
  248. package/lib/typescript/src/components/ui/Confirm/styles.d.ts.map +1 -1
  249. package/lib/typescript/src/components/ui/Confirm/types.d.ts +0 -9
  250. package/lib/typescript/src/components/ui/Confirm/types.d.ts.map +1 -1
  251. package/lib/typescript/src/components/ui/DrawerHeader/DrawerHeader.d.ts.map +1 -1
  252. package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts +7 -1
  253. package/lib/typescript/src/components/ui/DrawerHeader/types.d.ts.map +1 -1
  254. package/lib/typescript/src/components/ui/Grid/Grid.d.ts.map +1 -1
  255. package/lib/typescript/src/components/ui/Grid/accessibility.d.ts +5 -0
  256. package/lib/typescript/src/components/ui/Grid/accessibility.d.ts.map +1 -0
  257. package/lib/typescript/src/components/ui/Grid/types.d.ts +2 -0
  258. package/lib/typescript/src/components/ui/Grid/types.d.ts.map +1 -1
  259. package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts +1 -1
  260. package/lib/typescript/src/components/ui/IconButton/IconButton.d.ts.map +1 -1
  261. package/lib/typescript/src/components/ui/IconButton/types.d.ts +4 -2
  262. package/lib/typescript/src/components/ui/IconButton/types.d.ts.map +1 -1
  263. package/lib/typescript/src/components/ui/Input/Input.d.ts +5 -383
  264. package/lib/typescript/src/components/ui/Input/Input.d.ts.map +1 -1
  265. package/lib/typescript/src/components/ui/Input/index.d.ts +1 -0
  266. package/lib/typescript/src/components/ui/Input/index.d.ts.map +1 -1
  267. package/lib/typescript/src/components/ui/Input/types.d.ts +3 -17
  268. package/lib/typescript/src/components/ui/Input/types.d.ts.map +1 -1
  269. package/lib/typescript/src/components/ui/Logo/Logo.d.ts +2 -2
  270. package/lib/typescript/src/components/ui/Logo/Logo.d.ts.map +1 -1
  271. package/lib/typescript/src/components/ui/Logo/types.d.ts +2 -2
  272. package/lib/typescript/src/components/ui/Logo/types.d.ts.map +1 -1
  273. package/lib/typescript/src/components/ui/NavBar/NavBar.d.ts.map +1 -1
  274. package/lib/typescript/src/components/ui/NavBar/index.d.ts +1 -1
  275. package/lib/typescript/src/components/ui/NavBar/index.d.ts.map +1 -1
  276. package/lib/typescript/src/components/ui/NavBar/isSlot.d.ts +24 -4
  277. package/lib/typescript/src/components/ui/NavBar/isSlot.d.ts.map +1 -1
  278. package/lib/typescript/src/components/ui/NavBar/types.d.ts +8 -8
  279. package/lib/typescript/src/components/ui/NavBar/types.d.ts.map +1 -1
  280. package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts +6 -14
  281. package/lib/typescript/src/components/ui/PasswordInput/PasswordInput.d.ts.map +1 -1
  282. package/lib/typescript/src/components/ui/PasswordInput/types.d.ts +4 -14
  283. package/lib/typescript/src/components/ui/PasswordInput/types.d.ts.map +1 -1
  284. package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts +1 -1
  285. package/lib/typescript/src/components/ui/Pulse/PulseDot.d.ts.map +1 -1
  286. package/lib/typescript/src/components/ui/Pulse/normalizePulseOptions.d.ts +32 -0
  287. package/lib/typescript/src/components/ui/Pulse/normalizePulseOptions.d.ts.map +1 -0
  288. package/lib/typescript/src/components/ui/Pulse/usePulse.d.ts +10 -5
  289. package/lib/typescript/src/components/ui/Pulse/usePulse.d.ts.map +1 -1
  290. package/lib/typescript/src/components/ui/Pulse/usePulseDriver.d.ts +11 -0
  291. package/lib/typescript/src/components/ui/Pulse/usePulseDriver.d.ts.map +1 -0
  292. package/lib/typescript/src/components/ui/Pulse/usePulseDriver.web.d.ts +18 -0
  293. package/lib/typescript/src/components/ui/Pulse/usePulseDriver.web.d.ts.map +1 -0
  294. package/lib/typescript/src/components/ui/Radio/Radio.d.ts +1 -1
  295. package/lib/typescript/src/components/ui/Radio/Radio.d.ts.map +1 -1
  296. package/lib/typescript/src/components/ui/Radio/RadioGroup.d.ts +2 -2
  297. package/lib/typescript/src/components/ui/Radio/RadioGroup.d.ts.map +1 -1
  298. package/lib/typescript/src/components/ui/Radio/types.d.ts +14 -3
  299. package/lib/typescript/src/components/ui/Radio/types.d.ts.map +1 -1
  300. package/lib/typescript/src/components/ui/Reveal/Reveal.d.ts.map +1 -1
  301. package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts +2 -8
  302. package/lib/typescript/src/components/ui/Reveal/Reveal.web.d.ts.map +1 -1
  303. package/lib/typescript/src/components/ui/Reveal/types.d.ts +1 -1
  304. package/lib/typescript/src/components/ui/Reveal/types.d.ts.map +1 -1
  305. package/lib/typescript/src/components/ui/Reveal/webTransition.d.ts +38 -0
  306. package/lib/typescript/src/components/ui/Reveal/webTransition.d.ts.map +1 -0
  307. package/lib/typescript/src/components/ui/Search/Search.d.ts +4 -214
  308. package/lib/typescript/src/components/ui/Search/Search.d.ts.map +1 -1
  309. package/lib/typescript/src/components/ui/Search/types.d.ts +13 -6
  310. package/lib/typescript/src/components/ui/Search/types.d.ts.map +1 -1
  311. package/lib/typescript/src/components/ui/Segmented/Segmented.d.ts.map +1 -1
  312. package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts +3 -3
  313. package/lib/typescript/src/components/ui/Skeleton/Skeleton.d.ts.map +1 -1
  314. package/lib/typescript/src/components/ui/Spinner/Spinner.d.ts +1 -1
  315. package/lib/typescript/src/components/ui/Spinner/Spinner.d.ts.map +1 -1
  316. package/lib/typescript/src/components/ui/Spinner/Spinner.web.d.ts +1 -1
  317. package/lib/typescript/src/components/ui/Spinner/Spinner.web.d.ts.map +1 -1
  318. package/lib/typescript/src/components/ui/Spinner/shared.d.ts +5 -0
  319. package/lib/typescript/src/components/ui/Spinner/shared.d.ts.map +1 -1
  320. package/lib/typescript/src/components/ui/Spinner/types.d.ts +1 -1
  321. package/lib/typescript/src/components/ui/Spinner/types.d.ts.map +1 -1
  322. package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts +3 -3
  323. package/lib/typescript/src/components/ui/Stepper/Stepper.d.ts.map +1 -1
  324. package/lib/typescript/src/components/ui/Stepper/StepperPressable.d.ts +2 -0
  325. package/lib/typescript/src/components/ui/Stepper/StepperPressable.d.ts.map +1 -0
  326. package/lib/typescript/src/components/ui/Stepper/StepperPressable.web.d.ts +2 -0
  327. package/lib/typescript/src/components/ui/Stepper/StepperPressable.web.d.ts.map +1 -0
  328. package/lib/typescript/src/components/ui/Stepper/accessibility.d.ts +3 -0
  329. package/lib/typescript/src/components/ui/Stepper/accessibility.d.ts.map +1 -0
  330. package/lib/typescript/src/components/ui/Stepper/accessibility.types.d.ts +23 -0
  331. package/lib/typescript/src/components/ui/Stepper/accessibility.types.d.ts.map +1 -0
  332. package/lib/typescript/src/components/ui/Stepper/accessibility.web.d.ts +9 -0
  333. package/lib/typescript/src/components/ui/Stepper/accessibility.web.d.ts.map +1 -0
  334. package/lib/typescript/src/components/ui/Stepper/layout.d.ts +22 -0
  335. package/lib/typescript/src/components/ui/Stepper/layout.d.ts.map +1 -0
  336. package/lib/typescript/src/components/ui/Stepper/normalizeStepper.d.ts +31 -0
  337. package/lib/typescript/src/components/ui/Stepper/normalizeStepper.d.ts.map +1 -0
  338. package/lib/typescript/src/components/ui/Stepper/styles.d.ts +9 -2
  339. package/lib/typescript/src/components/ui/Stepper/styles.d.ts.map +1 -1
  340. package/lib/typescript/src/components/ui/Stepper/types.d.ts +3 -1
  341. package/lib/typescript/src/components/ui/Stepper/types.d.ts.map +1 -1
  342. package/lib/typescript/src/components/ui/Switch/Switch.d.ts.map +1 -1
  343. package/lib/typescript/src/components/ui/Switch/Switch.web.d.ts.map +1 -1
  344. package/lib/typescript/src/components/ui/Switch/styles.d.ts +9 -3
  345. package/lib/typescript/src/components/ui/Switch/styles.d.ts.map +1 -1
  346. package/lib/typescript/src/components/ui/Switch/types.d.ts +2 -2
  347. package/lib/typescript/src/components/ui/Switch/types.d.ts.map +1 -1
  348. package/lib/typescript/src/components/ui/Tag/Tag.d.ts.map +1 -1
  349. package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts +4 -401
  350. package/lib/typescript/src/components/ui/TextField/TextFieldBase.d.ts.map +1 -1
  351. package/lib/typescript/src/components/ui/TextField/TextFieldSlot.d.ts +13 -0
  352. package/lib/typescript/src/components/ui/TextField/TextFieldSlot.d.ts.map +1 -0
  353. package/lib/typescript/src/components/ui/TextField/normalize.d.ts +51 -0
  354. package/lib/typescript/src/components/ui/TextField/normalize.d.ts.map +1 -0
  355. package/lib/typescript/src/components/ui/TextField/styles.d.ts +30 -0
  356. package/lib/typescript/src/components/ui/TextField/styles.d.ts.map +1 -1
  357. package/lib/typescript/src/components/ui/TextField/types.d.ts +92 -18
  358. package/lib/typescript/src/components/ui/TextField/types.d.ts.map +1 -1
  359. package/lib/typescript/src/components/ui/TextField/useErrorAnnouncement.d.ts +3 -0
  360. package/lib/typescript/src/components/ui/TextField/useErrorAnnouncement.d.ts.map +1 -0
  361. package/lib/typescript/src/components/ui/TextField/useTextFieldValue.d.ts +18 -0
  362. package/lib/typescript/src/components/ui/TextField/useTextFieldValue.d.ts.map +1 -0
  363. package/lib/typescript/src/components/ui/TextField/valueState.d.ts +50 -0
  364. package/lib/typescript/src/components/ui/TextField/valueState.d.ts.map +1 -0
  365. package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts +4 -382
  366. package/lib/typescript/src/components/ui/Textarea/Textarea.d.ts.map +1 -1
  367. package/lib/typescript/src/components/ui/Textarea/index.d.ts +1 -0
  368. package/lib/typescript/src/components/ui/Textarea/index.d.ts.map +1 -1
  369. package/lib/typescript/src/components/ui/Textarea/types.d.ts +3 -14
  370. package/lib/typescript/src/components/ui/Textarea/types.d.ts.map +1 -1
  371. package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts +5 -12
  372. package/lib/typescript/src/components/ui/Thumbnail/Thumbnail.d.ts.map +1 -1
  373. package/lib/typescript/src/components/ui/Thumbnail/index.d.ts +1 -1
  374. package/lib/typescript/src/components/ui/Thumbnail/index.d.ts.map +1 -1
  375. package/lib/typescript/src/components/ui/Thumbnail/normalize.d.ts +13 -0
  376. package/lib/typescript/src/components/ui/Thumbnail/normalize.d.ts.map +1 -0
  377. package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts +4 -8
  378. package/lib/typescript/src/components/ui/Thumbnail/styles.d.ts.map +1 -1
  379. package/lib/typescript/src/components/ui/Thumbnail/types.d.ts +21 -13
  380. package/lib/typescript/src/components/ui/Thumbnail/types.d.ts.map +1 -1
  381. package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts +6 -2
  382. package/lib/typescript/src/components/ui/Toast/ToastHost.d.ts.map +1 -1
  383. package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts +6 -3
  384. package/lib/typescript/src/components/ui/Toast/ToastHost.web.d.ts.map +1 -1
  385. package/lib/typescript/src/components/ui/Toast/store.d.ts +39 -0
  386. package/lib/typescript/src/components/ui/Toast/store.d.ts.map +1 -0
  387. package/lib/typescript/src/components/ui/Toast/toast.d.ts +7 -2
  388. package/lib/typescript/src/components/ui/Toast/toast.d.ts.map +1 -1
  389. package/lib/typescript/src/components/ui/Toast/types.d.ts +5 -3
  390. package/lib/typescript/src/components/ui/Toast/types.d.ts.map +1 -1
  391. package/lib/typescript/src/components/ui/index.d.ts +4 -4
  392. package/lib/typescript/src/components/ui/index.d.ts.map +1 -1
  393. package/lib/typescript/src/components/ui/shared/ImageAttempt.d.ts +13 -0
  394. package/lib/typescript/src/components/ui/shared/ImageAttempt.d.ts.map +1 -0
  395. package/lib/typescript/src/components/ui/shared/a11y.d.ts +19 -0
  396. package/lib/typescript/src/components/ui/shared/a11y.d.ts.map +1 -0
  397. package/lib/typescript/src/components/ui/shared/accessibilityName.d.ts +3 -0
  398. package/lib/typescript/src/components/ui/shared/accessibilityName.d.ts.map +1 -0
  399. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.d.ts +3 -0
  400. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.d.ts.map +1 -0
  401. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.shared.d.ts +4 -0
  402. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.shared.d.ts.map +1 -0
  403. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.web.d.ts +3 -0
  404. package/lib/typescript/src/components/ui/shared/selectImageAttemptSource.web.d.ts.map +1 -0
  405. package/lib/typescript/src/theme/ThemeProvider.d.ts +2 -3
  406. package/lib/typescript/src/theme/ThemeProvider.d.ts.map +1 -1
  407. package/lib/typescript/src/theme/fontScale.d.ts +4 -0
  408. package/lib/typescript/src/theme/fontScale.d.ts.map +1 -0
  409. package/lib/typescript/src/theme/index.d.ts +2 -1
  410. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  411. package/lib/typescript/src/theme/themeContext.d.ts +6 -0
  412. package/lib/typescript/src/theme/themeContext.d.ts.map +1 -0
  413. package/lib/typescript/src/theme/themeDiagnostics.d.ts +6 -0
  414. package/lib/typescript/src/theme/themeDiagnostics.d.ts.map +1 -0
  415. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts +8 -3
  416. package/lib/typescript/src/theme/usePrefersReducedMotion.d.ts.map +1 -1
  417. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts +5 -2
  418. package/lib/typescript/src/theme/usePrefersReducedMotion.web.d.ts.map +1 -1
  419. package/lib/typescript/src/theme/useTheme.d.ts +1 -1
  420. package/lib/typescript/src/theme/useTheme.d.ts.map +1 -1
  421. package/lib/typescript/src/theme/useThemedStyles.d.ts +1 -1
  422. package/lib/typescript/src/theme/useThemedStyles.d.ts.map +1 -1
  423. package/lib/typescript/src/utils/imageSource.d.ts +20 -0
  424. package/lib/typescript/src/utils/imageSource.d.ts.map +1 -0
  425. package/lib/typescript/type-tests/public-api.d.ts +2 -0
  426. package/lib/typescript/type-tests/public-api.d.ts.map +1 -0
  427. package/lib/typescript/website/src/components/iconCatalogCategories.d.ts +11 -0
  428. package/lib/typescript/website/src/components/iconCatalogCategories.d.ts.map +1 -0
  429. package/package.json +27 -13
  430. package/src/components/business/AvatarWithRing/AvatarWithRing.tsx +11 -4
  431. package/src/components/business/AvatarWithRing/styles.ts +11 -9
  432. package/src/components/business/VersionPill/VersionPill.tsx +31 -25
  433. package/src/components/business/VersionPill/content.ts +47 -0
  434. package/src/components/business/VersionPill/index.ts +1 -1
  435. package/src/components/business/VersionPill/styles.ts +4 -0
  436. package/src/components/business/VersionPill/types.ts +7 -2
  437. package/src/components/business/index.ts +1 -1
  438. package/src/components/business/useSvgId.ts +29 -8
  439. package/src/components/ui/Avatar/Avatar.tsx +25 -34
  440. package/src/components/ui/Avatar/types.ts +6 -2
  441. package/src/components/ui/Button/Button.tsx +39 -20
  442. package/src/components/ui/Button/ButtonBase.tsx +21 -12
  443. package/src/components/ui/Button/types.ts +5 -3
  444. package/src/components/ui/Carousel/Carousel.tsx +102 -40
  445. package/src/components/ui/Carousel/behavior.ts +78 -0
  446. package/src/components/ui/Carousel/styles.ts +5 -7
  447. package/src/components/ui/Carousel/types.ts +18 -6
  448. package/src/components/ui/Cell/Cell.tsx +85 -74
  449. package/src/components/ui/Cell/Leading.tsx +14 -14
  450. package/src/components/ui/Cell/content.ts +53 -0
  451. package/src/components/ui/Cell/index.ts +7 -1
  452. package/src/components/ui/Cell/types.ts +64 -30
  453. package/src/components/ui/Checkbox/Checkbox.tsx +35 -8
  454. package/src/components/ui/Checkbox/types.ts +15 -3
  455. package/src/components/ui/Confirm/ConfirmHost.tsx +51 -26
  456. package/src/components/ui/Confirm/confirm.ts +17 -34
  457. package/src/components/ui/Confirm/labels.ts +14 -0
  458. package/src/components/ui/Confirm/store.ts +147 -0
  459. package/src/components/ui/Confirm/styles.ts +4 -0
  460. package/src/components/ui/Confirm/types.ts +2 -10
  461. package/src/components/ui/DrawerHeader/DrawerHeader.tsx +22 -27
  462. package/src/components/ui/DrawerHeader/types.ts +7 -1
  463. package/src/components/ui/Grid/Grid.tsx +44 -12
  464. package/src/components/ui/Grid/accessibility.ts +21 -0
  465. package/src/components/ui/Grid/types.ts +2 -0
  466. package/src/components/ui/IconButton/IconButton.tsx +20 -3
  467. package/src/components/ui/IconButton/types.ts +4 -2
  468. package/src/components/ui/Input/Input.tsx +16 -6
  469. package/src/components/ui/Input/index.ts +5 -0
  470. package/src/components/ui/Input/types.ts +12 -23
  471. package/src/components/ui/Logo/Logo.tsx +27 -4
  472. package/src/components/ui/Logo/types.ts +2 -2
  473. package/src/components/ui/NavBar/NavBar.tsx +27 -19
  474. package/src/components/ui/NavBar/index.ts +1 -1
  475. package/src/components/ui/NavBar/isSlot.ts +372 -5
  476. package/src/components/ui/NavBar/types.ts +9 -8
  477. package/src/components/ui/PasswordInput/PasswordInput.tsx +67 -69
  478. package/src/components/ui/PasswordInput/types.ts +12 -14
  479. package/src/components/ui/Pulse/PulseDot.tsx +5 -4
  480. package/src/components/ui/Pulse/normalizePulseOptions.ts +76 -0
  481. package/src/components/ui/Pulse/usePulse.ts +80 -34
  482. package/src/components/ui/Pulse/usePulseDriver.ts +49 -0
  483. package/src/components/ui/Pulse/usePulseDriver.web.ts +66 -0
  484. package/src/components/ui/Radio/Radio.tsx +44 -15
  485. package/src/components/ui/Radio/RadioGroup.tsx +21 -3
  486. package/src/components/ui/Radio/types.ts +17 -3
  487. package/src/components/ui/Reveal/Reveal.tsx +5 -3
  488. package/src/components/ui/Reveal/Reveal.web.tsx +72 -29
  489. package/src/components/ui/Reveal/types.ts +1 -1
  490. package/src/components/ui/Reveal/webTransition.ts +206 -0
  491. package/src/components/ui/Search/Search.tsx +127 -58
  492. package/src/components/ui/Search/types.ts +30 -9
  493. package/src/components/ui/Segmented/Segmented.tsx +10 -2
  494. package/src/components/ui/Skeleton/Skeleton.tsx +9 -5
  495. package/src/components/ui/Spinner/Spinner.tsx +25 -17
  496. package/src/components/ui/Spinner/Spinner.web.tsx +23 -18
  497. package/src/components/ui/Spinner/shared.ts +7 -0
  498. package/src/components/ui/Spinner/types.ts +1 -1
  499. package/src/components/ui/Stepper/Stepper.tsx +166 -86
  500. package/src/components/ui/Stepper/StepperPressable.tsx +1 -0
  501. package/src/components/ui/Stepper/StepperPressable.web.tsx +1 -0
  502. package/src/components/ui/Stepper/accessibility.ts +32 -0
  503. package/src/components/ui/Stepper/accessibility.types.ts +22 -0
  504. package/src/components/ui/Stepper/accessibility.web.ts +65 -0
  505. package/src/components/ui/Stepper/layout.ts +44 -0
  506. package/src/components/ui/Stepper/normalizeStepper.ts +85 -0
  507. package/src/components/ui/Stepper/styles.ts +9 -2
  508. package/src/components/ui/Stepper/types.ts +3 -1
  509. package/src/components/ui/Switch/Switch.tsx +54 -15
  510. package/src/components/ui/Switch/Switch.web.tsx +57 -19
  511. package/src/components/ui/Switch/styles.ts +11 -4
  512. package/src/components/ui/Switch/types.ts +2 -2
  513. package/src/components/ui/Tag/Tag.tsx +6 -2
  514. package/src/components/ui/TextField/TextFieldBase.tsx +175 -70
  515. package/src/components/ui/TextField/TextFieldSlot.tsx +91 -0
  516. package/src/components/ui/TextField/normalize.ts +280 -0
  517. package/src/components/ui/TextField/styles.ts +31 -0
  518. package/src/components/ui/TextField/types.ts +118 -22
  519. package/src/components/ui/TextField/useErrorAnnouncement.ts +27 -0
  520. package/src/components/ui/TextField/useTextFieldValue.ts +94 -0
  521. package/src/components/ui/TextField/valueState.ts +125 -0
  522. package/src/components/ui/Textarea/Textarea.tsx +11 -4
  523. package/src/components/ui/Textarea/index.ts +5 -0
  524. package/src/components/ui/Textarea/types.ts +14 -22
  525. package/src/components/ui/Thumbnail/Thumbnail.tsx +86 -51
  526. package/src/components/ui/Thumbnail/index.ts +5 -1
  527. package/src/components/ui/Thumbnail/normalize.ts +78 -0
  528. package/src/components/ui/Thumbnail/styles.ts +5 -10
  529. package/src/components/ui/Thumbnail/types.ts +43 -13
  530. package/src/components/ui/Toast/ToastHost.tsx +81 -22
  531. package/src/components/ui/Toast/ToastHost.web.tsx +91 -29
  532. package/src/components/ui/Toast/store.ts +148 -0
  533. package/src/components/ui/Toast/toast.ts +19 -10
  534. package/src/components/ui/Toast/types.ts +7 -3
  535. package/src/components/ui/index.ts +19 -4
  536. package/src/components/ui/shared/ImageAttempt.tsx +30 -0
  537. package/src/components/ui/shared/a11y.ts +18 -0
  538. package/src/components/ui/shared/accessibilityName.ts +6 -0
  539. package/src/components/ui/shared/selectImageAttemptSource.shared.ts +17 -0
  540. package/src/components/ui/shared/selectImageAttemptSource.ts +3 -0
  541. package/src/components/ui/shared/selectImageAttemptSource.web.ts +3 -0
  542. package/src/icons/data.ts +1 -1
  543. package/src/theme/ThemeProvider.tsx +18 -7
  544. package/src/theme/fontScale.ts +15 -0
  545. package/src/theme/index.ts +2 -3
  546. package/src/theme/themeContext.ts +24 -0
  547. package/src/theme/themeDiagnostics.ts +41 -0
  548. package/src/theme/usePrefersReducedMotion.ts +11 -4
  549. package/src/theme/usePrefersReducedMotion.web.ts +5 -2
  550. package/src/theme/useTheme.ts +19 -27
  551. package/src/theme/useThemedStyles.ts +12 -7
  552. package/src/utils/imageSource.ts +303 -0
  553. package/lib/module/components/ui/PasswordInput/styles.js +0 -12
  554. package/lib/module/components/ui/PasswordInput/styles.js.map +0 -1
  555. package/lib/module/components/ui/Pulse/usePulse.web.js +0 -76
  556. package/lib/module/components/ui/Pulse/usePulse.web.js.map +0 -1
  557. package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts +0 -7
  558. package/lib/typescript/src/components/ui/PasswordInput/styles.d.ts.map +0 -1
  559. package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts +0 -21
  560. package/lib/typescript/src/components/ui/Pulse/usePulse.web.d.ts.map +0 -1
  561. package/src/components/ui/PasswordInput/styles.ts +0 -7
  562. package/src/components/ui/Pulse/usePulse.web.ts +0 -74
@@ -1,32 +1,31 @@
1
1
  "use strict";
2
2
 
3
- import React from 'react';
3
+ import React, { useEffect, useRef } from 'react';
4
4
  import { Text, View } from 'react-native';
5
5
  import { useColors, useThemedStyles } from "../../../theme/index.js";
6
+ import { createLogger } from "../../../utils/logger/index.js";
6
7
  import { IconButton } from "../IconButton/index.js";
7
- import { isSlot } from "./isSlot.js";
8
+ import { classifyNavBarSlot } from "./isSlot.js";
8
9
  import { makeStyles } from "./styles.js";
9
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- /** NavBarSlotConfig IconButton(variant='ghost' + 外部 tint)。 */
11
+ const log = createLogger('NavBar');
12
+
13
+ /** NavBarAction → IconButton(variant='ghost' + 外部 tint)。 */
11
14
  function renderSlot(slot, tint) {
12
- // [L-50] 缺 accessibilityLabel 时 dev 告警 —— 回退读英文 icon 名(如 "menu")体验不佳。
13
- if (!slot.accessibilityLabel && typeof __DEV__ !== 'undefined' && __DEV__) {
14
- console.warn(`NavBar slot(icon="${slot.icon}")未传 accessibilityLabel,SR 将读出 icon 名,请传人类可读短语。`);
15
- }
16
15
  return /*#__PURE__*/_jsx(IconButton, {
17
16
  icon: slot.icon,
18
17
  onPress: slot.onPress,
19
18
  variant: "ghost",
20
19
  color: tint,
21
- accessibilityLabel: slot.accessibilityLabel ?? slot.icon
20
+ accessibilityLabel: slot.accessibilityLabel
22
21
  });
23
22
  }
24
23
 
25
- /** left / right slot:NavBarSlotConfig → IconButton,ReactNode → 原样。 */
24
+ /** left / right slot:NavBarAction → IconButton,已归一化 display node → 原样。 */
26
25
  function resolveSlot(slot, tint) {
27
- if (!slot) return null;
28
- if (isSlot(slot)) return renderSlot(slot, tint);
29
- return slot;
26
+ if (slot.kind === 'action') return renderSlot(slot.action, tint);
27
+ if (slot.kind === 'node') return slot.node;
28
+ return null;
30
29
  }
31
30
 
32
31
  /**
@@ -49,6 +48,16 @@ export function NavBar({
49
48
  const styles = useThemedStyles(makeStyles);
50
49
  const isBrand = variant === 'brand';
51
50
  const isTransparent = variant === 'transparent';
51
+ const leftSlot = classifyNavBarSlot(left);
52
+ const rightSlot = classifyNavBarSlot(right);
53
+ const warnedInvalidSlot = useRef(false);
54
+ const hasInvalidSlot = leftSlot.kind === 'invalid' || rightSlot.kind === 'invalid';
55
+ useEffect(() => {
56
+ if (hasInvalidSlot && !warnedInvalidSlot.current) {
57
+ warnedInvalidSlot.current = true;
58
+ log.warn('忽略无效的 NavBar action;请传 NavBarAction 或 ReactNode');
59
+ }
60
+ }, [hasInvalidSlot]);
52
61
  // brand 实底白字;default + transparent 都走深字(transparent 用在浅色
53
62
  // hero 渐变之上,白字看不清)。后续若有"相机 / 地图"等深色浮层场景需要
54
63
  // 白字 transparent navbar,再加 'transparentLight' variant。
@@ -59,7 +68,7 @@ export function NavBar({
59
68
  testID: testID,
60
69
  children: [/*#__PURE__*/_jsx(View, {
61
70
  style: styles.side,
62
- children: resolveSlot(left, tint)
71
+ children: resolveSlot(leftSlot, tint)
63
72
  }), /*#__PURE__*/_jsxs(View, {
64
73
  style: styles.center,
65
74
  children: [/*#__PURE__*/_jsx(Text, {
@@ -77,7 +86,7 @@ export function NavBar({
77
86
  }) : null]
78
87
  }), /*#__PURE__*/_jsx(View, {
79
88
  style: [styles.side, styles.sideRight],
80
- children: resolveSlot(right, tint)
89
+ children: resolveSlot(rightSlot, tint)
81
90
  })]
82
91
  });
83
92
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","useColors","useThemedStyles","IconButton","isSlot","makeStyles","jsx","_jsx","jsxs","_jsxs","renderSlot","slot","tint","accessibilityLabel","__DEV__","console","warn","icon","onPress","variant","color","resolveSlot","NavBar","title","subtitle","left","right","style","testID","c","styles","isBrand","isTransparent","onPrimary","foreground","subtint","onPrimaryMuted","foregroundSubtle","bar","barBrand","barTransparent","children","side","center","numberOfLines","sideRight"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/NavBar.tsx"],"mappings":";;AAAA,OAAO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1CpB,WAAW,CAACK,KAAK,EAAEd,IAAI;IAAC,CACrB,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useRef","Text","View","useColors","useThemedStyles","createLogger","IconButton","classifyNavBarSlot","makeStyles","jsx","_jsx","jsxs","_jsxs","log","renderSlot","slot","tint","icon","onPress","variant","color","accessibilityLabel","resolveSlot","kind","action","node","NavBar","title","subtitle","left","right","style","testID","c","styles","isBrand","isTransparent","leftSlot","rightSlot","warnedInvalidSlot","hasInvalidSlot","current","warn","onPrimary","foreground","subtint","onPrimaryMuted","foregroundSubtle","bar","barBrand","barTransparent","children","side","center","numberOfLines","sideRight"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/NavBar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC3D,SAASC,YAAY,QAAQ,gCAAuB;AACpD,SAASC,UAAU,QAAQ,wBAAe;AAC1C,SAASC,kBAAkB,QAAuC,aAAU;AAC5E,SAASC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGtC,MAAMC,GAAG,GAAGR,YAAY,CAAC,QAAQ,CAAC;;AAElC;AACA,SAASS,UAAUA,CAACC,IAAkB,EAAEC,IAAY,EAAE;EACpD,oBACEN,IAAA,CAACJ,UAAU;IACTW,IAAI,EAAEF,IAAI,CAACE,IAAK;IAChBC,OAAO,EAAEH,IAAI,CAACG,OAAQ;IACtBC,OAAO,EAAC,OAAO;IACfC,KAAK,EAAEJ,IAAK;IACZK,kBAAkB,EAAEN,IAAI,CAACM;EAAmB,CAC7C,CAAC;AAEN;;AAEA;AACA,SAASC,WAAWA,CAClBP,IAA8B,EAC9BC,IAAY,EACK;EACjB,IAAID,IA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;EAC/D,oBACEnC,KAAA,CAACV,IAAI;IACH6B,KAAK,EAAE,CACLG,MAAM,CAACc,GAAG,EACVb,OAAO,IAAID,MAAM,CAACe,QAAQ,EAC1Bb,aAAa,IAAIF,MAAM,CAACgB,cAAc,EACtCnB,KAAK,CACL;IACFC,MAAM,EAAEA,MAAO;IAAAmB,QAAA,gBAEfzC,IAAA,CAACR,IAAI;MAAC6B,KAAK,EAAEG,MAAM,CAACkB,IAAK;MAAAD,QAAA,EAAE7B,WAAW,CAACe,QAAQ,EAAErB,IAAI;IAAC,CAAO,CAAC,eAC9DJ,KAAA,CAACV,IAAI;MAAC6B,KAAK,EAAEG,MAAM,CAACmB,MAAO;MAAAF,QAAA,gBACzBzC,IAAA,CAACT,IAAI;QAAC8B,KAAK,EAAE,CAACG,MAAM,CAACP,KAAK,EAAE;UAAEP,KAAK,EAAEJ;QAAK,CAAC,CAAE;QAACsC,aAAa,EAAE,CAAE;QAAAH,QAAA,EAC5DxB;MAAK,CACF,CAAC,EACNC,QAAQ,gBACPlB,IAAA,CAACT,IAAI;QAAC8B,KAAK,EAAE,CAACG,MAAM,CAACN,QAAQ,EAAE;UAAER,KAAK,EAAEyB;QAAQ,CAAC,CAAE;QAACS,aAAa,EAAE,CAAE;QAAAH,QAAA,EAClEvB;MAAQ,CACL,CAAC,GACL,IAAI;IAAA,CACJ,CAAC,eACPlB,IAAA,CAACR,IAAI;MAAC6B,KAAK,EAAE,CAACG,MAAM,CAACkB,IAAI,EAAElB,MAAM,CAACqB,SAAS,CAAE;MAAAJ,QAAA,EAC1C7B,WAAW,CAACgB,SAAS,EAAEtB,IAAI;IAAC,CACzB,CAAC;EAAA,CACH,CAAC;AAEX","ignoreList":[]}
@@ -1,10 +1,303 @@
1
1
  "use strict";
2
2
 
3
+ import React from 'react';
4
+ import { Text } from 'react-native';
5
+ import { ICONS } from "../../../icons/index.js";
6
+ const mappedThenables = new WeakMap();
7
+ function isIconName(value) {
8
+ return typeof value === 'string' && Object.prototype.hasOwnProperty.call(ICONS, value);
9
+ }
10
+
11
+ /**
12
+ * Type guard:action 的 icon 必须真实存在于生成的 registry,且有 handler 与非空名称。
13
+ */
14
+ export function isNavBarAction(v) {
15
+ if (typeof v !== 'object' || v === null) return false;
16
+ const slot = v;
17
+ return isIconName(slot.icon) && typeof slot.onPress === 'function' && typeof slot.accessibilityLabel === 'string' && slot.accessibilityLabel.trim().length > 0;
18
+ }
19
+ function hasElementShape(value) {
20
+ const element = value;
21
+ return Object.prototype.hasOwnProperty.call(value, 'type') && Object.prototype.hasOwnProperty.call(value, 'props') && element.type !== null && element.type !== undefined && typeof element.props === 'object' && element.props !== null;
22
+ }
23
+ function isThenable(value) {
24
+ if (typeof value !== 'object' || value === null) {
25
+ return false;
26
+ }
27
+ try {
28
+ return typeof value.then === 'function';
29
+ } catch {
30
+ return false;
31
+ }
32
+ }
33
+ function normalizeFragment(value, activeIterables, path, owner) {
34
+ try {
35
+ const props = value.props;
36
+ const normalized = normalizeReactNode(props.children, activeIterables, `${path}.fragment`, owner);
37
+ if (normalized.kind === 'invalid') return normalized;
38
+ return {
39
+ kind: 'node',
40
+ node: /*#__PURE__*/React.cloneElement(value, undefined, normalized.node)
41
+ };
42
+ } catch {
43
+ return {
44
+ kind: 'invalid'
45
+ };
46
+ }
47
+ }
48
+ function recordReaches(from, target, visited = new Set()) {
49
+ if (from === target) return true;
50
+ if (visited.has(from)) return false;
51
+ visited.add(from);
52
+ for (const dependency of from.dependencies) {
53
+ if (recordReaches(dependency, target, visited)) return true;
54
+ }
55
+ return false;
56
+ }
57
+ function addThenableDependency(owner, dependency) {
58
+ // dependency 已能走回 owner 时再加边会闭环;不加边并让当前 resolution 失败关闭。
59
+ if (recordReaches(dependency, owner)) return false;
60
+ owner.dependencies.add(dependency);
61
+ return true;
62
+ }
63
+ function createThenableRecord(value, path) {
64
+ let resolveMapped = () => {};
65
+ let rejectMapped = () => {};
66
+ const mappedPromise = new Promise((resolve, reject) => {
67
+ resolveMapped = resolve;
68
+ rejectMapped = reject;
69
+ });
70
+ const mappedNode = mappedPromise;
71
+ const record = {
72
+ node: mappedNode,
73
+ dependencies: new Set()
74
+ };
75
+ // 先入 cache 再调用用户 then:同步 thenable 可复用同一 record,并由依赖图识别闭环。
76
+ mappedThenables.set(value, record);
77
+ let claimed = false;
78
+ const resolveOnce = resolved => {
79
+ if (claimed) return;
80
+ claimed = true;
81
+ if (resolved === value || resolved === mappedPromise) {
82
+ resolveMapped(null);
83
+ return;
84
+ }
85
+ try {
86
+ const normalized = normalizeReactNode(resolved, new WeakSet(), `${path}.then`, record);
87
+ resolveMapped(normalized.kind === 'invalid' ? null : normalized.node);
88
+ } catch {
89
+ resolveMapped(null);
90
+ }
91
+ };
92
+ const rejectOnce = reason => {
93
+ if (claimed) return;
94
+ claimed = true;
95
+ rejectMapped(reason);
96
+ };
97
+ try {
98
+ const then = value.then;
99
+ if (typeof then !== 'function') {
100
+ resolveOnce(null);
101
+ return record;
102
+ }
103
+ then.call(value, resolveOnce, rejectOnce);
104
+ } catch (error) {
105
+ rejectOnce(error);
106
+ }
107
+ return record;
108
+ }
109
+ function normalizeThenable(value, path, owner) {
110
+ const record = mappedThenables.get(value) ?? createThenableRecord(value, path);
111
+ if (owner !== undefined && !addThenableDependency(owner, record)) {
112
+ return {
113
+ kind: 'invalid'
114
+ };
115
+ }
116
+ return {
117
+ kind: 'node',
118
+ node: record.node
119
+ };
120
+ }
121
+ function getIteratorFactory(value) {
122
+ try {
123
+ const iterator = value[Symbol.iterator];
124
+ if (iterator === undefined || iterator === null) return {
125
+ kind: 'none'
126
+ };
127
+ if (typeof iterator !== 'function') return {
128
+ kind: 'none'
129
+ };
130
+ return {
131
+ kind: 'factory',
132
+ factory: iterator
133
+ };
134
+ } catch {
135
+ return {
136
+ kind: 'invalid'
137
+ };
138
+ }
139
+ }
140
+ function isReactPortal(value) {
141
+ const portal = value;
142
+ const hasPortalShape = Object.prototype.hasOwnProperty.call(value, 'key') && Object.prototype.hasOwnProperty.call(value, 'children') && Object.prototype.hasOwnProperty.call(value, 'containerInfo') && Object.prototype.hasOwnProperty.call(value, 'implementation') && (portal.key === null || typeof portal.key === 'string') && portal.containerInfo !== null && portal.containerInfo !== undefined;
143
+ if (!hasPortalShape) return false;
144
+ try {
145
+ // React 没有公开 portal guard;只调用公开 Children API,且该分支已排除 iterable/
146
+ // thenable,避免消费 generator 或改变 Promise 语义。
147
+ return React.Children.count(value) === 1;
148
+ } catch {
149
+ return false;
150
+ }
151
+ }
152
+ function normalizeArray(value, activeIterables, path, owner) {
153
+ if (activeIterables.has(value)) return {
154
+ kind: 'invalid'
155
+ };
156
+ activeIterables.add(value);
157
+ try {
158
+ const nodes = [];
159
+ for (let index = 0; index < value.length; index += 1) {
160
+ const normalized = normalizeReactNode(value[index], activeIterables, `${path}.${index}`, owner);
161
+ if (normalized.kind === 'invalid') return normalized;
162
+ nodes.push(normalized.node);
163
+ }
164
+ return {
165
+ kind: 'node',
166
+ node: nodes
167
+ };
168
+ } catch {
169
+ return {
170
+ kind: 'invalid'
171
+ };
172
+ } finally {
173
+ activeIterables.delete(value);
174
+ }
175
+ }
176
+ function normalizeIterable(value, factory, activeIterables, path, owner) {
177
+ if (activeIterables.has(value)) return {
178
+ kind: 'invalid'
179
+ };
180
+ activeIterables.add(value);
181
+ let iterator;
182
+ let completed = false;
183
+ try {
184
+ const candidate = factory.call(value);
185
+ if (typeof candidate !== 'object' || candidate === null) {
186
+ return {
187
+ kind: 'invalid'
188
+ };
189
+ }
190
+ iterator = candidate;
191
+ const next = iterator.next;
192
+ if (typeof next !== 'function') return {
193
+ kind: 'invalid'
194
+ };
195
+ const nodes = [];
196
+ let index = 0;
197
+ for (;;) {
198
+ const step = next.call(iterator);
199
+ if (typeof step !== 'object' || step === null) {
200
+ return {
201
+ kind: 'invalid'
202
+ };
203
+ }
204
+ const result = step;
205
+ // Iterator protocol 的 done 走 ToBoolean,而不是限制为 boolean primitive。
206
+ if (result.done) {
207
+ completed = true;
208
+ return {
209
+ kind: 'node',
210
+ node: nodes
211
+ };
212
+ }
213
+ const normalized = normalizeReactNode(result.value, activeIterables, `${path}.${index}`, owner);
214
+ if (normalized.kind === 'invalid') return normalized;
215
+ nodes.push(normalized.node);
216
+ index += 1;
217
+ }
218
+ } catch {
219
+ return {
220
+ kind: 'invalid'
221
+ };
222
+ } finally {
223
+ if (!completed && iterator !== undefined) {
224
+ try {
225
+ const close = iterator.return;
226
+ if (typeof close === 'function') close.call(iterator);
227
+ } catch {
228
+ // 分类已失败;关闭时的异常不能逃逸到 NavBar render。
229
+ }
230
+ }
231
+ activeIterables.delete(value);
232
+ }
233
+ }
234
+ function normalizeReactNode(value, activeIterables, path, owner) {
235
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'bigint') {
236
+ return {
237
+ kind: 'node',
238
+ node: /*#__PURE__*/React.createElement(Text, {
239
+ key: path
240
+ }, String(value))
241
+ };
242
+ }
243
+ if (value === undefined || value === null || typeof value === 'boolean') {
244
+ return {
245
+ kind: 'node',
246
+ node: value
247
+ };
248
+ }
249
+ if (/*#__PURE__*/React.isValidElement(value)) {
250
+ if (!hasElementShape(value)) return {
251
+ kind: 'invalid'
252
+ };
253
+ return value.type === React.Fragment ? normalizeFragment(value, activeIterables, path, owner) : {
254
+ kind: 'node',
255
+ node: value
256
+ };
257
+ }
258
+ if (typeof value !== 'object' || value === null) {
259
+ return {
260
+ kind: 'invalid'
261
+ };
262
+ }
263
+ if (Array.isArray(value)) {
264
+ return normalizeArray(value, activeIterables, path, owner);
265
+ }
266
+ const iterator = getIteratorFactory(value);
267
+ if (iterator.kind === 'invalid') return iterator;
268
+ if (iterator.kind === 'factory') {
269
+ return normalizeIterable(value, iterator.factory, activeIterables, path, owner);
270
+ }
271
+ if (isThenable(value)) return normalizeThenable(value, path, owner);
272
+ if (typeof value !== 'object') return {
273
+ kind: 'invalid'
274
+ };
275
+ return isReactPortal(value) ? {
276
+ kind: 'node',
277
+ node: value
278
+ } : {
279
+ kind: 'invalid'
280
+ };
281
+ }
282
+
3
283
  /**
4
- * Type guard:判断 left/right 是否为 NavBarSlotConfig 对象(含 icon 字段)。
5
- * 不是的话视为 ReactNode 自定义内容。
284
+ * 未类型化边界的单一分类器。React 的公开 API 无法证明 object 不可伪造;这里拒绝
285
+ * 结构不成立的 marker-only element 与普通 plain object,同时保留 React 19 声明的
286
+ * bigint、Iterable、portal、Promise/thenable 等合法 ReactNode。Fragment/Iterable
287
+ * 会递归验证 primitive 叶子;thenable 映射按源对象缓存,避免每次 render 制造新的
288
+ * suspend identity;resolution record 的依赖可达性同时拦截 direct/indirect cycle,
289
+ * 并把 cycle 或非法 resolved value 确定性失败关闭为 null。
6
290
  */
7
- export function isSlot(v) {
8
- return typeof v === 'object' && v !== null && 'icon' in v;
291
+ export function classifyNavBarSlot(value) {
292
+ if (value === undefined || value === null || typeof value === 'boolean') {
293
+ return {
294
+ kind: 'empty'
295
+ };
296
+ }
297
+ if (isNavBarAction(value)) return {
298
+ kind: 'action',
299
+ action: value
300
+ };
301
+ return normalizeReactNode(value, new WeakSet(), 'slot');
9
302
  }
10
303
  //# sourceMappingURL=isSlot.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isSlot","v"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/isSlot.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,CAAU,EAAyB;EACxD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAI,MAAM,IAAIA,CAAC;AAC3D","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","ICONS","mappedThenables","WeakMap","isIconName","value","Object","prototype","hasOwnProperty","call","isNavBarAction","v","slot","icon","onPress","accessibilityLabel","trim","length","hasElementShape","element","type","undefined","props","isThenable","then","normalizeFragment","activeIterables","path","owner","normalized","normalizeReactNode","children","kind","node","cloneElement","recordReaches","from","target","visited","Set","has","add","dependency","dependencies","addThenableDependency","createThenableRecord","resolveMapped","rejectMapped","mappedPromise","Promise","resolve","reject","mappedNode","record","set","claimed","resolveOnce","resolved","WeakSet","rejectOnce","reason","error","normalizeThenable","get","getIteratorFactory","iterator","Symbol","factory","isReactPortal","portal","hasPortalShape","key","containerInfo","Children","count","normalizeArray","nodes","index","push","delete","normalizeIterable","completed","candidate","next","step","result","done","close","return","createElement","String","isValidElement","Fragment","Array","isArray","classifyNavBarSlot","action"],"sourceRoot":"../../../../../src","sources":["components/ui/NavBar/isSlot.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAA0B,OAAO;AAC7C,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAuB,yBAAgB;AAqBrD,MAAMC,eAAe,GAAG,IAAIC,OAAO,CAAmC,CAAC;AAEvE,SAASC,UAAUA,CAACC,KAAc,EAAqB;EACrD,OACE,OAAOA,KAAK,KAAK,QAAQ,IACzBC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACR,KAAK,EAAEI,KAAK,CAAC;AAEtD;;AAEA;AACA;AACA;AACA,OAAO,SAASK,cAAcA,CAACC,CAAU,EAAqB;EAC5D,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,EAAE,OAAO,KAAK;EACrD,MAAMC,IAAI,GAAGD,CAA4B;EACzC,OACEP,UAAU,CAACQ,IAAI,CAACC,IAAI,CAAC,IACrB,OAAOD,IAAI,CAACE,OAAO,KAAK,UAAU,IAClC,OAAOF,IAAI,CAACG,kBAAkB,KAAK,QAAQ,IAC3CH,IAAI,CAACG,kBAAkB,CAACC,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC;AAE7C;AAEA,SAASC,eAAeA,CAACb,KAAyB,EAAW;EAC3D,MAAMc,OAAO,GAAGd,KAAqD;EACrE,OACEC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAK,EAAE,MAAM,CAAC,IACnDC,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,I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AAC;EAC5D;EAEA,MAAMqC,QAAQ,GAAGD,kBAAkB,CAAC3D,KAAK,CAAC;EAC1C,IAAI4D,QAAQ,CAACjC,IAAI,KAAK,SAAS,EAAE,OAAOiC,QAAQ;EAChD,IAAIA,QAAQ,CAACjC,IAAI,KAAK,SAAS,EAAE;IAC/B,OAAOgD,iBAAiB,CACtB3E,KAAK,EACL4D,QAAQ,CAACE,OAAO,EAChBzC,eAAe,EACfC,IAAI,EACJC,KACF,CAAC;EACH;EACA,IAAIL,UAAU,CAAClB,KAAK,CAAC,EAAE,OAAOyD,iBAAiB,CAACzD,KAAK,EAAEsB,IAAI,EAAEC,KAAK,CAAC;EACnE,IAAI,OAAOvB,KAAK,KAAK,QAAQ,EAAE,OAAO;IAAE2B,IAAI,EAAE;EAAU,CAAC;EACzD,OAAOoC,aAAa,CAAC/D,KAAK,CAAC,GACvB;IAAE2B,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE5B;EAAM,CAAC,GAC7B;IAAE2B,IAAI,EAAE;EAAU,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS+D,kBAAkBA,CAAC1F,KAAc,EAA4B;EAC3E,IAAIA,KAAK,KAAKgB,SAAS,IAAIhB,KAAK,KAAK,IAAI,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;IACvE,OAAO;MAAE2B,IAAI,EAAE;IAAQ,CAAC;EAC1B;EACA,IAAItB,cAAc,CAACL,KAAK,CAAC,EAAE,OAAO;IAAE2B,IAAI,EAAE,QAAQ;IAAEgE,MAAM,EAAE3F;EAAM,CAAC;EACnE,OAAOyB,kBAAkB,CAACzB,KAAK,EAAE,IAAIqD,OAAO,CAAS,CAAC,EAAE,MAAM,CAAC;AACjE","ignoreList":[]}
@@ -1,78 +1,73 @@
1
1
  "use strict";
2
2
 
3
- import React, { forwardRef, useState } from 'react';
4
- import { Pressable } from 'react-native-gesture-handler';
5
- import { Icon } from "../Icon/index.js";
3
+ import React, { forwardRef, useEffect, useState } from 'react';
6
4
  import { Input } from "../Input/index.js";
7
- import { control, fixed, r, useColors } from "../../../theme/index.js";
8
- import { childTestID } from "../../../utils/testID/index.js";
9
- import { styles } from "./styles.js";
5
+ import { createLogger } from "../../../utils/logger/index.js";
10
6
  import { jsx as _jsx } from "react/jsx-runtime";
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 = /*#__PURE__*/forwardRef(function PasswordInput({
24
- value,
25
- onChangeText,
26
- placeholder = '请输入密码',
27
- testID,
28
- error,
29
- disabled,
30
- inputProps
31
- }, ref) {
32
- const c = useColors();
33
- const [showPw, setShowPw] = useState(false);
7
+ const log = createLogger('PasswordInput');
8
+
9
+ /** 密码输入:只切换 secureTextEntry,不改变调用方持有的受控文本或焦点。 */
10
+ export const PasswordInput = /*#__PURE__*/forwardRef(function PasswordInput(props, ref) {
11
+ const {
12
+ textContentType: rawTextContentType,
13
+ autoComplete: rawAutoComplete,
14
+ autoCapitalize: rawAutoCapitalize,
15
+ value: rawValue,
16
+ onChangeText: rawOnChangeText,
17
+ disabled: rawDisabled,
18
+ editable: rawEditable,
19
+ placeholder: rawPlaceholder,
20
+ defaultValue: _defaultValue,
21
+ inputProps: _inputProps,
22
+ secureTextEntry: _secureTextEntry,
23
+ leading: _leading,
24
+ trailing: _trailing,
25
+ ...rest
26
+ } = props;
27
+ const value = typeof rawValue === 'string' ? rawValue : '';
28
+ const onChangeText = typeof rawOnChangeText === 'function' ? rawOnChangeText : undefined;
29
+ const disabled = rawDisabled === true;
30
+ const editable = rawEditable === false ? false : undefined;
31
+ const placeholder = typeof rawPlaceholder === 'string' ? rawPlaceholder : '请输入密码';
32
+ const removedNativeAliasKey = Object.entries({
33
+ defaultValue: _defaultValue,
34
+ inputProps: _inputProps,
35
+ secureTextEntry: _secureTextEntry,
36
+ leading: _leading,
37
+ trailing: _trailing
38
+ }).filter(([, entry]) => entry !== undefined).map(([name]) => name).join(',');
39
+ useEffect(() => {
40
+ if (removedNativeAliasKey.length > 0) {
41
+ log.warn(`已忽略 PasswordInput 自管 props(${removedNativeAliasKey})。`);
42
+ }
43
+ }, [removedNativeAliasKey]);
44
+ const [showPassword, setShowPassword] = useState(false);
45
+ const effectiveEditable = disabled !== true && editable !== false;
46
+ const trailing = {
47
+ kind: 'action',
48
+ icon: showPassword ? 'eye' : 'eye-off',
49
+ onPress: () => setShowPassword(visible => !visible),
50
+ accessibilityLabel: showPassword ? '隐藏密码' : '显示密码',
51
+ disabled: !effectiveEditable
52
+ };
34
53
  return /*#__PURE__*/_jsx(Input, {
35
54
  ref: ref,
36
- testID: testID,
55
+ ...rest,
37
56
  value: value,
38
57
  onChangeText: onChangeText,
58
+ disabled: disabled,
59
+ editable: editable,
39
60
  placeholder: placeholder,
40
- error: error,
41
- disabled: disabled
42
- // [L-32] 补 textContentType / autoComplete / autoCapitalize 默认值 —— 提升密码自动填充体验
43
- ,
44
- textContentType: "password",
45
- autoComplete: "current-password",
46
- autoCapitalize: "none",
47
- ...inputProps,
48
- // secureTextEntry 在 inputProps spread 之后覆盖,确保组件自管不被 caller 干扰
49
- secureTextEntry: !showPw,
50
- leading: /*#__PURE__*/_jsx(Icon, {
51
- name: "lock",
52
- size: r(18),
53
- color: c.iconFaint40
54
- }),
55
- trailing: /*#__PURE__*/_jsx(Pressable, {
56
- testID: childTestID(testID, 'toggle'),
57
- style: styles.eyeBtn,
58
- onPress: () => setShowPw(v => !v),
59
- accessibilityRole: "button",
60
- accessibilityLabel: showPw ? '隐藏密码' : '显示密码'
61
- // [M-7] eye icon r(16)≈16pt;Input 高 control.md≈36pt 限制垂直扩展
62
- // vertical 走 (44-control.md)/2≈4;horizontal 走 (44-16)/2=14
63
- ,
64
- hitSlop: {
65
- top: Math.round((fixed.hitTarget - control.md) / 2),
66
- bottom: Math.round((fixed.hitTarget - control.md) / 2),
67
- left: Math.round((fixed.hitTarget - r(16)) / 2),
68
- right: Math.round((fixed.hitTarget - r(16)) / 2)
69
- },
70
- children: /*#__PURE__*/_jsx(Icon, {
71
- name: showPw ? 'eye' : 'eye-off',
72
- size: r(16),
73
- color: c.iconFaint40
74
- })
75
- })
61
+ textContentType: rawTextContentType ?? 'password',
62
+ autoComplete: rawAutoComplete ?? 'current-password',
63
+ autoCapitalize: rawAutoCapitalize ?? 'none',
64
+ secureTextEntry: !showPassword,
65
+ leading: {
66
+ kind: 'icon',
67
+ icon: 'lock',
68
+ size: 18
69
+ },
70
+ trailing: trailing
76
71
  });
77
72
  });
78
73
  PasswordInput.displayName = 'PasswordInput';
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","useState","Pressable","Icon","Input","control","fixed","r","useColors","childTestID","styles","jsx","_jsx","PasswordInput","value","onChangeText","placeholder","testID","error","disabled","inputProps","ref","c","showPw","setShowPw","textContentType","autoComplete","autoCapitalize","secureTextEntry","leading","name","size","color","iconFaint40","trailing","style","eyeBtn","onPress","v","accessibilityRole","accessibilityLabel","hitSlop","top","Math","round","hitTarget","md","bottom","left","right","children","displayName"],"sourceRoot":"../../../../../src","sources":["components/ui/PasswordInput/PasswordInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AACnD,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,KAAK,QAAQ,mBAAU;AAChC,SAASC,OAAO,EAAEC,KAAK,EAAEC,CAAC,EAAEC,SAAS,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AC,QAAQ;MAC1BC,kBAAkB,EAAEjB,MAAM,GAAG,MAAM,GAAG;MACtC;MACA;MAAA;MACAkB,OAAO,EAAE;QACPC,GAAG,EAAEC,IAAI,CAACC,KAAK,CAAC,CAACtC,KAAK,CAACuC,SAAS,GAAGxC,OAAO,CAACyC,EAAE,IAAI,CAAC,CAAC;QACnDC,MAAM,EAAEJ,IAAI,CAACC,KAAK,CAAC,CAACtC,KAAK,CAACuC,SAAS,GAAGxC,OAAO,CAACyC,EAAE,IAAI,CAAC,CAAC;QACtDE,IAAI,EAAEL,IAAI,CAACC,KAAK,CAAC,CAACtC,KAAK,CAACuC,SAAS,GAAGtC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAC/C0C,KAAK,EAAEN,IAAI,CAACC,KAAK,CAAC,CAACtC,KAAK,CAACuC,SAAS,GAAGtC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;MACjD,CAAE;MAAA2C,QAAA,eAEFtC,IAAA,CAACT,IAAI;QACH2B,IAAI,EAAEP,MAAM,GAAG,KAAK,GAAG,SAAU;QACjCQ,IAAI,EAAExB,CAAC,CAAC,EAAE,CAAE;QACZyB,KAAK,EAAEV,CAAC,CAACW;MAAY,CACtB;IAAC,CACO;EACZ,CACF,CAAC;AAEN,CACF,CAAC;AAEDpB,aAAa,CAACsC,WAAW,GAAG,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","useEffect","useState","Input","createLogger","jsx","_jsx","log","PasswordInput","props","ref","textContentType","rawTextContentType","autoComplete","rawAutoComplete","autoCapitalize","rawAutoCapitalize","value","rawValue","onChangeText","rawOnChangeText","disabled","rawDisabled","editable","rawEditable","placeholder","rawPlaceholder","defaultValue","_defaultValue","inputProps","_inputProps","secureTextEntry","_secureTextEntry","leading","_leading","trailing","_trailing","rest","undefined","removedNativeAliasKey","Object","entries","filter","entry","map","name","join","length","warn","showPassword","setShowPassword","effectiveEditable","kind","icon","onPress","visible","accessibilityLabel","size","displayName"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EAAEC,iBAAiB,IAAI,MAAO;IAC5Ce,eAAe,EAAE,CAACkB,YAAa;IAC/BhB,OAAO,EAAE;MAAEmB,IAAI,EAAE,MAAM;MAAEC,IAAI,EAAE,MAAM;MAAEI,IAAI,EAAE;IAAG,CAAE;IAClDtB,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CACF,CAAC;AAED3B,aAAa,CAACkD,WAAW,GAAG,eAAe","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import Animated from 'react-native-reanimated';
5
- import { usePulse } from './usePulse';
5
+ import { usePulse } from "./usePulse.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export function Pulse({
8
8
  children,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","usePulse","jsx","_jsx","Pulse","children","style","testID","opts","animatedStyle","View"],"sourceRoot":"../../../../../src","sources":["components/ui/Pulse/Pulse.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtC,OAAO,SAASC,KAAKA,CAAC;EACpBC,QAAQ;EACRC,KAAK;EACLC,MAAM;EACN,GAAGC;AACuC,CAAC,EAAqB;EAChE,MAAMC,aAAa,GAAGR,QAAQ,CAACO,IAAI,CAAC;EACpC,oBACEL,IAAA,CAACH,QAAQ,CAACU,IAAI;IAACJ,KAAK,EAAE,CAACG,aAAa,EAAEH,KAAK,CAAE;IAACC,MAAM,EAAEA,MAAO;IAAAF,QAAA,EAC1DA;EAAQ,CACI,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["React","Animated","usePulse","jsx","_jsx","Pulse","children","style","testID","opts","animatedStyle","View"],"sourceRoot":"../../../../../src","sources":["components/ui/Pulse/Pulse.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,QAAQ,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtC,OAAO,SAASC,KAAKA,CAAC;EACpBC,QAAQ;EACRC,KAAK;EACLC,MAAM;EACN,GAAGC;AACuC,CAAC,EAAqB;EAChE,MAAMC,aAAa,GAAGR,QAAQ,CAACO,IAAI,CAAC;EACpC,oBACEL,IAAA,CAACH,QAAQ,CAACU,IAAI;IAACJ,KAAK,EAAE,CAACG,aAAa,EAAEH,KAAK,CAAE;IAACC,MAAM,EAAEA,MAAO;IAAAF,QAAA,EAC1DA;EAAQ,CACI,CAAC;AAEpB","ignoreList":[]}
@@ -3,23 +3,21 @@
3
3
  import React from 'react';
4
4
  import Animated from 'react-native-reanimated';
5
5
  import { r, useColors } from "../../../theme/index.js";
6
- import { usePulse } from './usePulse';
6
+ import { DOT_DEFAULTS, usePulseWithDefaults } from "./usePulse.js";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export function PulseDot({
9
9
  size = r(6),
10
10
  color,
11
- from = 0.5,
12
11
  style,
13
12
  testID,
14
13
  ...opts
15
14
  } = {}) {
16
15
  const c = useColors();
17
16
  const fill = color ?? c.primary;
18
- // [L-93] 只显式覆盖 from(默认 0.5 usePulse 的 0.6 不同),其余 opts 透传 usePulse。
19
- const animatedStyle = usePulse({
20
- from,
21
- ...opts
22
- });
17
+ // [L-93] 圆点的 from 默认 0.5(比 <Pulse> 的 0.6 更淡)。默认值交给共享的
18
+ // DOT_DEFAULTS,不再在解构里写 `from = 0.5` —— 那样 from 会先被默认值填满,
19
+ // 归一化层再也分不清「调用方没传」和「调用方传了 0.5」。
20
+ const animatedStyle = usePulseWithDefaults(opts, DOT_DEFAULTS, 'PulseDot');
23
21
  return /*#__PURE__*/_jsx(Animated.View, {
24
22
  style: [{
25
23
  width: size,