@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
package/src/Chip/Chip.tsx CHANGED
@@ -1,20 +1,13 @@
1
1
  import * as React from "react";
2
2
 
3
- import {
4
- createStyledContext,
5
- type GetProps,
6
- styled,
7
- useTheme,
8
- withStaticProperties,
9
- } from "@knitui/core";
3
+ import { createStyledContext, type GetProps, styled, withStaticProperties } from "@knitui/core";
10
4
  import { useKeyboardActions, useUncontrolled } from "@knitui/hooks";
11
- import { IconCheck } from "@knitui/icons";
5
+ import { IconCheck } from "@knitui/icons/IconCheck";
12
6
 
13
7
  import { Box } from "../Box";
14
8
  import { controlIconSize } from "../internal/control-icon-size";
15
9
  import { usePressScale } from "../internal/motion";
16
10
  import { renderTextChild } from "../internal/render-text-child";
17
- import { resolveThemeColor } from "../internal/resolve-theme-color";
18
11
  import {
19
12
  controlFontVariant,
20
13
  controlGapVariant,
@@ -25,6 +18,8 @@ import {
25
18
  webCursor,
26
19
  } from "../internal/style-props";
27
20
  import { slotStyles, type SlotStyles } from "../internal/styles";
21
+ import { useIconColor } from "../internal/use-icon-color";
22
+ import { useSlotTextWrapper } from "../internal/use-slot-text-wrapper";
28
23
  import { useToggle } from "../internal/use-toggle";
29
24
  import { Text } from "../Text";
30
25
 
@@ -312,18 +307,13 @@ const ChipComponent = ChipFrame.styleable<ChipProps>(function Chip(props, ref) {
312
307
  const s = slotStyles<ChipSlots>(styles, CHIP_SLOTS, "Chip");
313
308
 
314
309
  // The label slot must reach the `ChipLabel` that `renderTextChild` mounts, so
315
- // wrap `ChipLabel` to fold in the slot props. Memoized so the wrapper's
316
- // identity is stable across renders unless the slot props change.
317
- const labelSlot = s.get("label");
318
- const LabelWrapper = React.useMemo(
319
- () =>
320
- function ChipLabelSlot({ children: labelChildren }: { children: React.ReactNode }) {
321
- return <ChipLabel {...labelSlot}>{labelChildren}</ChipLabel>;
322
- },
323
- [labelSlot],
324
- );
310
+ // wrap `ChipLabel` to fold in the slot props. `useSlotTextWrapper` keys the memo
311
+ // on the slot props' SHALLOW VALUE, not their identity: the documented call is an
312
+ // inline literal (`styles={{ label: { … } }}`), which is a new object every
313
+ // render, so an identity-keyed memo never hit — the wrapper was a new component
314
+ // TYPE each render and React unmounted + remounted the label subtree.
315
+ const LabelWrapper = useSlotTextWrapper(ChipLabel, s.get("label"));
325
316
 
326
- const theme = useTheme();
327
317
  const group = React.useContext(ChipGroupContext);
328
318
  const inGroup = group !== null && value !== undefined;
329
319
  const [selfOn, toggle] = useToggle(checked, defaultChecked, onChange);
@@ -348,9 +338,12 @@ const ChipComponent = ChipFrame.styleable<ChipProps>(function Chip(props, ref) {
348
338
  // resolve theme tokens or the font cascade). Colour tracks the combined state,
349
339
  // size tracks the control key via the canonical icon ladder. A `color` from the
350
340
  // `icon` slot overrides the state colour and is routed to the icon.
341
+ // `useIconColor` (not `useTheme()` + `resolveThemeColor`): on web the token →
342
+ // `var(--token)` mapping is a pure string transform, so no theme subscription is
343
+ // needed — which matters because this runs on every chip render even when the
344
+ // glyph is hidden (the hook must stay unconditional).
351
345
  const { color: iconSlotColor, ...iconSlotProps } = s.get("icon") ?? {};
352
- const checkColor = resolveThemeColor(
353
- theme,
346
+ const checkColor = useIconColor(
354
347
  typeof iconSlotColor === "string" ? iconSlotColor : CHIP_ICON_TOKEN[state],
355
348
  );
356
349
  const checkSize = controlIconSize(size);
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import { type GetProps, styled, withStaticProperties } from "@knitui/core";
4
- import { IconX } from "@knitui/icons";
4
+ import { IconX } from "@knitui/icons/IconX";
5
5
 
6
6
  import { ActionIcon } from "../ActionIcon";
7
7
  import { Box } from "../Box";
@@ -228,11 +228,22 @@ const ColorInputComponent = React.forwardRef<ColorInputRef, ColorInputProps>(
228
228
 
229
229
  // The `swatch` slot reaches the dropdown picker's own swatch slot; explicit
230
230
  // `styles={{ picker: { styles } }}` wins (it is spread last).
231
+ //
232
+ // Memoized because this lands on `ColorPicker.Root`'s `styles` prop, which is a
233
+ // dependency of its context memo: a fresh object here re-provides the picker
234
+ // context on every render — i.e. on every keystroke in the hex field — which
235
+ // re-renders the whole swatch grid. `s.get(…)` returns the consumer's own slot
236
+ // objects unchanged, so keying on them is exact.
231
237
  const pickerSugar = s.get("picker");
232
- const pickerStyles: SlotStyles<ColorPickerStyles> | undefined =
233
- s.get("swatch") || pickerSugar?.styles
234
- ? { swatch: s.get("swatch"), ...pickerSugar?.styles }
235
- : undefined;
238
+ const swatchSugar = s.get("swatch");
239
+ const pickerSugarStyles = pickerSugar?.styles;
240
+ const pickerStyles = React.useMemo<SlotStyles<ColorPickerStyles> | undefined>(
241
+ () =>
242
+ swatchSugar || pickerSugarStyles
243
+ ? { swatch: swatchSugar, ...pickerSugarStyles }
244
+ : undefined,
245
+ [swatchSugar, pickerSugarStyles],
246
+ );
236
247
 
237
248
  return (
238
249
  <Popover
@@ -272,10 +272,14 @@ function ColorPickerSaturation(props: ColorPickerSaturationProps) {
272
272
  const { parsed: value, value: color, size, focusable, saturationLabel, geometry } = ctx;
273
273
  const { onPartChange: onChange, onSaturationChangeEnd, onScrubStart, onScrubEnd } = ctx;
274
274
 
275
- const [position, setPosition] = React.useState<MovePosition>({
276
- x: value.s / 100,
277
- y: 1 - value.v / 100,
278
- });
275
+ // `ctx.parsed` IS the source of truth for the thumb, so the position is
276
+ // DERIVED during render instead of mirrored into state by an effect. The mirror
277
+ // cost a second render of the whole picker subtree for every pointermove:
278
+ // ctx change → render → effect → setPosition → render again.
279
+ const position: MovePosition = { x: value.s / 100, y: 1 - value.v / 100 };
280
+ // Raw (unrounded) last-move position, read by `onScrubEnd` — deliberately NOT
281
+ // written during render; `useMove` always reports the final move before
282
+ // `onScrubEnd`, so this is fresh whenever it is read.
279
283
  const positionRef = React.useRef(position);
280
284
 
281
285
  const { ref, rootProps } = useMove(
@@ -293,10 +297,6 @@ function ColorPickerSaturation(props: ColorPickerSaturationProps) {
293
297
  },
294
298
  );
295
299
 
296
- React.useEffect(() => {
297
- setPosition({ x: value.s / 100, y: 1 - value.v / 100 });
298
- }, [value.s, value.v]);
299
-
300
300
  const nudge = (next: MovePosition) => {
301
301
  const clamped = clampMovePosition(next);
302
302
  onChange({ s: Math.round(clamped.x * 100), v: Math.round((1 - clamped.y) * 100) });
@@ -411,7 +411,9 @@ function ColorSlider(props: ColorSliderEngineProps) {
411
411
 
412
412
  const s = slotStyles<ColorPickerStyles>(styles, COLOR_PICKER_SLOT_KEYS, "ColorPicker");
413
413
 
414
- const [position, setPosition] = React.useState<MovePosition>({ x: value / maxValue, y: 0 });
414
+ // Derived during render from the incoming `value` — see the note in
415
+ // `ColorPickerSaturation`; the old mirror state + effect doubled every render.
416
+ const position: MovePosition = { x: value / maxValue, y: 0 };
415
417
  const positionRef = React.useRef(position);
416
418
 
417
419
  const getValue = (x: number) => (round_ ? Math.round(x * maxValue) : x * maxValue);
@@ -430,10 +432,6 @@ function ColorSlider(props: ColorSliderEngineProps) {
430
432
  },
431
433
  );
432
434
 
433
- React.useEffect(() => {
434
- setPosition({ x: value / maxValue, y: 0 });
435
- }, [value, maxValue]);
436
-
437
435
  const nudge = (x: number) => {
438
436
  const clamped = clampMovePosition({ x, y: 0 });
439
437
  onChange(getValue(clamped.x));
@@ -539,6 +537,9 @@ export interface ColorPickerAlphaSliderProps extends GetProps<typeof SliderFrame
539
537
  function ColorPickerAlphaSlider(props: ColorPickerAlphaSliderProps) {
540
538
  const ctx = useColorPickerContext();
541
539
  const { thumbProps, ...rest } = props;
540
+ // The gradient overlay and the thumb want the SAME hex; converting twice ran the
541
+ // HSVA→hex math twice per drag frame.
542
+ const hex = convertHsvaTo("hex", ctx.parsed);
542
543
  return (
543
544
  <ColorSlider
544
545
  value={ctx.parsed.a}
@@ -547,10 +548,10 @@ function ColorPickerAlphaSlider(props: ColorPickerAlphaSliderProps) {
547
548
  baseColor="#ffffff"
548
549
  overlays={[
549
550
  {
550
- backgroundImage: `linear-gradient(90deg, transparent, ${convertHsvaTo("hex", ctx.parsed)})`,
551
+ backgroundImage: `linear-gradient(90deg, transparent, ${hex})`,
551
552
  },
552
553
  ]}
553
- thumbColor={convertHsvaTo("hex", ctx.parsed)}
554
+ thumbColor={hex}
554
555
  size={ctx.size}
555
556
  focusable={ctx.focusable}
556
557
  aria-label={ctx.alphaLabel}
@@ -609,7 +610,15 @@ function ColorPickerSwatch(props: ColorPickerSwatchProps) {
609
610
  );
610
611
  const swatchSize = size ?? autoSize;
611
612
  const selected = ctx.value === color;
612
- const checkColor = (luminance(color) < 0.5 ? "#fff" : "#000") as TextProps["color"];
613
+ // `luminance` runs `parseColor` (a multi-pattern regex scan) plus HSVA math, and
614
+ // this component subscribes to a context that legitimately changes on EVERY
615
+ // pointermove of a saturation/hue/alpha drag — so all N swatches re-render per
616
+ // frame. The check colour depends only on `color`, which never changes for a
617
+ // given swatch, so it is computed once per swatch instead of once per frame.
618
+ const checkColor = React.useMemo(
619
+ () => (luminance(color) < 0.5 ? "#fff" : "#000") as TextProps["color"],
620
+ [color],
621
+ );
613
622
  const numericSize = typeof swatchSize === "number" ? swatchSize : autoSize;
614
623
 
615
624
  return (
@@ -738,13 +747,18 @@ const ColorPickerRoot = React.forwardRef<
738
747
 
739
748
  const withAlpha = format === "hexa" || format === "rgba" || format === "hsla";
740
749
 
741
- const handleChange = React.useCallback((color: Partial<HsvaColor>) => {
742
- const next = { ...parsedRef.current, ...color };
743
- parsedRef.current = next;
744
- setParsed(next);
745
- setValue(convertHsvaTo(formatRef.current, next));
746
- // eslint-disable-next-line react-hooks/exhaustive-deps
747
- }, []);
750
+ // `setValue` from `useUncontrolled` is referentially stable AND reads the latest
751
+ // `onChange` through a ref, so listing it honestly keeps this callback stable
752
+ // across renders — the old `[]` + eslint-disable workaround is now dead.
753
+ const handleChange = React.useCallback(
754
+ (color: Partial<HsvaColor>) => {
755
+ const next = { ...parsedRef.current, ...color };
756
+ parsedRef.current = next;
757
+ setParsed(next);
758
+ setValue(convertHsvaTo(formatRef.current, next));
759
+ },
760
+ [setValue],
761
+ );
748
762
 
749
763
  const startScrubbing = React.useCallback(() => {
750
764
  scrubbingRef.current = true;
@@ -808,8 +822,7 @@ const ColorPickerRoot = React.forwardRef<
808
822
  onColorSwatchClick?.(color);
809
823
  onChangeEnd?.(convertHsvaTo(formatRef.current, parseColor(color)));
810
824
  },
811
- // eslint-disable-next-line react-hooks/exhaustive-deps
812
- [onColorSwatchClick, onChangeEnd],
825
+ [onColorSwatchClick, onChangeEnd, setValue],
813
826
  );
814
827
 
815
828
  const ctx = React.useMemo<ColorPickerContextValue>(
@@ -5,10 +5,9 @@ import {
5
5
  type GetProps,
6
6
  type RadiusTokens,
7
7
  styled,
8
- useTheme,
9
8
  withStaticProperties,
10
9
  } from "@knitui/core";
11
- import { IconChevronDown } from "@knitui/icons";
10
+ import { IconChevronDown } from "@knitui/icons/IconChevronDown";
12
11
 
13
12
  import { Box } from "../Box";
14
13
  import { CloseButton, type CloseButtonProps } from "../CloseButton";
@@ -16,7 +15,6 @@ import { CONTROL_ICON_SIZE, controlIconSize } from "../internal/control-icon-siz
16
15
  import { toEmbeddedControlSize } from "../internal/embedded-control-size";
17
16
  import { HiddenInput } from "../internal/hidden-input";
18
17
  import { renderTextChild } from "../internal/render-text-child";
19
- import { resolveThemeColor } from "../internal/resolve-theme-color";
20
18
  import {
21
19
  fontSizePassthroughVariant,
22
20
  fontSizeVariant,
@@ -24,6 +22,7 @@ import {
24
22
  type SizeKey,
25
23
  webCursor,
26
24
  } from "../internal/style-props";
25
+ import { useIconColor } from "../internal/use-icon-color";
27
26
  import { Popover, type PopoverPosition, type PopoverWidth } from "../Popover";
28
27
  import { Text } from "../Text";
29
28
  import { type ComboboxStore, useCombobox } from "./use-combobox";
@@ -656,12 +655,17 @@ export interface ComboboxChevronProps extends Omit<
656
655
  const ComboboxChevron = ComboboxChevronText.styleable<ComboboxChevronProps>(
657
656
  function ComboboxChevron({ error, color, size, ...rest }, ref) {
658
657
  void error;
659
- const theme = useTheme();
660
- // Concrete colour for the SVG (defaults to the chevron's `$color11`); an
658
+ // Paintable colour for the SVG (defaults to the chevron's `$color11`); an
661
659
  // explicit `color`/slot value still wins. Size tracks the field's control key
662
660
  // via the canonical icon ladder. The wrapper `Box` keeps the open/close
663
661
  // rotation + slot passthrough.
664
- const iconColor = resolveThemeColor(theme, typeof color === "string" ? color : "$color11");
662
+ //
663
+ // `useIconColor` rather than `useTheme()` + `resolveThemeColor`: on web the
664
+ // token → `var(--token)` mapping is a pure string transform, so the chevron of
665
+ // every Select/Autocomplete/MultiSelect no longer registers a theme subscriber
666
+ // (nor pays `useThemeWithState`'s dep-less per-render `useEffect`). Native
667
+ // still resolves through the theme, where the SVG needs a concrete colour.
668
+ const iconColor = useIconColor(typeof color === "string" ? color : "$color11");
665
669
  // `size` is the open-ended host type (SizeKey | bare string | number); the
666
670
  // ladder only keys on `SizeKey`/number, so narrow before mapping.
667
671
  const iconSize =
@@ -179,9 +179,13 @@ export function OptionsDropdown(props: OptionsDropdownProps) {
179
179
  "aria-label": ariaLabel,
180
180
  } = props;
181
181
 
182
+ // Multi-select membership is O(1) per option — building the set once keeps the
183
+ // whole render O(n + m) instead of O(n * m) (`value.includes` per option).
184
+ const valueSet = React.useMemo(() => (Array.isArray(value) ? new Set(value) : null), [value]);
185
+
182
186
  const options = React.useMemo(() => {
183
187
  const isChecked = (optionValue: string) =>
184
- Array.isArray(value) ? value.includes(optionValue) : value != null && value === optionValue;
188
+ valueSet ? valueSet.has(optionValue) : value != null && value === optionValue;
185
189
 
186
190
  const renderItem = (item: ComboboxItem) => (
187
191
  <OptionRow
@@ -208,6 +212,7 @@ export function OptionsDropdown(props: OptionsDropdownProps) {
208
212
  }, [
209
213
  data,
210
214
  value,
215
+ valueSet,
211
216
  activeValue,
212
217
  withCheckIcon,
213
218
  checkIconPosition,
@@ -98,7 +98,27 @@ export interface GroupProps extends GroupFrameProps {
98
98
  export const Group = GroupFrame.styleable<GroupProps>(function Group(props, ref) {
99
99
  const { children, grow = false, preventGrowOverflow = true, ...rest } = props;
100
100
 
101
- if (!grow) {
101
+ const items = grow ? React.Children.toArray(children).filter(Boolean) : null;
102
+
103
+ // Memoised because it is the `style` handed to every non-Tamagui child (a
104
+ // memoized icon, a raw RN host). A fresh object per render is a fresh `style`
105
+ // identity, so the child's `React.memo` misses on every Group render — and on
106
+ // native react-native-svg then re-runs `StyleSheet.flatten` and rebuilds its
107
+ // root style array. It only actually depends on the child COUNT and the cap
108
+ // flag. Declared above the `!grow` early return so the hook order is stable
109
+ // when `grow` toggles.
110
+ const growStyle = React.useMemo<GrowStyle>(
111
+ () => ({
112
+ flexGrow: 1,
113
+ flexShrink: 1,
114
+ flexBasis: 0,
115
+ minWidth: 0,
116
+ ...(preventGrowOverflow ? { maxWidth: `${100 / Math.max(items?.length ?? 1, 1)}%` } : {}),
117
+ }),
118
+ [items?.length, preventGrowOverflow],
119
+ );
120
+
121
+ if (!items) {
102
122
  return (
103
123
  <GroupFrame ref={ref} {...rest}>
104
124
  {children}
@@ -106,15 +126,6 @@ export const Group = GroupFrame.styleable<GroupProps>(function Group(props, ref)
106
126
  );
107
127
  }
108
128
 
109
- const items = React.Children.toArray(children).filter(Boolean);
110
- const growStyle: GrowStyle = {
111
- flexGrow: 1,
112
- flexShrink: 1,
113
- flexBasis: 0,
114
- minWidth: 0,
115
- ...(preventGrowOverflow ? { maxWidth: `${100 / Math.max(items.length, 1)}%` } : {}),
116
- };
117
-
118
129
  return (
119
130
  <GroupFrame ref={ref} {...rest}>
120
131
  {items.map((child, i) =>
@@ -14,6 +14,9 @@ interface HighlightChunk {
14
14
  matchedTerm: string;
15
15
  }
16
16
 
17
+ /** Shared result for the non-string-children path — never rendered, never mutated. */
18
+ const NO_CHUNKS: readonly HighlightChunk[] = Object.freeze([]);
19
+
17
20
  type HighlightMarkProps = Omit<MarkProps, "children">;
18
21
  type HighlightStylesMap = Record<string, HighlightMarkProps>;
19
22
 
@@ -43,17 +46,22 @@ function isPerTermMap(
43
46
  * The deprecated `highlightStyles` alias therefore merges OVER the `mark` slot
44
47
  * ("explicit beats sugar"); a per-term entry, the documented exception with no
45
48
  * Pillar-B equivalent, is the most specific and wins outright for its term.
49
+ *
50
+ * `perTermStyles` is the ALREADY-DECIDED per-term map (`undefined` when `legacy`
51
+ * is the single-object form). Deciding it in here re-ran `isPerTermMap` — a fresh
52
+ * `Set` plus `Object.entries` — once per highlighted chunk, even though the answer
53
+ * only depends on `highlightStyles` + the term list; the caller now decides once.
46
54
  */
47
55
  function resolveHighlightStyles(
48
56
  slotMark: HighlightMarkProps | undefined,
49
57
  legacy: HighlightMarkProps | HighlightStylesMap | undefined,
50
- terms: string[],
58
+ perTermStyles: HighlightStylesMap | undefined,
51
59
  matchedTerm: string,
52
60
  ): HighlightMarkProps {
53
61
  const base = slotMark ?? {};
54
62
  if (legacy === undefined) return base;
55
- if (isPerTermMap(legacy, terms)) return { ...base, ...(legacy[matchedTerm] ?? {}) };
56
- return { ...base, ...legacy };
63
+ if (perTermStyles !== undefined) return { ...base, ...(perTermStyles[matchedTerm] ?? {}) };
64
+ return { ...base, ...(legacy as HighlightMarkProps) };
57
65
  }
58
66
 
59
67
  /** Strip diacritics for accent-insensitive matching. */
@@ -198,6 +206,36 @@ export const Highlight = Text.styleable<HighlightProps>(function Highlight(props
198
206
  const s = slotStyles<HighlightStyles>(styles, HIGHLIGHT_SLOT_KEYS, "Highlight");
199
207
  const slotMark = s.get("mark");
200
208
 
209
+ // ## Cost
210
+ //
211
+ // This is the search-results primitive: N instances re-render on every
212
+ // keystroke of the query they highlight. The scan below is the expensive part —
213
+ // a full `normalize()` of `children` (`.normalize("NFD")` + a `\p{M}` strip +
214
+ // `.toLowerCase()`) plus an O(len × terms) walk — and it used to run on every
215
+ // render even when nothing it reads had changed. Memoized on its real inputs.
216
+ // (The hooks sit ABOVE the non-string-children early return so hook order stays
217
+ // stable if `children` changes shape; the scan itself is guarded by `typeof`.)
218
+ const terms = React.useMemo(
219
+ () => (Array.isArray(highlight) ? highlight : [highlight]),
220
+ [highlight],
221
+ );
222
+ const chunks = React.useMemo(
223
+ () =>
224
+ typeof children === "string"
225
+ ? highlighter(children, terms, { caseInsensitive, wholeWord, accentInsensitive })
226
+ : NO_CHUNKS,
227
+ [children, terms, caseInsensitive, wholeWord, accentInsensitive],
228
+ );
229
+ // Decide the `highlightStyles` shape ONCE per render rather than per matched
230
+ // chunk (see `resolveHighlightStyles`).
231
+ const perTermStyles = React.useMemo(
232
+ () =>
233
+ highlightStyles !== undefined && isPerTermMap(highlightStyles, terms)
234
+ ? highlightStyles
235
+ : undefined,
236
+ [highlightStyles, terms],
237
+ );
238
+
201
239
  if (typeof children !== "string") {
202
240
  return (
203
241
  <Text ref={ref} {...rest}>
@@ -206,9 +244,6 @@ export const Highlight = Text.styleable<HighlightProps>(function Highlight(props
206
244
  );
207
245
  }
208
246
 
209
- const terms = Array.isArray(highlight) ? highlight : [highlight];
210
- const chunks = highlighter(children, terms, { caseInsensitive, wholeWord, accentInsensitive });
211
-
212
247
  return (
213
248
  <Text ref={ref} {...rest}>
214
249
  {chunks.map((part, index) => {
@@ -218,7 +253,7 @@ export const Highlight = Text.styleable<HighlightProps>(function Highlight(props
218
253
  const markProps = resolveHighlightStyles(
219
254
  slotMark,
220
255
  highlightStyles,
221
- terms,
256
+ perTermStyles,
222
257
  part.matchedTerm,
223
258
  );
224
259
  return (
@@ -339,48 +339,65 @@ type HoverHandlers = {
339
339
  };
340
340
 
341
341
  function HoverCardTarget({ children, refProp = "ref" }: HoverCardTargetProps) {
342
- const ctx = useHoverCardContext();
342
+ // Destructured so the memo dependency lists below name plain locals — the
343
+ // exhaustive-deps rule can't narrow `ctx.x` member expressions here.
344
+ const { openDropdown, closeDropdown, targetSlot } = useHoverCardContext();
343
345
 
344
346
  const child = children as React.ReactElement<HoverHandlers>;
345
347
  const childProps = child.props;
346
348
 
347
349
  // Hover-intent handlers — HoverCard's reason to exist. Web uses mouse events,
348
350
  // native uses Tamagui's `onHoverIn`/`onHoverOut`.
349
- const handlers: HoverHandlers = isWeb
350
- ? {
351
- onMouseEnter: (e) => {
352
- childProps.onMouseEnter?.(e);
353
- childProps.onHoverIn?.(e);
354
- ctx.openDropdown();
355
- },
356
- onMouseLeave: (e) => {
357
- childProps.onMouseLeave?.(e);
358
- childProps.onHoverOut?.(e);
359
- ctx.closeDropdown();
360
- },
361
- }
362
- : {
363
- onHoverIn: (e) => {
364
- childProps.onHoverIn?.(e);
365
- ctx.openDropdown();
366
- },
367
- onHoverOut: (e) => {
368
- childProps.onHoverOut?.(e);
369
- ctx.closeDropdown();
370
- },
371
- };
351
+ //
352
+ // Memoised, together with the clone below: a HoverCard re-renders on open /
353
+ // close and on every position update while open, and each of those rebuilt two
354
+ // closures and cloned a NEW trigger element, re-rendering the whole trigger
355
+ // subtree. `children` is a prop, so its identity survives HoverCard's own state
356
+ // churn; when nothing changed the memo returns the SAME element and React skips
357
+ // the subtree.
358
+ const handlers = React.useMemo<HoverHandlers>(
359
+ () =>
360
+ isWeb
361
+ ? {
362
+ onMouseEnter: (e) => {
363
+ childProps.onMouseEnter?.(e);
364
+ childProps.onHoverIn?.(e);
365
+ openDropdown();
366
+ },
367
+ onMouseLeave: (e) => {
368
+ childProps.onMouseLeave?.(e);
369
+ childProps.onHoverOut?.(e);
370
+ closeDropdown();
371
+ },
372
+ }
373
+ : {
374
+ onHoverIn: (e) => {
375
+ childProps.onHoverIn?.(e);
376
+ openDropdown();
377
+ },
378
+ onHoverOut: (e) => {
379
+ childProps.onHoverOut?.(e);
380
+ closeDropdown();
381
+ },
382
+ },
383
+ [childProps, openDropdown, closeDropdown],
384
+ );
372
385
 
373
386
  // Clone the child with the hover handlers + `target` slot sugar, then hand it to
374
387
  // `Popover.Target` (with `withPressToggle={false}` so it only attaches the
375
388
  // positioning reference ref, never a press toggle). The reference ref + width
376
389
  // handling all come from Popover's engine now.
377
- const hovered = React.cloneElement(child, {
378
- // `target` slot sugar layers UNDER the child's own props (the child's inline
379
- // props win — "explicit beats sugar").
380
- ...ctx.targetSlot,
381
- ...childProps,
382
- ...handlers,
383
- } as Partial<HoverHandlers> & React.Attributes);
390
+ const hovered = React.useMemo(
391
+ () =>
392
+ React.cloneElement(child, {
393
+ // `target` slot sugar layers UNDER the child's own props (the child's inline
394
+ // props win — "explicit beats sugar").
395
+ ...targetSlot,
396
+ ...childProps,
397
+ ...handlers,
398
+ } as Partial<HoverHandlers> & React.Attributes),
399
+ [child, childProps, targetSlot, handlers],
400
+ );
384
401
 
385
402
  return (
386
403
  <Popover.Target refProp={refProp} withPressToggle={false}>
@@ -282,6 +282,10 @@ const IndicatorBase = IndicatorContainer.styleable<IndicatorProps>(function Indi
282
282
  kind: "pulse",
283
283
  durationMs: DURATIONS.ambient,
284
284
  minOpacity: 0.45,
285
+ // Only a `processing` indicator pulses; without this gate every (static)
286
+ // indicator on screen scheduled a permanent compositor/UI-thread animation
287
+ // whose style is never spread.
288
+ enabled: Boolean(processing),
285
289
  });
286
290
  // One-shot scale-in entrance for the processing dot, via the shared `scale`
287
291
  // preset (`{ opacity: 0, scale: 0 }` + easing). `false` when not processing →
@@ -5,16 +5,15 @@ import {
5
5
  registerFocusable,
6
6
  styled,
7
7
  type TamaguiElement,
8
- useTheme,
9
8
  useWebRef,
10
- variableToString,
11
9
  withStaticProperties,
12
10
  } from "@knitui/core";
13
- import { useId } from "@knitui/hooks";
11
+ import { useCallbackRef, useId } from "@knitui/hooks";
14
12
 
15
13
  import { Box } from "../Box";
16
14
  import { webCursor } from "../internal/style-props";
17
15
  import { pick } from "../internal/styles";
16
+ import { themeColorToCssVar } from "../internal/theme-color-web";
18
17
  import { Text } from "../Text";
19
18
  import {
20
19
  DEFAULT_PLACEHOLDER_COLOR,
@@ -117,12 +116,20 @@ const StyledButtonInput = styled(Text, {
117
116
  type StyledInputProps = GetProps<typeof StyledInput>;
118
117
  type InputStyle = StyledInputProps["style"] & Record<`--${string}`, string | undefined>;
119
118
 
120
- const resolveThemeColor = (theme: ReturnType<typeof useTheme>, color: string) => {
121
- const themeKey = color.startsWith("$") ? color.slice(1) : color;
122
- const themeValue = themeKey ? theme[themeKey as keyof typeof theme] : undefined;
123
-
124
- return themeValue ? variableToString(themeValue) : color;
125
- };
119
+ /**
120
+ * Placeholder / selection colours as CSS custom properties, resolved ONCE at
121
+ * module scope.
122
+ *
123
+ * Both inputs are module constants (`"$color8"` / `"$blue5"`), and on web a
124
+ * `$token` maps to its CSS variable by pure string transform (see
125
+ * `theme-color-web.ts`) — the `var()` tracks the active theme by itself. So this
126
+ * needed no theme object, yet every `Input` used to call `useTheme()` for it,
127
+ * paying a `useThemeWithState` (useId + useRef + useReducer + a DEP-LESS
128
+ * `useEffect` that fires after EVERY render) plus a global theme-subscriber
129
+ * registration per mounted field — on every keystroke-driven re-render.
130
+ */
131
+ const PLACEHOLDER_COLOR_VAR = themeColorToCssVar(DEFAULT_PLACEHOLDER_COLOR);
132
+ const SELECTION_COLOR_VAR = themeColorToCssVar(DEFAULT_SELECTION_COLOR);
126
133
 
127
134
  const InputComponent = StyledInput.styleable<WebInputProps>((props, _forwardedRef) => {
128
135
  const {
@@ -187,7 +194,6 @@ const InputComponent = StyledInput.styleable<WebInputProps>((props, _forwardedRe
187
194
 
188
195
  const { ref, composedRef } = useWebRef<WebInputElement>(_forwardedRef);
189
196
  const [focused, setFocused] = React.useState(false);
190
- const theme = useTheme();
191
197
  const wrapperContext = React.useContext(InputWrapperContext);
192
198
  const generatedInputId = useId(id);
193
199
  const inputId = wrapperContext?.inputId || generatedInputId;
@@ -212,15 +218,24 @@ const InputComponent = StyledInput.styleable<WebInputProps>((props, _forwardedRe
212
218
  ? "off"
213
219
  : autoCapitalizeProp;
214
220
 
215
- // Handle selection changes
221
+ // Handle selection changes.
222
+ //
223
+ // `onSelectionChange` is held in a `useCallbackRef` (stable identity, always
224
+ // calls the latest version) and deliberately kept OUT of the effect deps:
225
+ // callers pass an inline arrow, so a fresh identity every render used to tear
226
+ // the DOM listener down and re-attach it on EVERY keystroke. `hasSelectionChange`
227
+ // gates attaching at all, so the "no handler = no listener" behaviour is kept
228
+ // while the listener itself now attaches once.
229
+ const selectionChangeRef = useCallbackRef(onSelectionChange);
230
+ const hasSelectionChange = Boolean(onSelectionChange);
216
231
  React.useEffect(() => {
217
- if (!onSelectionChange) return;
232
+ if (!hasSelectionChange) return;
218
233
 
219
234
  const node = ref.current;
220
235
  if (!node) return;
221
236
 
222
237
  const handleSelectionChange = () => {
223
- onSelectionChange({
238
+ selectionChangeRef({
224
239
  nativeEvent: {
225
240
  selection: {
226
241
  start: "selectionStart" in node ? (node.selectionStart ?? 0) : 0,
@@ -232,7 +247,7 @@ const InputComponent = StyledInput.styleable<WebInputProps>((props, _forwardedRe
232
247
 
233
248
  node.addEventListener("select", handleSelectionChange);
234
249
  return () => node.removeEventListener("select", handleSelectionChange);
235
- }, [onSelectionChange, ref]);
250
+ }, [hasSelectionChange, selectionChangeRef, ref]);
236
251
 
237
252
  // Sync selection prop
238
253
  React.useEffect(() => {
@@ -307,8 +322,8 @@ const InputComponent = StyledInput.styleable<WebInputProps>((props, _forwardedRe
307
322
  style && typeof style === "object" && !Array.isArray(style) ? style : undefined;
308
323
  const inputStyle: InputStyle = {
309
324
  ...(incomingStyle as object),
310
- "--t_placeholderColor": resolveThemeColor(theme, DEFAULT_PLACEHOLDER_COLOR),
311
- "--t_selectionColor": resolveThemeColor(theme, DEFAULT_SELECTION_COLOR),
325
+ "--t_placeholderColor": PLACEHOLDER_COLOR_VAR,
326
+ "--t_selectionColor": SELECTION_COLOR_VAR,
312
327
  };
313
328
 
314
329
  const inputHostProps = {