@wordpress/components 19.14.0 → 19.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (506) hide show
  1. package/CHANGELOG.md +51 -12
  2. package/build/autocomplete/get-default-use-items.js +5 -1
  3. package/build/autocomplete/get-default-use-items.js.map +1 -1
  4. package/build/autocomplete/index.js +5 -1
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/border-control/border-control/hook.js.map +1 -1
  7. package/build/box-control/index.js +1 -1
  8. package/build/box-control/index.js.map +1 -1
  9. package/build/color-picker/hex-input.js +5 -4
  10. package/build/color-picker/hex-input.js.map +1 -1
  11. package/build/color-picker/index.native.js +35 -34
  12. package/build/color-picker/index.native.js.map +1 -1
  13. package/build/color-picker/input-with-slider.js +3 -1
  14. package/build/color-picker/input-with-slider.js.map +1 -1
  15. package/build/color-picker/styles.js +31 -43
  16. package/build/color-picker/styles.js.map +1 -1
  17. package/build/color-picker/use-deprecated-props.js +22 -31
  18. package/build/color-picker/use-deprecated-props.js.map +1 -1
  19. package/build/combobox-control/index.js +14 -6
  20. package/build/combobox-control/index.js.map +1 -1
  21. package/build/combobox-control/styles.js +39 -0
  22. package/build/combobox-control/styles.js.map +1 -0
  23. package/build/dropdown-menu/index.js +5 -5
  24. package/build/dropdown-menu/index.js.map +1 -1
  25. package/build/dropdown-menu/index.native.js +5 -5
  26. package/build/dropdown-menu/index.native.js.map +1 -1
  27. package/build/elevation/hook.js +5 -5
  28. package/build/elevation/hook.js.map +1 -1
  29. package/build/external-link/index.js +1 -3
  30. package/build/external-link/index.js.map +1 -1
  31. package/build/focal-point-picker/grid.js +2 -7
  32. package/build/focal-point-picker/grid.js.map +1 -1
  33. package/build/focal-point-picker/index.native.js +8 -8
  34. package/build/focal-point-picker/index.native.js.map +1 -1
  35. package/build/focal-point-picker/tooltip/index.native.js +11 -12
  36. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  37. package/build/form-token-field/index.js +22 -7
  38. package/build/form-token-field/index.js.map +1 -1
  39. package/build/form-token-field/styles.js +40 -0
  40. package/build/form-token-field/styles.js.map +1 -0
  41. package/build/form-token-field/suggestions-list.js +2 -7
  42. package/build/form-token-field/suggestions-list.js.map +1 -1
  43. package/build/grid/component.js +7 -8
  44. package/build/grid/component.js.map +1 -1
  45. package/build/grid/hook.js +1 -5
  46. package/build/grid/hook.js.map +1 -1
  47. package/build/grid/index.js.map +1 -1
  48. package/build/grid/utils.js +4 -7
  49. package/build/grid/utils.js.map +1 -1
  50. package/build/h-stack/component.js +5 -9
  51. package/build/h-stack/component.js.map +1 -1
  52. package/build/h-stack/hook.js +8 -10
  53. package/build/h-stack/hook.js.map +1 -1
  54. package/build/h-stack/index.js.map +1 -1
  55. package/build/h-stack/utils.js +7 -18
  56. package/build/h-stack/utils.js.map +1 -1
  57. package/build/icon/index.js.map +1 -1
  58. package/build/menu-item/index.js +1 -3
  59. package/build/menu-item/index.js.map +1 -1
  60. package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
  61. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  62. package/build/mobile/image/index.native.js +4 -2
  63. package/build/mobile/image/index.native.js.map +1 -1
  64. package/build/modal/index.js +17 -3
  65. package/build/modal/index.js.map +1 -1
  66. package/build/navigation/index.js +4 -1
  67. package/build/navigation/index.js.map +1 -1
  68. package/build/navigation/item/base.js +3 -0
  69. package/build/navigation/item/base.js.map +1 -1
  70. package/build/popover/index.js +4 -4
  71. package/build/popover/index.js.map +1 -1
  72. package/build/range-control/index.js +54 -40
  73. package/build/range-control/index.js.map +1 -1
  74. package/build/range-control/input-range.js +5 -7
  75. package/build/range-control/input-range.js.map +1 -1
  76. package/build/range-control/mark.js +5 -7
  77. package/build/range-control/mark.js.map +1 -1
  78. package/build/range-control/rail.js +10 -16
  79. package/build/range-control/rail.js.map +1 -1
  80. package/build/range-control/styles/range-control-styles.js +62 -62
  81. package/build/range-control/styles/range-control-styles.js.map +1 -1
  82. package/build/range-control/tooltip.js +5 -7
  83. package/build/range-control/tooltip.js.map +1 -1
  84. package/build/range-control/types.js +6 -0
  85. package/build/range-control/types.js.map +1 -0
  86. package/build/range-control/utils.js +22 -29
  87. package/build/range-control/utils.js.map +1 -1
  88. package/build/resizable-box/resize-tooltip/utils.js +2 -7
  89. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  90. package/build/scrollable/component.js +7 -8
  91. package/build/scrollable/component.js.map +1 -1
  92. package/build/scrollable/hook.js +0 -8
  93. package/build/scrollable/hook.js.map +1 -1
  94. package/build/scrollable/index.js.map +1 -1
  95. package/build/scrollable/styles.js +7 -7
  96. package/build/scrollable/styles.js.map +1 -1
  97. package/build/shortcut/index.js +2 -8
  98. package/build/shortcut/index.js.map +1 -1
  99. package/build/slot-fill/index.native.js +6 -8
  100. package/build/slot-fill/index.native.js.map +1 -1
  101. package/build/slot-fill/provider.js +4 -8
  102. package/build/slot-fill/provider.js.map +1 -1
  103. package/build/slot-fill/slot.js +4 -8
  104. package/build/slot-fill/slot.js.map +1 -1
  105. package/build/spacer/component.js.map +1 -1
  106. package/build/spacer/hook.js +2 -2
  107. package/build/spacer/hook.js.map +1 -1
  108. package/build/spacer/index.js.map +1 -1
  109. package/build/text-highlight/index.js +22 -5
  110. package/build/text-highlight/index.js.map +1 -1
  111. package/build/text-highlight/types.js +6 -0
  112. package/build/text-highlight/types.js.map +1 -0
  113. package/build/tip/index.js +5 -11
  114. package/build/tip/index.js.map +1 -1
  115. package/build/tip/types.js +6 -0
  116. package/build/tip/types.js.map +1 -0
  117. package/build/toolbar-group/index.js +3 -3
  118. package/build/toolbar-group/index.js.map +1 -1
  119. package/build/tree-select/index.js +2 -2
  120. package/build/tree-select/index.js.map +1 -1
  121. package/build/ui/utils/get-valid-children.js.map +1 -1
  122. package/build/visually-hidden/component.js +12 -13
  123. package/build/visually-hidden/component.js.map +1 -1
  124. package/build/visually-hidden/index.js.map +1 -1
  125. package/build/visually-hidden/styles.js +3 -1
  126. package/build/visually-hidden/styles.js.map +1 -1
  127. package/build/visually-hidden/types.js +6 -0
  128. package/build/visually-hidden/types.js.map +1 -0
  129. package/build-module/autocomplete/get-default-use-items.js +3 -2
  130. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  131. package/build-module/autocomplete/index.js +3 -2
  132. package/build-module/autocomplete/index.js.map +1 -1
  133. package/build-module/border-control/border-control/hook.js.map +1 -1
  134. package/build-module/box-control/index.js +1 -1
  135. package/build-module/box-control/index.js.map +1 -1
  136. package/build-module/color-picker/hex-input.js +4 -3
  137. package/build-module/color-picker/hex-input.js.map +1 -1
  138. package/build-module/color-picker/index.native.js +36 -35
  139. package/build-module/color-picker/index.native.js.map +1 -1
  140. package/build-module/color-picker/input-with-slider.js +3 -1
  141. package/build-module/color-picker/input-with-slider.js.map +1 -1
  142. package/build-module/color-picker/styles.js +23 -40
  143. package/build-module/color-picker/styles.js.map +1 -1
  144. package/build-module/color-picker/use-deprecated-props.js +22 -31
  145. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  146. package/build-module/combobox-control/index.js +14 -7
  147. package/build-module/combobox-control/index.js.map +1 -1
  148. package/build-module/combobox-control/styles.js +27 -0
  149. package/build-module/combobox-control/styles.js.map +1 -0
  150. package/build-module/dropdown-menu/index.js +5 -4
  151. package/build-module/dropdown-menu/index.js.map +1 -1
  152. package/build-module/dropdown-menu/index.native.js +5 -4
  153. package/build-module/dropdown-menu/index.native.js.map +1 -1
  154. package/build-module/elevation/hook.js +5 -5
  155. package/build-module/elevation/hook.js.map +1 -1
  156. package/build-module/external-link/index.js +1 -2
  157. package/build-module/external-link/index.js.map +1 -1
  158. package/build-module/focal-point-picker/grid.js +2 -6
  159. package/build-module/focal-point-picker/grid.js.map +1 -1
  160. package/build-module/focal-point-picker/index.native.js +8 -8
  161. package/build-module/focal-point-picker/index.native.js.map +1 -1
  162. package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
  163. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  164. package/build-module/form-token-field/index.js +20 -6
  165. package/build-module/form-token-field/index.js.map +1 -1
  166. package/build-module/form-token-field/styles.js +28 -0
  167. package/build-module/form-token-field/styles.js.map +1 -0
  168. package/build-module/form-token-field/suggestions-list.js +2 -7
  169. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  170. package/build-module/grid/component.js +7 -8
  171. package/build-module/grid/component.js.map +1 -1
  172. package/build-module/grid/hook.js +1 -5
  173. package/build-module/grid/hook.js.map +1 -1
  174. package/build-module/grid/index.js.map +1 -1
  175. package/build-module/grid/utils.js +3 -8
  176. package/build-module/grid/utils.js.map +1 -1
  177. package/build-module/h-stack/component.js +3 -7
  178. package/build-module/h-stack/component.js.map +1 -1
  179. package/build-module/h-stack/hook.js +10 -12
  180. package/build-module/h-stack/hook.js.map +1 -1
  181. package/build-module/h-stack/index.js.map +1 -1
  182. package/build-module/h-stack/utils.js +7 -19
  183. package/build-module/h-stack/utils.js.map +1 -1
  184. package/build-module/icon/index.js.map +1 -1
  185. package/build-module/menu-item/index.js +1 -2
  186. package/build-module/menu-item/index.js.map +1 -1
  187. package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
  188. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  189. package/build-module/mobile/image/index.native.js +3 -2
  190. package/build-module/mobile/image/index.native.js.map +1 -1
  191. package/build-module/modal/index.js +19 -5
  192. package/build-module/modal/index.js.map +1 -1
  193. package/build-module/navigation/index.js +4 -1
  194. package/build-module/navigation/index.js.map +1 -1
  195. package/build-module/navigation/item/base.js +3 -0
  196. package/build-module/navigation/item/base.js.map +1 -1
  197. package/build-module/popover/index.js +4 -4
  198. package/build-module/popover/index.js.map +1 -1
  199. package/build-module/range-control/index.js +54 -40
  200. package/build-module/range-control/index.js.map +1 -1
  201. package/build-module/range-control/input-range.js +5 -6
  202. package/build-module/range-control/input-range.js.map +1 -1
  203. package/build-module/range-control/mark.js +5 -6
  204. package/build-module/range-control/mark.js.map +1 -1
  205. package/build-module/range-control/rail.js +10 -15
  206. package/build-module/range-control/rail.js.map +1 -1
  207. package/build-module/range-control/styles/range-control-styles.js +62 -64
  208. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  209. package/build-module/range-control/tooltip.js +5 -6
  210. package/build-module/range-control/tooltip.js.map +1 -1
  211. package/build-module/range-control/types.js +2 -0
  212. package/build-module/range-control/types.js.map +1 -0
  213. package/build-module/range-control/utils.js +22 -29
  214. package/build-module/range-control/utils.js.map +1 -1
  215. package/build-module/resizable-box/resize-tooltip/utils.js +2 -6
  216. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  217. package/build-module/scrollable/component.js +7 -8
  218. package/build-module/scrollable/component.js.map +1 -1
  219. package/build-module/scrollable/hook.js +0 -8
  220. package/build-module/scrollable/hook.js.map +1 -1
  221. package/build-module/scrollable/index.js.map +1 -1
  222. package/build-module/scrollable/styles.js +7 -7
  223. package/build-module/scrollable/styles.js.map +1 -1
  224. package/build-module/shortcut/index.js +2 -7
  225. package/build-module/shortcut/index.js.map +1 -1
  226. package/build-module/slot-fill/index.native.js +6 -7
  227. package/build-module/slot-fill/index.native.js.map +1 -1
  228. package/build-module/slot-fill/provider.js +4 -7
  229. package/build-module/slot-fill/provider.js.map +1 -1
  230. package/build-module/slot-fill/slot.js +4 -7
  231. package/build-module/slot-fill/slot.js.map +1 -1
  232. package/build-module/spacer/component.js.map +1 -1
  233. package/build-module/spacer/hook.js +2 -2
  234. package/build-module/spacer/hook.js.map +1 -1
  235. package/build-module/spacer/index.js.map +1 -1
  236. package/build-module/text-highlight/index.js +23 -6
  237. package/build-module/text-highlight/index.js.map +1 -1
  238. package/build-module/text-highlight/types.js +2 -0
  239. package/build-module/text-highlight/types.js.map +1 -0
  240. package/build-module/tip/index.js +6 -10
  241. package/build-module/tip/index.js.map +1 -1
  242. package/build-module/tip/types.js +2 -0
  243. package/build-module/tip/types.js.map +1 -0
  244. package/build-module/toolbar-group/index.js +3 -2
  245. package/build-module/toolbar-group/index.js.map +1 -1
  246. package/build-module/tree-select/index.js +3 -3
  247. package/build-module/tree-select/index.js.map +1 -1
  248. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  249. package/build-module/visually-hidden/component.js +12 -13
  250. package/build-module/visually-hidden/component.js.map +1 -1
  251. package/build-module/visually-hidden/index.js.map +1 -1
  252. package/build-module/visually-hidden/styles.js +3 -1
  253. package/build-module/visually-hidden/styles.js.map +1 -1
  254. package/build-module/visually-hidden/types.js +2 -0
  255. package/build-module/visually-hidden/types.js.map +1 -0
  256. package/build-style/style-rtl.css +13 -19
  257. package/build-style/style.css +13 -19
  258. package/build-types/border-control/border-control/hook.d.ts +1 -1
  259. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  260. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  261. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  262. package/build-types/color-picker/styles.d.ts +30 -31
  263. package/build-types/color-picker/styles.d.ts.map +1 -1
  264. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  265. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  266. package/build-types/external-link/index.d.ts.map +1 -1
  267. package/build-types/form-token-field/index.d.ts.map +1 -1
  268. package/build-types/form-token-field/styles.d.ts +14 -0
  269. package/build-types/form-token-field/styles.d.ts.map +1 -0
  270. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  271. package/build-types/form-token-field/types.d.ts +7 -0
  272. package/build-types/form-token-field/types.d.ts.map +1 -1
  273. package/build-types/grid/component.d.ts +3 -3
  274. package/build-types/grid/component.d.ts.map +1 -1
  275. package/build-types/grid/hook.d.ts +5 -2
  276. package/build-types/grid/hook.d.ts.map +1 -1
  277. package/build-types/grid/index.d.ts +2 -2
  278. package/build-types/grid/index.d.ts.map +1 -1
  279. package/build-types/grid/stories/index.d.ts +9 -0
  280. package/build-types/grid/stories/index.d.ts.map +1 -0
  281. package/build-types/grid/test/grid.d.ts +2 -0
  282. package/build-types/grid/test/grid.d.ts.map +1 -0
  283. package/build-types/grid/types.d.ts +16 -15
  284. package/build-types/grid/types.d.ts.map +1 -1
  285. package/build-types/grid/utils.d.ts +50 -69
  286. package/build-types/grid/utils.d.ts.map +1 -1
  287. package/build-types/h-stack/component.d.ts +3 -2
  288. package/build-types/h-stack/component.d.ts.map +1 -1
  289. package/build-types/h-stack/hook.d.ts +5 -3
  290. package/build-types/h-stack/hook.d.ts.map +1 -1
  291. package/build-types/h-stack/index.d.ts +2 -2
  292. package/build-types/h-stack/index.d.ts.map +1 -1
  293. package/build-types/h-stack/stories/index.d.ts +9 -0
  294. package/build-types/h-stack/stories/index.d.ts.map +1 -0
  295. package/build-types/h-stack/test/index.d.ts +2 -0
  296. package/build-types/h-stack/test/index.d.ts.map +1 -0
  297. package/build-types/h-stack/utils.d.ts +8 -4
  298. package/build-types/h-stack/utils.d.ts.map +1 -1
  299. package/build-types/icon/index.d.ts +1 -1
  300. package/build-types/icon/index.d.ts.map +1 -1
  301. package/build-types/menu-item/index.d.ts.map +1 -1
  302. package/build-types/popover/index.d.ts.map +1 -1
  303. package/build-types/range-control/index.d.ts +54 -29
  304. package/build-types/range-control/index.d.ts.map +1 -1
  305. package/build-types/range-control/input-range.d.ts +7 -10
  306. package/build-types/range-control/input-range.d.ts.map +1 -1
  307. package/build-types/range-control/mark.d.ts +4 -7
  308. package/build-types/range-control/mark.d.ts.map +1 -1
  309. package/build-types/range-control/rail.d.ts +4 -9
  310. package/build-types/range-control/rail.d.ts.map +1 -1
  311. package/build-types/range-control/stories/index.d.ts +48 -0
  312. package/build-types/range-control/stories/index.d.ts.map +1 -0
  313. package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
  314. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  315. package/build-types/range-control/test/index.d.ts +2 -0
  316. package/build-types/range-control/test/index.d.ts.map +1 -0
  317. package/build-types/range-control/tooltip.d.ts +4 -11
  318. package/build-types/range-control/tooltip.d.ts.map +1 -1
  319. package/build-types/range-control/types.d.ts +302 -0
  320. package/build-types/range-control/types.d.ts.map +1 -0
  321. package/build-types/range-control/utils.d.ts +15 -33
  322. package/build-types/range-control/utils.d.ts.map +1 -1
  323. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  324. package/build-types/scrollable/component.d.ts +3 -3
  325. package/build-types/scrollable/component.d.ts.map +1 -1
  326. package/build-types/scrollable/hook.d.ts +5 -2
  327. package/build-types/scrollable/hook.d.ts.map +1 -1
  328. package/build-types/scrollable/index.d.ts +2 -2
  329. package/build-types/scrollable/index.d.ts.map +1 -1
  330. package/build-types/scrollable/stories/index.d.ts +9 -0
  331. package/build-types/scrollable/stories/index.d.ts.map +1 -0
  332. package/build-types/scrollable/styles.d.ts +7 -7
  333. package/build-types/scrollable/styles.d.ts.map +1 -1
  334. package/build-types/scrollable/test/index.d.ts +2 -0
  335. package/build-types/scrollable/test/index.d.ts.map +1 -0
  336. package/build-types/scrollable/types.d.ts +9 -6
  337. package/build-types/scrollable/types.d.ts.map +1 -1
  338. package/build-types/shortcut/index.d.ts.map +1 -1
  339. package/build-types/slot-fill/provider.d.ts.map +1 -1
  340. package/build-types/slot-fill/slot.d.ts.map +1 -1
  341. package/build-types/spacer/component.d.ts +2 -2
  342. package/build-types/spacer/component.d.ts.map +1 -1
  343. package/build-types/spacer/hook.d.ts +2 -2
  344. package/build-types/spacer/hook.d.ts.map +1 -1
  345. package/build-types/spacer/index.d.ts +1 -1
  346. package/build-types/spacer/index.d.ts.map +1 -1
  347. package/build-types/spacer/test/index.d.ts +2 -0
  348. package/build-types/spacer/test/index.d.ts.map +1 -0
  349. package/build-types/spacer/types.d.ts +41 -29
  350. package/build-types/spacer/types.d.ts.map +1 -1
  351. package/build-types/text-highlight/index.d.ts +23 -0
  352. package/build-types/text-highlight/index.d.ts.map +1 -0
  353. package/build-types/text-highlight/stories/index.d.ts +12 -0
  354. package/build-types/text-highlight/stories/index.d.ts.map +1 -0
  355. package/build-types/text-highlight/test/index.d.ts +2 -0
  356. package/build-types/text-highlight/test/index.d.ts.map +1 -0
  357. package/build-types/text-highlight/types.d.ts +17 -0
  358. package/build-types/text-highlight/types.d.ts.map +1 -0
  359. package/build-types/tip/index.d.ts +5 -14
  360. package/build-types/tip/index.d.ts.map +1 -1
  361. package/build-types/tip/stories/index.d.ts +12 -0
  362. package/build-types/tip/stories/index.d.ts.map +1 -0
  363. package/build-types/tip/types.d.ts +11 -0
  364. package/build-types/tip/types.d.ts.map +1 -0
  365. package/build-types/ui/form-group/form-group.d.ts +1 -1
  366. package/build-types/ui/form-group/types.d.ts +1 -1
  367. package/build-types/ui/form-group/types.d.ts.map +1 -1
  368. package/build-types/ui/form-group/use-form-group.d.ts +3 -3
  369. package/build-types/ui/utils/get-valid-children.d.ts +2 -2
  370. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  371. package/build-types/visually-hidden/component.d.ts +8 -10
  372. package/build-types/visually-hidden/component.d.ts.map +1 -1
  373. package/build-types/visually-hidden/index.d.ts +1 -1
  374. package/build-types/visually-hidden/index.d.ts.map +1 -1
  375. package/build-types/visually-hidden/stories/index.d.ts +14 -0
  376. package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
  377. package/build-types/visually-hidden/styles.d.ts +5 -2
  378. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  379. package/build-types/visually-hidden/test/index.d.ts +2 -0
  380. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  381. package/build-types/visually-hidden/types.d.ts +11 -0
  382. package/build-types/visually-hidden/types.d.ts.map +1 -0
  383. package/package.json +17 -17
  384. package/src/autocomplete/get-default-use-items.js +3 -2
  385. package/src/autocomplete/index.js +3 -2
  386. package/src/border-control/border-control/hook.ts +1 -1
  387. package/src/box-control/index.js +1 -1
  388. package/src/button/README.md +1 -1
  389. package/src/color-picker/hex-input.tsx +3 -2
  390. package/src/color-picker/index.native.js +20 -27
  391. package/src/color-picker/input-with-slider.tsx +2 -0
  392. package/src/color-picker/styles.ts +0 -5
  393. package/src/color-picker/use-deprecated-props.ts +24 -43
  394. package/src/combobox-control/index.js +15 -7
  395. package/src/combobox-control/stories/index.js +3 -2
  396. package/src/combobox-control/style.scss +1 -1
  397. package/src/combobox-control/styles.ts +27 -0
  398. package/src/dropdown-menu/index.js +3 -4
  399. package/src/dropdown-menu/index.native.js +3 -5
  400. package/src/elevation/hook.js +3 -3
  401. package/src/external-link/index.tsx +10 -4
  402. package/src/focal-point-picker/grid.js +2 -5
  403. package/src/focal-point-picker/index.native.js +8 -8
  404. package/src/focal-point-picker/tooltip/index.native.js +10 -11
  405. package/src/form-token-field/index.tsx +45 -24
  406. package/src/form-token-field/style.scss +2 -7
  407. package/src/form-token-field/styles.ts +32 -0
  408. package/src/form-token-field/suggestions-list.tsx +2 -4
  409. package/src/form-token-field/types.ts +7 -0
  410. package/src/grid/README.md +33 -19
  411. package/src/grid/{component.js → component.tsx} +13 -9
  412. package/src/grid/{hook.js → hook.ts} +5 -5
  413. package/src/grid/{index.js → index.ts} +0 -0
  414. package/src/grid/stories/index.tsx +72 -0
  415. package/src/grid/test/{grid.js → grid.tsx} +4 -4
  416. package/src/grid/types.ts +16 -17
  417. package/src/grid/{utils.js → utils.ts} +9 -7
  418. package/src/guide/style.scss +1 -0
  419. package/src/h-stack/{component.js → component.tsx} +8 -8
  420. package/src/h-stack/{hook.js → hook.tsx} +21 -16
  421. package/src/h-stack/{index.js → index.ts} +0 -0
  422. package/src/h-stack/stories/index.tsx +92 -0
  423. package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  424. package/src/h-stack/test/{index.js → index.tsx} +0 -0
  425. package/src/h-stack/{utils.js → utils.ts} +14 -14
  426. package/src/higher-order/navigate-regions/README.md +4 -1
  427. package/src/icon/index.tsx +1 -1
  428. package/src/menu-item/index.js +1 -2
  429. package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
  430. package/src/mobile/image/index.native.js +3 -2
  431. package/src/modal/index.js +21 -2
  432. package/src/modal/stories/index.js +17 -1
  433. package/src/modal/style.scss +9 -18
  434. package/src/navigation/index.js +3 -0
  435. package/src/navigation/item/base.js +2 -1
  436. package/src/popover/README.md +2 -2
  437. package/src/popover/index.js +7 -4
  438. package/src/range-control/README.md +107 -79
  439. package/src/range-control/{index.js → index.tsx} +78 -48
  440. package/src/range-control/{input-range.js → input-range.tsx} +11 -7
  441. package/src/range-control/{mark.js → mark.tsx} +15 -9
  442. package/src/range-control/{rail.js → rail.tsx} +40 -23
  443. package/src/range-control/stories/index.tsx +244 -0
  444. package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
  445. package/src/range-control/test/index.tsx +311 -0
  446. package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
  447. package/src/range-control/types.ts +326 -0
  448. package/src/range-control/utils.ts +132 -0
  449. package/src/resizable-box/resize-tooltip/utils.ts +2 -3
  450. package/src/scrollable/README.md +14 -8
  451. package/src/scrollable/{component.js → component.tsx} +13 -10
  452. package/src/scrollable/{hook.js → hook.ts} +5 -7
  453. package/src/scrollable/{index.js → index.ts} +0 -0
  454. package/src/scrollable/stories/{index.js → index.tsx} +29 -34
  455. package/src/scrollable/{styles.js → styles.ts} +0 -0
  456. package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  457. package/src/scrollable/test/index.tsx +34 -0
  458. package/src/scrollable/types.ts +10 -5
  459. package/src/select-control/test/select-control.tsx +22 -15
  460. package/src/shortcut/index.js +2 -7
  461. package/src/slot-fill/index.native.js +2 -7
  462. package/src/slot-fill/provider.js +3 -7
  463. package/src/slot-fill/slot.js +21 -24
  464. package/src/spacer/README.md +43 -37
  465. package/src/spacer/component.tsx +2 -2
  466. package/src/spacer/hook.ts +4 -2
  467. package/src/spacer/index.ts +1 -1
  468. package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  469. package/src/spacer/test/index.tsx +149 -0
  470. package/src/spacer/types.ts +41 -29
  471. package/src/tab-panel/README.md +1 -1
  472. package/src/text-highlight/README.md +6 -6
  473. package/src/text-highlight/index.tsx +49 -0
  474. package/src/text-highlight/stories/index.tsx +33 -0
  475. package/src/text-highlight/test/index.tsx +93 -0
  476. package/src/text-highlight/types.ts +16 -0
  477. package/src/tip/index.tsx +22 -0
  478. package/src/tip/stories/index.tsx +33 -0
  479. package/src/tip/types.ts +11 -0
  480. package/src/toolbar-group/index.js +1 -2
  481. package/src/tree-select/index.tsx +3 -3
  482. package/src/ui/form-group/types.ts +1 -1
  483. package/src/ui/utils/get-valid-children.ts +4 -2
  484. package/src/visually-hidden/{component.js → component.tsx} +23 -15
  485. package/src/visually-hidden/{index.js → index.ts} +0 -0
  486. package/src/visually-hidden/stories/index.tsx +66 -0
  487. package/src/visually-hidden/{styles.js → styles.ts} +6 -2
  488. package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  489. package/src/visually-hidden/test/index.tsx +17 -0
  490. package/src/visually-hidden/types.ts +11 -0
  491. package/tsconfig.json +1 -0
  492. package/tsconfig.tsbuildinfo +1 -1
  493. package/src/grid/stories/index.js +0 -49
  494. package/src/h-stack/stories/index.js +0 -22
  495. package/src/range-control/stories/index.js +0 -180
  496. package/src/range-control/test/index.js +0 -320
  497. package/src/range-control/utils.js +0 -131
  498. package/src/scrollable/test/index.js +0 -31
  499. package/src/spacer/test/index.js +0 -146
  500. package/src/text-highlight/index.js +0 -28
  501. package/src/text-highlight/stories/index.js +0 -28
  502. package/src/text-highlight/test/index.js +0 -120
  503. package/src/tip/index.js +0 -24
  504. package/src/tip/stories/index.js +0 -26
  505. package/src/visually-hidden/stories/index.js +0 -42
  506. package/src/visually-hidden/test/index.js +0 -19
