@knitui/components 0.5.0 → 0.6.1

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 (495) 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/color.js +8 -1
  110. package/lib/commonjs/internal/color.js.map +1 -1
  111. package/lib/commonjs/internal/gradient-shared.js +9 -5
  112. package/lib/commonjs/internal/gradient-shared.js.map +1 -1
  113. package/lib/commonjs/internal/gradient.js +21 -9
  114. package/lib/commonjs/internal/gradient.js.map +1 -1
  115. package/lib/commonjs/internal/gradient.native.js +36 -10
  116. package/lib/commonjs/internal/gradient.native.js.map +1 -1
  117. package/lib/commonjs/internal/render-text-child.js +30 -2
  118. package/lib/commonjs/internal/render-text-child.js.map +1 -1
  119. package/lib/commonjs/internal/style-props.js +17 -5
  120. package/lib/commonjs/internal/style-props.js.map +1 -1
  121. package/lib/commonjs/internal/theme-color-web.js +46 -0
  122. package/lib/commonjs/internal/theme-color-web.js.map +1 -0
  123. package/lib/commonjs/internal/use-icon-color.js +33 -0
  124. package/lib/commonjs/internal/use-icon-color.js.map +1 -0
  125. package/lib/commonjs/internal/use-icon-color.native.js +23 -0
  126. package/lib/commonjs/internal/use-icon-color.native.js.map +1 -0
  127. package/lib/commonjs/internal/use-looping-animation.js +7 -3
  128. package/lib/commonjs/internal/use-looping-animation.js.map +1 -1
  129. package/lib/commonjs/internal/use-looping-animation.native.js +9 -1
  130. package/lib/commonjs/internal/use-looping-animation.native.js.map +1 -1
  131. package/lib/commonjs/internal/use-looping-animation.shared.js +33 -0
  132. package/lib/commonjs/internal/use-looping-animation.shared.js.map +1 -1
  133. package/lib/commonjs/internal/use-slot-text-wrapper.js +36 -5
  134. package/lib/commonjs/internal/use-slot-text-wrapper.js.map +1 -1
  135. package/lib/module/Accordion/Accordion.js +9 -5
  136. package/lib/module/Accordion/Accordion.js.map +1 -1
  137. package/lib/module/Alert/Alert.js +31 -11
  138. package/lib/module/Alert/Alert.js.map +1 -1
  139. package/lib/module/AngleSlider/AngleSlider.js +55 -17
  140. package/lib/module/AngleSlider/AngleSlider.js.map +1 -1
  141. package/lib/module/Autocomplete/Autocomplete.js +54 -34
  142. package/lib/module/Autocomplete/Autocomplete.js.map +1 -1
  143. package/lib/module/Badge/Badge.js +6 -9
  144. package/lib/module/Badge/Badge.js.map +1 -1
  145. package/lib/module/Button/Button.js +23 -7
  146. package/lib/module/Button/Button.js.map +1 -1
  147. package/lib/module/Card/Card.js +13 -4
  148. package/lib/module/Card/Card.js.map +1 -1
  149. package/lib/module/Checkbox/CheckIcon.js +9 -5
  150. package/lib/module/Checkbox/CheckIcon.js.map +1 -1
  151. package/lib/module/Checkbox/Checkbox.js +9 -2
  152. package/lib/module/Checkbox/Checkbox.js.map +1 -1
  153. package/lib/module/Chip/Chip.js +15 -16
  154. package/lib/module/Chip/Chip.js.map +1 -1
  155. package/lib/module/CloseButton/CloseButton.js +1 -1
  156. package/lib/module/CloseButton/CloseButton.js.map +1 -1
  157. package/lib/module/ColorInput/ColorInput.js +12 -4
  158. package/lib/module/ColorInput/ColorInput.js.map +1 -1
  159. package/lib/module/ColorPicker/ColorPicker.js +32 -24
  160. package/lib/module/ColorPicker/ColorPicker.js.map +1 -1
  161. package/lib/module/Combobox/Combobox.js +11 -6
  162. package/lib/module/Combobox/Combobox.js.map +1 -1
  163. package/lib/module/Combobox/OptionsDropdown.js +6 -2
  164. package/lib/module/Combobox/OptionsDropdown.js.map +1 -1
  165. package/lib/module/Group/Group.js +19 -11
  166. package/lib/module/Group/Group.js.map +1 -1
  167. package/lib/module/Highlight/Highlight.js +30 -10
  168. package/lib/module/Highlight/Highlight.js.map +1 -1
  169. package/lib/module/HoverCard/HoverCard.js +23 -10
  170. package/lib/module/HoverCard/HoverCard.js.map +1 -1
  171. package/lib/module/Indicator/Indicator.js +5 -1
  172. package/lib/module/Indicator/Indicator.js.map +1 -1
  173. package/lib/module/Input/Input.js +32 -14
  174. package/lib/module/Input/Input.js.map +1 -1
  175. package/lib/module/Input/shared.js +19 -9
  176. package/lib/module/Input/shared.js.map +1 -1
  177. package/lib/module/Loader/Loader.js +18 -10
  178. package/lib/module/Loader/Loader.js.map +1 -1
  179. package/lib/module/Menu/Menu.js +6 -7
  180. package/lib/module/Menu/Menu.js.map +1 -1
  181. package/lib/module/MultiSelect/MultiSelect.js +113 -48
  182. package/lib/module/MultiSelect/MultiSelect.js.map +1 -1
  183. package/lib/module/Notification/Notification.js +31 -11
  184. package/lib/module/Notification/Notification.js.map +1 -1
  185. package/lib/module/NumberFormatter/NumberFormatter.js +48 -11
  186. package/lib/module/NumberFormatter/NumberFormatter.js.map +1 -1
  187. package/lib/module/Paper/Paper.js +7 -8
  188. package/lib/module/Paper/Paper.js.map +1 -1
  189. package/lib/module/Pill/Pill.js +6 -8
  190. package/lib/module/Pill/Pill.js.map +1 -1
  191. package/lib/module/Progress/Progress.js +4 -1
  192. package/lib/module/Progress/Progress.js.map +1 -1
  193. package/lib/module/RollingNumber/RollingNumber.js +30 -13
  194. package/lib/module/RollingNumber/RollingNumber.js.map +1 -1
  195. package/lib/module/RollingNumber/rolling-number-utils.js +27 -5
  196. package/lib/module/RollingNumber/rolling-number-utils.js.map +1 -1
  197. package/lib/module/ScrollArea/ScrollArea.js +133 -43
  198. package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
  199. package/lib/module/ScrollArea/ScrollArea.native.js +128 -40
  200. package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
  201. package/lib/module/SegmentedControl/SegmentedControl.js +4 -1
  202. package/lib/module/SegmentedControl/SegmentedControl.js.map +1 -1
  203. package/lib/module/Select/Select.js +65 -36
  204. package/lib/module/Select/Select.js.map +1 -1
  205. package/lib/module/Skeleton/Skeleton.js +6 -2
  206. package/lib/module/Skeleton/Skeleton.js.map +1 -1
  207. package/lib/module/Slider/Slider.js +137 -84
  208. package/lib/module/Slider/Slider.js.map +1 -1
  209. package/lib/module/Spoiler/Spoiler.js +23 -3
  210. package/lib/module/Spoiler/Spoiler.js.map +1 -1
  211. package/lib/module/Stepper/Stepper.js +1 -1
  212. package/lib/module/Stepper/Stepper.js.map +1 -1
  213. package/lib/module/Switch/Switch.js +18 -7
  214. package/lib/module/Switch/Switch.js.map +1 -1
  215. package/lib/module/Table/Table.js +91 -28
  216. package/lib/module/Table/Table.js.map +1 -1
  217. package/lib/module/TableOfContents/TableOfContents.js +5 -2
  218. package/lib/module/TableOfContents/TableOfContents.js.map +1 -1
  219. package/lib/module/TagsInput/TagsInput.js +140 -57
  220. package/lib/module/TagsInput/TagsInput.js.map +1 -1
  221. package/lib/module/Tooltip/Tooltip.js +27 -5
  222. package/lib/module/Tooltip/Tooltip.js.map +1 -1
  223. package/lib/module/Tree/Tree.js +4 -1
  224. package/lib/module/Tree/Tree.js.map +1 -1
  225. package/lib/module/Tree/tree-data.js +57 -23
  226. package/lib/module/Tree/tree-data.js.map +1 -1
  227. package/lib/module/Tree/use-tree.js +34 -5
  228. package/lib/module/Tree/use-tree.js.map +1 -1
  229. package/lib/module/TreeSelect/TreeSelect.js +72 -32
  230. package/lib/module/TreeSelect/TreeSelect.js.map +1 -1
  231. package/lib/module/Typography/Typography.js +9 -10
  232. package/lib/module/Typography/Typography.js.map +1 -1
  233. package/lib/module/UnstyledButton/UnstyledButton.js +9 -4
  234. package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
  235. package/lib/module/VirtualList/VirtualList.js +71 -13
  236. package/lib/module/VirtualList/VirtualList.js.map +1 -1
  237. package/lib/module/floating/platform.js +28 -1
  238. package/lib/module/floating/platform.js.map +1 -1
  239. package/lib/module/floating/use-position.js +33 -1
  240. package/lib/module/floating/use-position.js.map +1 -1
  241. package/lib/module/internal/ControlIconProvider.js +18 -13
  242. package/lib/module/internal/ControlIconProvider.js.map +1 -1
  243. package/lib/module/internal/color.js +8 -1
  244. package/lib/module/internal/color.js.map +1 -1
  245. package/lib/module/internal/gradient-shared.js +9 -5
  246. package/lib/module/internal/gradient-shared.js.map +1 -1
  247. package/lib/module/internal/gradient.js +22 -9
  248. package/lib/module/internal/gradient.js.map +1 -1
  249. package/lib/module/internal/gradient.native.js +36 -10
  250. package/lib/module/internal/gradient.native.js.map +1 -1
  251. package/lib/module/internal/render-text-child.js +30 -2
  252. package/lib/module/internal/render-text-child.js.map +1 -1
  253. package/lib/module/internal/style-props.js +16 -4
  254. package/lib/module/internal/style-props.js.map +1 -1
  255. package/lib/module/internal/theme-color-web.js +42 -0
  256. package/lib/module/internal/theme-color-web.js.map +1 -0
  257. package/lib/module/internal/use-icon-color.js +29 -0
  258. package/lib/module/internal/use-icon-color.js.map +1 -0
  259. package/lib/module/internal/use-icon-color.native.js +19 -0
  260. package/lib/module/internal/use-icon-color.native.js.map +1 -0
  261. package/lib/module/internal/use-looping-animation.js +8 -4
  262. package/lib/module/internal/use-looping-animation.js.map +1 -1
  263. package/lib/module/internal/use-looping-animation.native.js +10 -2
  264. package/lib/module/internal/use-looping-animation.native.js.map +1 -1
  265. package/lib/module/internal/use-looping-animation.shared.js +31 -0
  266. package/lib/module/internal/use-looping-animation.shared.js.map +1 -1
  267. package/lib/module/internal/use-slot-text-wrapper.js +37 -5
  268. package/lib/module/internal/use-slot-text-wrapper.js.map +1 -1
  269. package/lib/typescript/Accordion/Accordion.d.ts +15 -15
  270. package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
  271. package/lib/typescript/ActionIcon/ActionIcon.d.ts +13 -13
  272. package/lib/typescript/Alert/Alert.d.ts +19 -19
  273. package/lib/typescript/Alert/Alert.d.ts.map +1 -1
  274. package/lib/typescript/Anchor/Anchor.d.ts +9 -9
  275. package/lib/typescript/AngleSlider/AngleSlider.d.ts +8 -8
  276. package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
  277. package/lib/typescript/Autocomplete/Autocomplete.d.ts +18 -44
  278. package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
  279. package/lib/typescript/Avatar/Avatar.d.ts +38 -38
  280. package/lib/typescript/Badge/Badge.d.ts +20 -20
  281. package/lib/typescript/Badge/Badge.d.ts.map +1 -1
  282. package/lib/typescript/Blockquote/Blockquote.d.ts +8 -8
  283. package/lib/typescript/Breadcrumbs/Breadcrumbs.d.ts +8 -8
  284. package/lib/typescript/Burger/Burger.d.ts +4 -4
  285. package/lib/typescript/Button/Button.d.ts +13 -13
  286. package/lib/typescript/Button/Button.d.ts.map +1 -1
  287. package/lib/typescript/Card/Card.d.ts.map +1 -1
  288. package/lib/typescript/Checkbox/CheckIcon.d.ts.map +1 -1
  289. package/lib/typescript/Checkbox/Checkbox.d.ts.map +1 -1
  290. package/lib/typescript/Chip/Chip.d.ts +15 -15
  291. package/lib/typescript/Chip/Chip.d.ts.map +1 -1
  292. package/lib/typescript/CloseButton/CloseButton.d.ts +7 -7
  293. package/lib/typescript/Code/Code.d.ts +6 -6
  294. package/lib/typescript/ColorInput/ColorInput.d.ts.map +1 -1
  295. package/lib/typescript/ColorPicker/ColorPicker.d.ts.map +1 -1
  296. package/lib/typescript/Combobox/Combobox.d.ts +9 -9
  297. package/lib/typescript/Combobox/Combobox.d.ts.map +1 -1
  298. package/lib/typescript/Combobox/OptionsDropdown.d.ts.map +1 -1
  299. package/lib/typescript/Combobox/index.d.ts +7 -7
  300. package/lib/typescript/Container/Container.d.ts +3 -3
  301. package/lib/typescript/Dialog/Dialog.d.ts +6 -6
  302. package/lib/typescript/Drawer/Drawer.d.ts +4 -4
  303. package/lib/typescript/Fieldset/Fieldset.d.ts +11 -11
  304. package/lib/typescript/Flex/Flex.d.ts +3 -3
  305. package/lib/typescript/Group/Group.d.ts +3 -3
  306. package/lib/typescript/Group/Group.d.ts.map +1 -1
  307. package/lib/typescript/Highlight/Highlight.d.ts +4 -4
  308. package/lib/typescript/Highlight/Highlight.d.ts.map +1 -1
  309. package/lib/typescript/HoverCard/HoverCard.d.ts +1 -1
  310. package/lib/typescript/HoverCard/HoverCard.d.ts.map +1 -1
  311. package/lib/typescript/Image/Image.d.ts +25 -25
  312. package/lib/typescript/Image/createImage.d.ts +36 -36
  313. package/lib/typescript/Indicator/Indicator.d.ts +4 -4
  314. package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
  315. package/lib/typescript/Input/Input.d.ts +61 -61
  316. package/lib/typescript/Input/Input.d.ts.map +1 -1
  317. package/lib/typescript/Input/Input.native.d.ts +79 -79
  318. package/lib/typescript/Input/shared.d.ts +66 -66
  319. package/lib/typescript/Input/shared.d.ts.map +1 -1
  320. package/lib/typescript/InputBase/InputBase.d.ts +4 -4
  321. package/lib/typescript/Kbd/Kbd.d.ts +23 -23
  322. package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.d.ts +1 -1
  323. package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +1 -1
  324. package/lib/typescript/List/List.d.ts +14 -14
  325. package/lib/typescript/Loader/Loader.d.ts.map +1 -1
  326. package/lib/typescript/LoadingOverlay/LoadingOverlay.d.ts +2 -2
  327. package/lib/typescript/Mark/Mark.d.ts +23 -23
  328. package/lib/typescript/Marquee/Marquee.d.ts +4 -4
  329. package/lib/typescript/MaskInput/MaskInput.d.ts +4 -4
  330. package/lib/typescript/Menu/Menu.d.ts +28 -28
  331. package/lib/typescript/Menu/Menu.d.ts.map +1 -1
  332. package/lib/typescript/Modal/Modal.d.ts +10 -10
  333. package/lib/typescript/MultiSelect/MultiSelect.d.ts +17 -62
  334. package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
  335. package/lib/typescript/NavLink/NavLink.d.ts +19 -19
  336. package/lib/typescript/Notification/Notification.d.ts +12 -12
  337. package/lib/typescript/Notification/Notification.d.ts.map +1 -1
  338. package/lib/typescript/NumberFormatter/NumberFormatter.d.ts +6 -6
  339. package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
  340. package/lib/typescript/NumberInput/NumberInput.d.ts +15 -15
  341. package/lib/typescript/Overlay/Overlay.d.ts +3 -3
  342. package/lib/typescript/Paper/Paper.d.ts +8 -40
  343. package/lib/typescript/Paper/Paper.d.ts.map +1 -1
  344. package/lib/typescript/Paragraph/Paragraph.d.ts +6 -6
  345. package/lib/typescript/PasswordInput/PasswordInput.d.ts +19 -19
  346. package/lib/typescript/Pill/Pill.d.ts +19 -19
  347. package/lib/typescript/Pill/Pill.d.ts.map +1 -1
  348. package/lib/typescript/PinInput/PinInput.d.ts +66 -66
  349. package/lib/typescript/Popover/Popover.shared.d.ts +3 -3
  350. package/lib/typescript/Progress/Progress.d.ts +4 -4
  351. package/lib/typescript/Progress/Progress.d.ts.map +1 -1
  352. package/lib/typescript/Radio/Radio.d.ts +8 -8
  353. package/lib/typescript/Rating/Rating.d.ts +2 -2
  354. package/lib/typescript/RollingNumber/RollingNumber.d.ts +4 -4
  355. package/lib/typescript/RollingNumber/RollingNumber.d.ts.map +1 -1
  356. package/lib/typescript/RollingNumber/rolling-number-utils.d.ts.map +1 -1
  357. package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
  358. package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
  359. package/lib/typescript/SegmentedControl/SegmentedControl.d.ts +4 -4
  360. package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  361. package/lib/typescript/Select/Select.d.ts +22 -51
  362. package/lib/typescript/Select/Select.d.ts.map +1 -1
  363. package/lib/typescript/Separator/Separator.d.ts +13 -13
  364. package/lib/typescript/Skeleton/Skeleton.d.ts +3 -3
  365. package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
  366. package/lib/typescript/Slider/Slider.d.ts +12 -12
  367. package/lib/typescript/Slider/Slider.d.ts.map +1 -1
  368. package/lib/typescript/Spoiler/Spoiler.d.ts +4 -4
  369. package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
  370. package/lib/typescript/Stepper/Stepper.d.ts +16 -16
  371. package/lib/typescript/Switch/Switch.d.ts +18 -7
  372. package/lib/typescript/Switch/Switch.d.ts.map +1 -1
  373. package/lib/typescript/Table/Table.d.ts +59 -53
  374. package/lib/typescript/Table/Table.d.ts.map +1 -1
  375. package/lib/typescript/TableOfContents/TableOfContents.d.ts +4 -4
  376. package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
  377. package/lib/typescript/Tabs/Tabs.d.ts +15 -15
  378. package/lib/typescript/TagsInput/TagsInput.d.ts +15 -49
  379. package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
  380. package/lib/typescript/Text/Text.d.ts +2 -2
  381. package/lib/typescript/TextInput/TextInput.d.ts +4 -4
  382. package/lib/typescript/Textarea/Textarea.d.ts +4 -4
  383. package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +7 -7
  384. package/lib/typescript/Title/Title.d.ts +9 -9
  385. package/lib/typescript/Tooltip/Tooltip.d.ts +4 -4
  386. package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
  387. package/lib/typescript/Tree/Tree.d.ts +8 -8
  388. package/lib/typescript/Tree/Tree.d.ts.map +1 -1
  389. package/lib/typescript/Tree/tree-data.d.ts +7 -0
  390. package/lib/typescript/Tree/tree-data.d.ts.map +1 -1
  391. package/lib/typescript/Tree/use-tree.d.ts +5 -0
  392. package/lib/typescript/Tree/use-tree.d.ts.map +1 -1
  393. package/lib/typescript/TreeSelect/TreeSelect.d.ts +36 -62
  394. package/lib/typescript/TreeSelect/TreeSelect.d.ts.map +1 -1
  395. package/lib/typescript/Typography/Typography.d.ts +8 -8
  396. package/lib/typescript/Typography/Typography.d.ts.map +1 -1
  397. package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  398. package/lib/typescript/VirtualList/VirtualList.d.ts.map +1 -1
  399. package/lib/typescript/VisuallyHidden/VisuallyHidden.d.ts +6 -6
  400. package/lib/typescript/floating/platform.d.ts +11 -0
  401. package/lib/typescript/floating/platform.d.ts.map +1 -1
  402. package/lib/typescript/floating/use-position.d.ts.map +1 -1
  403. package/lib/typescript/internal/ControlIconProvider.d.ts +1 -1
  404. package/lib/typescript/internal/ControlIconProvider.d.ts.map +1 -1
  405. package/lib/typescript/internal/InlineControl.d.ts +6 -6
  406. package/lib/typescript/internal/color.d.ts.map +1 -1
  407. package/lib/typescript/internal/gradient-shared.d.ts +7 -4
  408. package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
  409. package/lib/typescript/internal/gradient.d.ts +18 -0
  410. package/lib/typescript/internal/gradient.d.ts.map +1 -1
  411. package/lib/typescript/internal/gradient.native.d.ts.map +1 -1
  412. package/lib/typescript/internal/render-text-child.d.ts +11 -0
  413. package/lib/typescript/internal/render-text-child.d.ts.map +1 -1
  414. package/lib/typescript/internal/style-props.d.ts +17 -0
  415. package/lib/typescript/internal/style-props.d.ts.map +1 -1
  416. package/lib/typescript/internal/theme-color-web.d.ts +2 -0
  417. package/lib/typescript/internal/theme-color-web.d.ts.map +1 -0
  418. package/lib/typescript/internal/use-icon-color.d.ts +25 -0
  419. package/lib/typescript/internal/use-icon-color.d.ts.map +1 -0
  420. package/lib/typescript/internal/use-icon-color.native.d.ts +11 -0
  421. package/lib/typescript/internal/use-icon-color.native.d.ts.map +1 -0
  422. package/lib/typescript/internal/use-looping-animation.d.ts.map +1 -1
  423. package/lib/typescript/internal/use-looping-animation.native.d.ts.map +1 -1
  424. package/lib/typescript/internal/use-looping-animation.shared.d.ts +30 -3
  425. package/lib/typescript/internal/use-looping-animation.shared.d.ts.map +1 -1
  426. package/lib/typescript/internal/use-slot-text-wrapper.d.ts +0 -20
  427. package/lib/typescript/internal/use-slot-text-wrapper.d.ts.map +1 -1
  428. package/package.json +7 -7
  429. package/src/Accordion/Accordion.tsx +6 -2
  430. package/src/Alert/Alert.tsx +43 -22
  431. package/src/AngleSlider/AngleSlider.tsx +73 -21
  432. package/src/Autocomplete/Autocomplete.tsx +74 -55
  433. package/src/Badge/Badge.tsx +6 -8
  434. package/src/Button/Button.tsx +17 -3
  435. package/src/Card/Card.tsx +11 -3
  436. package/src/Checkbox/CheckIcon.tsx +9 -5
  437. package/src/Checkbox/Checkbox.tsx +8 -1
  438. package/src/Chip/Chip.tsx +15 -22
  439. package/src/CloseButton/CloseButton.tsx +1 -1
  440. package/src/ColorInput/ColorInput.tsx +15 -4
  441. package/src/ColorPicker/ColorPicker.tsx +38 -25
  442. package/src/Combobox/Combobox.tsx +10 -6
  443. package/src/Combobox/OptionsDropdown.tsx +6 -1
  444. package/src/Group/Group.tsx +21 -10
  445. package/src/Highlight/Highlight.tsx +42 -7
  446. package/src/HoverCard/HoverCard.tsx +48 -31
  447. package/src/Indicator/Indicator.tsx +4 -0
  448. package/src/Input/Input.tsx +31 -16
  449. package/src/Input/shared.tsx +20 -4
  450. package/src/Loader/Loader.tsx +14 -4
  451. package/src/Menu/Menu.tsx +6 -8
  452. package/src/MultiSelect/MultiSelect.tsx +140 -85
  453. package/src/Notification/Notification.tsx +43 -22
  454. package/src/NumberFormatter/NumberFormatter.tsx +66 -11
  455. package/src/Paper/Paper.tsx +8 -6
  456. package/src/Pill/Pill.tsx +6 -9
  457. package/src/Progress/Progress.tsx +3 -0
  458. package/src/RollingNumber/RollingNumber.tsx +43 -21
  459. package/src/RollingNumber/rolling-number-utils.ts +28 -5
  460. package/src/ScrollArea/ScrollArea.native.tsx +142 -49
  461. package/src/ScrollArea/ScrollArea.tsx +140 -47
  462. package/src/SegmentedControl/SegmentedControl.tsx +12 -1
  463. package/src/Select/Select.tsx +90 -67
  464. package/src/Skeleton/Skeleton.tsx +5 -1
  465. package/src/Slider/Slider.tsx +157 -61
  466. package/src/Spoiler/Spoiler.tsx +22 -10
  467. package/src/Stepper/Stepper.tsx +1 -1
  468. package/src/Switch/Switch.tsx +20 -9
  469. package/src/Table/Table.tsx +89 -33
  470. package/src/TableOfContents/TableOfContents.tsx +5 -1
  471. package/src/TagsInput/TagsInput.tsx +193 -141
  472. package/src/Tooltip/Tooltip.tsx +33 -7
  473. package/src/Tree/Tree.tsx +4 -1
  474. package/src/Tree/tree-data.ts +74 -26
  475. package/src/Tree/use-tree.ts +52 -7
  476. package/src/TreeSelect/TreeSelect.tsx +96 -64
  477. package/src/Typography/Typography.tsx +9 -8
  478. package/src/UnstyledButton/UnstyledButton.tsx +12 -5
  479. package/src/VirtualList/VirtualList.tsx +82 -18
  480. package/src/floating/platform.ts +29 -1
  481. package/src/floating/use-position.tsx +38 -1
  482. package/src/internal/ControlIconProvider.tsx +17 -12
  483. package/src/internal/color.ts +8 -1
  484. package/src/internal/gradient-shared.ts +9 -5
  485. package/src/internal/gradient.native.tsx +29 -5
  486. package/src/internal/gradient.tsx +22 -7
  487. package/src/internal/render-text-child.tsx +30 -2
  488. package/src/internal/style-props.ts +20 -4
  489. package/src/internal/theme-color-web.ts +40 -0
  490. package/src/internal/use-icon-color.native.ts +17 -0
  491. package/src/internal/use-icon-color.ts +26 -0
  492. package/src/internal/use-looping-animation.native.tsx +10 -2
  493. package/src/internal/use-looping-animation.shared.ts +38 -3
  494. package/src/internal/use-looping-animation.tsx +8 -4
  495. package/src/internal/use-slot-text-wrapper.tsx +39 -5
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import { withStaticProperties } from "@knitui/core";
4
- import { useUncontrolled } from "@knitui/hooks";
4
+ import { useCallbackRef, useUncontrolled } from "@knitui/hooks";
5
5
 
