@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
@@ -199,10 +199,24 @@ const SliderTrackContainer = styled(Box, {
199
199
  * the raw `SLIDER_TRACK` number alongside the matching centring offset — the
200
200
  * shared `sliderTrackVariant` (which only sets `height`) can't express the
201
201
  * vertical axis, so the local number map is the geometry source here. */
202
+ /*
203
+ * RAMP NOTE (`$colorN` steps below are MIRRORED, i.e. `13 - n`)
204
+ * ------------------------------------------------------------
205
+ * `SliderTrack` and `SliderThumb` collide by NAME with two entries in Tamagui's
206
+ * (deprecated) `defaultComponentThemes`, both templated `inverse`. Until
207
+ * `core/config/themes.ts` set `componentThemes: false` those frames — and every
208
+ * descendant, so `SliderBar` and `SliderLabelBubble` too — rendered inside a
209
+ * `<scheme>_SliderTrack` / `<scheme>_SliderThumb` theme whose ENTIRE `$color1…
210
+ * $color12` ramp was reversed. The steps here are therefore written pre-mirrored
211
+ * (`$color3` → `$color10`, `$color9` → `$color4`, `$color1` → `$color12`, …) so
212
+ * the slider keeps its shipped appearance now that the ramp is no longer flipped
213
+ * under it. See the changeset: un-mirroring these is a deliberate design change,
214
+ * not a cleanup.
215
+ */
202
216
  const SliderTrack = styled(Box, {
203
217
  name: "SliderTrack",
204
218
  position: "absolute",
205
- backgroundColor: "$color3",
219
+ backgroundColor: "$color10",
206
220
  variants: { radius: radiusVariant } as const,
207
221
  defaultVariants: { radius: "xl" },
208
222
  });
@@ -211,7 +225,7 @@ const SliderTrack = styled(Box, {
211
225
  const SliderBar = styled(Box, {
212
226
  name: "SliderBar",
213
227
  position: "absolute",
214
- backgroundColor: "$color9",
228
+ backgroundColor: "$color4",
215
229
  variants: { radius: radiusVariant } as const,
216
230
  defaultVariants: { radius: "xl" },
217
231
  });
@@ -221,12 +235,12 @@ const SliderThumb = styled(Box, {
221
235
  position: "absolute",
222
236
  alignItems: "center",
223
237
  justifyContent: "center",
224
- backgroundColor: "$color1",
238
+ backgroundColor: "$color12",
225
239
  borderWidth: 2,
226
- borderColor: "$color9",
240
+ borderColor: "$color4",
227
241
  borderRadius: 9999,
228
242
  ...webCursor("pointer"),
229
- hoverStyle: { borderColor: "$color10" },
243
+ hoverStyle: { borderColor: "$color3" },
230
244
  ...focusRingStyle,
231
245
  });
232
246
 
@@ -288,8 +302,10 @@ const SliderLabelBubble = styled(Text, {
288
302
  paddingHorizontal: 6,
289
303
  paddingVertical: 2,
290
304
  borderRadius: "$sm",
291
- backgroundColor: "$color9",
292
- color: "$color1",
305
+ // MIRRORED steps — this renders inside `SliderThumb`, which used to invert the
306
+ // whole ramp under it. See the RAMP NOTE above `SliderTrack`.
307
+ backgroundColor: "$color4",
308
+ color: "$color12",
293
309
  fontSize: "$xs",
294
310
  pointerEvents: "none",
295
311
  // Force a single line cross-platform. Safe here (unlike inside the thumb)
@@ -340,6 +356,114 @@ const SLIDER_SLOT_KEYS = [
340
356
  "label",
341
357
  ] as const satisfies readonly (keyof SliderStyles)[];
342
358
 
359
+ /* -------------------------------------------------------------------------- */
360
+ /* Marks — memoized subtree (shared by Slider + RangeSlider) */
361
+ /* -------------------------------------------------------------------------- */
362
+
363
+ interface SliderMarkItemProps {
364
+ /** Position along the track as a `0–100` percentage. */
365
+ markPct: number;
366
+ label?: React.ReactNode;
367
+ filled: boolean;
368
+ vertical: boolean;
369
+ markProps?: Partial<GetProps<typeof SliderMarkDot>>;
370
+ markLabelProps?: Partial<GetProps<typeof SliderMarkLabel>>;
371
+ }
372
+
373
+ /**
374
+ * ONE mark dot (+ its optional label), memoized on its own props.
375
+ *
376
+ * The marks used to be re-mapped inline in the slider render body, so a drag —
377
+ * which calls `setValue` on every single pointermove — re-rendered 2–3 Tamagui
378
+ * frames per mark per frame (≈45 frames for a 20-mark slider). They can't be
379
+ * memoized as one opaque block keyed on `(marks, min, max, orientation)` alone,
380
+ * because `filled` genuinely depends on the live value: the mark palette is part
381
+ * of the value readout. So the memo is PER MARK instead — the parent
382
+ * `SliderMarks` re-maps cheaply (no styled components) on every value change, but
383
+ * only the 0–1 marks whose `filled` state actually FLIPPED re-render any frames.
384
+ * The visual result is byte-identical to the inline version.
385
+ */
386
+ const SliderMarkItem = React.memo(function SliderMarkItem({
387
+ markPct,
388
+ label,
389
+ filled,
390
+ vertical,
391
+ markProps,
392
+ markLabelProps,
393
+ }: SliderMarkItemProps) {
394
+ const dotPos: Partial<BoxProps> = vertical
395
+ ? { bottom: pct(markPct), left: "50%", marginLeft: -3, marginBottom: -3 }
396
+ : { left: pct(markPct), top: "50%", marginLeft: -3, marginTop: -3 };
397
+ const labelPos: Partial<BoxProps> = vertical
398
+ ? { left: "100%", bottom: pct(markPct), marginLeft: 8, marginBottom: -8 }
399
+ : { top: "100%", left: pct(markPct), marginTop: 8, marginLeft: -12, minWidth: 24 };
400
+ return (
401
+ <>
402
+ <SliderMarkDot
403
+ filled={filled}
404
+ {...markProps}
405
+ {...(dotPos as GetProps<typeof SliderMarkDot>)}
406
+ />
407
+ {label != null ? (
408
+ <SliderMarkLabel {...markLabelProps} {...(labelPos as GetProps<typeof SliderMarkLabel>)}>
409
+ {label}
410
+ </SliderMarkLabel>
411
+ ) : null}
412
+ </>
413
+ );
414
+ });
415
+
416
+ interface SliderMarksProps {
417
+ marks: SliderMark[];
418
+ min: number;
419
+ max: number;
420
+ vertical: boolean;
421
+ /**
422
+ * Inclusive lower bound of the filled span. `-Infinity` for the single-value
423
+ * `Slider` (everything up to the thumb is filled); the lower thumb for
424
+ * `RangeSlider`.
425
+ */
426
+ filledFrom: number;
427
+ /** Inclusive upper bound of the filled span. */
428
+ filledTo: number;
429
+ markProps?: Partial<GetProps<typeof SliderMarkDot>>;
430
+ markLabelProps?: Partial<GetProps<typeof SliderMarkLabel>>;
431
+ }
432
+
433
+ /**
434
+ * The marks layer. Memoized so a parent re-render that changes nothing about the
435
+ * marks (hover, focus, label-bubble visibility, a `styles` slot that isn't
436
+ * `mark`/`markLabel`) doesn't touch them at all; when the value DOES change, the
437
+ * per-mark memo above keeps the work proportional to the marks that actually
438
+ * changed rather than to the mark count.
439
+ */
440
+ const SliderMarks = React.memo(function SliderMarks({
441
+ marks,
442
+ min,
443
+ max,
444
+ vertical,
445
+ filledFrom,
446
+ filledTo,
447
+ markProps,
448
+ markLabelProps,
449
+ }: SliderMarksProps) {
450
+ return (
451
+ <>
452
+ {marks.map((mark, index) => (
453
+ <SliderMarkItem
454
+ key={index}
455
+ markPct={valueToPct(mark.value, min, max)}
456
+ label={mark.label}
457
+ filled={mark.value >= filledFrom && mark.value <= filledTo}
458
+ vertical={vertical}
459
+ markProps={markProps}
460
+ markLabelProps={markLabelProps}
461
+ />
462
+ ))}
463
+ </>
464
+ );
465
+ });
466
+
343
467
  /* -------------------------------------------------------------------------- */
344
468
  /* Shared prop surface */
345
469
  /* -------------------------------------------------------------------------- */
@@ -674,33 +798,19 @@ const SliderComponent = SliderRoot.styleable<SliderProps>(function Slider(props,
674
798
  <SliderBar radius={radius} {...s.get("bar")} {...(fill as GetProps<typeof SliderBar>)} />
675
799
  </SliderTrack>
676
800
 
677
- {marks?.map((mark, index) => {
678
- const markPct = valueToPct(mark.value, dMin, dMax);
679
- const filled = mark.value <= current;
680
- const dotPos: Partial<BoxProps> = vertical
681
- ? { bottom: pct(markPct), left: "50%", marginLeft: -3, marginBottom: -3 }
682
- : { left: pct(markPct), top: "50%", marginLeft: -3, marginTop: -3 };
683
- const labelPos: Partial<BoxProps> = vertical
684
- ? { left: "100%", bottom: pct(markPct), marginLeft: 8, marginBottom: -8 }
685
- : { top: "100%", left: pct(markPct), marginTop: 8, marginLeft: -12, minWidth: 24 };
686
- return (
687
- <React.Fragment key={index}>
688
- <SliderMarkDot
689
- filled={filled}
690
- {...s.get("mark")}
691
- {...(dotPos as GetProps<typeof SliderMarkDot>)}
692
- />
693
- {mark.label != null ? (
694
- <SliderMarkLabel
695
- {...s.get("markLabel")}
696
- {...(labelPos as GetProps<typeof SliderMarkLabel>)}
697
- >
698
- {mark.label}
699
- </SliderMarkLabel>
700
- ) : null}
701
- </React.Fragment>
702
- );
703
- })}
801
+ {marks ? (
802
+ <SliderMarks
803
+ marks={marks}
804
+ min={dMin}
805
+ max={dMax}
806
+ vertical={vertical}
807
+ // Single thumb: everything at or below the value is filled.
808
+ filledFrom={-Infinity}
809
+ filledTo={current}
810
+ markProps={s.get("mark")}
811
+ markLabelProps={s.get("markLabel")}
812
+ />
813
+ ) : null}
704
814
 
705
815
  <SliderThumb
706
816
  width={knob.value}
@@ -1054,33 +1164,19 @@ const RangeSliderComponent = SliderRoot.styleable<RangeSliderProps>(
1054
1164
  />
1055
1165
  </SliderTrack>
1056
1166
 
1057
- {marks?.map((mark, index) => {
1058
- const markPct = valueToPct(mark.value, dMin, dMax);
1059
- const filled = mark.value >= valA && mark.value <= valB;
1060
- const dotPos: Partial<BoxProps> = vertical
1061
- ? { bottom: pct(markPct), left: "50%", marginLeft: -3, marginBottom: -3 }
1062
- : { left: pct(markPct), top: "50%", marginLeft: -3, marginTop: -3 };
1063
- const labelPos: Partial<BoxProps> = vertical
1064
- ? { left: "100%", bottom: pct(markPct), marginLeft: 8, marginBottom: -8 }
1065
- : { top: "100%", left: pct(markPct), marginTop: 8, marginLeft: -12, minWidth: 24 };
1066
- return (
1067
- <React.Fragment key={index}>
1068
- <SliderMarkDot
1069
- filled={filled}
1070
- {...s.get("mark")}
1071
- {...(dotPos as GetProps<typeof SliderMarkDot>)}
1072
- />
1073
- {mark.label != null ? (
1074
- <SliderMarkLabel
1075
- {...s.get("markLabel")}
1076
- {...(labelPos as GetProps<typeof SliderMarkLabel>)}
1077
- >
1078
- {mark.label}
1079
- </SliderMarkLabel>
1080
- ) : null}
1081
- </React.Fragment>
1082
- );
1083
- })}
1167
+ {marks ? (
1168
+ <SliderMarks
1169
+ marks={marks}
1170
+ min={dMin}
1171
+ max={dMax}
1172
+ vertical={vertical}
1173
+ // Two thumbs: the span BETWEEN them is filled.
1174
+ filledFrom={valA}
1175
+ filledTo={valB}
1176
+ markProps={s.get("mark")}
1177
+ markLabelProps={s.get("markLabel")}
1178
+ />
1179
+ ) : null}
1084
1180
 
1085
1181
  {renderThumb(0, valA, pctA)}
1086
1182
  {renderThumb(1, valB, pctB)}
@@ -6,7 +6,6 @@ import {
6
6
  isWeb,
7
7
  styled,
8
8
  type TamaguiElement,
9
- useTheme,
10
9
  withStaticProperties,
11
10
  } from "@knitui/core";
12
11
  import { useElementSize, useId, useReducedMotion, useUncontrolled } from "@knitui/hooks";
@@ -16,6 +15,7 @@ import { CollapseBox } from "../internal/collapse-box";
16
15
  import { renderTextChild } from "../internal/render-text-child";
17
16
  import { webCursor } from "../internal/style-props";
18
17
  import { slotStyles, type SlotStyles } from "../internal/styles";
18
+ import { themeColorToCssVar } from "../internal/theme-color-web";
19
19
  import { Text } from "../Text";
20
20
 
21
21
  /* -------------------------------------------------------------------------- */
@@ -46,6 +46,26 @@ const SpoilerControl = styled(Text, {
46
46
  pressStyle: { opacity: 0.7 },
47
47
  });
48
48
 
49
+ /**
50
+ * The collapsed-state bottom fade (web only — `isWeb` gates it below; native gets
51
+ * no `backgroundImage`). Built ONCE at module scope: the gradient fades into the
52
+ * theme's `background`, and on web a token maps to its CSS custom property by
53
+ * pure string transform (`theme-color-web.ts`), so the `var()` tracks the active
54
+ * theme by itself.
55
+ *
56
+ * Previously this read `theme.background?.val` per render, which cost a
57
+ * `useTheme()` (`useThemeWithState` = useId + useRef + useReducer + a DEP-LESS
58
+ * `useEffect` that fires after every render) and — because reading a field off
59
+ * Tamagui's theme proxy calls its `track()` — registered every `Spoiler` as a
60
+ * theme subscriber, including on native where the fade isn't even painted. The
61
+ * old `?? "#fff"` last resort survives as the CSS variable's own fallback.
62
+ */
63
+ const SPOILER_FADE_BACKGROUND = (() => {
64
+ const backgroundVar = themeColorToCssVar("$background");
65
+ return backgroundVar.startsWith("var(") ? `${backgroundVar.slice(0, -1)}, #fff)` : backgroundVar;
66
+ })();
67
+ const SPOILER_FADE_GRADIENT = `linear-gradient(to bottom, transparent, ${SPOILER_FADE_BACKGROUND})`;
68
+
49
69
  /* -------------------------------------------------------------------------- */
50
70
  /* Types */
51
71
  /* -------------------------------------------------------------------------- */
@@ -168,8 +188,6 @@ const SpoilerBase = SpoilerRoot.styleable<SpoilerProps>(function Spoiler(props,
168
188
  // Animate the reveal unless reduced motion / a 0 duration asks us to snap.
169
189
  const animate = transitionDuration > 0 && !reduced;
170
190
 
171
- const theme = useTheme();
172
-
173
191
  const ariaLabel = show ? hideAriaLabel : showAriaLabel;
174
192
 
175
193
  const toggle = React.useCallback(() => {
@@ -202,13 +220,7 @@ const SpoilerBase = SpoilerRoot.styleable<SpoilerProps>(function Spoiler(props,
202
220
  ...(spoilerActive ? { "aria-labelledby": controlId } : {}),
203
221
  };
204
222
 
205
- const webFade: WebFadeProps = isWeb
206
- ? {
207
- backgroundImage: `linear-gradient(to bottom, transparent, ${String(
208
- theme.background?.val ?? "#fff",
209
- )})`,
210
- }
211
- : {};
223
+ const webFade: WebFadeProps = isWeb ? { backgroundImage: SPOILER_FADE_GRADIENT } : {};
212
224
 
213
225
  return (
214
226
  <SpoilerRoot ref={ref} id={rootId} {...s.merge("root", rest)}>
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
 
3
3
  import { createStyledContext, type GetProps, styled, withStaticProperties } from "@knitui/core";
4
- import { IconCheck } from "@knitui/icons";
4
+ import { IconCheck } from "@knitui/icons/IconCheck";
5
5
 
6
6
  import { Box } from "../Box";
7
7
  import { ControlIconProvider } from "../internal/ControlIconProvider";
@@ -112,7 +112,7 @@ const SwitchTrack = styled(Box, {
112
112
  },
113
113
  } as const,
114
114
 
115
- defaultVariants: { size: "md", on: false },
115
+ defaultVariants: { size: "sm", on: false },
116
116
  });
117
117
 
118
118
  const SwitchThumb = styled(Box, {
@@ -128,20 +128,31 @@ const SwitchThumb = styled(Box, {
128
128
  size: thumbSizeVariant,
129
129
  } as const,
130
130
 
131
- defaultVariants: { size: "md" },
131
+ defaultVariants: { size: "sm" },
132
132
  });
133
133
 
134
- /** Small dot inside the thumb that echoes the track colour. */
134
+ /**
135
+ * Small dot inside the thumb that echoes the track colour.
136
+ *
137
+ * RAMP NOTE: the `$colorN` steps here are MIRRORED (`13 - n`). This renders
138
+ * inside `SwitchThumb`, whose name collides with an `inverse`-templated entry in
139
+ * Tamagui's (deprecated) `defaultComponentThemes`; until
140
+ * `core/config/themes.ts` set `componentThemes: false`, the dot resolved its ramp
141
+ * from a `<scheme>_SwitchThumb` theme with `$color1…$color12` fully reversed
142
+ * (`$color5` → step 8, `$color9` → step 4). Written pre-mirrored so the dot keeps
143
+ * its shipped appearance. (`SwitchThumb` itself is safe: `$white` is a TOKEN, not
144
+ * a theme value, so no inversion ever reached it.)
145
+ */
135
146
  const ThumbIndicator = styled(Box, {
136
147
  name: "SwitchThumbIndicator",
137
148
  width: "40%",
138
149
  height: "40%",
139
150
  borderRadius: 999,
140
- backgroundColor: "$color5",
151
+ backgroundColor: "$color8",
141
152
  ...transitionProps("fast"),
142
153
  ...animateOnlyProps(["backgroundColor"]),
143
154
  variants: {
144
- on: { true: { backgroundColor: "$color9" } },
155
+ on: { true: { backgroundColor: "$color4" } },
145
156
  } as const,
146
157
  });
147
158
 
@@ -240,7 +251,7 @@ export interface SwitchProps
240
251
  onChange?: (checked: boolean) => void;
241
252
  /** @deprecated Tamagui-style alias for {@link SwitchProps.onChange}. */
242
253
  onCheckedChange?: (checked: boolean) => void;
243
- /** Controls the size of every element. @default 'md' */
254
+ /** Controls the size of every element. @default 'sm' */
244
255
  size?: SwitchSize;
245
256
  /** Inner label shown in the track when unchecked. */
246
257
  offLabel?: React.ReactNode;
@@ -303,7 +314,7 @@ const SwitchComponent = SwitchTrack.styleable<SwitchProps>(function Switch(props
303
314
 
304
315
  const ctx = React.useContext(SwitchGroupContext);
305
316
  const inGroup = ctx != null && value != null;
306
- const size = sizeProp ?? ctx?.size ?? "md";
317
+ const size = sizeProp ?? ctx?.size ?? "sm";
307
318
 
308
319
  // When the user prefers reduced motion, drop the thumb-slide + colour
309
320
  // transitions to a null transition (instant). The slide stays transform-based
@@ -472,7 +483,7 @@ export interface SwitchGroupProps extends Omit<GetProps<typeof GroupFrame>, "onC
472
483
  defaultValue?: string[];
473
484
  /** Called with the next array of selected values. */
474
485
  onChange?: (value: string[]) => void;
475
- /** Size shared with every child switch. @default 'md' */
486
+ /** Size shared with every child switch. @default 'sm' */
476
487
  size?: SwitchSize;
477
488
  /** Group label rendered above the switches. */
478
489
  label?: React.ReactNode;
@@ -497,7 +508,7 @@ const SwitchGroup = GroupFrame.styleable<SwitchGroupProps>(function SwitchGroup(
497
508
  value,
498
509
  defaultValue,
499
510
  onChange,
500
- size = "md",
511
+ size = "sm",
501
512
  label,
502
513
  description,
503
514
  readOnly,
@@ -62,6 +62,21 @@ const useTableContext = (): TableContextValue => {
62
62
  return ctx;
63
63
  };
64
64
 
65
+ /**
66
+ * 0-based body-row index, provided by `Table.Tbody` around each `Table.Tr`;
67
+ * `undefined` outside a striped body (head/foot rows never stripe).
68
+ *
69
+ * Position is passed down by context rather than by cloning every row/cell with
70
+ * an injected prop: cloning re-allocated one element per row AND per cell on
71
+ * every render (a 500x8 table = ~4.5k throwaway elements) and, because the clone
72
+ * always produced fresh props, it also defeated any bail-out on referentially
73
+ * stable children.
74
+ */
75
+ const TableRowIndexContext = React.createContext<number | undefined>(undefined);
76
+
77
+ /** `true` for the leading cell of a row — gates the column divider border. */
78
+ const TableFirstCellContext = React.createContext(false);
79
+
65
80
  /* -------------------------------------------------------------------------- */
66
81
  /* Frames */
67
82
  /* -------------------------------------------------------------------------- */
@@ -122,24 +137,19 @@ type CellFrameProps = Omit<GetProps<typeof CellFrame>, "columnBorder" | "header"
122
137
 
123
138
  export interface TableCellProps extends CellFrameProps {}
124
139
 
125
- interface InternalTableCellProps extends TableCellProps {
126
- /** @internal first-cell flag injected by `Table.Tr` (gates column borders). */
127
- __first?: boolean;
128
- }
129
-
130
140
  function makeCell(header: boolean, role: NonNullable<BoxProps["role"]>, displayName: string) {
131
- const Cell = CellFrame.styleable<InternalTableCellProps>(function Cell(props, ref) {
141
+ const Cell = CellFrame.styleable<TableCellProps>(function Cell(props, ref) {
132
142
  const ctx = useTableContext();
133
- const { __first, ...rest } = props;
143
+ const isFirst = React.useContext(TableFirstCellContext);
134
144
  return (
135
145
  <CellFrame
136
146
  ref={ref}
137
147
  role={role}
138
148
  header={header}
139
- columnBorder={ctx.withColumnBorders && !__first}
149
+ columnBorder={ctx.withColumnBorders && !isFirst}
140
150
  paddingHorizontal={toSpace(ctx.horizontalSpacing)}
141
151
  paddingVertical={toSpace(ctx.verticalSpacing)}
142
- {...rest}
152
+ {...props}
143
153
  />
144
154
  );
145
155
  });
@@ -159,26 +169,61 @@ const TableTd = makeCell(false, "cell", "Table.Td");
159
169
 
160
170
  export type TableTrProps = GetProps<typeof RowFrame>;
161
171
 
162
- interface InternalTableTrProps extends TableTrProps {
163
- /** @internal 0-based row index injected by `Table.Tbody` (drives striping). */
164
- __index?: number;
172
+ /**
173
+ * Wraps a row's leading cell in `TableFirstCellContext` so column dividers only
174
+ * appear BETWEEN columns. Recurses through arrays and fragments the way
175
+ * `React.Children.map` flattens them, rebuilding only the branch that leads to
176
+ * the first cell — one extra element (plus one array copy) per row, instead of a
177
+ * clone of every cell. Returns `null` when the subtree renders no cell at all.
178
+ *
179
+ * Empty slots (`null` / `false` / `undefined`) are skipped rather than counted,
180
+ * so a conditionally rendered leading cell is still recognised as first — the
181
+ * old `__first: i === 0` flag counted them and mis-bordered that case.
182
+ */
183
+ function markFirstCell(node: React.ReactNode): React.ReactNode | null {
184
+ if (Array.isArray(node)) {
185
+ for (let i = 0; i < node.length; i += 1) {
186
+ const marked = markFirstCell(node[i] as React.ReactNode);
187
+ if (marked !== null) {
188
+ const next = node.slice() as React.ReactNode[];
189
+ next[i] = marked;
190
+ return next;
191
+ }
192
+ }
193
+ return null;
194
+ }
195
+
196
+ if (React.isValidElement(node)) {
197
+ if (node.type === React.Fragment) {
198
+ const props = node.props as { children?: React.ReactNode };
199
+ const inner = markFirstCell(props.children);
200
+ return inner === null ? node : React.cloneElement(node, undefined, inner);
201
+ }
202
+ return (
203
+ <TableFirstCellContext.Provider key={node.key ?? "first-cell"} value={true}>
204
+ {node}
205
+ </TableFirstCellContext.Provider>
206
+ );
207
+ }
208
+
209
+ // A text child occupies the leading slot but cannot carry the flag: nothing is
210
+ // marked, matching the old behavior. Empty slots keep the search going.
211
+ return node === null || node === undefined || typeof node === "boolean" ? null : node;
165
212
  }
166
213
 
167
- const TableTr = RowFrame.styleable<InternalTableTrProps>(function TableTr(props, ref) {
214
+ const TableTr = RowFrame.styleable<TableTrProps>(function TableTr(props, ref) {
168
215
  const ctx = useTableContext();
169
- const { __index, children, ...rest } = props;
216
+ const rowIndex = React.useContext(TableRowIndexContext);
217
+ const { children, ...rest } = props;
170
218
 
171
219
  const isStriped =
172
220
  ctx.striped !== undefined &&
173
- __index !== undefined &&
174
- (ctx.striped === "odd" ? __index % 2 === 0 : __index % 2 === 1);
175
-
176
- // Tag the first cell so column borders only appear BETWEEN columns.
177
- const cells = React.Children.map(children, (child, i) =>
178
- React.isValidElement<InternalTableCellProps>(child)
179
- ? React.cloneElement(child, { __first: i === 0 })
180
- : child,
181
- );
221
+ rowIndex !== undefined &&
222
+ (ctx.striped === "odd" ? rowIndex % 2 === 0 : rowIndex % 2 === 1);
223
+
224
+ // Only the first cell needs flagging, and only when dividers are on at all —
225
+ // with `withColumnBorders` off the flag can never change a cell's styling.
226
+ const cells = ctx.withColumnBorders ? (markFirstCell(children) ?? children) : children;
182
227
 
183
228
  return (
184
229
  <RowFrame
@@ -211,18 +256,24 @@ const TableTfoot = RowGroup.styleable<TableTfootProps>(function TableTfoot(props
211
256
  return <RowGroup ref={ref} role="rowgroup" {...props} />;
212
257
  });
213
258
 
214
- const TableTbody = RowGroup.styleable<TableTbodyProps>(function TableTbody(props, ref) {
215
- const { children, ...rest } = props;
216
- // Inject a row index so `Table.Tr` can stripe odd/even body rows.
259
+ /** Publishes a 0-based index to each `Table.Tr` child so it can stripe itself. */
260
+ function withRowIndices(children: React.ReactNode): React.ReactNode {
217
261
  let rowIndex = 0;
218
- const rows = React.Children.map(children, (child) => {
219
- if (React.isValidElement<InternalTableTrProps>(child) && child.type === TableTr) {
220
- const cloned = React.cloneElement(child, { __index: rowIndex });
262
+ return React.Children.map(children, (child) => {
263
+ if (React.isValidElement(child) && child.type === TableTr) {
264
+ const index = rowIndex;
221
265
  rowIndex += 1;
222
- return cloned;
266
+ return <TableRowIndexContext.Provider value={index}>{child}</TableRowIndexContext.Provider>;
223
267
  }
224
268
  return child;
225
269
  });
270
+ }
271
+
272
+ const TableTbody = RowGroup.styleable<TableTbodyProps>(function TableTbody(props, ref) {
273
+ const ctx = useTableContext();
274
+ const { children, ...rest } = props;
275
+ // Row indices only matter for striping — skip the walk entirely without it.
276
+ const rows = ctx.striped === undefined ? children : withRowIndices(children);
226
277
  return (
227
278
  <RowGroup ref={ref} role="rowgroup" {...rest}>
228
279
  {rows}
@@ -389,9 +440,14 @@ const TableRoot = TableFrame.styleable<TableProps>(function Table(props, ref) {
389
440
 
390
441
  return (
391
442
  <TableContext.Provider value={ctx}>
392
- <TableFrame ref={ref} role="table" {...s.merge("table", rest)}>
393
- {content}
394
- </TableFrame>
443
+ {/* Reset row/cell position so a table nested in a cell starts clean. */}
444
+ <TableRowIndexContext.Provider value={undefined}>
445
+ <TableFirstCellContext.Provider value={false}>
446
+ <TableFrame ref={ref} role="table" {...s.merge("table", rest)}>
447
+ {content}
448
+ </TableFrame>
449
+ </TableFirstCellContext.Provider>
450
+ </TableRowIndexContext.Provider>
395
451
  </TableContext.Provider>
396
452
  );
397
453
  });
@@ -2,6 +2,7 @@ import * as React from "react";
2
2
 
3
3
  import {
4
4
  createStyledContext,
5
+ getLineHeight,
5
6
  type GetProps,
6
7
  getTokenValue,
7
8
  type SpaceTokens,
@@ -138,9 +139,12 @@ const TocText = styled(Text, {
138
139
  size: {
139
140
  ...fontSizeVariant,
140
141
  ...fontSizePassthroughVariant,
142
+ // A numeric size skips the font tokens, so pair it through the same ladder
143
+ // the tokens use (rather than a local ratio) or a custom size gets leading
144
+ // that doesn't match the equivalent `$token` step.
141
145
  ":number": (value: number) => ({
142
146
  fontSize: value,
143
- lineHeight: Math.round(value * 1.4),
147
+ lineHeight: getLineHeight(value),
144
148
  }),
145
149
  },
146
150
  active: {