@knitui/components 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) 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/ActionIcon/ActionIcon.js.map +1 -1
  4. package/lib/commonjs/Alert/Alert.js +31 -11
  5. package/lib/commonjs/Alert/Alert.js.map +1 -1
  6. package/lib/commonjs/AngleSlider/AngleSlider.js +55 -17
  7. package/lib/commonjs/AngleSlider/AngleSlider.js.map +1 -1
  8. package/lib/commonjs/Autocomplete/Autocomplete.js +53 -33
  9. package/lib/commonjs/Autocomplete/Autocomplete.js.map +1 -1
  10. package/lib/commonjs/Avatar/Avatar.js.map +1 -1
  11. package/lib/commonjs/Badge/Badge.js +6 -9
  12. package/lib/commonjs/Badge/Badge.js.map +1 -1
  13. package/lib/commonjs/Button/Button.js +22 -6
  14. package/lib/commonjs/Button/Button.js.map +1 -1
  15. package/lib/commonjs/Card/Card.js +13 -4
  16. package/lib/commonjs/Card/Card.js.map +1 -1
  17. package/lib/commonjs/Checkbox/CheckIcon.js +10 -6
  18. package/lib/commonjs/Checkbox/CheckIcon.js.map +1 -1
  19. package/lib/commonjs/Checkbox/Checkbox.js +9 -2
  20. package/lib/commonjs/Checkbox/Checkbox.js.map +1 -1
  21. package/lib/commonjs/Chip/Chip.js +15 -16
  22. package/lib/commonjs/Chip/Chip.js.map +1 -1
  23. package/lib/commonjs/CloseButton/CloseButton.js +2 -2
  24. package/lib/commonjs/CloseButton/CloseButton.js.map +1 -1
  25. package/lib/commonjs/ColorInput/ColorInput.js +12 -4
  26. package/lib/commonjs/ColorInput/ColorInput.js.map +1 -1
  27. package/lib/commonjs/ColorPicker/ColorPicker.js +32 -24
  28. package/lib/commonjs/ColorPicker/ColorPicker.js.map +1 -1
  29. package/lib/commonjs/Combobox/Combobox.js +11 -6
  30. package/lib/commonjs/Combobox/Combobox.js.map +1 -1
  31. package/lib/commonjs/Combobox/OptionsDropdown.js +6 -2
  32. package/lib/commonjs/Combobox/OptionsDropdown.js.map +1 -1
  33. package/lib/commonjs/Group/Group.js +19 -11
  34. package/lib/commonjs/Group/Group.js.map +1 -1
  35. package/lib/commonjs/Highlight/Highlight.js +30 -10
  36. package/lib/commonjs/Highlight/Highlight.js.map +1 -1
  37. package/lib/commonjs/HoverCard/HoverCard.js +23 -10
  38. package/lib/commonjs/HoverCard/HoverCard.js.map +1 -1
  39. package/lib/commonjs/Indicator/Indicator.js +5 -1
  40. package/lib/commonjs/Indicator/Indicator.js.map +1 -1
  41. package/lib/commonjs/Input/Input.js +30 -12
  42. package/lib/commonjs/Input/Input.js.map +1 -1
  43. package/lib/commonjs/Input/shared.js +18 -8
  44. package/lib/commonjs/Input/shared.js.map +1 -1
  45. package/lib/commonjs/Loader/Loader.js +18 -10
  46. package/lib/commonjs/Loader/Loader.js.map +1 -1
  47. package/lib/commonjs/Menu/Menu.js +6 -7
  48. package/lib/commonjs/Menu/Menu.js.map +1 -1
  49. package/lib/commonjs/MultiSelect/MultiSelect.js +112 -47
  50. package/lib/commonjs/MultiSelect/MultiSelect.js.map +1 -1
  51. package/lib/commonjs/Notification/Notification.js +31 -11
  52. package/lib/commonjs/Notification/Notification.js.map +1 -1
  53. package/lib/commonjs/NumberFormatter/NumberFormatter.js +48 -11
  54. package/lib/commonjs/NumberFormatter/NumberFormatter.js.map +1 -1
  55. package/lib/commonjs/Paper/Paper.js +8 -8
  56. package/lib/commonjs/Paper/Paper.js.map +1 -1
  57. package/lib/commonjs/Pill/Pill.js +6 -8
  58. package/lib/commonjs/Pill/Pill.js.map +1 -1
  59. package/lib/commonjs/PinInput/PinInput.js.map +1 -1
  60. package/lib/commonjs/Progress/Progress.js +4 -1
  61. package/lib/commonjs/Progress/Progress.js.map +1 -1
  62. package/lib/commonjs/RollingNumber/RollingNumber.js +30 -13
  63. package/lib/commonjs/RollingNumber/RollingNumber.js.map +1 -1
  64. package/lib/commonjs/RollingNumber/rolling-number-utils.js +27 -5
  65. package/lib/commonjs/RollingNumber/rolling-number-utils.js.map +1 -1
  66. package/lib/commonjs/ScrollArea/ScrollArea.js +131 -41
  67. package/lib/commonjs/ScrollArea/ScrollArea.js.map +1 -1
  68. package/lib/commonjs/ScrollArea/ScrollArea.native.js +128 -40
  69. package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
  70. package/lib/commonjs/SegmentedControl/SegmentedControl.js +4 -1
  71. package/lib/commonjs/SegmentedControl/SegmentedControl.js.map +1 -1
  72. package/lib/commonjs/Select/Select.js +64 -35
  73. package/lib/commonjs/Select/Select.js.map +1 -1
  74. package/lib/commonjs/Skeleton/Skeleton.js +6 -2
  75. package/lib/commonjs/Skeleton/Skeleton.js.map +1 -1
  76. package/lib/commonjs/Slider/Slider.js +136 -83
  77. package/lib/commonjs/Slider/Slider.js.map +1 -1
  78. package/lib/commonjs/Spoiler/Spoiler.js +22 -2
  79. package/lib/commonjs/Spoiler/Spoiler.js.map +1 -1
  80. package/lib/commonjs/Stepper/Stepper.js +2 -2
  81. package/lib/commonjs/Stepper/Stepper.js.map +1 -1
  82. package/lib/commonjs/Switch/Switch.js +18 -7
  83. package/lib/commonjs/Switch/Switch.js.map +1 -1
  84. package/lib/commonjs/Table/Table.js +91 -28
  85. package/lib/commonjs/Table/Table.js.map +1 -1
  86. package/lib/commonjs/TableOfContents/TableOfContents.js +4 -1
  87. package/lib/commonjs/TableOfContents/TableOfContents.js.map +1 -1
  88. package/lib/commonjs/TagsInput/TagsInput.js +138 -55
  89. package/lib/commonjs/TagsInput/TagsInput.js.map +1 -1
  90. package/lib/commonjs/ThemeIcon/ThemeIcon.js.map +1 -1
  91. package/lib/commonjs/Title/Title.js.map +1 -1
  92. package/lib/commonjs/Tooltip/Tooltip.js +27 -5
  93. package/lib/commonjs/Tooltip/Tooltip.js.map +1 -1
  94. package/lib/commonjs/Transition/use-transition.js.map +1 -1
  95. package/lib/commonjs/Tree/Tree.js +4 -1
  96. package/lib/commonjs/Tree/Tree.js.map +1 -1
  97. package/lib/commonjs/Tree/tree-data.js +58 -23
  98. package/lib/commonjs/Tree/tree-data.js.map +1 -1
  99. package/lib/commonjs/Tree/use-tree.js +33 -4
  100. package/lib/commonjs/Tree/use-tree.js.map +1 -1
  101. package/lib/commonjs/TreeSelect/TreeSelect.js +70 -30
  102. package/lib/commonjs/TreeSelect/TreeSelect.js.map +1 -1
  103. package/lib/commonjs/Typography/Typography.js +10 -10
  104. package/lib/commonjs/Typography/Typography.js.map +1 -1
  105. package/lib/commonjs/UnstyledButton/UnstyledButton.js +8 -3
  106. package/lib/commonjs/UnstyledButton/UnstyledButton.js.map +1 -1
  107. package/lib/commonjs/VirtualList/VirtualList.js +71 -13
  108. package/lib/commonjs/VirtualList/VirtualList.js.map +1 -1
  109. package/lib/commonjs/floating/platform.js +28 -1
  110. package/lib/commonjs/floating/platform.js.map +1 -1
  111. package/lib/commonjs/floating/use-position.js +33 -1
  112. package/lib/commonjs/floating/use-position.js.map +1 -1
  113. package/lib/commonjs/internal/ControlIconProvider.js +20 -15
  114. package/lib/commonjs/internal/ControlIconProvider.js.map +1 -1
  115. package/lib/commonjs/internal/gradient-shared.js +9 -5
  116. package/lib/commonjs/internal/gradient-shared.js.map +1 -1
  117. package/lib/commonjs/internal/gradient.js +21 -9
  118. package/lib/commonjs/internal/gradient.js.map +1 -1
  119. package/lib/commonjs/internal/gradient.native.js +36 -10
  120. package/lib/commonjs/internal/gradient.native.js.map +1 -1
  121. package/lib/commonjs/internal/render-text-child.js +30 -2
  122. package/lib/commonjs/internal/render-text-child.js.map +1 -1
  123. package/lib/commonjs/internal/style-props.js +17 -5
  124. package/lib/commonjs/internal/style-props.js.map +1 -1
  125. package/lib/commonjs/internal/theme-color-web.js +46 -0
  126. package/lib/commonjs/internal/theme-color-web.js.map +1 -0
  127. package/lib/commonjs/internal/use-icon-color.js +33 -0
  128. package/lib/commonjs/internal/use-icon-color.js.map +1 -0
  129. package/lib/commonjs/internal/use-icon-color.native.js +23 -0
  130. package/lib/commonjs/internal/use-icon-color.native.js.map +1 -0
  131. package/lib/commonjs/internal/use-looping-animation.js +7 -3
  132. package/lib/commonjs/internal/use-looping-animation.js.map +1 -1
  133. package/lib/commonjs/internal/use-looping-animation.native.js +9 -1
  134. package/lib/commonjs/internal/use-looping-animation.native.js.map +1 -1
  135. package/lib/commonjs/internal/use-looping-animation.shared.js +33 -0
  136. package/lib/commonjs/internal/use-looping-animation.shared.js.map +1 -1
  137. package/lib/commonjs/internal/use-slot-text-wrapper.js +36 -5
  138. package/lib/commonjs/internal/use-slot-text-wrapper.js.map +1 -1
  139. package/lib/module/Accordion/Accordion.js +9 -5
  140. package/lib/module/Accordion/Accordion.js.map +1 -1
  141. package/lib/module/ActionIcon/ActionIcon.js.map +1 -1
  142. package/lib/module/Alert/Alert.js +31 -11
  143. package/lib/module/Alert/Alert.js.map +1 -1
  144. package/lib/module/AngleSlider/AngleSlider.js +55 -17
  145. package/lib/module/AngleSlider/AngleSlider.js.map +1 -1
  146. package/lib/module/Autocomplete/Autocomplete.js +54 -34
  147. package/lib/module/Autocomplete/Autocomplete.js.map +1 -1
  148. package/lib/module/Avatar/Avatar.js.map +1 -1
  149. package/lib/module/Badge/Badge.js +6 -9
  150. package/lib/module/Badge/Badge.js.map +1 -1
  151. package/lib/module/Button/Button.js +23 -7
  152. package/lib/module/Button/Button.js.map +1 -1
  153. package/lib/module/Card/Card.js +13 -4
  154. package/lib/module/Card/Card.js.map +1 -1
  155. package/lib/module/Checkbox/CheckIcon.js +9 -5
  156. package/lib/module/Checkbox/CheckIcon.js.map +1 -1
  157. package/lib/module/Checkbox/Checkbox.js +9 -2
  158. package/lib/module/Checkbox/Checkbox.js.map +1 -1
  159. package/lib/module/Chip/Chip.js +15 -16
  160. package/lib/module/Chip/Chip.js.map +1 -1
  161. package/lib/module/CloseButton/CloseButton.js +1 -1
  162. package/lib/module/CloseButton/CloseButton.js.map +1 -1
  163. package/lib/module/ColorInput/ColorInput.js +12 -4
  164. package/lib/module/ColorInput/ColorInput.js.map +1 -1
  165. package/lib/module/ColorPicker/ColorPicker.js +32 -24
  166. package/lib/module/ColorPicker/ColorPicker.js.map +1 -1
  167. package/lib/module/Combobox/Combobox.js +11 -6
  168. package/lib/module/Combobox/Combobox.js.map +1 -1
  169. package/lib/module/Combobox/OptionsDropdown.js +6 -2
  170. package/lib/module/Combobox/OptionsDropdown.js.map +1 -1
  171. package/lib/module/Group/Group.js +19 -11
  172. package/lib/module/Group/Group.js.map +1 -1
  173. package/lib/module/Highlight/Highlight.js +30 -10
  174. package/lib/module/Highlight/Highlight.js.map +1 -1
  175. package/lib/module/HoverCard/HoverCard.js +23 -10
  176. package/lib/module/HoverCard/HoverCard.js.map +1 -1
  177. package/lib/module/Indicator/Indicator.js +5 -1
  178. package/lib/module/Indicator/Indicator.js.map +1 -1
  179. package/lib/module/Input/Input.js +32 -14
  180. package/lib/module/Input/Input.js.map +1 -1
  181. package/lib/module/Input/shared.js +19 -9
  182. package/lib/module/Input/shared.js.map +1 -1
  183. package/lib/module/Loader/Loader.js +18 -10
  184. package/lib/module/Loader/Loader.js.map +1 -1
  185. package/lib/module/Menu/Menu.js +6 -7
  186. package/lib/module/Menu/Menu.js.map +1 -1
  187. package/lib/module/MultiSelect/MultiSelect.js +113 -48
  188. package/lib/module/MultiSelect/MultiSelect.js.map +1 -1
  189. package/lib/module/Notification/Notification.js +31 -11
  190. package/lib/module/Notification/Notification.js.map +1 -1
  191. package/lib/module/NumberFormatter/NumberFormatter.js +48 -11
  192. package/lib/module/NumberFormatter/NumberFormatter.js.map +1 -1
  193. package/lib/module/Paper/Paper.js +7 -8
  194. package/lib/module/Paper/Paper.js.map +1 -1
  195. package/lib/module/Pill/Pill.js +6 -8
  196. package/lib/module/Pill/Pill.js.map +1 -1
  197. package/lib/module/PinInput/PinInput.js.map +1 -1
  198. package/lib/module/Progress/Progress.js +4 -1
  199. package/lib/module/Progress/Progress.js.map +1 -1
  200. package/lib/module/RollingNumber/RollingNumber.js +30 -13
  201. package/lib/module/RollingNumber/RollingNumber.js.map +1 -1
  202. package/lib/module/RollingNumber/rolling-number-utils.js +27 -5
  203. package/lib/module/RollingNumber/rolling-number-utils.js.map +1 -1
  204. package/lib/module/ScrollArea/ScrollArea.js +133 -43
  205. package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
  206. package/lib/module/ScrollArea/ScrollArea.native.js +128 -40
  207. package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
  208. package/lib/module/SegmentedControl/SegmentedControl.js +4 -1
  209. package/lib/module/SegmentedControl/SegmentedControl.js.map +1 -1
  210. package/lib/module/Select/Select.js +65 -36
  211. package/lib/module/Select/Select.js.map +1 -1
  212. package/lib/module/Skeleton/Skeleton.js +6 -2
  213. package/lib/module/Skeleton/Skeleton.js.map +1 -1
  214. package/lib/module/Slider/Slider.js +137 -84
  215. package/lib/module/Slider/Slider.js.map +1 -1
  216. package/lib/module/Spoiler/Spoiler.js +23 -3
  217. package/lib/module/Spoiler/Spoiler.js.map +1 -1
  218. package/lib/module/Stepper/Stepper.js +1 -1
  219. package/lib/module/Stepper/Stepper.js.map +1 -1
  220. package/lib/module/Switch/Switch.js +18 -7
  221. package/lib/module/Switch/Switch.js.map +1 -1
  222. package/lib/module/Table/Table.js +91 -28
  223. package/lib/module/Table/Table.js.map +1 -1
  224. package/lib/module/TableOfContents/TableOfContents.js +5 -2
  225. package/lib/module/TableOfContents/TableOfContents.js.map +1 -1
  226. package/lib/module/TagsInput/TagsInput.js +140 -57
  227. package/lib/module/TagsInput/TagsInput.js.map +1 -1
  228. package/lib/module/ThemeIcon/ThemeIcon.js.map +1 -1
  229. package/lib/module/Title/Title.js.map +1 -1
  230. package/lib/module/Tooltip/Tooltip.js +27 -5
  231. package/lib/module/Tooltip/Tooltip.js.map +1 -1
  232. package/lib/module/Transition/use-transition.js.map +1 -1
  233. package/lib/module/Tree/Tree.js +4 -1
  234. package/lib/module/Tree/Tree.js.map +1 -1
  235. package/lib/module/Tree/tree-data.js +57 -23
  236. package/lib/module/Tree/tree-data.js.map +1 -1
  237. package/lib/module/Tree/use-tree.js +34 -5
  238. package/lib/module/Tree/use-tree.js.map +1 -1
  239. package/lib/module/TreeSelect/TreeSelect.js +72 -32
  240. package/lib/module/TreeSelect/TreeSelect.js.map +1 -1
  241. package/lib/module/Typography/Typography.js +9 -10
  242. package/lib/module/Typography/Typography.js.map +1 -1
  243. package/lib/module/UnstyledButton/UnstyledButton.js +9 -4
  244. package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
  245. package/lib/module/VirtualList/VirtualList.js +71 -13
  246. package/lib/module/VirtualList/VirtualList.js.map +1 -1
  247. package/lib/module/floating/platform.js +28 -1
  248. package/lib/module/floating/platform.js.map +1 -1
  249. package/lib/module/floating/use-position.js +33 -1
  250. package/lib/module/floating/use-position.js.map +1 -1
  251. package/lib/module/internal/ControlIconProvider.js +18 -13
  252. package/lib/module/internal/ControlIconProvider.js.map +1 -1
  253. package/lib/module/internal/gradient-shared.js +9 -5
  254. package/lib/module/internal/gradient-shared.js.map +1 -1
  255. package/lib/module/internal/gradient.js +22 -9
  256. package/lib/module/internal/gradient.js.map +1 -1
  257. package/lib/module/internal/gradient.native.js +36 -10
  258. package/lib/module/internal/gradient.native.js.map +1 -1
  259. package/lib/module/internal/render-text-child.js +30 -2
  260. package/lib/module/internal/render-text-child.js.map +1 -1
  261. package/lib/module/internal/style-props.js +16 -4
  262. package/lib/module/internal/style-props.js.map +1 -1
  263. package/lib/module/internal/theme-color-web.js +42 -0
  264. package/lib/module/internal/theme-color-web.js.map +1 -0
  265. package/lib/module/internal/use-icon-color.js +29 -0
  266. package/lib/module/internal/use-icon-color.js.map +1 -0
  267. package/lib/module/internal/use-icon-color.native.js +19 -0
  268. package/lib/module/internal/use-icon-color.native.js.map +1 -0
  269. package/lib/module/internal/use-looping-animation.js +8 -4
  270. package/lib/module/internal/use-looping-animation.js.map +1 -1
  271. package/lib/module/internal/use-looping-animation.native.js +10 -2
  272. package/lib/module/internal/use-looping-animation.native.js.map +1 -1
  273. package/lib/module/internal/use-looping-animation.shared.js +31 -0
  274. package/lib/module/internal/use-looping-animation.shared.js.map +1 -1
  275. package/lib/module/internal/use-slot-text-wrapper.js +37 -5
  276. package/lib/module/internal/use-slot-text-wrapper.js.map +1 -1
  277. package/lib/typescript/Accordion/Accordion.d.ts +11 -11
  278. package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
  279. package/lib/typescript/ActionIcon/ActionIcon.d.ts +7 -7
  280. package/lib/typescript/ActionIcon/ActionIcon.d.ts.map +1 -1
  281. package/lib/typescript/Alert/Alert.d.ts +7 -7
  282. package/lib/typescript/Alert/Alert.d.ts.map +1 -1
  283. package/lib/typescript/Anchor/Anchor.d.ts +3 -3
  284. package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
  285. package/lib/typescript/Autocomplete/Autocomplete.d.ts +16 -42
  286. package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
  287. package/lib/typescript/Avatar/Avatar.d.ts +21 -21
  288. package/lib/typescript/Avatar/Avatar.d.ts.map +1 -1
  289. package/lib/typescript/Badge/Badge.d.ts +7 -7
  290. package/lib/typescript/Badge/Badge.d.ts.map +1 -1
  291. package/lib/typescript/Button/Button.d.ts +7 -7
  292. package/lib/typescript/Button/Button.d.ts.map +1 -1
  293. package/lib/typescript/Card/Card.d.ts.map +1 -1
  294. package/lib/typescript/Checkbox/CheckIcon.d.ts.map +1 -1
  295. package/lib/typescript/Checkbox/Checkbox.d.ts.map +1 -1
  296. package/lib/typescript/Chip/Chip.d.ts.map +1 -1
  297. package/lib/typescript/CloseButton/CloseButton.d.ts +7 -7
  298. package/lib/typescript/ColorInput/ColorInput.d.ts.map +1 -1
  299. package/lib/typescript/ColorPicker/ColorPicker.d.ts.map +1 -1
  300. package/lib/typescript/Combobox/Combobox.d.ts +2 -2
  301. package/lib/typescript/Combobox/Combobox.d.ts.map +1 -1
  302. package/lib/typescript/Combobox/OptionsDropdown.d.ts.map +1 -1
  303. package/lib/typescript/Combobox/index.d.ts +2 -2
  304. package/lib/typescript/Dialog/Dialog.d.ts +6 -6
  305. package/lib/typescript/Fieldset/Fieldset.d.ts +7 -7
  306. package/lib/typescript/FileButton/FileButton.types.d.ts.map +1 -1
  307. package/lib/typescript/Flex/Flex.d.ts +3 -3
  308. package/lib/typescript/Group/Group.d.ts +3 -3
  309. package/lib/typescript/Group/Group.d.ts.map +1 -1
  310. package/lib/typescript/Highlight/Highlight.d.ts.map +1 -1
  311. package/lib/typescript/HoverCard/HoverCard.d.ts +1 -1
  312. package/lib/typescript/HoverCard/HoverCard.d.ts.map +1 -1
  313. package/lib/typescript/Image/Image.d.ts +14 -14
  314. package/lib/typescript/Image/createImage.d.ts +17 -17
  315. package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
  316. package/lib/typescript/Input/Input.d.ts +13 -13
  317. package/lib/typescript/Input/Input.d.ts.map +1 -1
  318. package/lib/typescript/Input/Input.native.d.ts +16 -16
  319. package/lib/typescript/Input/shared.d.ts +10 -10
  320. package/lib/typescript/Input/shared.d.ts.map +1 -1
  321. package/lib/typescript/InputBase/InputBase.d.ts +2 -2
  322. package/lib/typescript/Kbd/Kbd.d.ts +1 -1
  323. package/lib/typescript/Loader/Loader.d.ts.map +1 -1
  324. package/lib/typescript/Mark/Mark.d.ts +1 -1
  325. package/lib/typescript/MaskInput/MaskInput.d.ts +2 -2
  326. package/lib/typescript/Menu/Menu.d.ts +1 -1
  327. package/lib/typescript/Menu/Menu.d.ts.map +1 -1
  328. package/lib/typescript/Modal/Modal.d.ts +6 -6
  329. package/lib/typescript/MultiSelect/MultiSelect.d.ts +15 -60
  330. package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
  331. package/lib/typescript/NavLink/NavLink.d.ts +7 -7
  332. package/lib/typescript/Notification/Notification.d.ts.map +1 -1
  333. package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
  334. package/lib/typescript/NumberInput/NumberInput.d.ts +5 -5
  335. package/lib/typescript/Paper/Paper.d.ts +8 -40
  336. package/lib/typescript/Paper/Paper.d.ts.map +1 -1
  337. package/lib/typescript/PasswordInput/PasswordInput.d.ts +11 -11
  338. package/lib/typescript/Pill/Pill.d.ts +15 -15
  339. package/lib/typescript/Pill/Pill.d.ts.map +1 -1
  340. package/lib/typescript/PinInput/PinInput.d.ts +13 -13
  341. package/lib/typescript/PinInput/PinInput.d.ts.map +1 -1
  342. package/lib/typescript/Popover/Popover.shared.d.ts +3 -3
  343. package/lib/typescript/Progress/Progress.d.ts.map +1 -1
  344. package/lib/typescript/Radio/Radio.d.ts +8 -8
  345. package/lib/typescript/RollingNumber/RollingNumber.d.ts.map +1 -1
  346. package/lib/typescript/RollingNumber/rolling-number-utils.d.ts.map +1 -1
  347. package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
  348. package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
  349. package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  350. package/lib/typescript/Select/Select.d.ts +20 -49
  351. package/lib/typescript/Select/Select.d.ts.map +1 -1
  352. package/lib/typescript/Separator/Separator.d.ts +9 -9
  353. package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
  354. package/lib/typescript/Slider/Slider.d.ts.map +1 -1
  355. package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
  356. package/lib/typescript/Switch/Switch.d.ts +14 -3
  357. package/lib/typescript/Switch/Switch.d.ts.map +1 -1
  358. package/lib/typescript/Table/Table.d.ts +18 -12
  359. package/lib/typescript/Table/Table.d.ts.map +1 -1
  360. package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
  361. package/lib/typescript/Tabs/Tabs.d.ts +12 -12
  362. package/lib/typescript/TagsInput/TagsInput.d.ts +13 -47
  363. package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
  364. package/lib/typescript/TextInput/TextInput.d.ts +2 -2
  365. package/lib/typescript/Textarea/Textarea.d.ts +2 -2
  366. package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +7 -7
  367. package/lib/typescript/ThemeIcon/ThemeIcon.d.ts.map +1 -1
  368. package/lib/typescript/Title/Title.d.ts +3 -3
  369. package/lib/typescript/Title/Title.d.ts.map +1 -1
  370. package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
  371. package/lib/typescript/Transition/use-transition.d.ts.map +1 -1
  372. package/lib/typescript/Tree/Tree.d.ts +1 -1
  373. package/lib/typescript/Tree/Tree.d.ts.map +1 -1
  374. package/lib/typescript/Tree/tree-data.d.ts +7 -0
  375. package/lib/typescript/Tree/tree-data.d.ts.map +1 -1
  376. package/lib/typescript/Tree/use-tree.d.ts +5 -0
  377. package/lib/typescript/Tree/use-tree.d.ts.map +1 -1
  378. package/lib/typescript/TreeSelect/TreeSelect.d.ts +21 -47
  379. package/lib/typescript/TreeSelect/TreeSelect.d.ts.map +1 -1
  380. package/lib/typescript/Typography/Typography.d.ts +8 -8
  381. package/lib/typescript/Typography/Typography.d.ts.map +1 -1
  382. package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  383. package/lib/typescript/VirtualList/VirtualList.d.ts.map +1 -1
  384. package/lib/typescript/floating/platform.d.ts +11 -0
  385. package/lib/typescript/floating/platform.d.ts.map +1 -1
  386. package/lib/typescript/floating/use-position.d.ts.map +1 -1
  387. package/lib/typescript/internal/ControlIconProvider.d.ts +1 -1
  388. package/lib/typescript/internal/ControlIconProvider.d.ts.map +1 -1
  389. package/lib/typescript/internal/gradient-shared.d.ts +7 -4
  390. package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
  391. package/lib/typescript/internal/gradient.d.ts +18 -0
  392. package/lib/typescript/internal/gradient.d.ts.map +1 -1
  393. package/lib/typescript/internal/gradient.native.d.ts.map +1 -1
  394. package/lib/typescript/internal/render-text-child.d.ts +11 -0
  395. package/lib/typescript/internal/render-text-child.d.ts.map +1 -1
  396. package/lib/typescript/internal/style-props.d.ts +17 -0
  397. package/lib/typescript/internal/style-props.d.ts.map +1 -1
  398. package/lib/typescript/internal/theme-color-web.d.ts +2 -0
  399. package/lib/typescript/internal/theme-color-web.d.ts.map +1 -0
  400. package/lib/typescript/internal/use-icon-color.d.ts +25 -0
  401. package/lib/typescript/internal/use-icon-color.d.ts.map +1 -0
  402. package/lib/typescript/internal/use-icon-color.native.d.ts +11 -0
  403. package/lib/typescript/internal/use-icon-color.native.d.ts.map +1 -0
  404. package/lib/typescript/internal/use-looping-animation.d.ts.map +1 -1
  405. package/lib/typescript/internal/use-looping-animation.native.d.ts.map +1 -1
  406. package/lib/typescript/internal/use-looping-animation.shared.d.ts +30 -3
  407. package/lib/typescript/internal/use-looping-animation.shared.d.ts.map +1 -1
  408. package/lib/typescript/internal/use-slot-text-wrapper.d.ts +0 -20
  409. package/lib/typescript/internal/use-slot-text-wrapper.d.ts.map +1 -1
  410. package/package.json +13 -13
  411. package/src/Accordion/Accordion.tsx +6 -2
  412. package/src/ActionIcon/ActionIcon.tsx +1 -8
  413. package/src/Alert/Alert.tsx +44 -29
  414. package/src/AngleSlider/AngleSlider.tsx +73 -21
  415. package/src/Autocomplete/Autocomplete.tsx +74 -55
  416. package/src/Avatar/Avatar.tsx +1 -7
  417. package/src/Badge/Badge.tsx +7 -16
  418. package/src/Button/Button.tsx +18 -11
  419. package/src/Card/Card.tsx +11 -3
  420. package/src/Checkbox/CheckIcon.tsx +9 -5
  421. package/src/Checkbox/Checkbox.tsx +8 -1
  422. package/src/Chip/Chip.tsx +15 -22
  423. package/src/CloseButton/CloseButton.tsx +1 -1
  424. package/src/ColorInput/ColorInput.tsx +15 -4
  425. package/src/ColorPicker/ColorPicker.tsx +39 -27
  426. package/src/Combobox/Combobox.tsx +10 -6
  427. package/src/Combobox/OptionsDropdown.tsx +6 -1
  428. package/src/FileButton/FileButton.types.ts +2 -11
  429. package/src/Group/Group.tsx +21 -10
  430. package/src/Highlight/Highlight.tsx +42 -7
  431. package/src/HoverCard/HoverCard.tsx +48 -31
  432. package/src/Indicator/Indicator.tsx +4 -0
  433. package/src/Input/Input.tsx +31 -16
  434. package/src/Input/shared.tsx +20 -4
  435. package/src/Loader/Loader.tsx +14 -4
  436. package/src/Menu/Menu.tsx +6 -8
  437. package/src/MultiSelect/MultiSelect.tsx +140 -85
  438. package/src/Notification/Notification.tsx +43 -22
  439. package/src/NumberFormatter/NumberFormatter.tsx +66 -11
  440. package/src/Paper/Paper.tsx +8 -6
  441. package/src/Pill/Pill.tsx +6 -9
  442. package/src/PinInput/PinInput.tsx +1 -8
  443. package/src/Progress/Progress.tsx +3 -0
  444. package/src/RollingNumber/RollingNumber.tsx +43 -21
  445. package/src/RollingNumber/rolling-number-utils.ts +28 -5
  446. package/src/ScrollArea/ScrollArea.native.tsx +142 -49
  447. package/src/ScrollArea/ScrollArea.tsx +140 -47
  448. package/src/SegmentedControl/SegmentedControl.tsx +12 -1
  449. package/src/Select/Select.tsx +90 -67
  450. package/src/Skeleton/Skeleton.tsx +5 -1
  451. package/src/Slider/Slider.tsx +157 -61
  452. package/src/Spoiler/Spoiler.tsx +22 -10
  453. package/src/Stepper/Stepper.tsx +1 -1
  454. package/src/Switch/Switch.tsx +20 -9
  455. package/src/Table/Table.tsx +89 -33
  456. package/src/TableOfContents/TableOfContents.tsx +5 -1
  457. package/src/TagsInput/TagsInput.tsx +193 -141
  458. package/src/ThemeIcon/ThemeIcon.tsx +1 -8
  459. package/src/Title/Title.tsx +1 -13
  460. package/src/Tooltip/Tooltip.tsx +33 -7
  461. package/src/Transition/use-transition.ts +1 -6
  462. package/src/Tree/Tree.tsx +4 -1
  463. package/src/Tree/tree-data.ts +74 -26
  464. package/src/Tree/use-tree.ts +52 -7
  465. package/src/TreeSelect/TreeSelect.tsx +96 -64
  466. package/src/Typography/Typography.tsx +9 -8
  467. package/src/UnstyledButton/UnstyledButton.tsx +12 -5
  468. package/src/VirtualList/VirtualList.tsx +82 -18
  469. package/src/floating/platform.ts +29 -1
  470. package/src/floating/use-position.tsx +38 -1
  471. package/src/internal/ControlIconProvider.tsx +17 -12
  472. package/src/internal/gradient-shared.ts +9 -5
  473. package/src/internal/gradient.native.tsx +29 -5
  474. package/src/internal/gradient.tsx +22 -7
  475. package/src/internal/render-text-child.tsx +30 -2
  476. package/src/internal/style-props.ts +20 -4
  477. package/src/internal/theme-color-web.ts +40 -0
  478. package/src/internal/use-icon-color.native.ts +17 -0
  479. package/src/internal/use-icon-color.ts +26 -0
  480. package/src/internal/use-looping-animation.native.tsx +10 -2
  481. package/src/internal/use-looping-animation.shared.ts +38 -3
  482. package/src/internal/use-looping-animation.tsx +8 -4
  483. package/src/internal/use-slot-text-wrapper.tsx +39 -5
