@knitui/components 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/lib/commonjs/Accordion/Accordion.js +10 -6
  2. package/lib/commonjs/Accordion/Accordion.js.map +1 -1
  3. package/lib/commonjs/Alert/Alert.js +31 -11
  4. package/lib/commonjs/Alert/Alert.js.map +1 -1
  5. package/lib/commonjs/AngleSlider/AngleSlider.js +55 -17
  6. package/lib/commonjs/AngleSlider/AngleSlider.js.map +1 -1
  7. package/lib/commonjs/Autocomplete/Autocomplete.js +53 -33
  8. package/lib/commonjs/Autocomplete/Autocomplete.js.map +1 -1
  9. package/lib/commonjs/Badge/Badge.js +6 -9
  10. package/lib/commonjs/Badge/Badge.js.map +1 -1
  11. package/lib/commonjs/Button/Button.js +22 -6
  12. package/lib/commonjs/Button/Button.js.map +1 -1
  13. package/lib/commonjs/Card/Card.js +13 -4
  14. package/lib/commonjs/Card/Card.js.map +1 -1
  15. package/lib/commonjs/Checkbox/CheckIcon.js +10 -6
  16. package/lib/commonjs/Checkbox/CheckIcon.js.map +1 -1
  17. package/lib/commonjs/Checkbox/Checkbox.js +9 -2
  18. package/lib/commonjs/Checkbox/Checkbox.js.map +1 -1
  19. package/lib/commonjs/Chip/Chip.js +15 -16
  20. package/lib/commonjs/Chip/Chip.js.map +1 -1
  21. package/lib/commonjs/CloseButton/CloseButton.js +2 -2
  22. package/lib/commonjs/CloseButton/CloseButton.js.map +1 -1
  23. package/lib/commonjs/ColorInput/ColorInput.js +12 -4
  24. package/lib/commonjs/ColorInput/ColorInput.js.map +1 -1
  25. package/lib/commonjs/ColorPicker/ColorPicker.js +32 -24
  26. package/lib/commonjs/ColorPicker/ColorPicker.js.map +1 -1
  27. package/lib/commonjs/Combobox/Combobox.js +11 -6
  28. package/lib/commonjs/Combobox/Combobox.js.map +1 -1
  29. package/lib/commonjs/Combobox/OptionsDropdown.js +6 -2
  30. package/lib/commonjs/Combobox/OptionsDropdown.js.map +1 -1
  31. package/lib/commonjs/Group/Group.js +19 -11
  32. package/lib/commonjs/Group/Group.js.map +1 -1
  33. package/lib/commonjs/Highlight/Highlight.js +30 -10
  34. package/lib/commonjs/Highlight/Highlight.js.map +1 -1
  35. package/lib/commonjs/HoverCard/HoverCard.js +23 -10
  36. package/lib/commonjs/HoverCard/HoverCard.js.map +1 -1
  37. package/lib/commonjs/Indicator/Indicator.js +5 -1
  38. package/lib/commonjs/Indicator/Indicator.js.map +1 -1
  39. package/lib/commonjs/Input/Input.js +30 -12
  40. package/lib/commonjs/Input/Input.js.map +1 -1
  41. package/lib/commonjs/Input/shared.js +18 -8
  42. package/lib/commonjs/Input/shared.js.map +1 -1
  43. package/lib/commonjs/Loader/Loader.js +18 -10
  44. package/lib/commonjs/Loader/Loader.js.map +1 -1
  45. package/lib/commonjs/Menu/Menu.js +6 -7
  46. package/lib/commonjs/Menu/Menu.js.map +1 -1
  47. package/lib/commonjs/MultiSelect/MultiSelect.js +112 -47
  48. package/lib/commonjs/MultiSelect/MultiSelect.js.map +1 -1
  49. package/lib/commonjs/Notification/Notification.js +31 -11
  50. package/lib/commonjs/Notification/Notification.js.map +1 -1
  51. package/lib/commonjs/NumberFormatter/NumberFormatter.js +48 -11
  52. package/lib/commonjs/NumberFormatter/NumberFormatter.js.map +1 -1
  53. package/lib/commonjs/Paper/Paper.js +8 -8
  54. package/lib/commonjs/Paper/Paper.js.map +1 -1
  55. package/lib/commonjs/Pill/Pill.js +6 -8
  56. package/lib/commonjs/Pill/Pill.js.map +1 -1
  57. package/lib/commonjs/Progress/Progress.js +4 -1
  58. package/lib/commonjs/Progress/Progress.js.map +1 -1
  59. package/lib/commonjs/RollingNumber/RollingNumber.js +30 -13
  60. package/lib/commonjs/RollingNumber/RollingNumber.js.map +1 -1
  61. package/lib/commonjs/RollingNumber/rolling-number-utils.js +27 -5
  62. package/lib/commonjs/RollingNumber/rolling-number-utils.js.map +1 -1
  63. package/lib/commonjs/ScrollArea/ScrollArea.js +131 -41
  64. package/lib/commonjs/ScrollArea/ScrollArea.js.map +1 -1
  65. package/lib/commonjs/ScrollArea/ScrollArea.native.js +128 -40
  66. package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
  67. package/lib/commonjs/SegmentedControl/SegmentedControl.js +4 -1
  68. package/lib/commonjs/SegmentedControl/SegmentedControl.js.map +1 -1
  69. package/lib/commonjs/Select/Select.js +64 -35
  70. package/lib/commonjs/Select/Select.js.map +1 -1
  71. package/lib/commonjs/Skeleton/Skeleton.js +6 -2
  72. package/lib/commonjs/Skeleton/Skeleton.js.map +1 -1
  73. package/lib/commonjs/Slider/Slider.js +136 -83
  74. package/lib/commonjs/Slider/Slider.js.map +1 -1
  75. package/lib/commonjs/Spoiler/Spoiler.js +22 -2
  76. package/lib/commonjs/Spoiler/Spoiler.js.map +1 -1
  77. package/lib/commonjs/Stepper/Stepper.js +2 -2
  78. package/lib/commonjs/Stepper/Stepper.js.map +1 -1
  79. package/lib/commonjs/Switch/Switch.js +18 -7
  80. package/lib/commonjs/Switch/Switch.js.map +1 -1
  81. package/lib/commonjs/Table/Table.js +91 -28
  82. package/lib/commonjs/Table/Table.js.map +1 -1
  83. package/lib/commonjs/TableOfContents/TableOfContents.js +4 -1
  84. package/lib/commonjs/TableOfContents/TableOfContents.js.map +1 -1
  85. package/lib/commonjs/TagsInput/TagsInput.js +138 -55
  86. package/lib/commonjs/TagsInput/TagsInput.js.map +1 -1
  87. package/lib/commonjs/Tooltip/Tooltip.js +27 -5
  88. package/lib/commonjs/Tooltip/Tooltip.js.map +1 -1
  89. package/lib/commonjs/Tree/Tree.js +4 -1
  90. package/lib/commonjs/Tree/Tree.js.map +1 -1
  91. package/lib/commonjs/Tree/tree-data.js +58 -23
  92. package/lib/commonjs/Tree/tree-data.js.map +1 -1
  93. package/lib/commonjs/Tree/use-tree.js +33 -4
  94. package/lib/commonjs/Tree/use-tree.js.map +1 -1
  95. package/lib/commonjs/TreeSelect/TreeSelect.js +70 -30
  96. package/lib/commonjs/TreeSelect/TreeSelect.js.map +1 -1
  97. package/lib/commonjs/Typography/Typography.js +10 -10
  98. package/lib/commonjs/Typography/Typography.js.map +1 -1
  99. package/lib/commonjs/UnstyledButton/UnstyledButton.js +8 -3
  100. package/lib/commonjs/UnstyledButton/UnstyledButton.js.map +1 -1
  101. package/lib/commonjs/VirtualList/VirtualList.js +71 -13
  102. package/lib/commonjs/VirtualList/VirtualList.js.map +1 -1
  103. package/lib/commonjs/floating/platform.js +28 -1
  104. package/lib/commonjs/floating/platform.js.map +1 -1
  105. package/lib/commonjs/floating/use-position.js +33 -1
  106. package/lib/commonjs/floating/use-position.js.map +1 -1
  107. package/lib/commonjs/internal/ControlIconProvider.js +20 -15
  108. package/lib/commonjs/internal/ControlIconProvider.js.map +1 -1
  109. package/lib/commonjs/internal/gradient-shared.js +9 -5
  110. package/lib/commonjs/internal/gradient-shared.js.map +1 -1
  111. package/lib/commonjs/internal/gradient.js +21 -9
  112. package/lib/commonjs/internal/gradient.js.map +1 -1
  113. package/lib/commonjs/internal/gradient.native.js +36 -10
  114. package/lib/commonjs/internal/gradient.native.js.map +1 -1
  115. package/lib/commonjs/internal/render-text-child.js +30 -2
  116. package/lib/commonjs/internal/render-text-child.js.map +1 -1
  117. package/lib/commonjs/internal/style-props.js +17 -5
  118. package/lib/commonjs/internal/style-props.js.map +1 -1
  119. package/lib/commonjs/internal/theme-color-web.js +46 -0
  120. package/lib/commonjs/internal/theme-color-web.js.map +1 -0
  121. package/lib/commonjs/internal/use-icon-color.js +33 -0
  122. package/lib/commonjs/internal/use-icon-color.js.map +1 -0
  123. package/lib/commonjs/internal/use-icon-color.native.js +23 -0
  124. package/lib/commonjs/internal/use-icon-color.native.js.map +1 -0
  125. package/lib/commonjs/internal/use-looping-animation.js +7 -3
  126. package/lib/commonjs/internal/use-looping-animation.js.map +1 -1
  127. package/lib/commonjs/internal/use-looping-animation.native.js +9 -1
  128. package/lib/commonjs/internal/use-looping-animation.native.js.map +1 -1
  129. package/lib/commonjs/internal/use-looping-animation.shared.js +33 -0
  130. package/lib/commonjs/internal/use-looping-animation.shared.js.map +1 -1
  131. package/lib/commonjs/internal/use-slot-text-wrapper.js +36 -5
  132. package/lib/commonjs/internal/use-slot-text-wrapper.js.map +1 -1
  133. package/lib/module/Accordion/Accordion.js +9 -5
  134. package/lib/module/Accordion/Accordion.js.map +1 -1
  135. package/lib/module/Alert/Alert.js +31 -11
  136. package/lib/module/Alert/Alert.js.map +1 -1
  137. package/lib/module/AngleSlider/AngleSlider.js +55 -17
  138. package/lib/module/AngleSlider/AngleSlider.js.map +1 -1
  139. package/lib/module/Autocomplete/Autocomplete.js +54 -34
  140. package/lib/module/Autocomplete/Autocomplete.js.map +1 -1
  141. package/lib/module/Badge/Badge.js +6 -9
  142. package/lib/module/Badge/Badge.js.map +1 -1
  143. package/lib/module/Button/Button.js +23 -7
  144. package/lib/module/Button/Button.js.map +1 -1
  145. package/lib/module/Card/Card.js +13 -4
  146. package/lib/module/Card/Card.js.map +1 -1
  147. package/lib/module/Checkbox/CheckIcon.js +9 -5
  148. package/lib/module/Checkbox/CheckIcon.js.map +1 -1
  149. package/lib/module/Checkbox/Checkbox.js +9 -2
  150. package/lib/module/Checkbox/Checkbox.js.map +1 -1
  151. package/lib/module/Chip/Chip.js +15 -16
  152. package/lib/module/Chip/Chip.js.map +1 -1
  153. package/lib/module/CloseButton/CloseButton.js +1 -1
  154. package/lib/module/CloseButton/CloseButton.js.map +1 -1
  155. package/lib/module/ColorInput/ColorInput.js +12 -4
  156. package/lib/module/ColorInput/ColorInput.js.map +1 -1
  157. package/lib/module/ColorPicker/ColorPicker.js +32 -24
  158. package/lib/module/ColorPicker/ColorPicker.js.map +1 -1
  159. package/lib/module/Combobox/Combobox.js +11 -6
  160. package/lib/module/Combobox/Combobox.js.map +1 -1
  161. package/lib/module/Combobox/OptionsDropdown.js +6 -2
  162. package/lib/module/Combobox/OptionsDropdown.js.map +1 -1
  163. package/lib/module/Group/Group.js +19 -11
  164. package/lib/module/Group/Group.js.map +1 -1
  165. package/lib/module/Highlight/Highlight.js +30 -10
  166. package/lib/module/Highlight/Highlight.js.map +1 -1
  167. package/lib/module/HoverCard/HoverCard.js +23 -10
  168. package/lib/module/HoverCard/HoverCard.js.map +1 -1
  169. package/lib/module/Indicator/Indicator.js +5 -1
  170. package/lib/module/Indicator/Indicator.js.map +1 -1
  171. package/lib/module/Input/Input.js +32 -14
  172. package/lib/module/Input/Input.js.map +1 -1
  173. package/lib/module/Input/shared.js +19 -9
  174. package/lib/module/Input/shared.js.map +1 -1
  175. package/lib/module/Loader/Loader.js +18 -10
  176. package/lib/module/Loader/Loader.js.map +1 -1
  177. package/lib/module/Menu/Menu.js +6 -7
  178. package/lib/module/Menu/Menu.js.map +1 -1
  179. package/lib/module/MultiSelect/MultiSelect.js +113 -48
  180. package/lib/module/MultiSelect/MultiSelect.js.map +1 -1
  181. package/lib/module/Notification/Notification.js +31 -11
  182. package/lib/module/Notification/Notification.js.map +1 -1
  183. package/lib/module/NumberFormatter/NumberFormatter.js +48 -11
  184. package/lib/module/NumberFormatter/NumberFormatter.js.map +1 -1
  185. package/lib/module/Paper/Paper.js +7 -8
  186. package/lib/module/Paper/Paper.js.map +1 -1
  187. package/lib/module/Pill/Pill.js +6 -8
  188. package/lib/module/Pill/Pill.js.map +1 -1
  189. package/lib/module/Progress/Progress.js +4 -1
  190. package/lib/module/Progress/Progress.js.map +1 -1
  191. package/lib/module/RollingNumber/RollingNumber.js +30 -13
  192. package/lib/module/RollingNumber/RollingNumber.js.map +1 -1
  193. package/lib/module/RollingNumber/rolling-number-utils.js +27 -5
  194. package/lib/module/RollingNumber/rolling-number-utils.js.map +1 -1
  195. package/lib/module/ScrollArea/ScrollArea.js +133 -43
  196. package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
  197. package/lib/module/ScrollArea/ScrollArea.native.js +128 -40
  198. package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
  199. package/lib/module/SegmentedControl/SegmentedControl.js +4 -1
  200. package/lib/module/SegmentedControl/SegmentedControl.js.map +1 -1
  201. package/lib/module/Select/Select.js +65 -36
  202. package/lib/module/Select/Select.js.map +1 -1
  203. package/lib/module/Skeleton/Skeleton.js +6 -2
  204. package/lib/module/Skeleton/Skeleton.js.map +1 -1
  205. package/lib/module/Slider/Slider.js +137 -84
  206. package/lib/module/Slider/Slider.js.map +1 -1
  207. package/lib/module/Spoiler/Spoiler.js +23 -3
  208. package/lib/module/Spoiler/Spoiler.js.map +1 -1
  209. package/lib/module/Stepper/Stepper.js +1 -1
  210. package/lib/module/Stepper/Stepper.js.map +1 -1
  211. package/lib/module/Switch/Switch.js +18 -7
  212. package/lib/module/Switch/Switch.js.map +1 -1
  213. package/lib/module/Table/Table.js +91 -28
  214. package/lib/module/Table/Table.js.map +1 -1
  215. package/lib/module/TableOfContents/TableOfContents.js +5 -2
  216. package/lib/module/TableOfContents/TableOfContents.js.map +1 -1
  217. package/lib/module/TagsInput/TagsInput.js +140 -57
  218. package/lib/module/TagsInput/TagsInput.js.map +1 -1
  219. package/lib/module/Tooltip/Tooltip.js +27 -5
  220. package/lib/module/Tooltip/Tooltip.js.map +1 -1
  221. package/lib/module/Tree/Tree.js +4 -1
  222. package/lib/module/Tree/Tree.js.map +1 -1
  223. package/lib/module/Tree/tree-data.js +57 -23
  224. package/lib/module/Tree/tree-data.js.map +1 -1
  225. package/lib/module/Tree/use-tree.js +34 -5
  226. package/lib/module/Tree/use-tree.js.map +1 -1
  227. package/lib/module/TreeSelect/TreeSelect.js +72 -32
  228. package/lib/module/TreeSelect/TreeSelect.js.map +1 -1
  229. package/lib/module/Typography/Typography.js +9 -10
  230. package/lib/module/Typography/Typography.js.map +1 -1
  231. package/lib/module/UnstyledButton/UnstyledButton.js +9 -4
  232. package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
  233. package/lib/module/VirtualList/VirtualList.js +71 -13
  234. package/lib/module/VirtualList/VirtualList.js.map +1 -1
  235. package/lib/module/floating/platform.js +28 -1
  236. package/lib/module/floating/platform.js.map +1 -1
  237. package/lib/module/floating/use-position.js +33 -1
  238. package/lib/module/floating/use-position.js.map +1 -1
  239. package/lib/module/internal/ControlIconProvider.js +18 -13
  240. package/lib/module/internal/ControlIconProvider.js.map +1 -1
  241. package/lib/module/internal/gradient-shared.js +9 -5
  242. package/lib/module/internal/gradient-shared.js.map +1 -1
  243. package/lib/module/internal/gradient.js +22 -9
  244. package/lib/module/internal/gradient.js.map +1 -1
  245. package/lib/module/internal/gradient.native.js +36 -10
  246. package/lib/module/internal/gradient.native.js.map +1 -1
  247. package/lib/module/internal/render-text-child.js +30 -2
  248. package/lib/module/internal/render-text-child.js.map +1 -1
  249. package/lib/module/internal/style-props.js +16 -4
  250. package/lib/module/internal/style-props.js.map +1 -1
  251. package/lib/module/internal/theme-color-web.js +42 -0
  252. package/lib/module/internal/theme-color-web.js.map +1 -0
  253. package/lib/module/internal/use-icon-color.js +29 -0
  254. package/lib/module/internal/use-icon-color.js.map +1 -0
  255. package/lib/module/internal/use-icon-color.native.js +19 -0
  256. package/lib/module/internal/use-icon-color.native.js.map +1 -0
  257. package/lib/module/internal/use-looping-animation.js +8 -4
  258. package/lib/module/internal/use-looping-animation.js.map +1 -1
  259. package/lib/module/internal/use-looping-animation.native.js +10 -2
  260. package/lib/module/internal/use-looping-animation.native.js.map +1 -1
  261. package/lib/module/internal/use-looping-animation.shared.js +31 -0
  262. package/lib/module/internal/use-looping-animation.shared.js.map +1 -1
  263. package/lib/module/internal/use-slot-text-wrapper.js +37 -5
  264. package/lib/module/internal/use-slot-text-wrapper.js.map +1 -1
  265. package/lib/typescript/Accordion/Accordion.d.ts +11 -11
  266. package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
  267. package/lib/typescript/ActionIcon/ActionIcon.d.ts +7 -7
  268. package/lib/typescript/Alert/Alert.d.ts +7 -7
  269. package/lib/typescript/Alert/Alert.d.ts.map +1 -1
  270. package/lib/typescript/Anchor/Anchor.d.ts +3 -3
  271. package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
  272. package/lib/typescript/Autocomplete/Autocomplete.d.ts +16 -42
  273. package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
  274. package/lib/typescript/Avatar/Avatar.d.ts +21 -21
  275. package/lib/typescript/Badge/Badge.d.ts +7 -7
  276. package/lib/typescript/Badge/Badge.d.ts.map +1 -1
  277. package/lib/typescript/Button/Button.d.ts +7 -7
  278. package/lib/typescript/Button/Button.d.ts.map +1 -1
  279. package/lib/typescript/Card/Card.d.ts.map +1 -1
  280. package/lib/typescript/Checkbox/CheckIcon.d.ts.map +1 -1
  281. package/lib/typescript/Checkbox/Checkbox.d.ts.map +1 -1
  282. package/lib/typescript/Chip/Chip.d.ts.map +1 -1
  283. package/lib/typescript/CloseButton/CloseButton.d.ts +7 -7
  284. package/lib/typescript/ColorInput/ColorInput.d.ts.map +1 -1
  285. package/lib/typescript/ColorPicker/ColorPicker.d.ts.map +1 -1
  286. package/lib/typescript/Combobox/Combobox.d.ts +2 -2
  287. package/lib/typescript/Combobox/Combobox.d.ts.map +1 -1
  288. package/lib/typescript/Combobox/OptionsDropdown.d.ts.map +1 -1
  289. package/lib/typescript/Combobox/index.d.ts +2 -2
  290. package/lib/typescript/Dialog/Dialog.d.ts +6 -6
  291. package/lib/typescript/Fieldset/Fieldset.d.ts +7 -7
  292. package/lib/typescript/Flex/Flex.d.ts +3 -3
  293. package/lib/typescript/Group/Group.d.ts +3 -3
  294. package/lib/typescript/Group/Group.d.ts.map +1 -1
  295. package/lib/typescript/Highlight/Highlight.d.ts.map +1 -1
  296. package/lib/typescript/HoverCard/HoverCard.d.ts +1 -1
  297. package/lib/typescript/HoverCard/HoverCard.d.ts.map +1 -1
  298. package/lib/typescript/Image/Image.d.ts +14 -14
  299. package/lib/typescript/Image/createImage.d.ts +17 -17
  300. package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
  301. package/lib/typescript/Input/Input.d.ts +13 -13
  302. package/lib/typescript/Input/Input.d.ts.map +1 -1
  303. package/lib/typescript/Input/Input.native.d.ts +16 -16
  304. package/lib/typescript/Input/shared.d.ts +10 -10
  305. package/lib/typescript/Input/shared.d.ts.map +1 -1
  306. package/lib/typescript/InputBase/InputBase.d.ts +2 -2
  307. package/lib/typescript/Kbd/Kbd.d.ts +1 -1
  308. package/lib/typescript/Loader/Loader.d.ts.map +1 -1
  309. package/lib/typescript/Mark/Mark.d.ts +1 -1
  310. package/lib/typescript/MaskInput/MaskInput.d.ts +2 -2
  311. package/lib/typescript/Menu/Menu.d.ts +1 -1
  312. package/lib/typescript/Menu/Menu.d.ts.map +1 -1
  313. package/lib/typescript/Modal/Modal.d.ts +6 -6
  314. package/lib/typescript/MultiSelect/MultiSelect.d.ts +15 -60
  315. package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
  316. package/lib/typescript/NavLink/NavLink.d.ts +7 -7
  317. package/lib/typescript/Notification/Notification.d.ts.map +1 -1
  318. package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
  319. package/lib/typescript/NumberInput/NumberInput.d.ts +5 -5
  320. package/lib/typescript/Paper/Paper.d.ts +8 -40
  321. package/lib/typescript/Paper/Paper.d.ts.map +1 -1
  322. package/lib/typescript/PasswordInput/PasswordInput.d.ts +11 -11
  323. package/lib/typescript/Pill/Pill.d.ts +15 -15
  324. package/lib/typescript/Pill/Pill.d.ts.map +1 -1
  325. package/lib/typescript/PinInput/PinInput.d.ts +13 -13
  326. package/lib/typescript/Popover/Popover.shared.d.ts +3 -3
  327. package/lib/typescript/Progress/Progress.d.ts.map +1 -1
  328. package/lib/typescript/Radio/Radio.d.ts +8 -8
  329. package/lib/typescript/RollingNumber/RollingNumber.d.ts.map +1 -1
  330. package/lib/typescript/RollingNumber/rolling-number-utils.d.ts.map +1 -1
  331. package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
  332. package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
  333. package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  334. package/lib/typescript/Select/Select.d.ts +20 -49
  335. package/lib/typescript/Select/Select.d.ts.map +1 -1
  336. package/lib/typescript/Separator/Separator.d.ts +9 -9
  337. package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
  338. package/lib/typescript/Slider/Slider.d.ts.map +1 -1
  339. package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
  340. package/lib/typescript/Switch/Switch.d.ts +14 -3
  341. package/lib/typescript/Switch/Switch.d.ts.map +1 -1
  342. package/lib/typescript/Table/Table.d.ts +18 -12
  343. package/lib/typescript/Table/Table.d.ts.map +1 -1
  344. package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
  345. package/lib/typescript/Tabs/Tabs.d.ts +12 -12
  346. package/lib/typescript/TagsInput/TagsInput.d.ts +13 -47
  347. package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
  348. package/lib/typescript/TextInput/TextInput.d.ts +2 -2
  349. package/lib/typescript/Textarea/Textarea.d.ts +2 -2
  350. package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +7 -7
  351. package/lib/typescript/Title/Title.d.ts +3 -3
  352. package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
  353. package/lib/typescript/Tree/Tree.d.ts.map +1 -1
  354. package/lib/typescript/Tree/tree-data.d.ts +7 -0
  355. package/lib/typescript/Tree/tree-data.d.ts.map +1 -1
  356. package/lib/typescript/Tree/use-tree.d.ts +5 -0
  357. package/lib/typescript/Tree/use-tree.d.ts.map +1 -1
  358. package/lib/typescript/TreeSelect/TreeSelect.d.ts +21 -47
  359. package/lib/typescript/TreeSelect/TreeSelect.d.ts.map +1 -1
  360. package/lib/typescript/Typography/Typography.d.ts +8 -8
  361. package/lib/typescript/Typography/Typography.d.ts.map +1 -1
  362. package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  363. package/lib/typescript/VirtualList/VirtualList.d.ts.map +1 -1
  364. package/lib/typescript/floating/platform.d.ts +11 -0
  365. package/lib/typescript/floating/platform.d.ts.map +1 -1
  366. package/lib/typescript/floating/use-position.d.ts.map +1 -1
  367. package/lib/typescript/internal/ControlIconProvider.d.ts +1 -1
  368. package/lib/typescript/internal/ControlIconProvider.d.ts.map +1 -1
  369. package/lib/typescript/internal/gradient-shared.d.ts +7 -4
  370. package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
  371. package/lib/typescript/internal/gradient.d.ts +18 -0
  372. package/lib/typescript/internal/gradient.d.ts.map +1 -1
  373. package/lib/typescript/internal/gradient.native.d.ts.map +1 -1
  374. package/lib/typescript/internal/render-text-child.d.ts +11 -0
  375. package/lib/typescript/internal/render-text-child.d.ts.map +1 -1
  376. package/lib/typescript/internal/style-props.d.ts +17 -0
  377. package/lib/typescript/internal/style-props.d.ts.map +1 -1
  378. package/lib/typescript/internal/theme-color-web.d.ts +2 -0
  379. package/lib/typescript/internal/theme-color-web.d.ts.map +1 -0
  380. package/lib/typescript/internal/use-icon-color.d.ts +25 -0
  381. package/lib/typescript/internal/use-icon-color.d.ts.map +1 -0
  382. package/lib/typescript/internal/use-icon-color.native.d.ts +11 -0
  383. package/lib/typescript/internal/use-icon-color.native.d.ts.map +1 -0
  384. package/lib/typescript/internal/use-looping-animation.d.ts.map +1 -1
  385. package/lib/typescript/internal/use-looping-animation.native.d.ts.map +1 -1
  386. package/lib/typescript/internal/use-looping-animation.shared.d.ts +30 -3
  387. package/lib/typescript/internal/use-looping-animation.shared.d.ts.map +1 -1
  388. package/lib/typescript/internal/use-slot-text-wrapper.d.ts +0 -20
  389. package/lib/typescript/internal/use-slot-text-wrapper.d.ts.map +1 -1
  390. package/package.json +4 -4
  391. package/src/Accordion/Accordion.tsx +6 -2
  392. package/src/Alert/Alert.tsx +43 -22
  393. package/src/AngleSlider/AngleSlider.tsx +73 -21
  394. package/src/Autocomplete/Autocomplete.tsx +74 -55
  395. package/src/Badge/Badge.tsx +6 -8
  396. package/src/Button/Button.tsx +17 -3
  397. package/src/Card/Card.tsx +11 -3
  398. package/src/Checkbox/CheckIcon.tsx +9 -5
  399. package/src/Checkbox/Checkbox.tsx +8 -1
  400. package/src/Chip/Chip.tsx +15 -22
  401. package/src/CloseButton/CloseButton.tsx +1 -1
  402. package/src/ColorInput/ColorInput.tsx +15 -4
  403. package/src/ColorPicker/ColorPicker.tsx +38 -25
  404. package/src/Combobox/Combobox.tsx +10 -6
  405. package/src/Combobox/OptionsDropdown.tsx +6 -1
  406. package/src/Group/Group.tsx +21 -10
  407. package/src/Highlight/Highlight.tsx +42 -7
  408. package/src/HoverCard/HoverCard.tsx +48 -31
  409. package/src/Indicator/Indicator.tsx +4 -0
  410. package/src/Input/Input.tsx +31 -16
  411. package/src/Input/shared.tsx +20 -4
  412. package/src/Loader/Loader.tsx +14 -4
  413. package/src/Menu/Menu.tsx +6 -8
  414. package/src/MultiSelect/MultiSelect.tsx +140 -85
  415. package/src/Notification/Notification.tsx +43 -22
  416. package/src/NumberFormatter/NumberFormatter.tsx +66 -11
  417. package/src/Paper/Paper.tsx +8 -6
  418. package/src/Pill/Pill.tsx +6 -9
  419. package/src/Progress/Progress.tsx +3 -0
  420. package/src/RollingNumber/RollingNumber.tsx +43 -21
  421. package/src/RollingNumber/rolling-number-utils.ts +28 -5
  422. package/src/ScrollArea/ScrollArea.native.tsx +142 -49
  423. package/src/ScrollArea/ScrollArea.tsx +140 -47
  424. package/src/SegmentedControl/SegmentedControl.tsx +12 -1
  425. package/src/Select/Select.tsx +90 -67
  426. package/src/Skeleton/Skeleton.tsx +5 -1
  427. package/src/Slider/Slider.tsx +157 -61
  428. package/src/Spoiler/Spoiler.tsx +22 -10
  429. package/src/Stepper/Stepper.tsx +1 -1
  430. package/src/Switch/Switch.tsx +20 -9
  431. package/src/Table/Table.tsx +89 -33
  432. package/src/TableOfContents/TableOfContents.tsx +5 -1
  433. package/src/TagsInput/TagsInput.tsx +193 -141
  434. package/src/Tooltip/Tooltip.tsx +33 -7
  435. package/src/Tree/Tree.tsx +4 -1
  436. package/src/Tree/tree-data.ts +74 -26
  437. package/src/Tree/use-tree.ts +52 -7
  438. package/src/TreeSelect/TreeSelect.tsx +96 -64
  439. package/src/Typography/Typography.tsx +9 -8
  440. package/src/UnstyledButton/UnstyledButton.tsx +12 -5
  441. package/src/VirtualList/VirtualList.tsx +82 -18
  442. package/src/floating/platform.ts +29 -1
  443. package/src/floating/use-position.tsx +38 -1
  444. package/src/internal/ControlIconProvider.tsx +17 -12
  445. package/src/internal/gradient-shared.ts +9 -5
  446. package/src/internal/gradient.native.tsx +29 -5
  447. package/src/internal/gradient.tsx +22 -7
  448. package/src/internal/render-text-child.tsx +30 -2
  449. package/src/internal/style-props.ts +20 -4
  450. package/src/internal/theme-color-web.ts +40 -0
  451. package/src/internal/use-icon-color.native.ts +17 -0
  452. package/src/internal/use-icon-color.ts +26 -0
  453. package/src/internal/use-looping-animation.native.tsx +10 -2
  454. package/src/internal/use-looping-animation.shared.ts +38 -3
  455. package/src/internal/use-looping-animation.tsx +8 -4
  456. package/src/internal/use-slot-text-wrapper.tsx +39 -5
