@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
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Stepper 唯一的范围与 action 归一化入口。
5
+ *
6
+ * 组件的视觉状态、handler 和 a11y 都消费同一份结果,避免边界按钮已禁用但
7
+ * adjustable 仍暴露无效 action。
8
+ */
9
+ export function normalizeStepper({
10
+ value,
11
+ min = 0,
12
+ max = 99,
13
+ step = 1,
14
+ disabled = false
15
+ }) {
16
+ const safeMin = typeof min === 'number' && Number.isFinite(min) ? min : 0;
17
+ const safeMax = typeof max === 'number' && Number.isFinite(max) && max >= safeMin ? max : safeMin;
18
+ const safeStep = typeof step === 'number' && Number.isFinite(step) && step > 0 ? step : 1;
19
+ const safeValue = typeof value === 'number' && Number.isFinite(value) ? Math.min(safeMax, Math.max(safeMin, value)) : safeMin;
20
+ const rangeDisabled = disabled === true || safeMin === safeMax;
21
+ const canDecrement = !rangeDisabled && safeValue > safeMin;
22
+ const canIncrement = !rangeDisabled && safeValue < safeMax;
23
+ const accessibilityActions = [];
24
+ if (canIncrement) {
25
+ accessibilityActions.push({
26
+ name: 'increment',
27
+ label: '增加'
28
+ });
29
+ }
30
+ if (canDecrement) {
31
+ accessibilityActions.push({
32
+ name: 'decrement',
33
+ label: '减少'
34
+ });
35
+ }
36
+ return {
37
+ safeMin,
38
+ safeMax,
39
+ safeStep,
40
+ safeValue,
41
+ rangeDisabled,
42
+ canDecrement,
43
+ canIncrement,
44
+ accessibilityActions
45
+ };
46
+ }
47
+ export function nextStepperValue(normalized, direction) {
48
+ if (direction === 'increment') {
49
+ return normalized.canIncrement ? Math.min(normalized.safeMax, normalized.safeValue + normalized.safeStep) : undefined;
50
+ }
51
+ return normalized.canDecrement ? Math.max(normalized.safeMin, normalized.safeValue - normalized.safeStep) : undefined;
52
+ }
53
+ //# sourceMappingURL=normalizeStepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["normalizeStepper","value","min","max","step","disabled","safeMin","Number","isFinite","safeMax","safeStep","safeValue","Math","rangeDisabled","canDecrement","canIncrement","accessibilityActions","push","name","label","nextStepperValue","normalized","direction","undefined"],"sourceRoot":"../../../../../src","sources":["components/ui/Stepper/normalizeStepper.ts"],"mappings":";;AAwBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,gBAAgBA,CAAC;EAC/BC,KAAK;EACLC,GAAG,GAAG,CAAC;EACPC,GAAG,GAAG,EAAE;EACRC,IAAI,GAAG,CAAC;EACRC,QAAQ,GAAG;AACc,CAAC,EAAqB;EAC/C,MAAMC,OAAO,GAAG,OAAOJ,GAAG,KAAK,QAAQ,IAAIK,MAAM,CAACC,QAAQ,CAACN,GAAG,CAAC,GAAGA,GAAG,GAAG,CAAC;EACzE,MAAMO,OAAO,GACX,OAAON,GAAG,KAAK,QAAQ,IAAII,MAAM,CAACC,QAAQ,CAACL,GAAG,CAAC,IAAIA,GAAG,IAAIG,OAAO,GAC7DH,GAAG,GACHG,OAAO;EACb,MAAMI,QAAQ,GACZ,OAAON,IAAI,KAAK,QAAQ,IAAIG,MAAM,CAACC,QAAQ,CAACJ,IAAI,CAAC,IAAIA,IAAI,GAAG,CAAC,GAAGA,IAAI,GAAG,CAAC;EAC1E,MAAMO,SAAS,GACb,OAAOV,KAAK,KAAK,QAAQ,IAAIM,MAAM,CAACC,QAAQ,CAACP,KAAK,CAAC,GAC/CW,IAAI,CAACV,GAAG,CAACO,OAAO,EAAEG,IAAI,CAACT,GAAG,CAACG,OAAO,EAAEL,KAAK,CAAC,CAAC,GAC3CK,OAAO;EACb,MAAMO,aAAa,GAAGR,QAAQ,KAAK,IAAI,IAAIC,OAAO,KAAKG,OAAO;EAC9D,MAAMK,YAAY,GAAG,CAACD,aAAa,IAAIF,SAAS,GAAGL,OAAO;EAC1D,MAAMS,YAAY,GAAG,CAACF,aAAa,IAAIF,SAAS,GAAGF,OAAO;EAC1D,MAAMO,oBAA+D,GAAG,EAAE;EAE1E,IAAID,YAAY,EAAE;IAChBC,oBAAoB,CAACC,IAAI,CAAC;MAAEC,IAAI,EAAE,WAAW;MAAEC,KAAK,EAAE;IAAK,CAAC,CAAC;EAC/D;EACA,IAAIL,YAAY,EAAE;IAChBE,oBAAoB,CAACC,IAAI,CAAC;MAAEC,IAAI,EAAE,WAAW;MAAEC,KAAK,EAAE;IAAK,CAAC,CAAC;EAC/D;EAEA,OAAO;IACLb,OAAO;IACPG,OAAO;IACPC,QAAQ;IACRC,SAAS;IACTE,aAAa;IACbC,YAAY;IACZC,YAAY;IACZC;EACF,CAAC;AACH;AAEA,OAAO,SAASI,gBAAgBA,CAC9BC,UAA6B,EAC7BC,SAA2B,EACP;EACpB,IAAIA,SAAS,KAAK,WAAW,EAAE;IAC7B,OAAOD,UAAU,CAACN,YAAY,GAC1BH,IAAI,CAACV,GAAG,CAACmB,UAAU,CAACZ,OAAO,EAAEY,UAAU,CAACV,SAAS,GAAGU,UAAU,CAACX,QAAQ,CAAC,GACxEa,SAAS;EACf;EACA,OAAOF,UAAU,CAACP,YAAY,GAC1BF,IAAI,CAACT,GAAG,CAACkB,UAAU,CAACf,OAAO,EAAEe,UAAU,CAACV,SAAS,GAAGU,UAAU,CAACX,QAAQ,CAAC,GACxEa,SAAS;AACf","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  import { StyleSheet } from 'react-native';
4
4
  import { control, fw, r, radius, type as t } from "../../../theme/index.js";