@@ -0,0 +1,311 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { fireEvent, render, screen } from '@testing-library/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import RangeControl from '../';
10
+
11
+ const getRangeInput = (): HTMLInputElement | null =>
12
+ screen.getByRole( 'slider' ) as HTMLInputElement;
13
+ const getNumberInput = (): HTMLInputElement | null =>
14
+ screen.getByRole( 'spinbutton' ) as HTMLInputElement;
15
+ const getResetButton = (): HTMLButtonElement | null =>
16
+ screen.getByRole( 'button' ) as HTMLButtonElement;
17
+
18
+ const fireChangeEvent = (
19
+ input: HTMLInputElement | null,
20
+ value?: number | string
21
+ ) => fireEvent.change( input as Element, { target: { value } } );
22
+
23
+ describe( 'RangeControl', () => {
24
+ describe( '#render()', () => {
25
+ it( 'should trigger change callback with numeric value', () => {
26
+ const onChange = jest.fn();
27
+
28
+ render( <RangeControl onChange={ onChange } /> );
29
+
30
+ const rangeInput = getRangeInput();
31
+ const numberInput = getNumberInput();
32
+
33
+ rangeInput?.focus();
34
+ fireChangeEvent( rangeInput, '5' );
35
+
36
+ numberInput?.focus();
37
+ fireChangeEvent( numberInput, '10' );
38
+
39
+ expect( onChange ).toHaveBeenCalledWith( 5 );
40
+ expect( onChange ).toHaveBeenCalledWith( 10 );
41
+ } );
42
+
43
+ it( 'should render with icons', () => {
44
+ const { container } = render(
45
+ <RangeControl
46
+ beforeIcon="format-image"
47
+ afterIcon="format-video"
48
+ />
49
+ );
50
+
51
+ const beforeIcon = container.querySelector(
52
+ '.dashicons-format-image'
53
+ );
54
+ const afterIcon = container.querySelector(
55
+ '.dashicons-format-video'
56
+ );
57
+
58
+ expect( beforeIcon ).toBeInTheDocument();
59
+ expect( afterIcon ).toBeInTheDocument();
60
+ } );
61
+ } );
62
+
63
+ describe( 'validation', () => {
64
+ it( 'should not apply if new value is lower than minimum', () => {
65
+ render( <RangeControl min={ 11 } /> );
66
+
67
+ const rangeInput = getRangeInput();
68
+ const numberInput = getNumberInput();
69
+
70
+ fireChangeEvent( numberInput, '10' );
71
+ fireEvent.blur( numberInput as Element );
72
+
73
+ expect( rangeInput?.value ).not.toBe( '10' );
74
+ } );
75
+
76
+ it( 'should not apply if new value is greater than maximum', () => {
77
+ render( <RangeControl max={ 20 } /> );
78
+
79
+ const rangeInput = getRangeInput();
80
+ const numberInput = getNumberInput();
81
+
82
+ fireChangeEvent( numberInput, '21' );
83
+ fireEvent.blur( numberInput as Element );
84
+
85
+ expect( rangeInput?.value ).not.toBe( '21' );
86
+ } );
87
+
88
+ it( 'should not call onChange if new value is invalid', () => {
89
+ const onChange = jest.fn();
90
+ render(
91
+ <RangeControl onChange={ onChange } min={ 10 } max={ 20 } />
92
+ );
93
+
94
+ const numberInput = getNumberInput();
95
+
96
+ numberInput?.focus();
97
+ fireChangeEvent( numberInput, '25e' );
98
+
99
+ expect( onChange ).not.toHaveBeenCalled();
100
+ } );
101
+
102
+ it( 'should keep invalid values in number input until loss of focus', () => {
103
+ const onChange = jest.fn();
104
+ render(
105
+ <RangeControl onChange={ onChange } min={ -1 } max={ 1 } />
106
+ );
107
+
108
+ const rangeInput = getRangeInput();
109
+ const numberInput = getNumberInput();
110
+
111
+ numberInput?.focus();
112
+ fireChangeEvent( numberInput, '-1.1' );
113
+
114
+ expect( numberInput?.value ).toBe( '-1.1' );
115
+ expect( rangeInput?.value ).toBe( '-1' );
116
+
117
+ fireEvent.blur( numberInput as Element );
118
+ expect( onChange ).toHaveBeenCalledWith( -1 );
119
+ expect( numberInput?.value ).toBe( '-1' );
120
+ } );
121
+
122
+ it( 'should validate when provided a max or min of zero', () => {
123
+ render( <RangeControl min={ -100 } max={ 0 } /> );
124
+
125
+ const rangeInput = getRangeInput();
126
+ const numberInput = getNumberInput();
127
+
128
+ numberInput?.focus();
129
+ fireChangeEvent( numberInput, '1' );
130
+ fireEvent.blur( numberInput as Element );
131
+
132
+ expect( rangeInput?.value ).toBe( '0' );
133
+ } );
134
+
135
+ it( 'should validate when min and max are negative', () => {
136
+ render( <RangeControl min={ -100 } max={ -50 } /> );
137
+
138
+ const rangeInput = getRangeInput();
139
+ const numberInput = getNumberInput();
140
+
141
+ numberInput?.focus();
142
+
143
+ fireChangeEvent( numberInput, '-101' );
144
+ expect( rangeInput?.value ).toBe( '-100' );
145
+
146
+ fireChangeEvent( numberInput, '-49' );
147
+ expect( rangeInput?.value ).toBe( '-50' );
148
+
149
+ fireChangeEvent( numberInput, '-50' );
150
+ expect( rangeInput?.value ).toBe( '-50' );
151
+ } );
152
+
153
+ it( 'should take into account the step starting from min', () => {
154
+ const onChange = jest.fn();
155
+ render(
156
+ <RangeControl
157
+ onChange={ onChange }
158
+ min={ 0.1 }
159
+ step={ 0.125 }
160
+ />
161
+ );
162
+
163
+ const rangeInput = getRangeInput();
164
+ const numberInput = getNumberInput();
165
+
166
+ numberInput?.focus();
167
+ fireChangeEvent( numberInput, '0.125' );
168
+
169
+ expect( onChange ).toHaveBeenCalledWith( 0.125 );
170
+ expect( rangeInput?.value ).toBe( '0.125' );
171
+
172
+ fireChangeEvent( numberInput, '0.225' );
173
+
174
+ expect( onChange ).toHaveBeenCalledWith( 0.225 );
175
+ expect( rangeInput?.value ).toBe( '0.225' );
176
+ } );
177
+ } );
178
+
179
+ describe( 'initialPosition / value', () => {
180
+ it( 'should render initial rendered value of 50% of min/max, if no initialPosition or value is defined', () => {
181
+ render( <RangeControl min={ 0 } max={ 10 } /> );
182
+
183
+ const rangeInput = getRangeInput();
184
+
185
+ expect( rangeInput?.value ).toBe( '5' );
186
+ } );
187
+
188
+ it( 'should render initialPosition if no value is provided', () => {
189
+ render( <RangeControl initialPosition={ 50 } /> );
190
+
191
+ const rangeInput = getRangeInput();
192
+
193
+ expect( rangeInput?.value ).toBe( '50' );
194
+ } );
195
+
196
+ it( 'should render value instead of initialPosition is provided', () => {
197
+ render( <RangeControl initialPosition={ 50 } value={ 10 } /> );
198
+
199
+ const rangeInput = getRangeInput();
200
+
201
+ expect( rangeInput?.value ).toBe( '10' );
202
+ } );
203
+ } );
204
+
205
+ describe( 'input field', () => {
206
+ it( 'should render an input field by default', () => {
207
+ render( <RangeControl /> );
208
+
209
+ const numberInput = getNumberInput();
210
+
211
+ expect( numberInput ).toBeInTheDocument();
212
+ } );
213
+
214
+ it( 'should not render an input field, if disabled', () => {
215
+ render( <RangeControl withInputField={ false } /> );
216
+
217
+ const numberInput = screen.queryByRole( 'spinbutton' );
218
+
219
+ expect( numberInput ).not.toBeInTheDocument();
220
+ } );
221
+
222
+ it( 'should render a zero value into input range and field', () => {
223
+ render( <RangeControl value={ 0 } /> );
224
+
225
+ const rangeInput = getRangeInput();
226
+ const numberInput = getNumberInput();
227
+
228
+ expect( rangeInput?.value ).toBe( '0' );
229
+ expect( numberInput?.value ).toBe( '0' );
230
+ } );
231
+
232
+ it( 'should update both field and range on change', () => {
233
+ render( <RangeControl /> );
234
+
235
+ const rangeInput = getRangeInput();
236
+ const numberInput = getNumberInput();
237
+
238
+ rangeInput?.focus();
239
+ fireChangeEvent( rangeInput, 13 );
240
+
241
+ expect( rangeInput?.value ).toBe( '13' );
242
+ expect( numberInput?.value ).toBe( '13' );
243
+
244
+ numberInput?.focus();
245
+ fireChangeEvent( numberInput, 7 );
246
+
247
+ expect( rangeInput?.value ).toBe( '7' );
248
+ expect( numberInput?.value ).toBe( '7' );
249
+ } );
250
+
251
+ it( 'should reset input values if next value is removed', () => {
252
+ render( <RangeControl /> );
253
+
254
+ const rangeInput = getRangeInput();
255
+ const numberInput = getNumberInput();
256
+
257
+ fireChangeEvent( numberInput, '' );
258
+ fireEvent.blur( numberInput as Element );
259
+
260
+ // Reset to 50. Median value of min: 0, max: 100.
261
+ expect( rangeInput?.value ).toBe( '50' );
262
+ // Input field should be blank.
263
+ expect( numberInput?.value ).toBe( '' );
264
+ } );
265
+ } );
266
+
267
+ describe( 'reset', () => {
268
+ it( 'should reset to a custom fallback value, defined by a parent component', () => {
269
+ const spy = jest.fn();
270
+ render(
271
+ <RangeControl
272
+ initialPosition={ 10 }
273
+ allowReset={ true }
274
+ onChange={ spy }
275
+ resetFallbackValue={ 33 }
276
+ />
277
+ );
278
+
279
+ const resetButton = getResetButton();
280
+ const rangeInput = getRangeInput();
281
+ const numberInput = getNumberInput();
282
+
283
+ fireEvent.click( resetButton as Element );
284
+
285
+ expect( rangeInput?.value ).toBe( '33' );
286
+ expect( numberInput?.value ).toBe( '33' );
287
+ expect( spy ).toHaveBeenCalledWith( 33 );
288
+ } );
289
+
290
+ it( 'should reset to a 50% of min/max value, of no initialPosition or value is defined', () => {
291
+ render(
292
+ <RangeControl
293
+ initialPosition={ undefined }
294
+ min={ 0 }
295
+ max={ 100 }
296
+ allowReset={ true }
297
+ resetFallbackValue={ undefined }
298
+ />
299
+ );
300
+
301
+ const resetButton = getResetButton();
302
+ const rangeInput = getRangeInput();
303
+ const numberInput = getNumberInput();
304
+
305
+ fireEvent.click( resetButton as Element );
306
+
307
+ expect( rangeInput?.value ).toBe( '50' );
308
+ expect( numberInput?.value ).toBe( '' );
309
+ } );
310
+ } );
311
+ } );
@@ -1,4 +1,3 @@
1
- // @ts-nocheck
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -14,17 +13,23 @@ import { useCallback, useEffect, useState } from '@wordpress/element';
14
13
  */