package/src/Menu/Menu.tsx CHANGED
@@ -15,6 +15,7 @@ import { useOverlayChrome } from "../internal/overlay-chrome";
15
15
  import { renderTextChild } from "../internal/render-text-child";
16
16
  import { focusRingStyle, hoverProps, type shadowVariant, webCursor } from "../internal/style-props";
17
17
  import { type SlotStyles } from "../internal/styles";
18
+ import { useSlotTextWrapper } from "../internal/use-slot-text-wrapper";
18
19
  import {
19
20
  Popover,
20
21
  type PopoverArrowPosition,
@@ -502,14 +503,11 @@ const MenuItemComponent = MenuItemFrame.styleable<MenuItemProps>(function MenuIt
502
503
 
503
504
  // Bind the `itemLabel` slot onto the text wrapper so `renderTextChild` (which
504
505
  // only passes `children`) carries the sugar onto the auto-wrapped label text.
505
- const itemLabelSlot = ctx.slots.itemLabel;
506
- const LabelWrapper = React.useMemo(
507
- () =>
508
- function MenuItemLabelSlot(labelProps: { children: React.ReactNode }) {
509
- return <MenuItemLabel {...itemLabelSlot} {...labelProps} />;
510
- },
511
- [itemLabelSlot],
512
- );
506
+ // The shared hook compares the slot props by VALUE — the slot arrives off menu
507
+ // context, whose `slots` object is rebuilt whenever the caller passes an inline
508
+ // `styles` literal, so an identity-keyed memo handed every item a new component
509
+ // TYPE and remounted every item label on each menu render.
510
+ const LabelWrapper = useSlotTextWrapper(MenuItemLabel, ctx.slots.itemLabel);
513
511
 
514
512
  const sectionSlot = ctx.slots.itemSection;
515
513
 
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import { withStaticProperties } from "@knitui/core";
4
- import { useId, useUncontrolled } from "@knitui/hooks";
4
+ import { useCallbackRef, useId, useUncontrolled } from "@knitui/hooks";
5
5
 
6
6
  import {
7
7
  Combobox,
@@ -146,12 +146,6 @@ interface MultiSelectContextValue {
146
146
  clearButtonProps?: Partial<ComboboxClearButtonProps>;
147
147
  /** Coexistence mode for the clear button + right section. */
148
148
  clearSectionMode?: "clear" | "default" | "rightSection" | "both";
149
- /** Trigger props the sugar wrapper assembled (chrome, aria, ref). */
150
- triggerProps?: Partial<MultiSelectInputProps> & {
151
- placeholder?: string;
152
- id?: string;
153
- ref?: React.Ref<MultiSelectRef>;
154
- };
155
149
  /** Remove a single value (pill remove / Backspace). */
156
150
  removeValue: (value: string) => void;
157
151
  // Event/behaviour handlers consumed by MultiSelect.Trigger.
@@ -173,6 +167,51 @@ const useMultiSelectContext = (): MultiSelectContextValue => {
173
167
  return ctx;
174
168
  };
175
169
 
170
+ /**
171
+ * Trigger props the sugar wrapper assembled (chrome, aria, ref). Rebuilt every
172
+ * render (`...inputProps` is a rest spread, so its identity can never be
173
+ * preserved), which is why it rides its OWN context: `MultiSelect.Trigger` is the
174
+ * only consumer, while the option rows consume `MultiSelectContext`.
175
+ */
176
+ type MultiSelectFunneledTriggerProps = Partial<MultiSelectInputProps> & {
177
+ placeholder?: string;
178
+ id?: string;
179
+ ref?: React.Ref<MultiSelectRef>;
180
+ };
181
+
182
+ const MultiSelectTriggerPropsContext = React.createContext<
183
+ MultiSelectFunneledTriggerProps | undefined
184
+ >(undefined);
185
+
186
+ /** Shared empty funnel for the composable path (no sugar wrapper above). */
187
+ const EMPTY_TRIGGER_PROPS: MultiSelectFunneledTriggerProps = {};
188
+
189
+ /**
190
+ * The slice of Root state a PILL needs — deliberately WITHOUT `search`, so typing
191
+ * in the field cannot re-render the selected-value pills through context. The
192
+ * search text lives on `MultiSelectContext`, which the trigger/field consume; the
193
+ * pills subscribe here instead and `React.memo` on `{ value }` then actually holds.
194
+ */
195
+ interface MultiSelectPillContextValue {
196
+ lockup: ReturnType<typeof getOptionsLockup>;
197
+ pillSize: ReturnType<typeof toEmbeddedControlSize>;
198
+ disabled?: boolean;
199
+ readOnly?: boolean;
200
+ renderPill?: ComboboxRenderPill;
201
+ styles?: SlotStyles<MultiSelectStyles>;
202
+ removeValue: (value: string) => void;
203
+ }
204
+
205
+ const MultiSelectPillContext = React.createContext<MultiSelectPillContextValue | null>(null);
206
+
207
+ const useMultiSelectPillContext = (): MultiSelectPillContextValue => {
208
+ const ctx = React.useContext(MultiSelectPillContext);
209
+ if (!ctx) {
210
+ throw new Error("MultiSelect.Pill must be rendered inside <MultiSelect.Root>");
211
+ }
212
+ return ctx;
213
+ };
214
+
176
215
  /* -------------------------------------------------------------------------- */
177
216
  /* MultiSelect.Root — the values / search / active-option state machine */
178
217
  /* -------------------------------------------------------------------------- */
@@ -277,7 +316,7 @@ export interface MultiSelectRootProps {
277
316
  * render `<MultiSelect.Trigger>` with your own props instead.
278
317
  * @internal
279
318
  */
280
- __triggerProps?: MultiSelectContextValue["triggerProps"];
319
+ __triggerProps?: MultiSelectFunneledTriggerProps;
281
320
  }
282
321
 
283
322
  function MultiSelectRoot(props: MultiSelectRootProps) {
@@ -398,41 +437,33 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
398
437
  }
399
438
  }, [flatOptions]);
400
439
 
401
- const handleSubmit = React.useCallback(
402
- (optionValue: string) => {
403
- const option = lockup[optionValue];
404
- if (!option || option.disabled) return;
405
- onOptionSubmit?.(optionValue);
406
- if (_value.includes(optionValue)) {
407
- setValue(_value.filter((v) => v !== optionValue));
408
- onRemove?.(optionValue);
409
- } else if (_value.length < maxValues) {
410
- setValue([..._value, optionValue]);
411
- } else {
412
- onMaxValues?.();
413
- }
414
- if (clearSearchOnChange) setSearch("");
415
- },
416
- [
417
- lockup,
418
- onOptionSubmit,
419
- _value,
420
- maxValues,
421
- setValue,
422
- onRemove,
423
- onMaxValues,
424
- setSearch,
425
- clearSearchOnChange,
426
- ],
427
- );
428
-
429
- const removeValue = React.useCallback(
430
- (optionValue: string) => {
440
+ // Every handler in this Root is `useCallbackRef`-stable (identity fixed, latest
441
+ // closure). That is what lets the context memo below actually HIT — with fresh
442
+ // closures it either had to be invalidated every render (re-rendering every option
443
+ // row, since context propagation walks past `React.memo`) or it would have served
444
+ // stale callbacks. `handleSubmit` additionally lands on `<Combobox onOptionSubmit>`,
445
+ // a dep of Combobox's OWN context memo, so churn there hit every `Combobox.Option`.
446
+ const handleSubmit = useCallbackRef((optionValue: string) => {
447
+ const option = lockup[optionValue];
448
+ if (!option || option.disabled) return;
449
+ onOptionSubmit?.(optionValue);
450
+ if (_value.includes(optionValue)) {
431
451
  setValue(_value.filter((v) => v !== optionValue));
432
452
  onRemove?.(optionValue);
433
- },
434
- [setValue, _value, onRemove],
435
- );
453
+ } else if (_value.length < maxValues) {
454
+ setValue([..._value, optionValue]);
455
+ } else {
456
+ onMaxValues?.();
457
+ }
458
+ if (clearSearchOnChange) setSearch("");
459
+ });
460
+
461
+ // Stable so each pill's `onRemove` closure is stable too (it used to depend on
462
+ // `_value`, giving every pill a fresh callback on every selection change).
463
+ const removeValue = useCallbackRef((optionValue: string) => {
464
+ setValue(_value.filter((v) => v !== optionValue));
465
+ onRemove?.(optionValue);
466
+ });
436
467
 
437
468
  const moveActive = (direction: 1 | -1) => {
438
469
  if (flatOptions.length === 0) return;
@@ -446,7 +477,7 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
446
477
  setActiveValue(flatOptions[nextIndex].value);
447
478
  };
448
479
 
449
- const handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
480
+ const handleKeyDown = useCallbackRef<[React.KeyboardEvent<HTMLInputElement>], void>((event) => {
450
481
  if (disabled || readOnly) return;
451
482
  switch (event.key) {
452
483
  case "ArrowDown":
@@ -489,38 +520,38 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
489
520
  break;
490
521
  }
491
522
  onKeyDown?.(event);
492
- };
523
+ });
493
524
 
494
- const handleChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {
525
+ const handleChange = useCallbackRef<[React.ChangeEvent<HTMLInputElement>], void>((event) => {
495
526
  setSearch(event.currentTarget.value);
496
527
  combobox.openDropdown();
497
528
  if (selectFirstOptionOnChange) selectFirstPending.current = true;
498
- };
529
+ });
499
530
 
500
- const handleFocus: React.FocusEventHandler<HTMLInputElement> = (event) => {
531
+ const handleFocus = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
501
532
  if (searchable) combobox.openDropdown();
502
533
  onFocus?.(event);
503
- };
534
+ });
504
535
 