@@ -81,37 +81,47 @@ const resolveFontSize = (
81
81
  ? { token: fontSize, px: fontSize }
82
82
  : { token: `$${fontSize}` as TextProps["fontSize"], px: getFontSize(fontSize) };
83
83
 
84
+ /** Resolved per-slot style sugar for the digit-column parts. */
85
+ interface RollingDigitSlots {
86
+ viewport?: GetProps<typeof RollingNumberDigitViewport>;
87
+ strip?: GetProps<typeof RollingNumberDigitStrip>;
88
+ text?: GetProps<typeof RollingNumberDigitText>;
89
+ }
90
+
84
91
  interface RollingDigitProps {
85
92
  digit: string;
86
93
  empty: boolean;
87
94
  digitHeight: number;
88
95
  fontSize: TextProps["fontSize"];
89
96
  fontFamily: TextProps["fontFamily"];
90
- animate: boolean;
91
- duration: number;
92
- /** Resolved per-slot style sugar for the digit-column parts. */
93
- slots: {
94
- viewport?: GetProps<typeof RollingNumberDigitViewport>;
95
- strip?: GetProps<typeof RollingNumberDigitStrip>;
96
- text?: GetProps<typeof RollingNumberDigitText>;
97
- };
97
+ /**
98
+ * The ready-made `{ transition }` object, built ONCE by the parent. Every
99
+ * column used to recompute the identical `transitionProps(timedTransition(…))`
100
+ * itself, and the fresh object also broke the `React.memo` below.
101
+ */
102
+ transition: ReturnType<typeof transitionProps>;
103
+ slots: RollingDigitSlots;
98
104
  }
99
105
 
100
106
  /** A single rolling digit — a 0–9 strip translated so the target digit shows.
101
107
  * The continuous `translateY` interpolation rolls through the intermediate
102
- * digits when the value changes. */
103
- function RollingDigit({
108
+ * digits when the value changes.
109
+ *
110
+ * Memoized: a number ticking from 1 to 2 changes ONE column, but the parent
111
+ * re-renders on every tick, and each column is a viewport + strip + ten glyph
112
+ * `Text`s. Without the memo a 6-digit value re-rendered ~78 styled nodes per
113
+ * tick to move one strip. Every prop is either a primitive or hoisted/memoized
114
+ * by the parent so the comparison can actually bail out. */
115
+ const RollingDigit = React.memo(function RollingDigit({
104
116
  digit,
105
117
  empty,
106
118
  digitHeight,
107
119
  fontSize,
108
120
  fontFamily,
109
- animate,
110
- duration,
121
+ transition,
111
122
  slots,
112
123
  }: RollingDigitProps) {
113
124
  const index = parseInt(digit, 10) || 0;
114
- const transition = animate ? transitionProps(timedTransition(duration)) : transitionProps(null);
115
125
 
116
126
  // `styles` slot sugar is lowest precedence — it spreads UNDER the
117
127
  // component-owned geometry/transition props, which always win.
@@ -140,7 +150,7 @@ function RollingDigit({
140
150
  </RollingNumberDigitStrip>
141
151
  </RollingNumberDigitViewport>
142
152
  );
143
- }
153
+ });
144
154
 
145
155
  /* -------------------------------------------------------------------------- */
146
156
  /* Types */
@@ -211,15 +221,28 @@ const RollingNumberBase = RollingNumberRoot.styleable<RollingNumberProps>(
211
221
  } = props;
212
222
 
213
223
  const s = slotStyles<RollingNumberStyles>(styles, ROLLING_NUMBER_SLOT_KEYS, "RollingNumber");
214
- const digitSlots = {
215
- viewport: s.get("digitViewport"),
216
- strip: s.get("digitStrip"),
217
- text: s.get("digitText"),
218
- };
224
+ // Both of these are props of the memoized `RollingDigit`, so they have to be
225
+ // referentially stable or the memo never bails out. `s.get(…)` hands back the
226
+ // consumer's own slot objects unchanged, so keying on them is exact.
227
+ const viewportSlot = s.get("digitViewport");
228
+ const stripSlot = s.get("digitStrip");
229
+ const textSlot = s.get("digitText");
230
+ const digitSlots = React.useMemo<RollingDigitSlots>(
231
+ () => ({ viewport: viewportSlot, strip: stripSlot, text: textSlot }),
232
+ [viewportSlot, stripSlot, textSlot],
233
+ );
219
234
 
220
235
  const reduced = useReducedMotion();
221
236
  const duration = reduced ? 0 : animationDuration;
222
237
 
238
+ // One `{ transition }` object for ALL columns instead of one per column per
239
+ // render. `null` (reduced motion) keeps the prop present so Tamagui's
240
+ // animation driver hook order is stable — see `transitionProps`.
241
+ const digitTransition = React.useMemo(
242
+ () => (duration > 0 ? transitionProps(timedTransition(duration)) : transitionProps(null)),
243
+ [duration],
244
+ );
245
+
223
246
  const { token: fontToken, px: fontSizePx } = resolveFontSize(fontSize);
224
247
  const digitHeight = Math.round(fontSizePx * 1.25);
225
248
  const fontFamily: TextProps["fontFamily"] = tabularNumbers ? "$mono" : undefined;
@@ -267,8 +290,7 @@ const RollingNumberBase = RollingNumberRoot.styleable<RollingNumberProps>(
267
290
  digitHeight={digitHeight}
268
291
  fontSize={fontToken}
269
292
  fontFamily={fontFamily}
270
- animate={duration > 0}
271
- duration={duration}
293
+ transition={digitTransition}
272
294
  slots={digitSlots}
273
295
  />
274
296
  ) : (
@@ -22,17 +22,40 @@ const PLAIN_FORMAT = new Intl.NumberFormat("en-US", {
22
22
  maximumFractionDigits: 20,
23
23
  });
24
24
 
25
+ /**
26
+ * Fixed-scale formatters, cached by `decimalScale`.
27
+ *
28
+ * Constructing an `Intl.NumberFormat` resolves locale data and plural rules — one
29
+ * of the most expensive plain-object constructions in JS. `toPlainString` is
30
+ * reached ~3× per `RollingNumber` render (current digits, previous digits, and
31
+ * `buildValue`) on a component that re-renders on every animation tick, so
32
+ * building the formatter inline made every tick pay for it. The formatter depends
33
+ * only on `decimalScale`, and a component's `decimalScale` is a fixed prop, so the
34
+ * key space stays tiny — same reasoning as the no-scale `PLAIN_FORMAT` above,
35
+ * just parameterised.
36
+ */
37
+ const SCALED_FORMATS = new Map<number, Intl.NumberFormat>();
38
+
39
+ function getScaledFormat(decimalScale: number): Intl.NumberFormat {
40
+ let format = SCALED_FORMATS.get(decimalScale);
41
+ if (!format) {
42
+ format = new Intl.NumberFormat("en-US", {
43
+ useGrouping: false,
44
+ minimumFractionDigits: decimalScale,
45
+ maximumFractionDigits: decimalScale,
46
+ });
47
+ SCALED_FORMATS.set(decimalScale, format);
48
+ }
49
+ return format;
50
+ }
51
+
25
52
  function toPlainString(num: number, decimalScale?: number): string {
26
53
  if (!Number.isFinite(num)) {
27
54
  return "0";
28
55
  }
29
56
 
30
57
  if (decimalScale !== undefined) {
31
- return new Intl.NumberFormat("en-US", {
32
- useGrouping: false,
33
- minimumFractionDigits: decimalScale,
34
- maximumFractionDigits: decimalScale,
35
- }).format(num);
58
+ return getScaledFormat(decimalScale).format(num);
36
59
  }
37
60
 
38
61
  const str = String(num);
@@ -68,6 +68,15 @@ const ANIMATE_OPACITY = ["opacity"];
68
68
  scrollable case uses the Pan engine, not a native nested ScrollView. */
69
69
  const PAN_ACTIVATE_THRESHOLD = 8;
70
70
 
71
+ /**
72
+ * How often (ms) a scroll may cross to the JS thread when the ONLY consumer is the
73
+ * scrollbar auto-hide (`type="hover"`/`"scroll"` with no scroll callbacks — the
74
+ * default). The flash is a boolean plus a ~1s trailing timer, so a few hops per
75
+ * second is indistinguishable from every frame, while a per-frame `runOnJS` piled
76
+ * work onto the JS thread precisely while it was rendering the content being flung.
77
+ */
78
+ const SCROLL_FLASH_INTERVAL_MS = 120;
79
+
71
80
  /* -------------------------------------------------------------------------- */
72
81
  /* UI-thread worklet helpers */
73
82
  /* -------------------------------------------------------------------------- */
@@ -78,6 +87,19 @@ function clampW(value: number, min: number, max: number): number {
78
87
  return value < min ? min : value > max ? max : value;
79
88
  }
80
89
 
90
+ /**
91
+ * UI-thread rate limiter for the `runOnJS` hop. Returns `true` (and re-arms) when a
92
+ * report is due: always, when `intervalMs` is 0, otherwise at most once per interval.
93
+ */
94
+ function shouldReportW(last: { value: number }, intervalMs: number): boolean {
95
+ "worklet";
96
+ if (intervalMs <= 0) return true;
97
+ const now = Date.now();
98
+ if (now - last.value < intervalMs) return false;
99
+ last.value = now;
100
+ return true;
101
+ }
102
+
81
103
  /**
82
104
  * Thumb length + offset along one axis, computed entirely on the UI thread.
83
105
  * Mirrors {@link getThumbGeometry} (the JS twin used for layout decisions) but is
@@ -307,10 +329,19 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
307
329
  const [size, setSize] = React.useState<Size>(ZERO_SIZE);
308
330
  const [scrolling, setScrolling] = React.useState(false);
309
331
  const [dragging, setDragging] = React.useState(false);
310
- // Scroll offset mirror, used ONLY to drive the (opt-in) edge fades. Updated per
311
- // frame solely when `shadows` is enabled, so the common case never re-renders.
312
- const [shadowScroll, setShadowScroll] = React.useState<ScrollPosition>({ x: 0, y: 0 });
332
+ // Which edges have content beyond them — the ONLY thing the (opt-in) edge fades
333
+ // need. Keeping the BOOLEANS in state (rather than mirroring the raw offset, as
334
+ // this used to) means a fling re-renders at most four times over its whole length
335
+ // — once per edge crossing — instead of once per frame.
336
+ const [edges, setEdges] = React.useState<EdgeState>({
337
+ top: false,
338
+ bottom: false,
339
+ left: false,
340
+ right: false,
341
+ });
313
342
  const hideTimeout = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
343
+ // Mirrors `scrolling` so the flash can skip a redundant setState per sample.
344
+ const scrollingRef = React.useRef(false);
314
345
 
315
346
  const scrubRef = React.useRef<{ pending: boolean; paging: boolean }>({
316
347
  pending: false,
@@ -330,9 +361,17 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
330
361
 
331
362
  const flashScrollbars = React.useCallback(() => {
332
363
  if (type !== "hover" && type !== "scroll") return;
333
- setScrolling(true);
364
+ // Guarded by a ref: React only bails on a same-value update after re-entering
365
+ // the component, so the unguarded version cost a render pass per sample.
366
+ if (!scrollingRef.current) {
367
+ scrollingRef.current = true;
368
+ setScrolling(true);
369
+ }
334
370
  clearTimeout(hideTimeout.current);
335
- hideTimeout.current = setTimeout(() => setScrolling(false), scrollHideDelay);
371
+ hideTimeout.current = setTimeout(() => {
372
+ scrollingRef.current = false;
373
+ setScrolling(false);
374
+ }, scrollHideDelay);
336
375
  }, [type, scrollHideDelay]);
337
376
 
338
377
  const debouncedScrollEnd = useDebouncedCallback((pos: ScrollPosition) => {
@@ -361,13 +400,43 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
361
400
  [reachThreshold, onReachTop, onReachBottom, onReachStart, onReachEnd],
362
401
  );
363
402
 
403
+ // Re-derive the edge-fade booleans from an offset + the measured size, re-rendering
404
+ // only when one actually flips. No-op unless `shadows` is set.
405
+ const syncEdges = React.useCallback(
406
+ (x: number, y: number) => {
407
+ if (!anyShadow) return;
408
+ const sz = sizeRef.current;
409
+ const next: EdgeState = {
410
+ top: y > 1,
411
+ bottom: sz.contentH - sz.viewportH - y > 1,
412
+ left: x > 1,
413
+ right: sz.contentW - sz.viewportW - x > 1,
414
+ };
415
+ setEdges((prev) =>
416
+ prev.top === next.top &&
417
+ prev.bottom === next.bottom &&
418
+ prev.left === next.left &&
419
+ prev.right === next.right
420
+ ? prev
421
+ : next,
422
+ );
423
+ },
424
+ [anyShadow],
425
+ );
426
+
427
+ // A size change can flip an edge without any scroll (content grew/shrank), and the
428
+ // fades are no longer derived during render — so re-sync when the size lands.
429
+ React.useEffect(() => {
430
+ syncEdges(scrollX.value, scrollY.value);
431
+ }, [syncEdges, size, scrollX, scrollY]);
432
+
364
433
  // Single JS entry point for a scroll sample — invoked from the UI thread via
365
434
  // `runOnJS`, and ONLY when something on the JS side actually consumes it.
366
435
  const reportScroll = React.useCallback(
367
436
  (x: number, y: number) => {
368
437
  onScrollPositionChange?.({ x, y });
369
438
  flashScrollbars();
370
- if (anyShadow) setShadowScroll((prev) => (prev.x === x && prev.y === y ? prev : { x, y }));
439
+ syncEdges(x, y);
371
440
  if (stickToBottom) {
372
441
  const sz = sizeRef.current;
373
442
  stuckRef.current = isNearBottom(y, sz.contentH, sz.viewportH, stickToBottomThreshold);
@@ -378,7 +447,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
378
447
  [
379
448
  onScrollPositionChange,
380
449
  flashScrollbars,
381
- anyShadow,
450
+ syncEdges,
382
451
  fireReachCallbacks,
383
452
  debouncedScrollEnd,
384
453
  onScrollEnd,
@@ -387,11 +456,9 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
387
456
  ],
388
457
  );
389
458
 
390
- // Whether ANY JS-side consumer needs per-frame scroll samples. When false the
391
- // scroll path stays 100% on the UI thread (no `runOnJS` at all).
392
- const needsJsScroll =
393
- type === "hover" ||
394
- type === "scroll" ||
459
+ // Does a consumer need the ACTUAL per-frame samples (a value it reads, a threshold
460
+ // it crosses)? Only then may the offset cross to the JS thread every frame.
461
+ const needsScrollSamples =
395
462
  stickToBottom ||
396
463
  anyShadow ||
397
464
  Boolean(
@@ -402,6 +469,17 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
402
469
  onReachStart ||
403
470
  onReachEnd,
404
471
  );
472
+ // The DEFAULT configuration (`type="hover"`, no callbacks) needs the JS thread for
473
+ // one thing only: showing the scrollbars while the user scrolls. That is a boolean
474
+ // with a ~1s trailing timer, so hopping the bridge 60–120×/s for it was pure waste
475
+ // — and the worst kind, since `runOnJS` lands its work on the JS thread exactly
476
+ // while it is busy rendering the list being flung. Throttled to a few hops/s below.
477
+ const needsScrollFlash = type === "hover" || type === "scroll";
478
+ const needsJsScroll = needsScrollSamples || needsScrollFlash;
479
+ // 0 = every frame (a real consumer); otherwise the flash cadence.
480
+ const reportIntervalMs = needsScrollSamples ? 0 : SCROLL_FLASH_INTERVAL_MS;
481
+ // Timestamp of the last `runOnJS` hop, kept on the UI thread.
482
+ const lastReportSV = useSharedValue(0);
405
483
 
406
484
  /* ---------------- size tracking ---------------- */
407
485
 
@@ -468,10 +546,12 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
468
546
  "worklet";
469
547
  scrollX.value = event.contentOffset.x;
470
548
  scrollY.value = event.contentOffset.y;
471
- if (needsJsScroll) runOnJS(reportScroll)(event.contentOffset.x, event.contentOffset.y);
549
+ if (needsJsScroll && shouldReportW(lastReportSV, reportIntervalMs)) {
550
+ runOnJS(reportScroll)(event.contentOffset.x, event.contentOffset.y);
551
+ }
472
552
  },
473
553
  },
474
- [needsJsScroll, reportScroll],
554
+ [needsJsScroll, reportIntervalMs, lastReportSV, reportScroll],
475
555
  );
476
556
 
477
557
  /* ---------------- Pan engine ---------------- */
@@ -484,6 +564,7 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
484
564
  "worklet";
485
565
  if (!usePan || !needsJsScroll) return;
486
566
  if (prev && curr.x === prev.x && curr.y === prev.y) return;
567
+ if (!shouldReportW(lastReportSV, reportIntervalMs)) return;
487
568
  runOnJS(reportScroll)(curr.x, curr.y);
488
569
  },
489
570
  );