6
6
  import {
7
7
  Combobox,
@@ -149,11 +149,6 @@ interface TagsInputContextValue {
149
149
  clearButtonProps?: Partial<ComboboxClearButtonProps>;
150
150
  /** Controls how the clear button coexists with the trigger's right section. */
151
151
  clearSectionMode?: "clear" | "default" | "rightSection" | "both";
152
- /** Trigger props the sugar wrapper assembled (chrome, ref). */
153
- triggerProps?: Partial<TagsInputFieldProps> & {
154
- placeholder?: string;
155
- ref?: React.Ref<TagsInputRef>;
156
- };
157
152
  // Event/behaviour handlers consumed by TagsInput.Trigger.
158
153
  onClear: () => void;
159
154
  removeTag: (index: number) => void;
@@ -174,6 +169,90 @@ const useTagsInputContext = (): TagsInputContextValue => {
174
169
  return ctx;
175
170
  };
176
171
 
172
+ /**
173
+ * Trigger props the sugar wrapper assembled (chrome, ref). Rebuilt every render
174
+ * (`...inputProps` is a rest spread, so its identity can never be preserved), which
175
+ * is why it rides its OWN context: `TagsInput.Trigger` is the only consumer, while
176
+ * the option rows consume `TagsInputContext`.
177
+ */
178
+ type TagsInputFunneledTriggerProps = Partial<TagsInputFieldProps> & {
179
+ placeholder?: string;
180
+ ref?: React.Ref<TagsInputRef>;
181
+ };
182
+
183
+ const TagsInputTriggerPropsContext = React.createContext<TagsInputFunneledTriggerProps | undefined>(
184
+ undefined,
185
+ );
186
+
187
+ /** Shared empty funnel for the composable path (no sugar wrapper above). */
188
+ const EMPTY_TRIGGER_PROPS: TagsInputFunneledTriggerProps = {};
189
+
190
+ /**
191
+ * The slice of Root state a tag CHIP needs — deliberately WITHOUT `search`, so
192
+ * typing in the field cannot re-render the tag chips through context. The search
193
+ * text lives on `TagsInputContext`, which the trigger/field consume; the chips
194
+ * subscribe here instead and `React.memo` on `{ value, index }` then actually holds.
195
+ */
196
+ interface TagsInputChipContextValue {
197
+ pillSize: PillProps["size"];
198
+ disabled?: boolean;
199
+ readOnly?: boolean;
200
+ renderPill?: ComboboxRenderPill;
201
+ styles?: SlotStyles<TagsInputStyles>;
202
+ removeTag: (index: number) => void;
203
+ }
204
+
205
+ const TagsInputChipContext = React.createContext<TagsInputChipContextValue | null>(null);
206
+
207
+ /**
208
+ * One tag chip in the data-driven `TagsInput.Trigger` row, memoized on
209
+ * `{ value, index }`. Reads `TagsInputChipContext` (no `search`) and gets a
210
+ * `useCallbackRef`-stable `removeTag`, so a keystroke no longer rebuilds every chip's
211
+ * `Pill` + `CloseButton` + icon SVG — previously keystroke latency scaled with the
212
+ * number of tags, each chip also getting a brand-new `onRemove` closure.
213
+ */
214
+ const TagsInputChip = React.memo(function TagsInputChip({
215
+ value: item,
216
+ index,
217
+ }: {
218
+ value: string;
219
+ index: number;
220
+ }) {
221
+ const ctx = React.useContext(TagsInputChipContext);
222
+ if (!ctx) {
223
+ throw new Error("TagsInput chips must be rendered inside <TagsInput.Root>");
224
+ }
225
+ const { removeTag } = ctx;
226
+ const s = slotStyles<TagsInputStyles>(ctx.styles, TAGS_INPUT_SLOT_KEYS, "TagsInput");
227
+ const handleRemove = React.useCallback(() => removeTag(index), [removeTag, index]);
228
+
229
+ // A custom `renderPill` REPLACES the built-in chip (Mantine parity).
230
+ if (ctx.renderPill) {
231
+ return (
232
+ <>
233
+ {ctx.renderPill({
234
+ option: { value: item, label: item },
235
+ value: item,
236
+ onRemove: handleRemove,
237
+ disabled: ctx.disabled || ctx.readOnly,
238
+ })}
239
+ </>
240
+ );
241
+ }
242
+
243
+ return (
244
+ <Pill
245
+ {...s.get("pill")}
246
+ size={ctx.pillSize}
247
+ withRemoveButton={!ctx.readOnly}
248
+ disabled={ctx.disabled}
249
+ onRemove={handleRemove}
250
+ >
251
+ {item}
252
+ </Pill>
253
+ );
254
+ });
255
+
177
256
  /* -------------------------------------------------------------------------- */
178
257
  /* TagsInput.Root — the free-text tag-list state machine */
179
258
  /* -------------------------------------------------------------------------- */
@@ -276,7 +355,7 @@ export interface TagsInputRootProps {
276
355
  * `<TagsInput.Trigger>` with your own props instead.
277
356
  * @internal
278
357
  */
279
- __triggerProps?: TagsInputContextValue["triggerProps"];
358
+ __triggerProps?: TagsInputFunneledTriggerProps;
280
359
  }
281
360
 
282
361
  function TagsInputRoot(props: TagsInputRootProps) {
@@ -361,88 +440,66 @@ function TagsInputRoot(props: TagsInputRootProps) {
361
440
  // filter memo and scopes the behaviour to actual input changes.
362
441
  const selectFirstPending = React.useRef(false);
363
442
 
364
- const isDup = React.useCallback(
365
- (tag: string, current: string[]) =>
366
- isDuplicate
367
- ? isDuplicate(tag, current)
368
- : current.some((t) => t.toLowerCase() === tag.toLowerCase()),
369
- [isDuplicate],
443
+ // Every handler in this Root is `useCallbackRef`-stable (identity fixed, latest
444
+ // closure — the ref is refreshed after every commit, and events always fire after
445
+ // a commit). That is what lets the context memo below actually HIT: with fresh
446
+ // closures it either had to be invalidated every render (re-rendering every option
447
+ // row AND every tag chip, since context propagation walks past `React.memo`) or it
448
+ // would have served stale callbacks. `handleSubmit` additionally lands on
449
+ // `<Combobox onOptionSubmit>`, a dep of Combobox's OWN context memo.
450
+ const isDup = useCallbackRef((tag: string, current: string[]) =>
451
+ isDuplicate
452
+ ? isDuplicate(tag, current)
453
+ : current.some((t) => t.toLowerCase() === tag.toLowerCase()),
370
454
  );
371
455
 
372
- const addTag = React.useCallback(
373
- (raw: string) => {
374
- const tag = raw.trim();
375
- if (tag.length === 0) return;
376
- if (!allowDuplicates && isDup(tag, _value)) {
377
- onDuplicate?.(tag);
378
- setSearch("");
379
- return;
380
- }
381
- if (_value.length >= maxTags) {
382
- onMaxTags?.(tag);
383
- return;
384
- }
385
- setValue([..._value, tag]);
386
- if (clearSearchOnChange) setSearch("");
387
- },
388
- [
389
- allowDuplicates,
390
- isDup,
391
- _value,
392
- onDuplicate,
393
- maxTags,
394
- onMaxTags,
395
- setValue,
396
- setSearch,
397
- clearSearchOnChange,
398
- ],
399
- );
456
+ const addTag = useCallbackRef((raw: string) => {
457
+ const tag = raw.trim();
458
+ if (tag.length === 0) return;
459
+ if (!allowDuplicates && isDup(tag, _value)) {
460
+ onDuplicate?.(tag);
461
+ setSearch("");
462
+ return;
463
+ }
464
+ if (_value.length >= maxTags) {
465
+ onMaxTags?.(tag);
466
+ return;
467
+ }
468
+ setValue([..._value, tag]);
469
+ if (clearSearchOnChange) setSearch("");
470
+ });
400
471
 
401
472
  // Commit a batch of tags in ONE pass — merges into the current value honouring
402
473
  // `maxTags` + duplicates, then `setValue` once. Used by the split-on-key and
403
474
  // split-on-paste paths (a per-tag `addTag` loop would read the render-time `_value`
404
475
  // for every call, so only the last tag would survive).
405
- const commitTags = React.useCallback(
406
- (tags: string[]) => {
407
- const merged = _value.slice();
408
- for (const raw of tags) {
409
- const tag = raw.trim();
410
- if (tag.length === 0) continue;
411
- if (merged.length >= maxTags) {
412
- onMaxTags?.(tag);
413
- break;
414
- }
415
- if (!allowDuplicates && isDup(tag, merged)) {
416
- onDuplicate?.(tag);
417
- continue;
418
- }
419
- merged.push(tag);
476
+ const commitTags = useCallbackRef((tags: string[]) => {
477
+ const merged = _value.slice();
478
+ for (const raw of tags) {
479
+ const tag = raw.trim();
480
+ if (tag.length === 0) continue;
481
+ if (merged.length >= maxTags) {
482
+ onMaxTags?.(tag);
483
+ break;
420
484
  }
421
- if (merged.length !== _value.length) setValue(merged);
422
- if (clearSearchOnChange) setSearch("");
423
- },
424
- [
425
- _value,
426
- maxTags,
427
- onMaxTags,
428
- allowDuplicates,
429
- isDup,
430
- onDuplicate,
431
- setValue,
432
- clearSearchOnChange,
433
- setSearch,
434
- ],
435
- );
485
+ if (!allowDuplicates && isDup(tag, merged)) {
486
+ onDuplicate?.(tag);
487
+ continue;
488
+ }
489
+ merged.push(tag);
490
+ }
491
+ if (merged.length !== _value.length) setValue(merged);
492
+ if (clearSearchOnChange) setSearch("");
493
+ });
436
494
 
437
- const removeTag = React.useCallback(
438
- (index: number) => {
439
- const next = _value.slice();
440
- const [removed] = next.splice(index, 1);
441
- setValue(next);
442
- if (removed != null) onRemove?.(removed);
443
- },
444
- [_value, setValue, onRemove],
445
- );
495
+ // Stable so each chip's `onRemove` closure is stable too (it used to depend on
496
+ // `_value`, giving every chip a fresh callback on every render).
497
+ const removeTag = useCallbackRef((index: number) => {
498
+ const next = _value.slice();
499
+ const [removed] = next.splice(index, 1);
500
+ setValue(next);
501
+ if (removed != null) onRemove?.(removed);
502
+ });
446
503
 
447
504
  const suggestions = React.useMemo(() => filterPickedTags(parsed, _value), [parsed, _value]);
448
505
  const filterFn = filter ?? defaultOptionsFilter;
@@ -475,15 +532,12 @@ function TagsInputRoot(props: TagsInputRootProps) {
475
532
  setActiveValue(flatOptions[nextIndex].value);
476
533
  };
477
534
 
478
- const handleSubmit = React.useCallback(
479
- (optionValue: string) => {
480
- onOptionSubmit?.(optionValue);
481
- addTag(optionValue);
482
- },
483
- [onOptionSubmit, addTag],
484
- );
535
+ const handleSubmit = useCallbackRef((optionValue: string) => {
536
+ onOptionSubmit?.(optionValue);
537
+ addTag(optionValue);
538
+ });
485
539
 
486
- const handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
540
+ const handleKeyDown = useCallbackRef<[React.KeyboardEvent<HTMLInputElement>], void>((event) => {
487
541
  if (disabled || readOnly) return;
488
542
  const trimmed = search.trim();
489
543
 
@@ -531,9 +585,9 @@ function TagsInputRoot(props: TagsInputRootProps) {
531
585
  break;
532
586
  }
533
587
  onKeyDown?.(event);
534
- };
588
+ });
535
589
 
536
- const handleChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {
590
+ const handleChange = useCallbackRef<[React.ChangeEvent<HTMLInputElement>], void>((event) => {
537
591
  const newSearch = event.currentTarget.value;
538
592
  setSearch(newSearch);
539
593
  if (newSearch.length > 0) {
@@ -542,12 +596,12 @@ function TagsInputRoot(props: TagsInputRootProps) {
542
596
  combobox.closeDropdown();
543
597
  }
544
598
  if (selectFirstOptionOnChange) selectFirstPending.current = true;
545
- };
599
+ });
546
600
 
547
601
  // Split a pasted string into tags on `splitChars` (combined with any pending search),
548
602
  // mirroring Mantine's paste behaviour. Web-only: native `TextInput` has no paste event
549
603
  // in this path, so a multi-value paste lands as one tag (the documented web-functional model).
550
- const handlePaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {
604
+ const handlePaste = useCallbackRef<[React.ClipboardEvent<HTMLInputElement>], void>((event) => {
551
605
  onPaste?.(event);
552
606
  if (disabled || readOnly) return;
553
607
  const pasted = event.clipboardData?.getData("text/plain") ?? "";
@@ -555,24 +609,24 @@ function TagsInputRoot(props: TagsInputRootProps) {
555
609
  if (tags.length === 0) return;
556
610
  event.preventDefault();
557
611
  commitTags(tags);
558
- };
612
+ });
559
613
 
560
- const handleFocus: React.FocusEventHandler<HTMLInputElement> = (event) => {
614
+ const handleFocus = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
561
615
  onFocus?.(event);
562
- };
616
+ });
563
617
 
564
- const handleBlur: React.FocusEventHandler<HTMLInputElement> = (event) => {
618
+ const handleBlur = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
565
619
  combobox.closeDropdown();
566
620
  if (acceptValueOnBlur) addTag(search);
567
621
  else setSearch("");
568
622
  onBlur?.(event);
569
- };
623
+ });
570
624
 
571
- const handleClear = React.useCallback(() => {
625
+ const handleClear = useCallbackRef(() => {
572
626
  setValue([]);
573
627
  setSearch("");
574
628
  onClear?.();
575
- }, [setValue, setSearch, onClear]);
629
+ });
576
630
 
577
631
  const canClear = clearable && _value.length > 0 && !disabled && !readOnly;
578
632
 
@@ -597,7 +651,6 @@ function TagsInputRoot(props: TagsInputRootProps) {
597
651
  styles,
598
652
  clearButtonProps,
599
653
  clearSectionMode,
600
- triggerProps: __triggerProps,
601
654
  onClear: handleClear,
602
655
  removeTag,
603
656
  onChangeText: handleChange,
@@ -606,9 +659,9 @@ function TagsInputRoot(props: TagsInputRootProps) {
606
659
  onBlur: handleBlur,
607
660
  onPaste: handlePaste,
608
661
  }),
609
- // handlers are recreated each render (they close over render-scoped state); the
610
- // context value is intentionally not stable, mirroring the original component.
611
- /* eslint-disable-next-line react-hooks/exhaustive-deps */
662
+ // Deps are COMPLETE: every handler above is `useCallbackRef`-stable, so this memo
663
+ // genuinely hits. `__triggerProps` is deliberately absent — it rides its own
664
+ // context (it is rebuilt every render and only the Trigger reads it).
612
665
  [
613
666
  combobox,
614
667
  size,
@@ -629,28 +682,43 @@ function TagsInputRoot(props: TagsInputRootProps) {
629
682
  styles,
630
683
  clearButtonProps,
631
684
  clearSectionMode,
632
- __triggerProps,
633
685
  removeTag,
686
+ handleClear,
687
+ handleChange,
688
+ handleKeyDown,
689
+ handleFocus,
690
+ handleBlur,
691
+ handlePaste,
634
692
  ],
635
693
  );
636
694
 
695
+ // Chip-only slice: no `search`, so typing cannot re-render the tag chips.
696
+ const chipCtx = React.useMemo<TagsInputChipContextValue>(
697
+ () => ({ pillSize, disabled, readOnly, renderPill, styles, removeTag }),
698
+ [pillSize, disabled, readOnly, renderPill, styles, removeTag],
699
+ );
700
+
637
701
  const s = slotStyles<TagsInputStyles>(styles, TAGS_INPUT_SLOT_KEYS, "TagsInput");
638
702
 
639
703
  return (
640
704
  <TagsInputContext.Provider value={ctx}>
641
- <Combobox
642
- position="bottom"
643
- width="target"
644
- // Deprecated `comboboxProps` alias merged OVER the `root` slot sugar
645
- // ("explicit beats sugar").
646
- {...s.merge("root", comboboxProps)}
647
- store={combobox}
648
- onOptionSubmit={handleSubmit}
649
- size={size}
650
- readOnly={readOnly}
651
- >
652
- {children}
653
- </Combobox>
705
+ <TagsInputChipContext.Provider value={chipCtx}>
706
+ <TagsInputTriggerPropsContext.Provider value={__triggerProps}>
707
+ <Combobox
708
+ position="bottom"
709
+ width="target"
710
+ // Deprecated `comboboxProps` alias merged OVER the `root` slot sugar
711
+ // ("explicit beats sugar").
712
+ {...s.merge("root", comboboxProps)}
713
+ store={combobox}
714
+ onOptionSubmit={handleSubmit}
715
+ size={size}
716
+ readOnly={readOnly}
717
+ >
718
+ {children}
719
+ </Combobox>
720
+ </TagsInputTriggerPropsContext.Provider>
721
+ </TagsInputChipContext.Provider>
654
722
  </TagsInputContext.Provider>
655
723
  );
656
724
  }
@@ -721,7 +789,7 @@ const TagsInputTrigger = React.forwardRef<TagsInputRef, TagsInputTriggerProps>(
721
789
  // so a composable caller and the sugar caller resolve to the same trigger.
722
790
  // Explicit props on `<TagsInput.Trigger>` win over the funneled ones, which in
723
791
  // turn win over the `trigger` slot sugar.
724
- const funneled = ctx.triggerProps ?? {};
792
+ const funneled = React.useContext(TagsInputTriggerPropsContext) ?? EMPTY_TRIGGER_PROPS;
725
793
  const { placeholder: funneledPlaceholder, ref: funneledRef, ...funneledRest } = funneled;
726
794
 
727
795
  const {
@@ -754,28 +822,12 @@ const TagsInputTrigger = React.forwardRef<TagsInputRef, TagsInputTriggerProps>(
754
822
  mode: ctx.clearSectionMode,
755
823
  });
756
824
 
757
- const pills = ctx.value.map((item, index) =>
758
- ctx.renderPill ? (
759
- <React.Fragment key={`${item}-${index}`}>
760
- {ctx.renderPill({
761
- option: { value: item, label: item },
762
- value: item,
763
- onRemove: () => ctx.removeTag(index),
764
- disabled: ctx.disabled || ctx.readOnly,
765
- })}
766
- </React.Fragment>
767
- ) : (
768
- <TagsInputPill
769
- key={`${item}-${index}`}
770
- size={ctx.pillSize}
771
- withRemoveButton={!ctx.readOnly}
772
- disabled={ctx.disabled}
773
- onRemove={() => ctx.removeTag(index)}
774
- >
775
- {item}
776
- </TagsInputPill>
777
- ),
778
- );
825
+ // `TagsInputChip` is memoized on `{ value, index }` and subscribes to the
826
+ // search-free chip context, so a keystroke re-renders the field but skips every
827
+ // chip. (The `renderPill` hatch and the `pill` slot sugar both live inside it.)
828
+ const pills = ctx.value.map((item, index) => (
829
+ <TagsInputChip key={`${item}-${index}`} value={item} index={index} />
830
+ ));
779
831
 
780
832
  return (
781
833
  <Combobox.Target>
@@ -1059,7 +1111,7 @@ const TagsInputComponent = React.forwardRef<TagsInputRef, TagsInputProps>(
1059
1111
 
1060
1112
  // The remaining chrome props are funneled to `TagsInput.Trigger` via Root context
1061
1113
  // so the sugar path and the composable path converge on the same trigger element.
1062
- const triggerProps: TagsInputContextValue["triggerProps"] = {
1114
+ const triggerProps: TagsInputFunneledTriggerProps = {
1063
1115
  ...inputProps,
1064
1116
  placeholder,
1065
1117
  // Forward ONLY the field-chrome slots to the trigger's `PillsInput` →
@@ -68,13 +68,27 @@ export interface TooltipEvents {
68
68
  /* Styled label frame */
69
69
  /* -------------------------------------------------------------------------- */
70
70
 
71
+ /*
72
+ * RAMP NOTE (`$colorN` steps below are MIRRORED, i.e. `13 - n`)
73
+ * ------------------------------------------------------------
74
+ * `name: "Tooltip"` collides with an `inverse`-templated entry in Tamagui's
75
+ * (deprecated) `defaultComponentThemes`. Until `core/config/themes.ts` set
76
+ * `componentThemes: false`, this frame — and `TooltipText` inside it — resolved
77
+ * against a `<scheme>_Tooltip` theme whose whole `$color1…$color12` ramp was
78
+ * reversed, so the authored `$color9` fill actually painted step 4 and the
79
+ * authored `$color1` label actually painted step 12. The steps are written
80
+ * pre-mirrored here so the tooltip keeps its shipped light-chip appearance now
81
+ * that nothing flips the ramp under it. Restoring the canonical filled pairing
82
+ * (`$color9` fill + `$color1` label) is a deliberate design change — see the
83
+ * changeset.
84
+ */
71
85
  const TooltipLabelFrame = styled(Box, {
72
86
  name: "Tooltip",
73
87
  // `fixed` is web-only viewport positioning; React Native supports only
74
88
  // `absolute`/`relative`/`static`. Pick the platform-correct value (mirrors
75
89
  // Popover.Dropdown) so the label isn't laid out in normal flow on native.
76
90
  position: isWeb ? ("fixed" as const) : ("absolute" as const),
77
- backgroundColor: "$color9",
91
+ backgroundColor: "$color4",
78
92
  paddingVertical: "$xxs",
79
93
  paddingHorizontal: "$xs",
80
94
  borderRadius: "$sm",
@@ -94,7 +108,8 @@ const TooltipLabelFrame = styled(Box, {
94
108
 
95
109
  const TooltipText = styled(Text, {
96
110
  name: "TooltipText",
97
- color: "$color1",
111
+ // MIRRORED step — renders inside `TooltipLabelFrame`. See the RAMP NOTE above.
112
+ color: "$color12",
98
113
  fontSize: "$sm",
99
114
  });
100
115
 
@@ -346,12 +361,23 @@ function TooltipTarget({ children, refProp: refPropOverride }: TooltipTargetProp
346
361
  const mergedRef = useMergedRef<TamaguiElement>(ctx.setReferenceRef, childRef);
347
362
 
348
363
  const child = children as React.ReactElement<InteractionProps>;
349
- const handlers = buildTargetHandlers(child.props, ctx);
350
364
 
351
- return React.cloneElement(child, {
352
- [refProp]: mergedRef,
353
- ...handlers,
354
- } as Partial<InteractionProps> & React.Attributes);
365
+ // Memoised on the child's props + the target context. A Tooltip re-renders on
366
+ // every position update while open, and each of those rebuilt 2–5 handler
367
+ // closures and cloned a NEW element for the trigger — re-rendering the whole
368
+ // trigger subtree. `children` is a prop, so its identity is stable across
369
+ // Tooltip's own state churn; when nothing the clone depends on changed, the
370
+ // memo returns the SAME element and React skips the subtree entirely.
371
+ const handlers = React.useMemo(() => buildTargetHandlers(child.props, ctx), [child.props, ctx]);
372
+
373
+ return React.useMemo(
374
+ () =>
375
+ React.cloneElement(child, {
376
+ [refProp]: mergedRef,
377
+ ...handlers,
378
+ } as Partial<InteractionProps> & React.Attributes),
379
+ [child, refProp, mergedRef, handlers],
380
+ );
355
381
  }
356
382
 
357
383
  const TooltipBase = TooltipLabelFrame.styleable<TooltipProps>(function Tooltip(props, ref) {
package/src/Tree/Tree.tsx CHANGED
@@ -237,7 +237,10 @@ const TreeNode = React.memo(function TreeNode(props: TreeNodePartProps) {
237
237
 
238
238
  const hasChildren = Array.isArray(node.children) && node.children.length > 0;
239
239
  const expanded = controller.expandedState[node.value] ?? false;
240
- const selected = controller.selectedState.includes(node.value);
240
+ // `Set` lookup, not an `Array.includes` scan — this runs once per rendered node,
241
+ // so the scan made selection O(nodes × selected) per render. See `selectedLookup`
242
+ // in `use-tree.ts`.
243
+ const selected = controller.isNodeSelected(node.value);
241
244
 
242
245
  const handlePress = React.useCallback(() => {
243
246
  if (hasChildren && expandOnClick) {