505
- const handleBlur: React.FocusEventHandler<HTMLInputElement> = (event) => {
536
+ const handleBlur = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
506
537
  combobox.closeDropdown();
507
538
  setSearch("");
508
539
  onBlur?.(event);
509
- };
540
+ });
510
541
 
511
- const handleFieldClick = React.useCallback(() => {
542
+ const handleFieldClick = useCallbackRef(() => {
512
543
  if (searchable) {
513
544
  combobox.openDropdown();
514
545
  } else {
515
546
  combobox.toggleDropdown();
516
547
  }
517
- }, [searchable, combobox]);
548
+ });
518
549
 
519
- const handleClear = React.useCallback(() => {
550
+ const handleClear = useCallbackRef(() => {
520
551
  onClear?.();
521
552
  setValue([]);
522
553
  setSearch("");
523
- }, [onClear, setValue, setSearch]);
554
+ });
524
555
 
525
556
  const canClear = clearable && _value.length > 0 && !disabled && !readOnly;
526
557
 
@@ -550,7 +581,6 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
550
581
  styles,
551
582
  clearButtonProps,
552
583
  clearSectionMode,
553
- triggerProps: __triggerProps,
554
584
  removeValue,
555
585
  onClear: handleClear,
556
586
  onChangeText: handleChange,