@@ -494,10 +575,16 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
494
575
  // which hops to JS via `runOnJS` and stutters when JS is busy. Watches the
495
576
  // internal offset shared values, so it covers BOTH the native (Autosize) and
496
577
  // Pan engines with one reaction. No-op unless the caller passes the props.
578
+ // When neither prop is supplied the prepare worklet reads NO shared value, so
579
+ // reanimated registers no dependency and the reaction never runs — instead of
580
+ // allocating + comparing an `{x, y}` object on the UI thread every frame for
581
+ // nothing (the common case: nobody passes these).
582
+ const mirrorsOffset = Boolean(scrollValueX || scrollValueY);
497
583
  useAnimatedReaction(
498
- () => ({ x: scrollX.value, y: scrollY.value }),
584
+ () => (mirrorsOffset ? { x: scrollX.value, y: scrollY.value } : null),
499
585
  (curr) => {
500
586
  "worklet";
587
+ if (!curr) return;
501
588
  if (scrollValueX) scrollValueX.value = curr.x;
502
589
  if (scrollValueY) scrollValueY.value = curr.y;
503
590
  },
@@ -708,38 +795,36 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
708
795
 
709
796
  /* ---------------- animated thumb styles (UI thread) ---------------- */
710
797
 
798
+ // The per-frame style carries a TRANSFORM ONLY. This split is the whole point: a
799
+ // `useAnimatedStyle` re-runs (and re-applies its result) whenever any shared value
800
+ // it reads changes, and a transform is a compositor-only mutation while `left`/
801
+ // `right`/`height` are LAYOUT props — pushing those through the animated style on
802
+ // every scroll frame dirtied Yoga and forced a layout pass per frame per thumb.
803
+ // The thumb's LENGTH is scroll-independent (`yBar.size`, plain style below) and the
804
+ // hover-grow inset lives in its own style, which only re-runs while `insetSV` is
805
+ // actually animating (~150ms on drag start/end).
711
806
  const yThumbStyle = useAnimatedStyle(() => {
712
807
  "worklet";
713
- const { size: thumbSize, offset } = thumbGeometryW(
714
- size.contentH,
715
- size.viewportH,
716
- yTrack,
717
- scrollY.value,
718
- );
719
- return {
720
- height: thumbSize,
721
- left: insetSV.value,
722
- right: insetSV.value,
723
- transform: [{ translateY: offset }],
724
- };
808
+ const { offset } = thumbGeometryW(size.contentH, size.viewportH, yTrack, scrollY.value);
809
+ return { transform: [{ translateY: offset }] };
725
810
  }, [size.contentH, size.viewportH, yTrack]);
726
811
 
812
+ const yThumbInsetStyle = useAnimatedStyle(() => {
813
+ "worklet";
814
+ return { left: insetSV.value, right: insetSV.value };
815
+ });
816
+
727
817
  const xThumbStyle = useAnimatedStyle(() => {
728
818
  "worklet";
729
- const { size: thumbSize, offset } = thumbGeometryW(
730
- size.contentW,
731
- size.viewportW,
732
- xTrack,
733
- scrollX.value,
734
- );
735
- return {
736
- width: thumbSize,
737
- top: insetSV.value,
738
- bottom: insetSV.value,
739
- transform: [{ translateX: offset }],
740
- };
819
+ const { offset } = thumbGeometryW(size.contentW, size.viewportW, xTrack, scrollX.value);
820
+ return { transform: [{ translateX: offset }] };
741
821
  }, [size.contentW, size.viewportW, xTrack]);
742
822
 
823
+ const xThumbInsetStyle = useAnimatedStyle(() => {
824
+ "worklet";
825
+ return { top: insetSV.value, bottom: insetSV.value };
826
+ });
827
+
743
828
  /* ---------------- content translate (Pan engine) ---------------- */
744
829
 
745
830
  const contentTranslateStyle = useAnimatedStyle(() => {
@@ -853,14 +938,10 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
853
938
 
854
939
  /* ---------------- edge shadows ---------------- */
855
940
 
856
- // Plain (non-animated) overlays whose visibility is driven by the `shadowScroll`
857
- // mirror — opt-in, so this React-state path only costs when `shadows` is set.
858
- const edgeOverflow: EdgeState = {
859
- top: shadowScroll.y > 1,
860
- bottom: size.contentH - size.viewportH - shadowScroll.y > 1,
861
- left: shadowScroll.x > 1,
862
- right: size.contentW - size.viewportW - shadowScroll.x > 1,
863
- };
941
+ // Plain (non-animated) overlays whose visibility is driven by the `edges` booleans
942
+ // derived in `reportScroll` — opt-in, so this React-state path only costs when
943
+ // `shadows` is set, and then only on an actual edge crossing.
944
+ const edgeOverflow: EdgeState = edges;
864
945
  const resolvedScrim = (shadowColor ?? "$color8") as BoxProps["backgroundColor"];
865
946
 
866
947
  const renderEdgeShadow = (edge: Edge) => {
@@ -911,7 +992,13 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
911
992
  {/* Plain Animated.View carries the per-frame geometry (height/offset/
912
993
  inset); the inner Tamagui Thumb fills it and supplies colour/radius/
913
994
  `thumbProps`. Keeps reanimated off the styled component. */}
914
- <Animated.View style={[{ position: "absolute", top: 0 }, yThumbStyle]}>
995
+ <Animated.View
996
+ style={[
997
+ { position: "absolute", top: 0, height: yBar.size },
998
+ yThumbInsetStyle,
999
+ yThumbStyle,
1000
+ ]}
1001
+ >
915
1002
  <ScrollAreaThumb top={0} left={0} right={0} bottom={0} {...mergedThumbProps} />
916
1003
  </Animated.View>
917
1004
  </ScrollAreaScrollbar>
@@ -931,7 +1018,13 @@ const ScrollAreaComponent = React.forwardRef<ScrollAreaHandle, ScrollAreaProps>(
931
1018
  {...animateOnlyProps(ANIMATE_OPACITY)}
932
1019
  {...mergedScrollbarProps}
933
1020
  >
934
- <Animated.View style={[{ position: "absolute", left: 0 }, xThumbStyle]}>
1021
+ <Animated.View
1022
+ style={[
1023
+ { position: "absolute", left: 0, width: xBar.size },
1024
+ xThumbInsetStyle,
1025
+ xThumbStyle,
1026
+ ]}
1027
+ >
935
1028
  <ScrollAreaThumb top={0} left={0} right={0} bottom={0} {...mergedThumbProps} />
936
1029
  </Animated.View>
937
1030
  </ScrollAreaScrollbar>