@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
@@ -0,0 +1,26 @@
1
+ import { themeColorToCssVar } from "./theme-color-web";
2
+
3
+ /**
4
+ * Resolve a control's icon colour token to something `react-native-svg` (native)
5
+ * or CSS (web) can paint — WEB implementation (`use-icon-color.native.ts` is the
6
+ * native twin).
7
+ *
8
+ * On web this needs no theme at all: a `$token` maps to its CSS custom property
9
+ * by pure string transform (see `theme-color-web.ts`). That matters a lot here,
10
+ * because `ControlIconProvider` is instantiated once per control SECTION — a
11
+ * Button with a left and a right section mounts two, on top of its own frame, at
12
+ * 16 JSX sites across 11 components. Every one of those used to call `useTheme()`,
13
+ * which means:
14
+ *
15
+ * - a `useThemeWithState` per section (useId + useRef + useReducer + a DEP-LESS
16
+ * `useEffect` that fires after every render — 100 icon sites = 100 effect fires
17
+ * per render pass plus 100 global listener entries), and
18
+ * - on native, `variableToString` reads `variable.val`, which trips Tamagui's
19
+ * theme proxy `track(key)` and makes every icon-bearing control a theme
20
+ * SUBSCRIBER.
21
+ *
22
+ * The subscription is only actually needed on native (where the concrete colour
23
+ * value has to be read out of the active theme); on web the CSS variable tracks
24
+ * the theme by itself.
25
+ */
26
+ export const useIconColor = (token: string): string => themeColorToCssVar(token);
@@ -11,7 +11,7 @@ import Animated, {
11
11
 
12
12
  import { useReducedMotion } from "@knitui/hooks";
13
13
 
14
- import { type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
14
+ import { isMotionActive, type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
15
15
 
16
16
  export type {
17
17
  LoopMotion,
@@ -64,8 +64,16 @@ const EASE_IN_OUT: Easer = Easing.bezier(0.42, 0, 0.58, 1);
64
64
  * rotate), `pulse` (alternating opacity), `shimmer` (repeating translate offset).
65
65
  */
66
66
  export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
67
- const reduced = useReducedMotion();
67
+ const reducedPreference = useReducedMotion();
68
68
  const resolved = resolveMotion(motion);
69
+ // A loop that is disabled (its style is never rendered) or visually inert (zero
70
+ // travel) must not be scheduled: `withRepeat` runs FOREVER, and every live loop
71
+ // re-evaluates its worklet and pushes a props update on the UI thread every
72
+ // frame. A screen full of `Skeleton`s, or a single `Loader` (which declares a
73
+ // spin + three pulses but renders one of them), otherwise paid for animations
74
+ // nothing displays. Folding it into `reduced` keeps the static-frame branch below
75
+ // as the single "not animating" path.
76
+ const reduced = reducedPreference || !isMotionActive(motion, resolved);
69
77
 
70
78
  // `progress` runs 0→1 forever; the worklet interpolates per motion kind. For
71
79
  // `pulse` we set `reverse=true` so each cycle ping-pongs (a seamless throb).
@@ -13,8 +13,25 @@ import { DURATIONS } from "@knitui/core";
13
13
  * two implementations can never drift.
14
14
  */
15
15
 
16
+ /**
17
+ * Fields every motion accepts. `enabled` is the perf-critical one: a loop is a
18
+ * PERMANENT animation (a compositor `@keyframes` on web, a `withRepeat` on
19
+ * reanimated's UI thread on native), so an instance whose loop is never rendered
20
+ * must not schedule one. Components declare their hooks unconditionally (stable
21
+ * hook order across variant changes) — e.g. `Loader` declares a spin + three
22
+ * pulses but renders only one of them, `Skeleton`/`Indicator` declare a pulse they
23
+ * only use when `animate`/`processing` — so without this gate every instance paid
24
+ * for up to four forever-running animations that nothing displays. Pass the same
25
+ * condition that decides whether the returned `style` is actually spread.
26
+ * @default true
27
+ */
28
+ export interface LoopMotionBase {
29
+ /** Schedule the loop at all. `false` → a static first frame, no animation. */
30
+ enabled?: boolean;
31
+ }
32
+
16
33
  /** A continuous 360° rotation (the `Loader` oval, `Indicator` processing ring). */
17
- export interface SpinMotion {
34
+ export interface SpinMotion extends LoopMotionBase {
18
35
  kind: "spin";
19
36
  /** One full revolution, ms. @default 1000 */
20
37
  durationMs?: number;
@@ -25,7 +42,7 @@ export interface SpinMotion {
25
42
  * (`Skeleton` shimmer-lite, `Indicator` processing dot). Alternates direction so
26
43
  * the loop is seamless without a snap.
27
44
  */
28
- export interface PulseMotion {
45
+ export interface PulseMotion extends LoopMotionBase {
29
46
  kind: "pulse";
30
47
  /** One half-cycle (full→min OR min→full), ms. @default 600 */
31
48
  durationMs?: number;
@@ -39,7 +56,7 @@ export interface PulseMotion {
39
56
  * axis, then snaps back (the repeated copies make the snap invisible). Linear so
40
57
  * the speed is constant.
41
58
  */
42
- export interface ShimmerMotion {
59
+ export interface ShimmerMotion extends LoopMotionBase {
43
60
  kind: "shimmer";
44
61
  /** One full slide of `distance`, ms. @default 1000 */
45
62
  durationMs?: number;
@@ -78,3 +95,21 @@ export function resolveMotion(motion: LoopMotion): ResolvedMotion {
78
95
  };
79
96
  }
80
97
  }
98
+
99
+ /**
100
+ * Whether a resolved motion would actually MOVE anything. A zero-duration loop,
101
+ * or a `shimmer` with no travel, paints an identical frame forever — scheduling it
102
+ * costs a compositor animation (web) / a per-frame UI-thread worklet (native) for
103
+ * no visual result, so both platform files treat it as static. This is why callers
104
+ * can express "not animating right now" as `distance: 0` (`Progress`, `Marquee`
105
+ * before measurement) and pay nothing for it.
106
+ */
107
+ export function isMotionInert(motion: ResolvedMotion): boolean {
108
+ if (motion.durationMs <= 0) return true;
109
+ return motion.kind === "shimmer" && motion.distance === 0;
110
+ }
111
+
112
+ /** Whether the loop should be scheduled: explicitly enabled AND visually moving. */
113
+ export function isMotionActive(motion: LoopMotion, resolved: ResolvedMotion): boolean {
114
+ return (motion.enabled ?? true) && !isMotionInert(resolved);
115
+ }
@@ -4,7 +4,7 @@ import { useReducedMotion } from "@knitui/hooks";
4
4
 
5
5
  import { Box } from "../Box";
6
6
  import { injectKeyframes } from "./keyframes-web";
7
- import { type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
7
+ import { isMotionActive, type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
8
8
 
9
9
  export type {
10
10
  LoopMotion,
@@ -109,13 +109,17 @@ function staticStyle(motion: ReturnType<typeof resolveMotion>): LoopStyle["style
109
109
  export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
110
110
  const reduced = useReducedMotion();
111
111
  const resolved = resolveMotion(motion);
112
+ // A disabled or non-moving loop must not run: a live `@keyframes` animation keeps
113
+ // a compositor animation alive per element for a frame that never changes (an
114
+ // un-`animated` Progress stripe row, a `Loader`'s three unused pulses).
115
+ const active = !reduced && isMotionActive(motion, resolved);
112
116
 
113
117
  // Inject during render (idempotent) so the rule exists before first paint.
114
118
  const { name, body, timing, alternate } = keyframesFor(resolved);
115
- if (!reduced) injectKeyframes(name, body);
119
+ if (active) injectKeyframes(name, body);
116
120
 
117
121
  return React.useMemo<LoopStyle>(() => {
118
- if (reduced) return { style: staticStyle(resolved) };
122
+ if (!active) return { style: staticStyle(resolved) };
119
123
  return {
120
124
  style: {
121
125
  animationName: name,
@@ -128,5 +132,5 @@ export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
128
132
  // `resolved` is recomputed each render but value-stable per motion shape; the
129
133
  // primitive deps are what actually change the returned style.
130
134
  // eslint-disable-next-line react-hooks/exhaustive-deps
131
- }, [reduced, name, timing, alternate, resolved.durationMs]);
135
+ }, [active, name, timing, alternate, resolved.durationMs]);
132
136
  }
@@ -12,23 +12,57 @@ import * as React from "react";
12
12
  *
13
13
  * Pass the component's own styled text element (`BlockquoteText`,
14
14
  * `BreadcrumbLabel`, `ButtonText`, …) plus the resolved `styles` slot props (the
15
- * `slotStyles(...).get("...")` value, which is a stable reference while the
16
- * caller's `styles` prop is stable). When there are no slot props the base
15
+ * `slotStyles(...).get("...")` value). When there are no slot props the base
17
16
  * `Component` is returned unwrapped, matching the historical
18
17
  * `slot ? (p) => <El {...slot} {...p}/> : El` idiom.
19
18
  *
19
+ * The slot props are compared by SHALLOW VALUE, not by identity. Keying the memo
20
+ * on identity looked correct but defeated the hook's entire purpose: the
21
+ * documented, idiomatic call is an inline literal —
22
+ * `styles={{ label: { color: "$red9" } }}` — which is a new object on every
23
+ * render, so the memo never hit, the wrapper was a new component type every
24
+ * render, and React unmounted and remounted the wrapped text on every render.
25
+ * That is precisely the failure this hook exists to prevent, and it only showed
26
+ * up for the callers who passed `styles` at all.
27
+ *
20
28
  * (`Tabs` keeps its own `useCallback` wrapper because it also binds dynamic
21
29
  * `active`/`variant`/`size` props; this hook covers the slot-only sites.)
22
30
  */
31
+ /** Own enumerable keys compared with `Object.is` — one level deep, no recursion. */
32
+ function shallowEqualProps(a: object | undefined, b: object | undefined): boolean {
33
+ if (a === b) return true;
34
+ if (!a || !b) return false;
35
+ const aKeys = Object.keys(a) as (keyof typeof a)[];
36
+ const bKeys = Object.keys(b);
37
+ if (aKeys.length !== bKeys.length) return false;
38
+ for (const key of aKeys) {
39
+ if (!Object.is(a[key], b[key])) return false;
40
+ }
41
+ return true;
42
+ }
43
+
44
+ /**
45
+ * Hold `slotProps` at a stable reference while its shallow value is unchanged, so
46
+ * an inline literal doesn't invalidate the wrapper memo below. Same stable-ref
47
+ * shape the carousel uses for its inline `modeConfig`.
48
+ */
49
+ function useShallowStable<T extends object | undefined>(value: T): T {
50
+ const ref = React.useRef(value);
51
+ if (!shallowEqualProps(ref.current, value)) ref.current = value;
52
+ return ref.current;
53
+ }
54
+
23
55
  export function useSlotTextWrapper<P extends { children?: React.ReactNode }>(
24
56
  Component: React.ComponentType<P>,
25
57
  slotProps: Partial<P> | undefined,
26
58
  ): React.ComponentType<{ children: React.ReactNode }> {
59
+ const stableSlotProps = useShallowStable(slotProps);
60
+
27
61
  return React.useMemo(() => {
28
- if (!slotProps) return Component as React.ComponentType<{ children: React.ReactNode }>;
62
+ if (!stableSlotProps) return Component as React.ComponentType<{ children: React.ReactNode }>;
29
63
  const Wrapper = ({ children }: { children: React.ReactNode }) => (
30
- <Component {...(slotProps as P)}>{children}</Component>
64
+ <Component {...(stableSlotProps as P)}>{children}</Component>
31
65
  );
32
66
  return Wrapper;
33
- }, [Component, slotProps]);
67
+ }, [Component, stableSlotProps]);
34
68
  }