@@ -559,9 +589,9 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
559
589
  onBlur: handleBlur,
560
590
  onFieldClick: handleFieldClick,
561
591
  }),
562
- // handlers are recreated each render (they close over render-scoped state); the
563
- // context value is intentionally not stable, mirroring the original component.
564
- /* eslint-disable-next-line react-hooks/exhaustive-deps */
592
+ // Deps are COMPLETE: every handler above is `useCallbackRef`-stable, so this memo
593
+ // genuinely hits. `__triggerProps` is deliberately absent — it rides its own
594
+ // context (it is rebuilt every render and only the Trigger reads it).
565
595
  [
566
596
  combobox,
567
597
  dropdownId,
@@ -587,34 +617,50 @@ function MultiSelectRoot(props: MultiSelectRootProps) {
587
617
  styles,
588
618
  clearButtonProps,
589
619
  clearSectionMode,
590
- __triggerProps,
620
+ removeValue,
621
+ handleClear,
622
+ handleChange,
623
+ handleKeyDown,
624
+ handleFocus,
625
+ handleBlur,
626
+ handleFieldClick,
591
627
  ],
592
628
  );
593
629
 
630
+ // Pill-only slice: no `search`, so typing cannot re-render the pills.
631
+ const pillCtx = React.useMemo<MultiSelectPillContextValue>(
632
+ () => ({ lockup, pillSize, disabled, readOnly, renderPill, styles, removeValue }),
633
+ [lockup, pillSize, disabled, readOnly, renderPill, styles, removeValue],
634
+ );
635
+
594
636
  const s = slotStyles<MultiSelectStyles>(styles, MULTISELECT_SLOT_KEYS, "MultiSelect");