15
14
  import { Tooltip } from './styles/range-control-styles';
16
15
 
17
- export default function SimpleTooltip( {
18
- className,
19
- inputRef,
20
- tooltipPosition,
21
- show = false,
22
- style = {},
23
- value = 0,
24
- renderTooltipContent = ( v ) => v,
25
- zIndex = 100,
26
- ...restProps
27
- } ) {
16
+ import type { TooltipProps } from './types';
17
+ import type { WordPressComponentProps } from '../ui/context';
18
+
19
+ export default function SimpleTooltip(
20
+ props: WordPressComponentProps< TooltipProps, 'span' >
21
+ ) {
22
+ const {
23
+ className,
24
+ inputRef,
25
+ tooltipPosition,
26
+ show = false,
27
+ style = {},
28
+ value = 0,
29
+ renderTooltipContent = ( v ) => v,
30
+ zIndex = 100,
31
+ ...restProps
32
+ } = props;
28
33
  const position = useTooltipPosition( { inputRef, tooltipPosition } );
29
34
  const classes = classnames( 'components-simple-tooltip', className );
30
35
  const styles = {
@@ -47,8 +52,8 @@ export default function SimpleTooltip( {
47
52
  );
48
53
  }
49
54
 
50
- function useTooltipPosition( { inputRef, tooltipPosition } ) {
51
- const [ position, setPosition ] = useState();
55
+ function useTooltipPosition( { inputRef, tooltipPosition }: TooltipProps ) {
56
+ const [ position, setPosition ] = useState< string >();
52
57
 
53
58
  const setTooltipPosition = useCallback( () => {
54
59
  if ( inputRef && inputRef.current ) {
@@ -0,0 +1,326 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type {
5
+ CSSProperties,
6
+ FocusEventHandler,
7
+ MouseEventHandler,
8
+ MutableRefObject,
9
+ } from 'react';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import type { BaseControlProps } from '../base-control/types';
15
+ import type { IconType } from '../icon';
16
+
17
+ export type NumericProps = {
18
+ /**
19
+ * The minimum `value` allowed.
20
+ *
21
+ * @default 0
22
+ */
23
+ min?: number;
24
+ /**
25
+ * The maximum `value` allowed.
26
+ *
27
+ * @default 100
28
+ */
29
+ max?: number;
30
+ /**
31
+ * The current value of the range slider.
32
+ */
33
+ value?: number;
34
+ };
35
+
36
+ export type RangeMark = { value: number; label?: string };
37
+ // An expanded definition of this type is used in MarkProps to improve Storybook
38
+ // generated docs.
39
+ export type RangeMarks = boolean | RangeMark[];
40
+
41
+ export type MarksProps = NumericProps & {
42
+ /**
43
+ * Disables the `input`, preventing new values from being applied.
44
+ *
45
+ * @default false
46
+ */
47
+ disabled?: boolean;
48
+ /**
49
+ * Renders a visual representation of `step` ticks. Custom mark indicators
50
+ * can be provided by an `Array`.
51
+ *
52
+ * @default false
53
+ */
54
+ marks?: boolean | { value: number; label?: string }[];
55
+ /**
56
+ * The minimum amount by which `value` changes. It is also a factor in
57
+ * validation as `value` must be a multiple of `step` (offset by `min`) to
58
+ * be valid. Accepts the special string value `any` that voids the
59
+ * validation constraint and overrides both `withInputField` and
60
+ * `showTooltip` props to `false`.
61
+ *
62
+ * @default 1
63
+ */
64
+ step?: number | 'any';
65
+ };
66
+
67
+ export type RangeMarkProps = {
68
+ isFilled?: boolean;
69
+ label?: string;
70
+ disabled?: boolean;
71
+ key?: string;
72
+ style?: CSSProperties;
73
+ };
74
+
75
+ export type ControlledRangeValue = number | '' | null;
76
+
77
+ export type RangeControlProps< IconProps = unknown > = Pick<
78
+ BaseControlProps,
79
+ 'hideLabelFromVision' | 'help'
80
+ > &
81
+ MarksProps & {
82
+ /**
83
+ * If this property is added, an Icon component will be rendered
84
+ * after the slider with the icon equal to afterIcon.
85
+ *
86
+ * For more information on `IconType` see the Icon component:
87
+ * /packages/components/src/icon/index.tsx
88
+ */
89
+ afterIcon?: IconType< IconProps >;
90
+ /**
91
+ * If this property is true, a button to reset the the slider is
92
+ * rendered.
93
+ *
94
+ * @default false
95
+ */
96
+ allowReset?: boolean;
97
+ /**
98
+ * If this property is added, an Icon component will be rendered
99
+ * before the slider with the icon equal to beforeIcon.
100
+ *
101
+ * For more information on `IconType` see the Icon component:
102
+ * /packages/components/src/icon/index.tsx
103
+ */
104
+ beforeIcon?: IconType< IconProps >;
105
+ /**
106
+ * CSS color string for the `RangeControl` wrapper.
107
+ *
108
+ * @default COLORS.ui.theme
109
+ * @see /packages/components/src/utils/colors-values.js
110
+ */
111
+ color?: CSSProperties[ 'color' ];
112
+ /**
113
+ * The current input to use as a fallback if `value` is currently
114
+ * `undefined`.
115
+ */
116
+ currentInput?: number;
117
+ /**
118
+ * An icon to be shown above the slider next to its container title.
119
+ */
120
+ icon?: string;
121
+ /**
122
+ * If no value exists this prop contains the slider starting position.
123
+ */
124
+ initialPosition?: number;
125
+ /**
126
+ * Passed as a prop to the `NumberControl` component and is only
127
+ * applicable if `withInputField` is true. If true, while the number
128
+ * input has focus, pressing `UP` or `DOWN` along with the `SHIFT` key
129
+ * will change the value by the `shiftStep` value.
130
+ *
131
+ * @default true
132
+ */
133
+ isShiftStepEnabled?: boolean;
134
+ /**
135
+ * If this property is added, a label will be generated using label
136
+ * property as the content.
137
+ */
138
+ label?: string;
139
+ /**
140
+ * Callback for when `RangeControl` input loses focus.
141
+ *
142
+ * @default () => void
143
+ */
144
+ onBlur?: FocusEventHandler< HTMLInputElement >;
145
+ /**
146
+ * A function that receives the new value. The value will be less than
147
+ * `max` and more than `min` unless a reset (enabled by `allowReset`)
148
+ * has occurred. In which case the value will be either that of
149
+ * `resetFallbackValue` if it has been specified or otherwise
150
+ * `undefined`.
151
+ *
152
+ * @default () => void
153
+ */
154
+ onChange?: ( value?: number ) => void;
155
+ /**
156
+ * Callback for when `RangeControl` input gains focus.
157
+ *
158
+ * @default () => void
159
+ */
160
+ onFocus?: FocusEventHandler< HTMLInputElement >;
161
+ /**
162
+ * Callback for when mouse exits the `RangeControl`.
163
+ *
164
+ * @default () => void
165
+ */
166
+ onMouseLeave?: MouseEventHandler< HTMLInputElement >;
167
+ /**
168
+ * Callback for when mouse moves within the `RangeControl`.
169
+ *
170
+ * @default () => void
171
+ */
172
+ onMouseMove?: MouseEventHandler< HTMLInputElement >;
173
+ /**
174
+ * CSS color string to customize the rail element's background.
175
+ */
176
+ railColor?: CSSProperties[ 'color' ];
177
+ /**
178
+ * A way to customize the rendered UI of the value.
179
+ *
180
+ * @default ( value ) => value
181
+ */
182
+ renderTooltipContent?: (
183
+ value?: ControlledRangeValue
184
+ ) => string | number | null | undefined;
185
+ /**
186
+ * The value to revert to if the Reset button is clicked (enabled by
187
+ * `allowReset`)
188
+ */
189
+ resetFallbackValue?: number;
190
+ /**
191
+ * Define if separator line under/above control row should be disabled
192
+ * or full width. By default it is placed below excluding underline the
193
+ * control icon.
194
+ */
195
+ separatorType?: 'none' | 'fullWidth' | 'topFullWidth';
196
+ /**
197
+ * Passed as a prop to the `NumberControl` component and is only
198
+ * applicable if `withInputField` and `isShiftStepEnabled` are both true
199
+ * and while the number input has focus. Acts as a multiplier of `step`.
200
+ *
201
+ * @default 10
202
+ */
203
+ shiftStep?: number;
204
+ /**
205
+ * Forcing the Tooltip UI to show or hide. This is overridden to `false`
206
+ * when `step` is set to the special string value `any`.
207
+ */
208
+ showTooltip?: boolean;
209
+ /**
210
+ * CSS color string to customize the track element's background.
211
+ */
212
+ trackColor?: CSSProperties[ 'color' ];
213
+ /**
214
+ * Define if the value selection should present a stepper control or a
215
+ * slider control in the bottom sheet on mobile. To use the stepper set
216
+ * the type value as `stepper`. Defaults to slider if no option is
217
+ * provided.
218
+ */
219
+ type?: 'stepper';
220
+ /**
221
+ * Determines if the `input` number field will render next to the
222
+ * RangeControl. This is overridden to `false` when `step` is set to the
223
+ * special string value `any`.
224
+ *
225
+ * @default true
226
+ */
227
+ withInputField?: boolean;
228
+ };
229
+
230
+ export type RailProps = MarksProps & {
231
+ railColor?: CSSProperties[ 'color' ];
232
+ };
233
+
234
+ export type InputRangeProps = {
235
+ describedBy?: string;
236
+ label?: string;
237
+ onHideTooltip?: () => void;
238
+ onMouseLeave?: MouseEventHandler< HTMLInputElement >;
239
+ onMouseMove?: MouseEventHandler< HTMLInputElement >;
240
+ onShowTooltip?: () => void;
241
+ value?: number | '';
242
+ };
243
+
244
+ export type WrapperProps = {
245
+ color?: CSSProperties[ 'color' ];
246
+ marks?: RangeMarks;
247
+ };
248
+
249
+ export type ThumbProps = {
250
+ isFocused?: boolean;
251
+ disabled?: boolean;
252
+ };
253
+
254
+ export type TooltipProps = {
255
+ show?: boolean;
256
+ position?: string;
257
+ inputRef?: MutableRefObject< HTMLElement | undefined >;
258
+ tooltipPosition?: string;
259
+ value?: ControlledRangeValue;
260
+ renderTooltipContent?: (
261
+ value?: ControlledRangeValue
262
+ ) => string | number | null | undefined;
263
+ zIndex?: number;
264
+ };
265
+
266
+ export type TrackProps = {
267
+ disabled: boolean;
268
+ trackColor: CSSProperties[ 'color' ];
269
+ };
270
+
271
+ export type UseControlledRangeValueArgs = {
272
+ /**
273
+ * The initial value.
274
+ */
275
+ initial?: number;
276
+ /**
277
+ * The maximum value.
278
+ */
279
+ max: number;
280
+ /**
281
+ * The minimum value.
282
+ */
283
+ min: number;
284
+ /**
285
+ * The current value.
286
+ */
287
+ value: number | null;
288
+ };
289
+
290
+ export type UseDebouncedHoverInteractionArgs = {
291
+ /**
292
+ * A callback function invoked when the element is hidden.
293
+ *
294
+ * @default () => {}
295
+ */
296
+ onHide?: () => void;
297
+ /**
298
+ * A callback function invoked when the mouse is moved out of the element.
299
+ *
300
+ * @default () => {}
301
+ */
302
+ onMouseLeave?: MouseEventHandler< HTMLInputElement >;
303
+ /**
304
+ * A callback function invoked when the mouse is moved.
305
+ *
306
+ * @default () => {}
307
+ */
308
+ onMouseMove?: MouseEventHandler< HTMLInputElement >;
309
+ /**
310
+ * A callback function invoked when the element is shown.
311
+ *
312
+ * @default () => {}
313
+ */
314
+ onShow?: () => void;
315
+ /**
316
+ * Timeout before the element is shown or hidden.
317
+ *
318
+ * @default 300
319
+ */
320
+ timeout?: number;
321
+ };
322
+
323
+ export type UseMarksArgs = NumericProps & {
324
+ marks: RangeMarks;
325
+ step: number;
326
+ };