5
5
  /** Stepper 静态 + themed base —— btn / value 容器共用 cell 基底,radius / border 走 token。
6
- * 尺寸(高 / 宽 / 字号)由 sizingFor 派生,sm 走 control.sm,md 走 r(32)(介于
6
+ * 尺寸(高 / 宽 / 字号)由 sizingFor 派生,sm 走 control.sm (`r(28)`),md 走 r(32)(介于
7
7
  * control.sm 与 control.md 之间,与 avatar.md / dim.sendBtn 同值但语义独立)。 */
8
8
  export const makeStyles = c => StyleSheet.create({
9
9
  wrap: {
@@ -11,6 +11,13 @@ export const makeStyles = c => StyleSheet.create({
11
11
  alignItems: 'center',
12
12
  alignSelf: 'flex-start'
13
13
  },
14
+ actionFrame: {
15
+ justifyContent: 'center'
16
+ },
17
+ valueFrame: {
18
+ alignItems: 'center',
19
+ justifyContent: 'center'
20
+ },
14
21
  /** btn / value 共用的 cell 基底 —— 居中 + surface 背景 + 上下边框。
15
22
  * 左右边框 / 圆角由 btnLeft / btnRight 增量补齐;value 中间无侧边框。 */
16
23
  cell: {
@@ -43,7 +50,7 @@ export const makeStyles = c => StyleSheet.create({
43
50
  }
44
51
  });
45
52
 
46
- /** Stepper 尺寸推导:sm(control.sm=28 高 / 28 按钮 / 40 值宽 / xs 字)/
53
+ /** Stepper 尺寸推导:sm(control.sm=`r(28)` 高 / `r(28)` 按钮 / r(40) 值宽 / xs 字)/
47
54
  * md(r(32) 高 / r(32) 按钮 / r(48) 值宽 / sm 字)。
48
55
  * 新增 size 在 types.ts 加 union + 这里加 case。 */
49
56
  export function sizingFor(size) {
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","control","fw","r","radius","type","t","makeStyles","c","create","wrap","flexDirection","alignItems","alignSelf","cell","justifyContent","backgroundColor","surface","borderTopWidth","borderBottomWidth","borderColor","outline","btnLeft","borderLeftWidth","borderTopLeftRadius","md","borderBottomLeftRadius","btnRight","borderRightWidth","borderTopRightRadius","borderBottomRightRadius","btnText","fontSize","h1","color","foreground","fontWeight","medium","lineHeight","valueText","sizingFor","size","h","sm","btn","w","fs","xs"],"sourceRoot":"../../../../../src","sources":["components/ui/Stepper/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,EAAEC,EAAE,EAAEC,CAAC,EAAEC,MAAM,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAIlE;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCR,UAAU,CAACS,MAAM,CAAC;EAChBC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE;EACb,CAAC;EACD;AACJ;EACIC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AC;QAAE2C,EAAE,EAAExC,CAAC,CAACqC;MAAG,CAAC;EACvD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","control","fw","r","radius","type","t","makeStyles","c","create","wrap","flexDirection","alignItems","alignSelf","actionFrame","justifyContent","valueFrame","cell","backgroundColor","surface","borderTopWidth","borderBottomWidth","borderColor","outline","btnLeft","borderLeftWidth","borderTopLeftRadius","md","borderBottomLeftRadius","btnRight","borderRightWidth","borderTopRightRadius","borderBottomRightRadius","btnText","fontSize","h1","color","foreground","fontWeight","medium","lineHeight","valueText","sizingFor","size","h","sm","btn","w","fs","xs"],"sourceRoot":"../../../../../src","sources":["components/ui/Stepper/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,OAAO,EAAEC,EAAE,EAAEC,CAAC,EAAEC,MAAM,EAAEC,IAAI,IAAIC,CAAC,QAAQ,yBAAgB;AAIlE;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,CAAc,IACvCR,UAAU,CAACS,MAAM,CAAC;EAChBC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE;EACb,CAAC;EACDC,WAAW,EAAE;IACXC,cAAc,EAAE;EAClB,CAAC;EACDC,UAAU,EAAE;IACVJ,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE;EAClB,CAAC;EACD;AACJ;EACIE,IAAI,EAAE;IACJL,UAAU,EAAE,QAAQ;IACpBG,cAAc,EAAE,QAAQ;IACxBG,eAAe,EAAEV,CAAC,CAACW,OAAO;IAC1BC,cAAc,EAAE,CAAC;IACjBC,iBAAiB,EAAE,CAAC;IACpBC,WAAW,EAAEd,CAAC,CAACe;EACjB,CAAC;EACDC,OAAO,EAAE;IACPC,eAAe,EAAE,CAAC;IAClBC,mBAAmB,EAAEtB,MAAM,CAACuB,EAAE;IAC9BC,sBAAsB,EAAExB,MAAM,CAACuB;EACjC,CAAC;EACDE,QAAQ,EAAE;IACRC,gBAAgB,EAAE,CAAC;IACnBC,oBAAoB,EAAE3B,MAAM,CAACuB,EAAE;IAC/BK,uBAAuB,EAAE5B,MAAM,CAACuB;EAClC,CAAC;EACDM,OAAO,EAAE;IACPC,QAAQ,EAAE5B,CAAC,CAAC6B,EAAE;IACdC,KAAK,EAAE5B,CAAC,CAAC6B,UAAU;IACnBC,UAAU,EAAEpC,EAAE,CAACqC,MAAM;IACrBC,UAAU,EAAElC,CAAC,CAAC6B;EAChB,CAAC;EACDM,SAAS,EAAE;IACTL,KAAK,EAAE5B,CAAC,CAAC6B,UAAU;IACnBC,UAAU,EAAEpC,EAAE,CAACqC;EACjB;AACF,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,OAAO,SAASG,SAASA,CAACC,IAAiB,EAKzC;EACA,QAAQA,IAAI;IACV,KAAK,IAAI;MACP,OAAO;QAAEC,CAAC,EAAE3C,OAAO,CAAC4C,EAAE;QAAEC,GAAG,EAAE7C,OAAO,CAAC4C,EAAE;QAAEE,CAAC,EAAE5C,CAAC,CAAC,EAAE,CAAC;QAAE6C,EAAE,EAAE1C,CAAC,CAAC2C;MAAG,CAAC;IAC/D,KAAK,IAAI;MACP,OAAO;QAAEL,CAAC,EAAEzC,CAAC,CAAC,EAAE,CAAC;QAAE2C,GAAG,EAAE3C,CAAC,CAAC,EAAE,CAAC;QAAE4C,CAAC,EAAE5C,CAAC,CAAC,EAAE,CAAC;QAAE6C,EAAE,EAAE1C,CAAC,CAACuC;MAAG,CAAC;EACvD;AACF","ignoreList":[]}
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useEffect } from 'react';
4
+ import { View } from 'react-native';
4
5
  import { Pressable } from 'react-native-gesture-handler';
5
6
  import Animated, { cancelAnimation, interpolate, interpolateColor, useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
6
- import { fixed, motion, r, useColors, useThemedStyles } from "../../../theme/index.js";
7
- import { makeStyles, THUMB_OFF_X, THUMB_ON_X, TRACK_H } from "./styles.js";
7
+ import { motion, useColors, usePrefersReducedMotion, useThemedStyles } from "../../../theme/index.js";
8
+ import { createLogger } from "../../../utils/logger/index.js";
9
+ import { childTestID } from "../../../utils/testID/index.js";
10
+ import { A11Y_HIDDEN_PROPS } from "../shared/a11y.js";
11
+ import { normalizeNonBlankText } from "../shared/accessibilityName.js";
12
+ import { makeStyles, THUMB_OFF_X, THUMB_ON_X } from "./styles.js";
8
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
+ const log = createLogger('Switch');
15
+
9
16
  /**
10
17
  * 布尔切换。32×20 轨道 + 16×16 白色把手,200ms 缓动。
11
18
  *
@@ -21,13 +28,27 @@ export function Switch({
21
28
  }) {
22
29
  const c = useColors();
23
30
  const styles = useThemedStyles(makeStyles);
31
+ const reducedMotion = usePrefersReducedMotion();
24
32
  const progress = useSharedValue(value ? 1 : 0);
33
+ const accessibleName = normalizeNonBlankText(accessibilityLabel);
34
+ const hasBlankLabel = accessibleName === undefined;
35
+ const isDisabled = disabled === true || hasBlankLabel;
25
36
  useEffect(() => {
26
- progress.value = withTiming(value ? 1 : 0, {
27
- duration: motion.base
28
- });
37
+ if (reducedMotion) {
38
+ cancelAnimation(progress);
39
+ progress.value = value ? 1 : 0;
40
+ } else {
41
+ progress.value = withTiming(value ? 1 : 0, {
42
+ duration: motion.base
43
+ });
44
+ }
29
45
  return () => cancelAnimation(progress);
30
- }, [value, progress]);
46
+ }, [progress, reducedMotion, value]);
47
+ useEffect(() => {
48
+ if (hasBlankLabel) {
49
+ log.warn('Switch accessibilityLabel 不能为空白,当前 action 已禁用。');
50
+ }
51
+ }, [hasBlankLabel]);
31
52
  const trackStyle = useAnimatedStyle(() => ({
32
53
  backgroundColor: interpolateColor(progress.value, [0, 1], [c.surfaceContainerHighest, c.primary])
33
54
  }));
@@ -37,23 +58,28 @@ export function Switch({
37
58
  }]
38
59
  }));
39
60
  return /*#__PURE__*/_jsx(Pressable, {
40
- onPress: () => !disabled && onChange(!value),
41
- disabled: disabled
42
- // [M-7] 轨道高 r(20)≈20pt;补 (44-20)/2=12 到 fixed.hitTarget
43
- ,
44
- hitSlop: Math.round((fixed.hitTarget - r(TRACK_H)) / 2),
45
- style: disabled ? styles.pressableDisabled : styles.pressableEnabled,
46
- accessibilityRole: "switch",
47
- accessibilityState: {
61
+ accessible: !hasBlankLabel,
62
+ onPress: isDisabled ? undefined : () => onChange(!value),
63
+ disabled: isDisabled,
64
+ style: [styles.pressable, isDisabled && styles.pressableDisabled],
65
+ accessibilityRole: hasBlankLabel ? undefined : 'switch',
66
+ accessibilityState: hasBlankLabel ? undefined : {
48
67
  checked: value,
49
- disabled: !!disabled
68
+ disabled: isDisabled
50
69
  },
51
- accessibilityLabel: accessibilityLabel,
70
+ accessibilityLabel: accessibleName,
52
71
  testID: testID,
53
- children: /*#__PURE__*/_jsx(Animated.View, {
54
- style: [styles.track, trackStyle],
72
+ children: /*#__PURE__*/_jsx(View, {
73
+ ...A11Y_HIDDEN_PROPS,
74
+ style: styles.visualFrame,
75
+ testID: childTestID(testID, 'visual'),
55
76
  children: /*#__PURE__*/_jsx(Animated.View, {
56
- style: [styles.thumb, thumbStyle]
77
+ style: [styles.track, trackStyle],
78
+ testID: childTestID(testID, 'track'),
79
+ children: /*#__PURE__*/_jsx(Animated.View, {
80
+ style: [styles.thumb, thumbStyle],
81
+ testID: childTestID(testID, 'thumb')
82
+ })
57
83
  })
58
84
  })
59
85
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","Pressable","Animated","cancelAnimation","interpolate","interpolateColor","useAnimatedStyle","useSharedValue","withTiming","fixed","motion","r","useColors","useThemedStyles","makeStyles","THUMB_OFF_X","THUMB_ON_X","TRACK_H","jsx","_jsx","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","progress","duration","base","trackStyle","backgroundColor","surfaceContainerHighest","primary","thumbStyle","transform","translateX","onPress","hitSlop","Math","round","hitTarget","style","pressableDisabled","pressableEnabled","accessibilityRole","accessibilityState","checked","children","View","track","thumb"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,SAAS,QAAQ,8BAA8B;AAExD,OAAOC,QAAQ,IACbC,eAAe,EACfC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,KAAK,EAAEC,MAAM,EAAEC,CAAC,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AAC7E,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,EAAEC,OAAO,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGxE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,MAAMA,CAAC;EACrBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,kBAAkB;EAClBC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGd,SAAS,CAAC,CAAC;EACrB,MAAMe,MAAM,GAAGd,eAAe,CAACC,UAAU,CAAC;EAC1C,MAAMc,QAAQ,GAAGrB,cAAc,CAACc,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;EAE9CrB,SAAS,CAAC,MAAM;IACd4B,QAAQ,CAACP,KAAK,GAAGb,UAAU,CAACa,KAAK,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEQ,QAAQ,EAAEnB,MAAM,CAACoB;IAAK,CAAC,CAAC;IACrE,OAAO,MAAM3B,eAAe,CAACyB,QAAQ,CAAC;EACxC,CAAC,EAAE,CAACP,KAAK,EAAEO,QAAQ,CAAC,CAAC;EAErB,MAAMG,UAAU,GAAGzB,gBAAgB,CAAC,OAAO;IACzC0B,eAAe,EAAE3B,gBAAgB,CAC/BuB,QAAQ,CAACP,KAAK,EACd,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAACK,CAAC,CAACO,uBAAuB,EAAEP,CAAC,CAACQ,OAAO,CACvC;EACF,CAAC,CAAC,CAAC;EAEH,MAAMC,UAAU,GAAG7B,gBAAgB,CAAC,OAAO;IACzC8B,SAAS,EAAE,CACT;MACEC,UAAU,EAAEjC,WAAW,CACrBwB,QAAQ,CAACP,KAAK,EACd,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAACN,WAAW,EAAEC,UAAU,CAC1B;IACF,CAAC;EAEL,CAAC,CAAC,CAAC;EAEH,oBACEG,IAAA,CAAClB,SAAS;IACRqC,OAAO,EAAEA,CAAA,KAAM,CAACf,QAAQ,IAAID,QAAQ,CAAC,CAACD,KAAK,CAAE;IAC7CE,QAAQ,EAAEA;IACV;IAAA;IACAgB,OAAO,EAAEC,IAAI,CAACC,KAAK,CAAC,CAAChC,KAAK,CAACiC,SAAS,GAAG/B,CAAC,CAACM,OAAO,CAAC,IAAI,CAAC,CAAE;IACxD0B,KAAK,EAAEpB,QAAQ,GAAGI,MAAM,CAACiB,iBAAiB,GAAGjB,MAAM,CAACkB,gBAAiB;IACrEC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAE;MAAEC,OAAO,EAAE3B,KAAK;MAAEE,QAAQ,EAAE,CAAC,CAACA;IAAS,CAAE;IAC7DC,kBAAkB,EAAEA,kBAAmB;IACvCC,MAAM,EAAEA,MAAO;IAAAwB,QAAA,eAEf9B,IAAA,CAACjB,QAAQ,CAACgD,IAAI;MAACP,KAAK,EAAE,CAAChB,MAAM,CAACwB,KAAK,EAAEpB,UAAU,CAAE;MAAAkB,QAAA,eAC/C9B,IAAA,CAACjB,QAAQ,CAACgD,IAAI;QAACP,KAAK,EAAE,CAAChB,MAAM,CAACyB,KAAK,EAAEjB,UAAU;MAAE,CAAE;IAAC,CACvC;EAAC,CACP,CAAC;AAEhB","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","View","Pressable","Animated","cancelAnimation","interpolate","interpolateColor","useAnimatedStyle","useSharedValue","withTiming","motion","useColors","usePrefersReducedMotion","useThemedStyles","createLogger","childTestID","A11Y_HIDDEN_PROPS","normalizeNonBlankText","makeStyles","THUMB_OFF_X","THUMB_ON_X","jsx","_jsx","log","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","reducedMotion","progress","accessibleName","hasBlankLabel","undefined","isDisabled","duration","base","warn","trackStyle","backgroundColor","surfaceContainerHighest","primary","thumbStyle","transform","translateX","accessible","onPress","style","pressable","pressableDisabled","accessibilityRole","accessibilityState","checked","children","visualFrame","track","thumb"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,SAAS,QAAQ,8BAA8B;AAExD,OAAOC,QAAQ,IACbC,eAAe,EACfC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SACEC,MAAM,EACNC,SAAS,EACTC,uBAAuB,EACvBC,eAAe,QACV,yBAAgB;AACvB,SAASC,YAAY,QAAQ,gCAAuB;AACpD,SAASC,WAAW,QAAQ,gCAAuB;AACnD,SAASC,iBAAiB,QAAQ,mBAAgB;AAClD,SAASC,qBAAqB,QAAQ,gCAA6B;AACnE,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/D,MAAMC,GAAG,GAAGT,YAAY,CAAC,QAAQ,CAAC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,MAAMA,CAAC;EACrBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,kBAAkB;EAClBC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGnB,SAAS,CAAC,CAAC;EACrB,MAAMoB,MAAM,GAAGlB,eAAe,CAACK,UAAU,CAAC;EAC1C,MAAMc,aAAa,GAAGpB,uBAAuB,CAAC,CAAC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EAAEC,UAAU,CAC1B;IACF,CAAC;EAEL,CAAC,CAAC,CAAC;EAEH,oBACEE,IAAA,CAACpB,SAAS;IACR8C,UAAU,EAAE,CAACb,aAAc;IAC3Bc,OAAO,EAAEZ,UAAU,GAAGD,SAAS,GAAG,MAAMV,QAAQ,CAAC,CAACD,KAAK,CAAE;IACzDE,QAAQ,EAAEU,UAAW;IACrBa,KAAK,EAAE,CAACnB,MAAM,CAACoB,SAAS,EAAEd,UAAU,IAAIN,MAAM,CAACqB,iBAAiB,CAAE;IAClEC,iBAAiB,EAAElB,aAAa,GAAGC,SAAS,GAAG,QAAS;IACxDkB,kBAAkB,EAChBnB,aAAa,GAAGC,SAAS,GAAG;MAAEmB,OAAO,EAAE9B,KAAK;MAAEE,QAAQ,EAAEU;IAAW,CACpE;IACDT,kBAAkB,EAAEM,cAAe;IACnCL,MAAM,EAAEA,MAAO;IAAA2B,QAAA,eAEflC,IAAA,CAACrB,IAAI;MAAA,GACCe,iBAAiB;MACrBkC,KAAK,EAAEnB,MAAM,CAAC0B,WAAY;MAC1B5B,MAAM,EAAEd,WAAW,CAACc,MAAM,EAAE,QAAQ,CAAE;MAAA2B,QAAA,eAEtClC,IAAA,CAACnB,QAAQ,CAACF,IAAI;QACZiD,KAAK,EAAE,CAACnB,MAAM,CAAC2B,KAAK,EAAEjB,UAAU,CAAE;QAClCZ,MAAM,EAAEd,WAAW,CAACc,MAAM,EAAE,OAAO,CAAE;QAAA2B,QAAA,eAErClC,IAAA,CAACnB,QAAQ,CAACF,IAAI;UACZiD,KAAK,EAAE,CAACnB,MAAM,CAAC4B,KAAK,EAAEd,UAAU,CAAE;UAClChB,MAAM,EAAEd,WAAW,CAACc,MAAM,EAAE,OAAO;QAAE,CACtC;MAAC,CACW;IAAC,CACZ;EAAC,CACE,CAAC;AAEhB","ignoreList":[]}
@@ -1,11 +1,17 @@
1
1
  "use strict";
2
2
 
3
- import React from 'react';
3
+ import React, { useEffect } from 'react';
4
4
  import { Pressable } from 'react-native-gesture-handler';
5
5
  import { View } from 'react-native';
6
- import { motion, useColors, useThemedStyles } from "../../../theme/index.js";
6
+ import { motion, useColors, usePrefersReducedMotion, useThemedStyles } from "../../../theme/index.js";
7
+ import { createLogger } from "../../../utils/logger/index.js";
8
+ import { childTestID } from "../../../utils/testID/index.js";
9
+ import { A11Y_HIDDEN_PROPS } from "../shared/a11y.js";
10
+ import { normalizeNonBlankText } from "../shared/accessibilityName.js";
7
11
  import { makeStyles, THUMB_OFF_X, THUMB_ON_X } from "./styles.js";
8
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const log = createLogger('Switch');
14
+
9
15
  /**
10
16
  * Web 端 Switch —— RN-Web 上 reanimated 4 + worklets 0.9.x 的 useAnimatedStyle
11
17
  * 链路会抛 `Object.keys(undefined)` TypeError(切换时打印,thumb 卡住),走 CSS
@@ -25,41 +31,62 @@ export function Switch({
25
31
  }) {
26
32
  const c = useColors();
27
33
  const styles = useThemedStyles(makeStyles);
34
+ const reducedMotion = usePrefersReducedMotion();
35
+ const accessibleName = normalizeNonBlankText(accessibilityLabel);
36
+ const hasBlankLabel = accessibleName === undefined;
37
+ const isDisabled = disabled === true || hasBlankLabel;
38
+ useEffect(() => {
39
+ if (hasBlankLabel) {
40
+ log.warn('Switch accessibilityLabel 不能为空白,当前 action 已禁用。');
41
+ }
42
+ }, [hasBlankLabel]);
28
43
 
29
- // 给 RN style 数组追加 web-only 字段:transition + 切换值
44
+ // 给 RN style 数组追加 web-only 字段;reduced motion 时连 transition key
45
+ // 都不输出,避免浏览器仍创建零时长 transition。
30
46
  const trackWebStyle = {
31
47
  ...styles.track,
32
48
  backgroundColor: value ? c.primary : c.surfaceContainerHighest,
33
- // RN style 不识 transition 但 RN-Web 会把它当 inline style 透传给 DOM
34
- transitionProperty: 'background-color',
35
- transitionDuration: `${motion.base}ms`,
36
- transitionTimingFunction: 'ease-out'
49
+ ...(reducedMotion ? {} : {
50
+ // RN style 不识 transition 但 RN-Web 会把它当 inline style 透传给 DOM
51
+ transitionProperty: 'background-color',
52
+ transitionDuration: `${motion.base}ms`,
53
+ transitionTimingFunction: 'ease-out'
54
+ })
37
55
  };
38
56
  const thumbWebStyle = {
39
57
  ...styles.thumb,
40
58
  transform: [{
41
59
  translateX: value ? THUMB_ON_X : THUMB_OFF_X
42
60
  }],
43
- transitionProperty: 'transform',
44
- transitionDuration: `${motion.base}ms`,
45
- transitionTimingFunction: 'ease-out'
61
+ ...(reducedMotion ? {} : {
62
+ transitionProperty: 'transform',
63
+ transitionDuration: `${motion.base}ms`,
64
+ transitionTimingFunction: 'ease-out'
65
+ })
46
66
  };
47
67
  return /*#__PURE__*/_jsx(Pressable, {
48
- onPress: () => !disabled && onChange(!value),
49
- disabled: disabled,
50
- hitSlop: 6,
51
- style: disabled ? styles.pressableDisabled : styles.pressableEnabled,
52
- accessibilityRole: "switch",
53
- accessibilityState: {
68
+ accessible: !hasBlankLabel,
69
+ onPress: isDisabled ? undefined : () => onChange(!value),
70
+ disabled: isDisabled,
71
+ style: [styles.pressable, isDisabled && styles.pressableDisabled],
72
+ accessibilityRole: hasBlankLabel ? undefined : 'switch',
73
+ accessibilityState: hasBlankLabel ? undefined : {
54
74
  checked: value,
55
- disabled: !!disabled
75
+ disabled: isDisabled
56
76
  },
57
- accessibilityLabel: accessibilityLabel,
77
+ accessibilityLabel: accessibleName,
58
78
  testID: testID,
59
79
  children: /*#__PURE__*/_jsx(View, {
60
- style: trackWebStyle,
80
+ ...A11Y_HIDDEN_PROPS,
81
+ style: styles.visualFrame,
82
+ testID: childTestID(testID, 'visual'),
61
83
  children: /*#__PURE__*/_jsx(View, {
62
- style: thumbWebStyle
84
+ style: trackWebStyle,
85
+ testID: childTestID(testID, 'track'),
86
+ children: /*#__PURE__*/_jsx(View, {
87
+ style: thumbWebStyle,
88
+ testID: childTestID(testID, 'thumb')
89
+ })
63
90
  })
64
91
  })
65
92
  });
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","View","motion","useColors","useThemedStyles","makeStyles","THUMB_OFF_X","THUMB_ON_X","jsx","_jsx","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","trackWebStyle","track","backgroundColor","primary","surfaceContainerHighest","transitionProperty","transitionDuration","base","transitionTimingFunction","thumbWebStyle","thumb","transform","translateX","onPress","hitSlop","style","pressableDisabled","pressableEnabled","accessibilityRole","accessibilityState","checked","children"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,MAAM,EAAEC,SAAS,EAAEC,eAAe,QAAQ,yBAAgB;AACnE,SAASC,UAAU,EAAEC,WAAW,EAAEC,UAAU,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,MAAMA,CAAC;EACrBC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,kBAAkB;EAClBC;AACW,CAAC,EAAqB;EACjC,MAAMC,CAAC,GAAGb,SAAS,CAAC,CAAC;EACrB,MAAMc,MAAM,GAAGb,eAAe,CAACC,UAAU,CAAC;;EAE1C;EACA,MAAMa,aAAa,GAAG;IACpB,GAAGD,MAAM,CAACE,KAAK;IACfC,eAAe,EAAET,KAAK,GAAGK,CAAC,CAACK,OAAO,GAAGL,CAAC,CAACM,uBAAuB;IAC9D;IACAC,kBAAkB,EAAE,kBAAkB;IACtCC,kBAAkB,EAAE,GAAGtB,MAAM,CAACuB,IAAI,IAAI;IACtCC,wBAAwB,EAAE;EAC5B,CAAsB;EACtB,MAAMC,aAAa,GAAG;IACpB,GAAGV,MAAM,CAACW,KAAK;IACfC,SAAS,EAAE,CAAC;MAAEC,UAAU,EAAEnB,KAAK,GAAGJ,UAAU,GAAGD;IAAY,CAAC,CAAC;IAC7DiB,kBAAkB,EAAE,WAAW;IAC/BC,kBAAkB,EAAE,GAAGtB,MAAM,CAACuB,IAAI,IAAI;IACtCC,wBAAwB,EAAE;EAC5B,CAAsB;EAEtB,oBACEjB,IAAA,CAACT,SAAS;IACR+B,OAAO,EAAEA,CAAA,KAAM,CAAClB,QAAQ,IAAID,QAAQ,CAAC,CAACD,KAAK,CAAE;IAC7CE,QAAQ,EAAEA,QAAS;IACnBmB,OAAO,EAAE,CAAE;IACXC,KAAK,EAAEpB,QAAQ,GAAGI,MAAM,CAACiB,iBAAiB,GAAGjB,MAAM,CAACkB,gBAAiB;IACrEC,iBAAiB,EAAC,QAAQ;IAC1BC,kBAAkB,EAAE;MAAEC,OAAO,EAAE3B,KAAK;MAAEE,QAAQ,EAAE,CAAC,CAACA;IAAS,CAAE;IAC7DC,kBAAkB,EAAEA,kBAAmB;IACvCC,MAAM,EAAEA,MAAO;IAAAwB,QAAA,eAEf9B,IAAA,CAACR,IAAI;MAACgC,KAAK,EAAEf,aAAc;MAAAqB,QAAA,eACzB9B,IAAA,CAACR,IAAI;QAACgC,KAAK,EAAEN;MAAc,CAAE;IAAC,CAC1B;EAAC,CACE,CAAC;AAEhB","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","Pressable","View","motion","useColors","usePrefersReducedMotion","useThemedStyles","createLogger","childTestID","A11Y_HIDDEN_PROPS","normalizeNonBlankText","makeStyles","THUMB_OFF_X","THUMB_ON_X","jsx","_jsx","log","Switch","value","onChange","disabled","accessibilityLabel","testID","c","styles","reducedMotion","accessibleName","hasBlankLabel","undefined","isDisabled","warn","trackWebStyle","track","backgroundColor","primary","surfaceContainerHighest","transitionProperty","transitionDuration","base","transitionTimingFunction","thumbWebStyle","thumb","transform","translateX","accessible","onPress","style","pressable","pressableDisabled","accessibilityRole","accessibilityState","checked","children","visualFrame"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/Switch.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,S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AAA8B,QAAA,eAC/DrC,IAAA,CAACb,IAAI;UAAC4C,KAAK,EAAEN,aAAc;UAAClB,MAAM,EAAEd,WAAW,CAACc,MAAM,EAAE,OAAO;QAAE,CAAE;MAAC,CAChE;IAAC,CACH;EAAC,CACE,CAAC;AAEhB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { StyleSheet } from 'react-native';
4
- import { r, radius } from "../../../theme/index.js";
4
+ import { fixed, r, radius } from "../../../theme/index.js";
5
5
  /** 轨道宽 32 / 高 20、把手 16×16、轨道内边距 2 —— Unif 自有 Switch 物理尺寸。
6
6
  * 导出常量给 Switch.tsx interpolate translateX 复用(走 r() 保证多设备一致缩放)。 */
7
7
  export const TRACK_W = 32;
@@ -14,14 +14,21 @@ export const INSET = 2;
14
14
  export const THUMB_OFF_X = r(INSET);
15
15
  export const THUMB_ON_X = r(TRACK_W - INSET - THUMB);
16
16
  export const makeStyles = c => StyleSheet.create({
17
- pressableEnabled: {
18
- opacity: 1,
17
+ // 固定命中框不走 r()/fontScale:它是手指可达性约束,不是视觉 token。
18
+ pressable: {
19
+ width: fixed.hitTarget,
20
+ height: fixed.hitTarget,
21
+ alignItems: 'center',
22
+ justifyContent: 'center',
19
23
  // [L-37] alignSelf:'flex-start' 防止父容器拉伸把手区域(与 Chip [M-8] 同口径)
20
24
  alignSelf: 'flex-start'
21
25
  },
22
26
  pressableDisabled: {
23
- opacity: 0.5,
24
- alignSelf: 'flex-start'
27
+ opacity: 0.5
28
+ },
29
+ visualFrame: {
30
+ width: r(TRACK_W),
31
+ height: r(TRACK_H)
25
32
  },
26
33
  track: {
27
34
  width: r(TRACK_W),
@@ -1 +1 @@
1
- {"version":3,"names":["StyleSheet","r","radius","TRACK_W","TRACK_H","THUMB","INSET","THUMB_OFF_X","THUMB_ON_X","makeStyles","c","create","pressableEnabled","opacity","alignSelf","pressableDisabled","track","width","height","borderRadius","lg","justifyContent","thumb","pill","backgroundColor","onPrimary"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,CAAC,EAAEC,MAAM,QAAQ,yBAAgB;AAG1C;AACA;AACA,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,KAAK,GAAG,EAAE;AACvB,OAAO,MAAMC,KAAK,GAAG,CAAC;;AAEtB;AACA;AACA,OAAO,MAAMC,WAAW,GAAGN,CAAC,CAACK,KAAK,CAAC;AACnC,OAAO,MAAME,UAAU,GAAGP,CAAC,CAACE,OAAO,GAAGG,KAAK,GAAGD,KAAK,CAAC;AAEpD,OAAO,MAAMI,UAAU,GAAIC,CAAc,IACvCV,UAAU,CAACW,MAAM,CAAC;EAChBC,gBAAgB,EAAE;IAChBC,OAAO,EAAE,CAAC;IACV;IACAC,SAAS,EAAE;EACb,CAAC;EACDC,iBAAiB,EAAE;IACjBF,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE;EACb,CAAC;EACDE,KAAK,EAAE;IACLC,KAAK,EAAEhB,CAAC,CAACE,OAAO,CAAC;IACjBe,MAAM,EAAEjB,CAAC,CAACG,OAAO,CAAC;IAClBe,YAAY,EAAEjB,MAAM,CAACkB,EAAE;IACvBC,cAAc,EAAE;EAClB,CAAC;EACDC,KAAK,EAAE;IACLL,KAAK,EAAEhB,CAAC,CAACI,KAAK,CAAC;IACfa,MAAM,EAAEjB,CAAC,CAACI,KAAK,CAAC;IAChB;IACAc,YAAY,EAAEjB,MAAM,CAACqB,IAAI;IACzBC,eAAe,EAAEd,CAAC,CAACe;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","fixed","r","radius","TRACK_W","TRACK_H","THUMB","INSET","THUMB_OFF_X","THUMB_ON_X","makeStyles","c","create","pressable","width","hitTarget","height","alignItems","justifyContent","alignSelf","pressableDisabled","opacity","visualFrame","track","borderRadius","lg","thumb","pill","backgroundColor","onPrimary"],"sourceRoot":"../../../../../src","sources":["components/ui/Switch/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,KAAK,EAAEC,CAAC,EAAEC,MAAM,QAAQ,yBAAgB;AAGjD;AACA;AACA,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,OAAO,GAAG,EAAE;AACzB,OAAO,MAAMC,KAAK,GAAG,EAAE;AACvB,OAAO,MAAMC,KAAK,GAAG,CAAC;;AAEtB;AACA;AACA,OAAO,MAAMC,WAAW,GAAGN,CAAC,CAACK,KAAK,CAAC;AACnC,OAAO,MAAME,UAAU,GAAGP,CAAC,CAACE,OAAO,GAAGG,KAAK,GAAGD,KAAK,CAAC;AAEpD,OAAO,MAAMI,UAAU,GAAIC,CAAc,IACvCX,UAAU,CAACY,MAAM,CAAC;EAChB;EACAC,SAAS,EAAE;IACTC,KAAK,EAAEb,KAAK,CAACc,SAAS;IACtBC,MAAM,EAAEf,KAAK,CAACc,SAAS;IACvBE,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxB;IACAC,SAAS,EAAE;EACb,CAAC;EACDC,iBAAiB,EAAE;IACjBC,OAAO,EAAE;EACX,CAAC;EACDC,WAAW,EAAE;IACXR,KAAK,EAAEZ,CAAC,CAACE,OAAO,CAAC;IACjBY,MAAM,EAAEd,CAAC,CAACG,OAAO;EACnB,CAAC;EACDkB,KAAK,EAAE;IACLT,KAAK,EAAEZ,CAAC,CAACE,OAAO,CAAC;IACjBY,MAAM,EAAEd,CAAC,CAACG,OAAO,CAAC;IAClBmB,YAAY,EAAErB,MAAM,CAACsB,EAAE;IACvBP,cAAc,EAAE;EAClB,CAAC;EACDQ,KAAK,EAAE;IACLZ,KAAK,EAAEZ,CAAC,CAACI,KAAK,CAAC;IACfU,MAAM,EAAEd,CAAC,CAACI,KAAK,CAAC;IAChB;IACAkB,YAAY,EAAErB,MAAM,CAACwB,IAAI;IACzBC,eAAe,EAAEjB,CAAC,CAACkB;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { Text, View } from 'react-native';
4
- import { useColors } from "../../../theme/index.js";
4
+ import { scaleFontMetric, useColors, useFontScale } from "../../../theme/index.js";
5
5
  import { paletteFor, sizingFor, styles } from "./styles.js";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  export function Tag({
@@ -13,6 +13,7 @@ export function Tag({
13
13
  testID
14
14
  }) {
15
15
  const c = useColors();
16
+ const fontScale = useFontScale();
16
17
  const palette = paletteFor(variant, c);
17
18
  const sizing = sizingFor(size);
18
19
  const dynamicStyle = {
@@ -24,7 +25,7 @@ export function Tag({
24
25
  };
25
26
  const dynamicTextStyle = {
26
27
  color: palette.fg,
27
- fontSize: sizing.fs
28
+ fontSize: scaleFontMetric(sizing.fs, fontScale)
28
29
  };
29
30
  return /*#__PURE__*/_jsx(View, {
30
31
  style: [styles.base, dynamicStyle, style],
@@ -1 +1 @@
1
- {"version":3,"names":["Text","View","useColors","paletteFor","sizingFor","styles","jsx","_jsx","Tag","label","variant","size","style","numberOfLines","testID","c","palette","sizing","dynamicStyle","height","h","paddingHorizontal","px","backgroundColor","bg","borderColor","border","borderWidth","dynamicTextStyle","color","fg","fontSize","fs","base","children","text"],"sourceRoot":"../../../../../src","sources":["components/ui/Tag/Tag.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,SAAS,QAAQ,yBAAgB;AAC1C,SAASC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGzD,OAAO,SAASC,GAAGA,CAAC;EAClBC,KAAK;EACLC,OAAO,GAAG,SAAS;EACnBC,IAAI,GAAG,IAAI;EACXC,KAAK;EACLC,aAAa,GAAG,CAAC;EACjBC;AACQ,CAAC,EAAE;EACX,MAAMC,CAAC,GAAGb,SAAS,CAAC,CAAC;EACrB,MAAMc,OAAO,GAAGb,UAAU,CAACO,OAAO,EAAEK,CAAC,CAAC;EACtC,MAAME,MAAM,GAAGb,SAAS,CAACO,IAAI,CAAC;EAE9B,MAAMO,YAAY,GAAG;IACnBC,MAAM,EAAEF,MAAM,CAACG,CAAC;IAChBC,iBAAiB,EAAEJ,MAAM,CAACK,EAAE;IAC5BC,eAAe,EAAEP,OAAO,CAACQ,EAAE;IAC3BC,WAAW,EAAET,OAAO,CAACU,MAAM,IAAI,aAAa;IAC5CC,WAAW,EAAEX,OAAO,CAACU,MAAM,GAAG,CAAC,GAAG;EACpC,CAAC;EACD,MAAME,gBAAgB,GAAG;IAAEC,KAAK,EAAEb,OAAO,CAACc,EAAE;IAAEC,QAAQ,EAAEd,MAAM,CAACe;EAAG,CAAC;EAEnE,oBACEzB,IAAA,CAACN,IAAI;IAACW,KAAK,EAAE,CAACP,MAAM,CAAC4B,IAAI,EAAEf,YAAY,EAAEN,KAAK,CAAE;IAACE,MAAM,EAAEA,MAAO;IAAAoB,QAAA,eAC9D3B,IAAA,CAACP,IAAI;MACHY,KAAK,EAAE,CAACP,MAAM,CAAC8B,IAAI,EAAEP,gBAAgB,CAAE;MACvCf,aAAa,EAAEA,aAAc;MAAAqB,QAAA,EAE5BzB;IAAK,CACF;EAAC,CACH,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["Text","View","scaleFontMetric","useColors","useFontScale","paletteFor","sizingFor","styles","jsx","_jsx","Tag","label","variant","size","style","numberOfLines","testID","c","fontScale","palette","sizing","dynamicStyle","height","h","paddingHorizontal","px","backgroundColor","bg","borderColor","border","borderWidth","dynamicTextStyle","color","fg","fontSize","fs","base","children","text"],"sourceRoot":"../../../../../src","sources":["components/ui/Tag/Tag.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,eAAe,EAAEC,SAAS,EAAEC,YAAY,QAAQ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