595
637
 
596
638
  return (
597
639
  <MultiSelectContext.Provider value={ctx}>
598
- <Combobox
599
- position="bottom"
600
- width="target"
601
- // Deprecated `comboboxProps` alias merged OVER the `root` slot sugar
602
- // ("explicit beats sugar").
603
- {...s.merge("root", comboboxProps)}
604
- store={combobox}
605
- onOptionSubmit={handleSubmit}
606
- size={size}
607
- readOnly={readOnly}
608
- >
609
- {children}
610
- </Combobox>
611
- <Combobox.HiddenInput
612
- name={hiddenInputName}
613
- form={form}
614
- value={_value}
615
- valuesDivider={hiddenInputValuesDivider}
616
- disabled={disabled}
617
- />
640
+ <MultiSelectPillContext.Provider value={pillCtx}>
641
+ <MultiSelectTriggerPropsContext.Provider value={__triggerProps}>
642
+ <Combobox
643
+ position="bottom"
644
+ width="target"
645
+ // Deprecated `comboboxProps` alias merged OVER the `root` slot sugar
646
+ // ("explicit beats sugar").
647
+ {...s.merge("root", comboboxProps)}
648
+ store={combobox}
649
+ onOptionSubmit={handleSubmit}
650
+ size={size}
651
+ readOnly={readOnly}
652
+ >
653
+ {children}
654
+ </Combobox>
655
+ <Combobox.HiddenInput
656
+ name={hiddenInputName}
657
+ form={form}
658
+ value={_value}
659
+ valuesDivider={hiddenInputValuesDivider}
660
+ disabled={disabled}
661
+ />
662
+ </MultiSelectTriggerPropsContext.Provider>
663
+ </MultiSelectPillContext.Provider>
618
664
  </MultiSelectContext.Provider>
619
665
  );
620
666
  }
@@ -628,11 +674,20 @@ export interface MultiSelectPillProps extends Partial<PillProps> {
628
674
  value: string;
629
675
  }
630
676
 
631
- function MultiSelectPill(props: MultiSelectPillProps) {
632
- const ctx = useMultiSelectContext();
677
+ /**
678
+ * Memoized so typing in the field doesn't re-render the whole pill row. Two things
679
+ * make the memo actually hold: the pill subscribes to `MultiSelectPillContext`
680
+ * (which carries no `search`) rather than the Root context, and `removeValue` is
681
+ * `useCallbackRef`-stable — previously each pill got a brand-new `onRemove` closure
682
+ * on every render, so keystroke latency scaled with the number of selected values.
683
+ */
684
+ const MultiSelectPill = React.memo(function MultiSelectPill(props: MultiSelectPillProps) {
685
+ const ctx = useMultiSelectPillContext();
686
+ const { removeValue } = ctx;
633
687
  const s = slotStyles<MultiSelectStyles>(ctx.styles, MULTISELECT_SLOT_KEYS, "MultiSelect");
634
688
  const { value: itemValue, children, ...rest } = props;
635
689
  const option = ctx.lockup[itemValue];
690
+ const handleRemove = React.useCallback(() => removeValue(itemValue), [removeValue, itemValue]);
636
691
 
637
692
  // A custom `renderPill` REPLACES the built-in chip (Mantine parity).
638
693
  if (ctx.renderPill) {
@@ -641,7 +696,7 @@ function MultiSelectPill(props: MultiSelectPillProps) {
641
696
  {ctx.renderPill({
642
697
  option: option ?? { value: itemValue, label: itemValue },
643
698
  value: itemValue,
644
- onRemove: () => ctx.removeValue(itemValue),
699
+ onRemove: handleRemove,
645
700
  disabled: ctx.disabled,
646
701
  })}
647
702
  </>
@@ -655,13 +710,13 @@ function MultiSelectPill(props: MultiSelectPillProps) {
655
710
  size={ctx.pillSize}
656
711
  withRemoveButton={!ctx.readOnly && !option?.disabled}
657
712
  disabled={ctx.disabled}
658
- onRemove={() => ctx.removeValue(itemValue)}
713
+ onRemove={handleRemove}
659
714
  {...rest}
660
715
  >
661
716
  {children ?? option?.label ?? itemValue}
662
717
  </Pill>
663
718
  );
664
- }
719
+ });
665
720
 
666
721
  /* -------------------------------------------------------------------------- */
667
722
  /* MultiSelect.Pills — the pill row wrapper (`Pill.Group`) */
@@ -711,7 +766,7 @@ const MultiSelectTrigger = React.forwardRef<MultiSelectRef, MultiSelectTriggerPr
711
766
 
712
767
  // The sugar `<MultiSelect>` wrapper funnels its chrome props + ref through
713
768
  // context so the composable and sugar callers resolve to the same trigger.
714
- const funneled = ctx.triggerProps ?? {};
769
+ const funneled = React.useContext(MultiSelectTriggerPropsContext) ?? EMPTY_TRIGGER_PROPS;
715
770
  const {
716
771
  placeholder: funneledPlaceholder,
717
772
  id: funneledId,
@@ -1030,7 +1085,7 @@ const MultiSelectComponent = React.forwardRef<MultiSelectRef, MultiSelectProps>(
1030
1085
  // The remaining chrome props are funneled to `MultiSelect.Trigger` via Root
1031
1086
  // context so the sugar path and the composable path converge on the same
1032
1087
  // trigger element.
1033
- const triggerProps: MultiSelectContextValue["triggerProps"] = {
1088
+ const triggerProps: MultiSelectFunneledTriggerProps = {
1034
1089
  ...inputProps,
1035
1090
  placeholder,
1036
1091
  // Forward ONLY the field-chrome slots to the trigger's `PillsInput` →
@@ -155,17 +155,37 @@ export interface NotificationProps extends NotificationFrameProps {
155
155
  }
156
156
 
157
157
  /**
158
- * Pure-text body renders as a single themed `NotificationMessage`. Any element
159
- * present routes to the `NotificationContent` Box so rich content isn't trapped
160
- * inside a `<Text>` (text runs within it stay themed via `renderTextChild`).
158
+ * How the body children render: nothing at all, a pure-text body (a single themed
159
+ * `NotificationMessage`), or rich content. Any element present routes to the
160
+ * `NotificationContent` Box so rich content isn't trapped inside a `<Text>` (text
161
+ * runs within it stay themed via `renderTextChild`).
161
162
  */
162
- function isTextOnly(children: React.ReactNode): boolean {
163
- const array = React.Children.toArray(children);
164
- return array.length > 0 && array.every((c) => typeof c === "string" || typeof c === "number");
165
- }
163
+ type NotificationBodyKind = "empty" | "text" | "rich";
164
+
165
+ /**
166
+ * ## Cost
167
+ *
168
+ * This replaces a `hasRenderableChild(children)` + `isTextOnly(children)` pair
169
+ * that BOTH called `React.Children.toArray` — which flattens *and clones every
170
+ * element child* — so the same work ran twice per render, and a toast stack
171
+ * renders N notifications. One pass now, with the single-child shapes answered
172
+ * before `toArray` is reached at all (same fast-path ladder as `renderTextChild`).
173
+ * Classification is unchanged: `toArray` drops `null`/`undefined`/booleans, and
174
+ * does NOT flatten a Fragment (which therefore counts as one element → "rich").
175
+ */
176
+ function classifyBody(children: React.ReactNode): NotificationBodyKind {
177
+ const type = typeof children;
178
+ if (type === "string" || type === "number") return "text";
179
+ if (children == null || type === "boolean") return "empty";
180
+ if (React.isValidElement(children)) return "rich";
166
181
 
167
- function hasRenderableChild(children: React.ReactNode): boolean {
168
- return React.Children.toArray(children).length > 0;
182
+ const array = React.Children.toArray(children);
183
+ if (array.length === 0) return "empty";
184
+ for (let i = 0; i < array.length; i++) {
185
+ const child = array[i];
186
+ if (typeof child !== "string" && typeof child !== "number") return "rich";
187
+ }
188
+ return "text";
169
189
  }
170
190
 
171
191
  const NotificationComponent = NotificationFrame.styleable<NotificationProps>(
@@ -187,21 +207,22 @@ const NotificationComponent = NotificationFrame.styleable<NotificationProps>(
187
207
  const slots = slotStyles(styles, NOTIFICATION_SLOTS, "Notification");
188
208
  const rootId = useId(typeof id === "string" ? id : undefined);
189
209
  const titleId = title ? `${rootId}-title` : undefined;
190
- const hasBody = hasRenderableChild(children);
191
- const bodyId = hasBody ? `${rootId}-body` : undefined;
210
+ const bodyKind = classifyBody(children);
211
+ const bodyId = bodyKind !== "empty" ? `${rootId}-body` : undefined;
192
212
 
193
213
  const showBadge = loading || icon != null;
194
- const bodyContent = hasBody ? (
195
- isTextOnly(children) ? (
196
- <NotificationMessage id={bodyId} {...slots.get("message")}>
197
- {children}
198
- </NotificationMessage>
199
- ) : (
200
- <NotificationContent id={bodyId} {...slots.get("content")}>
201
- {renderTextChild(children, NotificationMessage)}
202
- </NotificationContent>
203
- )
204
- ) : null;
214
+ const bodyContent =
215
+ bodyKind !== "empty" ? (
216
+ bodyKind === "text" ? (
217
+ <NotificationMessage id={bodyId} {...slots.get("message")}>
218
+ {children}
219
+ </NotificationMessage>
220
+ ) : (
221
+ <NotificationContent id={bodyId} {...slots.get("content")}>
222
+ {renderTextChild(children, NotificationMessage)}
223
+ </NotificationContent>
224
+ )
225
+ ) : null;
205
226
 
206
227
  return (
207
228
  <NotificationFrame
@@ -31,6 +31,33 @@ export interface NumberFormatterProps extends NumberFormatterFrameProps {
31
31
  thousandSeparator?: string | boolean;
32
32
  }
33
33
 
34
+ /**
35
+ * Group-separator patterns, compiled once at module scope.
36
+ *
37
+ * `groupDigits` ran `new RegExp(...)` on every format call — i.e. once per table
38
+ * cell / list row on every render — recompiling one of only two realistic
39
+ * patterns. `thousandsGroupStyle` can only reach group size 3 (`thousand`) or 4
40
+ * (`wan`), so both are precompiled; an unusual size still works, it is built and
41
+ * cached on first use rather than rejected.
42
+ *
43
+ * Reusing a `/g` regex across calls is safe here: `String.prototype.replace`
44
+ * resets `lastIndex` before and after a global match, so no state leaks between
45
+ * calls.
46
+ */
47
+ const GROUP_PATTERNS = new Map<number, RegExp>([
48
+ [3, /\B(?=(\d{3})+(?!\d))/g],
49
+ [4, /\B(?=(\d{4})+(?!\d))/g],
50
+ ]);
51
+
52
+ function groupPattern(groupSize: number): RegExp {
53
+ let pattern = GROUP_PATTERNS.get(groupSize);
54
+ if (pattern === undefined) {
55
+ pattern = new RegExp(`\\B(?=(\\d{${groupSize}})+(?!\\d))`, "g");
56
+ GROUP_PATTERNS.set(groupSize, pattern);
57
+ }
58
+ return pattern;
59
+ }
60
+
34
61
  function groupDigits(
35
62
  intPart: string,
36
63
  style: NonNullable<NumberFormatterProps["thousandsGroupStyle"]>,
@@ -51,7 +78,7 @@ function groupDigits(
51
78
  }
52
79
 
53
80
  const groupSize = style === "wan" ? 4 : 3;
54
- return `${neg ? "-" : ""}${digits.replace(new RegExp(`\\B(?=(\\d{${groupSize}})+(?!\\d))`, "g"), sep)}`;
81
+ return `${neg ? "-" : ""}${digits.replace(groupPattern(groupSize), sep)}`;
55
82
  }
56
83
 
57
84
  function formatValue(props: NumberFormatterProps): string {
@@ -111,19 +138,47 @@ function formatValue(props: NumberFormatterProps): string {
111
138
  export const NumberFormatter = NumberFormatterFrame.styleable<NumberFormatterProps>(
112
139
  function NumberFormatter(props, ref) {
113
140
  const {
114
- value: _value,
115
- allowNegative: _allowNegative,
116
- decimalScale: _decimalScale,
117
- decimalSeparator: _decimalSeparator,
118
- fixedDecimalScale: _fixedDecimalScale,
119
- prefix: _prefix,
120
- suffix: _suffix,
121
- thousandSeparator: _thousandSeparator,
122
- thousandsGroupStyle: _thousandsGroupStyle,
141
+ value,
142
+ allowNegative,
143
+ decimalScale,
144
+ decimalSeparator,
145
+ fixedDecimalScale,
146
+ prefix,
147
+ suffix,
148
+ thousandSeparator,
149
+ thousandsGroupStyle,
123
150
  ...textProps
124
151
  } = props;
125
152
 
126
- const formatted = formatValue(props);
153
+ // Formatting is pure over these nine props (the defaults live in
154
+ // `formatValue`), so memoize it: this component renders per table cell / list
155
+ // row, and re-running the parse + rounding + grouping on every parent render —
156
+ // including renders where only a style prop moved — was wasted string work.
157
+ const formatted = React.useMemo(
158
+ () =>
159
+ formatValue({
160
+ value,
161
+ allowNegative,
162
+ decimalScale,
163
+ decimalSeparator,
164
+ fixedDecimalScale,
165
+ prefix,
166
+ suffix,
167
+ thousandSeparator,
168
+ thousandsGroupStyle,
169
+ }),
170
+ [
171
+ value,
172
+ allowNegative,
173
+ decimalScale,
174
+ decimalSeparator,
175
+ fixedDecimalScale,
176
+ prefix,
177
+ suffix,
178
+ thousandSeparator,
179
+ thousandsGroupStyle,
180
+ ],
181
+ );
127
182
  if (!formatted) return null;
128
183
 
129
184
  return (
@@ -7,8 +7,14 @@ import { radiusVariant, shadowVariant } from "../internal/style-props";
7
7
  * Paper — generic content surface with optional elevation and border. Mirrors
8
8
  * Mantine's `Paper`. `shadow` (xs→xl) controls elevation, `radius` the corner
9
9
  * rounding, `withBorder` shows the outline. No border or shadow by default.
10
+ *
11
+ * A plain `styled()` export, NOT a `.styleable()` wrapper: the wrapper's render
12
+ * function did nothing but `<PaperFrame ref {...props} />`, so every `<Paper>`
13
+ * paid a whole extra component layer (and its own render pass, and the `<Theme>`
14
+ * layer `themeable` puts around a named styleable) to add exactly zero props.
15
+ * `GetProps` gives the identical public prop shape either way.
10
16
  */
11
- const PaperFrame = styled(Box, {
17
+ export const Paper = styled(Box, {
12
18
  name: "Paper",
13
19
  backgroundColor: "$background",
14
20
 
@@ -23,8 +29,4 @@ const PaperFrame = styled(Box, {
23
29
  defaultVariants: { radius: "md" },
24
30
  });
25
31
 
26
- export type PaperProps = GetProps<typeof PaperFrame>;
27
-
28
- export const Paper = PaperFrame.styleable<PaperProps>(function Paper(props, ref) {
29
- return <PaperFrame ref={ref} {...props} />;
30
- });
32
+ export type PaperProps = GetProps<typeof Paper>;
package/src/Pill/Pill.tsx CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  type SizeKey,
14
14
  } from "../internal/style-props";
15
15
  import { slotStyles, type SlotStyles } from "../internal/styles";
16
+ import { useSlotTextWrapper } from "../internal/use-slot-text-wrapper";
16
17
  import { Text } from "../Text";
17
18
 
18
19
  type PillSize = SizeKey;
@@ -233,15 +234,11 @@ const PillComponent = PillFrame.styleable<PillProps>(function Pill(props, ref) {
233
234
  );
234
235
 
235
236
  // Bind the `label` slot props onto the label wrapper that `renderTextChild`
236
- // emits for text children (`styles={{ label }}` → `<Pill.Label … />`).
237
- const labelSlot = s.get("label");
238
- const LabelWrapper = React.useMemo<React.FC<{ children: React.ReactNode }>>(
239
- () =>
240
- function PillLabelWrapper(wrapperProps) {
241
- return <PillLabel {...labelSlot} {...wrapperProps} />;
242
- },
243
- [labelSlot],
244
- );
237
+ // emits for text children (`styles={{ label }}` → `<Pill.Label … />`). The shared
238
+ // hook compares the slot props by VALUE: keyed on identity, the documented inline
239
+ // `styles={{ label: { … } }}` literal made the wrapper a new component TYPE every
240
+ // render, remounting the label of every pill in a group.
241
+ const LabelWrapper = useSlotTextWrapper(PillLabel, s.get("label"));
245
242
 
246
243
  return (
247
244
  <PillFrame
@@ -21,14 +21,7 @@ export type PinInputHostType = React.HTMLInputTypeAttribute;
21
21
 
22
22
  /** Host `inputmode` override (inferred from `type` when unset). */
23
23
  export type PinInputMode =
24
- | "none"
25
- | "text"
26
- | "tel"
27
- | "url"
28
- | "email"
29
- | "numeric"
30
- | "decimal"
31
- | "search";
24
+ "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
32
25
 
33
26
  const REGEX = {
34
27
  number: /^[0-9]+$/,
@@ -188,6 +188,9 @@ const ProgressSection = ProgressSectionFrame.styleable<ProgressSectionProps>(
188
188
  axis: "x",
189
189
  distance: animated ? STRIPE_PERIOD : 0,
190
190
  durationMs: STRIPE_DURATION_MS,
191
+ // A `distance: 0` shimmer is inert, so the primitive already skips scheduling;
192
+ // stating it keeps the intent explicit for a plain `striped` bar.
193
+ enabled: Boolean(animated),
191
194
  });
192
195
 
193
196
  const pct = `${Math.max(0, Math.min(100, value))}%`;