@wordpress/components 19.12.0 → 19.13.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 (717) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/CONTRIBUTING.md +94 -12
  3. package/build/alignment-matrix-control/index.js +3 -3
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/angle-picker-control/index.js +2 -2
  6. package/build/angle-picker-control/index.js.map +1 -1
  7. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  8. package/build/border-box-control/utils.js.map +1 -1
  9. package/build/border-control/border-control/hook.js.map +1 -1
  10. package/build/box-control/all-input-control.js +6 -10
  11. package/build/box-control/all-input-control.js.map +1 -1
  12. package/build/box-control/axial-input-controls.js.map +1 -1
  13. package/build/box-control/index.js +3 -7
  14. package/build/box-control/index.js.map +1 -1
  15. package/build/box-control/input-controls.js +6 -10
  16. package/build/box-control/input-controls.js.map +1 -1
  17. package/build/box-control/unit-control.js +4 -4
  18. package/build/box-control/unit-control.js.map +1 -1
  19. package/build/button/index.native.js +1 -3
  20. package/build/button/index.native.js.map +1 -1
  21. package/build/checkbox-control/index.js.map +1 -1
  22. package/build/color-picker/index.native.js.map +1 -1
  23. package/build/combobox-control/index.js +4 -2
  24. package/build/combobox-control/index.js.map +1 -1
  25. package/build/confirm-dialog/component.js.map +1 -1
  26. package/build/custom-gradient-bar/constants.js +1 -3
  27. package/build/custom-gradient-bar/constants.js.map +1 -1
  28. package/build/custom-gradient-bar/control-points.js +15 -8
  29. package/build/custom-gradient-bar/control-points.js.map +1 -1
  30. package/build/custom-gradient-bar/index.js +5 -5
  31. package/build/custom-gradient-bar/index.js.map +1 -1
  32. package/build/custom-gradient-bar/utils.js +5 -7
  33. package/build/custom-gradient-bar/utils.js.map +1 -1
  34. package/build/custom-gradient-picker/utils.js.map +1 -1
  35. package/build/custom-select-control/index.js.map +1 -1
  36. package/build/date-time/date/index.js +4 -4
  37. package/build/date-time/date/index.js.map +1 -1
  38. package/build/date-time/date-time/index.js +3 -3
  39. package/build/date-time/date-time/index.js.map +1 -1
  40. package/build/dimension-control/index.js +1 -3
  41. package/build/dimension-control/index.js.map +1 -1
  42. package/build/divider/styles.js +5 -5
  43. package/build/divider/styles.js.map +1 -1
  44. package/build/draggable/index.js.map +1 -1
  45. package/build/draggable/index.native.js +6 -1
  46. package/build/draggable/index.native.js.map +1 -1
  47. package/build/drop-zone/provider.js.map +1 -1
  48. package/build/dropdown/index.js +2 -2
  49. package/build/dropdown/index.js.map +1 -1
  50. package/build/dropdown-menu/index.js +13 -2
  51. package/build/dropdown-menu/index.js.map +1 -1
  52. package/build/dropdown-menu/index.native.js +13 -2
  53. package/build/dropdown-menu/index.native.js.map +1 -1
  54. package/build/external-link/index.js +20 -8
  55. package/build/external-link/index.js.map +1 -1
  56. package/build/external-link/styles/external-link-styles.js +3 -3
  57. package/build/external-link/styles/external-link-styles.js.map +1 -1
  58. package/build/external-link/types.js +6 -0
  59. package/build/external-link/types.js.map +1 -0
  60. package/build/flex/flex/hook.js +9 -5
  61. package/build/flex/flex/hook.js.map +1 -1
  62. package/build/focal-point-picker/controls.js +3 -7
  63. package/build/focal-point-picker/controls.js.map +1 -1
  64. package/build/focal-point-picker/index.js.map +1 -1
  65. package/build/focal-point-picker/media.js +4 -8
  66. package/build/focal-point-picker/media.js.map +1 -1
  67. package/build/font-size-picker/index.js +1 -1
  68. package/build/font-size-picker/index.js.map +1 -1
  69. package/build/form-toggle/index.js +6 -4
  70. package/build/form-toggle/index.js.map +1 -1
  71. package/build/form-token-field/index.js +328 -359
  72. package/build/form-token-field/index.js.map +1 -1
  73. package/build/form-token-field/suggestions-list.js +26 -20
  74. package/build/form-token-field/suggestions-list.js.map +1 -1
  75. package/build/form-token-field/token-input.js +39 -53
  76. package/build/form-token-field/token-input.js.map +1 -1
  77. package/build/form-token-field/token.js +3 -3
  78. package/build/form-token-field/token.js.map +1 -1
  79. package/build/form-token-field/types.js +6 -0
  80. package/build/form-token-field/types.js.map +1 -0
  81. package/build/gradient-picker/index.js.map +1 -1
  82. package/build/heading/hook.js.map +1 -1
  83. package/build/higher-order/navigate-regions/index.js.map +1 -1
  84. package/build/higher-order/with-focus-return/index.js.map +1 -1
  85. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  86. package/build/icon/index.js.map +1 -1
  87. package/build/input-control/index.js +5 -5
  88. package/build/input-control/index.js.map +1 -1
  89. package/build/input-control/input-field.js +10 -10
  90. package/build/input-control/input-field.js.map +1 -1
  91. package/build/input-control/reducer/reducer.js.map +1 -1
  92. package/build/input-control/utils.js +1 -1
  93. package/build/input-control/utils.js.map +1 -1
  94. package/build/menu-items-choice/index.js +3 -7
  95. package/build/menu-items-choice/index.js.map +1 -1
  96. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  97. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  98. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
  99. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  100. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  101. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  102. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  103. package/build/mobile/color-settings/index.native.js.map +1 -1
  104. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  105. package/build/mobile/gradient/index.native.js.map +1 -1
  106. package/build/mobile/html-text-input/index.native.js.map +1 -1
  107. package/build/mobile/inserter-button/index.native.js.map +1 -1
  108. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  109. package/build/mobile/media-edit/index.native.js.map +1 -1
  110. package/build/mobile/segmented-control/index.native.js +1 -1
  111. package/build/mobile/segmented-control/index.native.js.map +1 -1
  112. package/build/modal/index.js +1 -1
  113. package/build/modal/index.js.map +1 -1
  114. package/build/navigable-container/container.js +4 -2
  115. package/build/navigable-container/container.js.map +1 -1
  116. package/build/navigation/context.js +12 -16
  117. package/build/navigation/context.js.map +1 -1
  118. package/build/navigation/index.js +3 -3
  119. package/build/navigation/index.js.map +1 -1
  120. package/build/navigation/item/index.js +3 -3
  121. package/build/navigation/item/index.js.map +1 -1
  122. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  123. package/build/navigator/navigator-button/hook.js.map +1 -1
  124. package/build/navigator/navigator-provider/component.js +1 -1
  125. package/build/navigator/navigator-provider/component.js.map +1 -1
  126. package/build/navigator/navigator-screen/component.js +1 -1
  127. package/build/navigator/navigator-screen/component.js.map +1 -1
  128. package/build/notice/index.js +5 -5
  129. package/build/notice/index.js.map +1 -1
  130. package/build/notice/list.js +4 -2
  131. package/build/notice/list.js.map +1 -1
  132. package/build/panel/body.js +3 -3
  133. package/build/panel/body.js.map +1 -1
  134. package/build/placeholder/index.js +26 -12
  135. package/build/placeholder/index.js.map +1 -1
  136. package/build/radio-control/index.js +43 -7
  137. package/build/radio-control/index.js.map +1 -1
  138. package/build/radio-control/types.js +6 -0
  139. package/build/radio-control/types.js.map +1 -0
  140. package/build/range-control/index.js +8 -6
  141. package/build/range-control/index.js.map +1 -1
  142. package/build/range-control/input-range.js +6 -10
  143. package/build/range-control/input-range.js.map +1 -1
  144. package/build/range-control/utils.js +7 -5
  145. package/build/range-control/utils.js.map +1 -1
  146. package/build/resizable-box/resize-tooltip/index.js +3 -3
  147. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  148. package/build/resizable-box/resize-tooltip/utils.js +4 -7
  149. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  150. package/build/responsive-wrapper/index.js.map +1 -1
  151. package/build/select-control/index.js +5 -3
  152. package/build/select-control/index.js.map +1 -1
  153. package/build/slot-fill/fill.js +1 -7
  154. package/build/slot-fill/fill.js.map +1 -1
  155. package/build/slot-fill/slot.js +14 -3
  156. package/build/slot-fill/slot.js.map +1 -1
  157. package/build/snackbar/index.js +7 -7
  158. package/build/snackbar/index.js.map +1 -1
  159. package/build/snackbar/list.js +3 -1
  160. package/build/snackbar/list.js.map +1 -1
  161. package/build/tab-panel/index.js +3 -1
  162. package/build/tab-panel/index.js.map +1 -1
  163. package/build/text/hook.js +4 -4
  164. package/build/text/hook.js.map +1 -1
  165. package/build/text/utils.js.map +1 -1
  166. package/build/toggle-control/index.js +1 -3
  167. package/build/toggle-control/index.js.map +1 -1
  168. package/build/toggle-control/index.native.js +1 -7
  169. package/build/toggle-control/index.native.js.map +1 -1
  170. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  171. package/build/toolbar/index.js.map +1 -1
  172. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  173. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  174. package/build/tooltip/index.js +2 -1
  175. package/build/tooltip/index.js.map +1 -1
  176. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  177. package/build/tree-select/index.js +57 -4
  178. package/build/tree-select/index.js.map +1 -1
  179. package/build/tree-select/types.js +6 -0
  180. package/build/tree-select/types.js.map +1 -0
  181. package/build/ui/form-group/form-group-content.js.map +1 -1
  182. package/build/unit-control/index.js.map +1 -1
  183. package/build/utils/unit-values.js.map +1 -1
  184. package/build/utils/values.js.map +1 -1
  185. package/build/z-stack/component.js +22 -3
  186. package/build/z-stack/component.js.map +1 -1
  187. package/build/z-stack/types.js +6 -0
  188. package/build/z-stack/types.js.map +1 -0
  189. package/build-module/alignment-matrix-control/index.js +2 -1
  190. package/build-module/alignment-matrix-control/index.js.map +1 -1
  191. package/build-module/angle-picker-control/index.js +1 -1
  192. package/build-module/angle-picker-control/index.js.map +1 -1
  193. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  194. package/build-module/border-box-control/utils.js.map +1 -1
  195. package/build-module/border-control/border-control/hook.js.map +1 -1
  196. package/build-module/box-control/all-input-control.js +3 -5
  197. package/build-module/box-control/all-input-control.js.map +1 -1
  198. package/build-module/box-control/axial-input-controls.js.map +1 -1
  199. package/build-module/box-control/index.js +2 -5
  200. package/build-module/box-control/index.js.map +1 -1
  201. package/build-module/box-control/input-controls.js +3 -5
  202. package/build-module/box-control/input-controls.js.map +1 -1
  203. package/build-module/box-control/unit-control.js +3 -1
  204. package/build-module/box-control/unit-control.js.map +1 -1
  205. package/build-module/button/index.native.js +1 -2
  206. package/build-module/button/index.native.js.map +1 -1
  207. package/build-module/checkbox-control/index.js.map +1 -1
  208. package/build-module/color-picker/index.native.js.map +1 -1
  209. package/build-module/combobox-control/index.js +5 -2
  210. package/build-module/combobox-control/index.js.map +1 -1
  211. package/build-module/confirm-dialog/component.js.map +1 -1
  212. package/build-module/custom-gradient-bar/constants.js +0 -1
  213. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  214. package/build-module/custom-gradient-bar/control-points.js +16 -9
  215. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  216. package/build-module/custom-gradient-bar/index.js +6 -6
  217. package/build-module/custom-gradient-bar/index.js.map +1 -1
  218. package/build-module/custom-gradient-bar/utils.js +6 -8
  219. package/build-module/custom-gradient-bar/utils.js.map +1 -1
  220. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  221. package/build-module/custom-select-control/index.js.map +1 -1
  222. package/build-module/date-time/date/index.js +4 -3
  223. package/build-module/date-time/date/index.js.map +1 -1
  224. package/build-module/date-time/date-time/index.js +2 -1
  225. package/build-module/date-time/date-time/index.js.map +1 -1
  226. package/build-module/dimension-control/index.js +1 -2
  227. package/build-module/dimension-control/index.js.map +1 -1
  228. package/build-module/divider/styles.js +5 -5
  229. package/build-module/divider/styles.js.map +1 -1
  230. package/build-module/draggable/index.js.map +1 -1
  231. package/build-module/draggable/index.native.js +6 -1
  232. package/build-module/draggable/index.native.js.map +1 -1
  233. package/build-module/drop-zone/provider.js.map +1 -1
  234. package/build-module/dropdown/index.js +2 -2
  235. package/build-module/dropdown/index.js.map +1 -1
  236. package/build-module/dropdown-menu/index.js +12 -1
  237. package/build-module/dropdown-menu/index.js.map +1 -1
  238. package/build-module/dropdown-menu/index.native.js +12 -1
  239. package/build-module/dropdown-menu/index.native.js.map +1 -1
  240. package/build-module/external-link/index.js +22 -7
  241. package/build-module/external-link/index.js.map +1 -1
  242. package/build-module/external-link/styles/external-link-styles.js +3 -3
  243. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  244. package/build-module/external-link/types.js +2 -0
  245. package/build-module/external-link/types.js.map +1 -0
  246. package/build-module/flex/flex/hook.js +7 -5
  247. package/build-module/flex/flex/hook.js.map +1 -1
  248. package/build-module/focal-point-picker/controls.js +3 -5
  249. package/build-module/focal-point-picker/controls.js.map +1 -1
  250. package/build-module/focal-point-picker/index.js.map +1 -1
  251. package/build-module/focal-point-picker/media.js +3 -5
  252. package/build-module/focal-point-picker/media.js.map +1 -1
  253. package/build-module/font-size-picker/index.js +1 -1
  254. package/build-module/font-size-picker/index.js.map +1 -1
  255. package/build-module/form-toggle/index.js +1 -1
  256. package/build-module/form-toggle/index.js.map +1 -1
  257. package/build-module/form-token-field/index.js +329 -361
  258. package/build-module/form-token-field/index.js.map +1 -1
  259. package/build-module/form-token-field/suggestions-list.js +32 -23
  260. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  261. package/build-module/form-token-field/token-input.js +43 -58
  262. package/build-module/form-token-field/token-input.js.map +1 -1
  263. package/build-module/form-token-field/token.js +3 -1
  264. package/build-module/form-token-field/token.js.map +1 -1
  265. package/build-module/form-token-field/types.js +2 -0
  266. package/build-module/form-token-field/types.js.map +1 -0
  267. package/build-module/gradient-picker/index.js.map +1 -1
  268. package/build-module/heading/hook.js.map +1 -1
  269. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  270. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  271. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  272. package/build-module/icon/index.js.map +1 -1
  273. package/build-module/input-control/index.js +2 -1
  274. package/build-module/input-control/index.js.map +1 -1
  275. package/build-module/input-control/input-field.js +2 -1
  276. package/build-module/input-control/input-field.js.map +1 -1
  277. package/build-module/input-control/reducer/reducer.js.map +1 -1
  278. package/build-module/input-control/utils.js +1 -1
  279. package/build-module/input-control/utils.js.map +1 -1
  280. package/build-module/menu-items-choice/index.js +3 -5
  281. package/build-module/menu-items-choice/index.js.map +1 -1
  282. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  283. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  284. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
  285. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  286. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  287. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  288. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  289. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  290. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  291. package/build-module/mobile/gradient/index.native.js.map +1 -1
  292. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  293. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  294. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  295. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  296. package/build-module/mobile/segmented-control/index.native.js +2 -2
  297. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  298. package/build-module/modal/index.js +1 -1
  299. package/build-module/modal/index.js.map +1 -1
  300. package/build-module/navigable-container/container.js +5 -2
  301. package/build-module/navigable-container/container.js.map +1 -1
  302. package/build-module/navigation/context.js +3 -5
  303. package/build-module/navigation/context.js.map +1 -1
  304. package/build-module/navigation/index.js +3 -1
  305. package/build-module/navigation/index.js.map +1 -1
  306. package/build-module/navigation/item/index.js +3 -1
  307. package/build-module/navigation/item/index.js.map +1 -1
  308. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  309. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  310. package/build-module/navigator/navigator-provider/component.js +1 -1
  311. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  312. package/build-module/navigator/navigator-screen/component.js +1 -1
  313. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  314. package/build-module/notice/index.js +2 -1
  315. package/build-module/notice/index.js.map +1 -1
  316. package/build-module/notice/list.js +4 -1
  317. package/build-module/notice/list.js.map +1 -1
  318. package/build-module/panel/body.js +3 -1
  319. package/build-module/panel/body.js.map +1 -1
  320. package/build-module/placeholder/index.js +24 -11
  321. package/build-module/placeholder/index.js.map +1 -1
  322. package/build-module/radio-control/index.js +40 -7
  323. package/build-module/radio-control/index.js.map +1 -1
  324. package/build-module/radio-control/types.js +2 -0
  325. package/build-module/radio-control/types.js.map +1 -0
  326. package/build-module/range-control/index.js +4 -2
  327. package/build-module/range-control/index.js.map +1 -1
  328. package/build-module/range-control/input-range.js +2 -5
  329. package/build-module/range-control/input-range.js.map +1 -1
  330. package/build-module/range-control/utils.js +4 -1
  331. package/build-module/range-control/utils.js.map +1 -1
  332. package/build-module/resizable-box/resize-tooltip/index.js +2 -1
  333. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  334. package/build-module/resizable-box/resize-tooltip/utils.js +3 -5
  335. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  336. package/build-module/responsive-wrapper/index.js.map +1 -1
  337. package/build-module/select-control/index.js +3 -1
  338. package/build-module/select-control/index.js.map +1 -1
  339. package/build-module/slot-fill/fill.js +1 -6
  340. package/build-module/slot-fill/fill.js.map +1 -1
  341. package/build-module/slot-fill/slot.js +12 -2
  342. package/build-module/slot-fill/slot.js.map +1 -1
  343. package/build-module/snackbar/index.js +3 -1
  344. package/build-module/snackbar/index.js.map +1 -1
  345. package/build-module/snackbar/list.js +4 -1
  346. package/build-module/snackbar/list.js.map +1 -1
  347. package/build-module/tab-panel/index.js +3 -1
  348. package/build-module/tab-panel/index.js.map +1 -1
  349. package/build-module/text/hook.js +4 -4
  350. package/build-module/text/hook.js.map +1 -1
  351. package/build-module/text/utils.js.map +1 -1
  352. package/build-module/toggle-control/index.js +1 -2
  353. package/build-module/toggle-control/index.js.map +1 -1
  354. package/build-module/toggle-control/index.native.js +1 -6
  355. package/build-module/toggle-control/index.native.js.map +1 -1
  356. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  357. package/build-module/toolbar/index.js.map +1 -1
  358. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  359. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  360. package/build-module/tooltip/index.js +2 -1
  361. package/build-module/tooltip/index.js.map +1 -1
  362. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  363. package/build-module/tree-select/index.js +53 -3
  364. package/build-module/tree-select/index.js.map +1 -1
  365. package/build-module/tree-select/types.js +2 -0
  366. package/build-module/tree-select/types.js.map +1 -0
  367. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  368. package/build-module/unit-control/index.js.map +1 -1
  369. package/build-module/utils/unit-values.js.map +1 -1
  370. package/build-module/utils/values.js.map +1 -1
  371. package/build-module/z-stack/component.js +21 -2
  372. package/build-module/z-stack/component.js.map +1 -1
  373. package/build-module/z-stack/types.js +2 -0
  374. package/build-module/z-stack/types.js.map +1 -0
  375. package/build-style/style-rtl.css +32 -3
  376. package/build-style/style.css +32 -4
  377. package/build-types/base-control/stories/index.d.ts.map +1 -1
  378. package/build-types/base-field/hook.d.ts +0 -1
  379. package/build-types/base-field/hook.d.ts.map +1 -1
  380. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  381. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  382. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  383. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
  384. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  385. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
  386. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  387. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
  388. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  389. package/build-types/border-box-control/utils.d.ts.map +1 -1
  390. package/build-types/border-control/border-control/hook.d.ts +0 -1
  391. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  392. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  393. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  394. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
  395. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  396. package/build-types/button-group/index.d.ts +1 -1
  397. package/build-types/button-group/index.d.ts.map +1 -1
  398. package/build-types/card/card/hook.d.ts +0 -1
  399. package/build-types/card/card/hook.d.ts.map +1 -1
  400. package/build-types/card/card-body/hook.d.ts +0 -1
  401. package/build-types/card/card-body/hook.d.ts.map +1 -1
  402. package/build-types/card/card-divider/hook.d.ts +0 -1
  403. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  404. package/build-types/card/card-footer/hook.d.ts +0 -1
  405. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  406. package/build-types/card/card-header/hook.d.ts +0 -1
  407. package/build-types/card/card-header/hook.d.ts.map +1 -1
  408. package/build-types/card/card-media/hook.d.ts +0 -1
  409. package/build-types/card/card-media/hook.d.ts.map +1 -1
  410. package/build-types/checkbox-control/index.d.ts.map +1 -1
  411. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  412. package/build-types/color-picker/styles.d.ts +7 -7
  413. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  414. package/build-types/date-time/date/index.d.ts.map +1 -1
  415. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  416. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  417. package/build-types/date-time/stories/date.d.ts.map +1 -1
  418. package/build-types/date-time/time/styles.d.ts +1 -1
  419. package/build-types/divider/styles.d.ts.map +1 -1
  420. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  421. package/build-types/elevation/hook.d.ts +0 -1
  422. package/build-types/elevation/hook.d.ts.map +1 -1
  423. package/build-types/external-link/index.d.ts +17 -0
  424. package/build-types/external-link/index.d.ts.map +1 -0
  425. package/build-types/external-link/stories/index.d.ts +12 -0
  426. package/build-types/external-link/stories/index.d.ts.map +1 -0
  427. package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
  428. package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
  429. package/build-types/external-link/types.d.ts +15 -0
  430. package/build-types/external-link/types.d.ts.map +1 -0
  431. package/build-types/flex/flex/hook.d.ts +0 -1
  432. package/build-types/flex/flex/hook.d.ts.map +1 -1
  433. package/build-types/flex/flex-block/hook.d.ts +0 -1
  434. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  435. package/build-types/flex/flex-item/hook.d.ts +0 -1
  436. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  437. package/build-types/form-token-field/index.d.ts +15 -0
  438. package/build-types/form-token-field/index.d.ts.map +1 -0
  439. package/build-types/form-token-field/stories/index.d.ts +13 -0
  440. package/build-types/form-token-field/stories/index.d.ts.map +1 -0
  441. package/build-types/form-token-field/suggestions-list.d.ts +10 -0
  442. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
  443. package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
  444. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
  445. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +18 -0
  446. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
  447. package/build-types/form-token-field/token-input.d.ts +12 -0
  448. package/build-types/form-token-field/token-input.d.ts.map +1 -0
  449. package/build-types/form-token-field/token.d.ts +4 -0
  450. package/build-types/form-token-field/token.d.ts.map +1 -0
  451. package/build-types/form-token-field/types.d.ts +176 -0
  452. package/build-types/form-token-field/types.d.ts.map +1 -0
  453. package/build-types/grid/hook.d.ts +0 -1
  454. package/build-types/grid/hook.d.ts.map +1 -1
  455. package/build-types/h-stack/hook.d.ts +0 -1
  456. package/build-types/h-stack/hook.d.ts.map +1 -1
  457. package/build-types/heading/hook.d.ts +0 -1
  458. package/build-types/heading/hook.d.ts.map +1 -1
  459. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  460. package/build-types/input-control/index.d.ts +1 -1
  461. package/build-types/input-control/index.d.ts.map +1 -1
  462. package/build-types/input-control/input-field.d.ts +1 -1
  463. package/build-types/input-control/input-field.d.ts.map +1 -1
  464. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  465. package/build-types/input-control/stories/index.d.ts +5 -5
  466. package/build-types/input-control/stories/index.d.ts.map +1 -1
  467. package/build-types/item-group/item/hook.d.ts +0 -1
  468. package/build-types/item-group/item/hook.d.ts.map +1 -1
  469. package/build-types/item-group/item-group/hook.d.ts +0 -1
  470. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  471. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
  472. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  473. package/build-types/navigator/navigator-button/hook.d.ts +0 -1
  474. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  475. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  476. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  477. package/build-types/radio-control/index.d.ts +31 -0
  478. package/build-types/radio-control/index.d.ts.map +1 -0
  479. package/build-types/radio-control/stories/index.d.ts +12 -0
  480. package/build-types/radio-control/stories/index.d.ts.map +1 -0
  481. package/build-types/radio-control/types.d.ts +29 -0
  482. package/build-types/radio-control/types.d.ts.map +1 -0
  483. package/build-types/range-control/index.d.ts +5 -5
  484. package/build-types/range-control/index.d.ts.map +1 -1
  485. package/build-types/range-control/input-range.d.ts +4 -4
  486. package/build-types/range-control/input-range.d.ts.map +1 -1
  487. package/build-types/range-control/utils.d.ts.map +1 -1
  488. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  489. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  490. package/build-types/scrollable/hook.d.ts +0 -1
  491. package/build-types/scrollable/hook.d.ts.map +1 -1
  492. package/build-types/select-control/index.d.ts +1 -1
  493. package/build-types/select-control/index.d.ts.map +1 -1
  494. package/build-types/select-control/stories/index.d.ts +3 -3
  495. package/build-types/select-control/stories/index.d.ts.map +1 -1
  496. package/build-types/slot-fill/fill.d.ts.map +1 -1
  497. package/build-types/slot-fill/slot.d.ts.map +1 -1
  498. package/build-types/spacer/hook.d.ts +0 -1
  499. package/build-types/spacer/hook.d.ts.map +1 -1
  500. package/build-types/surface/hook.d.ts +0 -1
  501. package/build-types/surface/hook.d.ts.map +1 -1
  502. package/build-types/text/hook.d.ts +0 -1
  503. package/build-types/text/hook.d.ts.map +1 -1
  504. package/build-types/text/utils.d.ts.map +1 -1
  505. package/build-types/text-control/index.d.ts +1 -1
  506. package/build-types/text-control/index.d.ts.map +1 -1
  507. package/build-types/text-control/stories/index.d.ts.map +1 -1
  508. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  509. package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
  510. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  511. package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
  512. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  513. package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
  514. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  515. package/build-types/tooltip/index.d.ts.map +1 -1
  516. package/build-types/tree-select/index.d.ts +53 -0
  517. package/build-types/tree-select/index.d.ts.map +1 -0
  518. package/build-types/tree-select/stories/index.d.ts +12 -0
  519. package/build-types/tree-select/stories/index.d.ts.map +1 -0
  520. package/build-types/tree-select/types.d.ts +30 -0
  521. package/build-types/tree-select/types.d.ts.map +1 -0
  522. package/build-types/truncate/hook.d.ts +0 -1
  523. package/build-types/truncate/hook.d.ts.map +1 -1
  524. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  525. package/build-types/ui/control-group/hook.d.ts +0 -1
  526. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  527. package/build-types/ui/control-label/hook.d.ts +0 -1
  528. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  529. package/build-types/ui/form-group/use-form-group.d.ts +0 -2
  530. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  531. package/build-types/unit-control/index.d.ts +1 -1
  532. package/build-types/unit-control/index.d.ts.map +1 -1
  533. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  534. package/build-types/utils/unit-values.d.ts.map +1 -1
  535. package/build-types/utils/values.d.ts.map +1 -1
  536. package/build-types/v-stack/hook.d.ts +0 -1
  537. package/build-types/v-stack/hook.d.ts.map +1 -1
  538. package/build-types/z-stack/component.d.ts +18 -28
  539. package/build-types/z-stack/component.d.ts.map +1 -1
  540. package/build-types/z-stack/stories/index.d.ts +6 -0
  541. package/build-types/z-stack/stories/index.d.ts.map +1 -0
  542. package/build-types/z-stack/types.d.ts +33 -0
  543. package/build-types/z-stack/types.d.ts.map +1 -0
  544. package/package.json +17 -17
  545. package/src/alignment-matrix-control/index.js +2 -1
  546. package/src/angle-picker-control/index.js +1 -1
  547. package/src/base-control/stories/index.tsx +2 -3
  548. package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
  549. package/src/border-box-control/utils.ts +5 -2
  550. package/src/border-control/border-control/hook.ts +2 -3
  551. package/src/box-control/all-input-control.js +2 -4
  552. package/src/box-control/axial-input-controls.js +4 -6
  553. package/src/box-control/index.js +2 -5
  554. package/src/box-control/input-controls.js +33 -36
  555. package/src/box-control/unit-control.js +2 -1
  556. package/src/button/index.native.js +1 -2
  557. package/src/card/stories/index.js +10 -5
  558. package/src/checkbox-control/index.tsx +2 -3
  559. package/src/checkbox-control/stories/index.tsx +2 -3
  560. package/src/checkbox-control/test/index.tsx +2 -1
  561. package/src/color-picker/index.native.js +7 -4
  562. package/src/combobox-control/index.js +4 -2
  563. package/src/confirm-dialog/component.tsx +7 -8
  564. package/src/custom-gradient-bar/constants.js +2 -2
  565. package/src/custom-gradient-bar/control-points.js +20 -16
  566. package/src/custom-gradient-bar/index.js +11 -11
  567. package/src/custom-gradient-bar/test/utils.js +79 -0
  568. package/src/custom-gradient-bar/utils.js +6 -18
  569. package/src/custom-gradient-picker/style.scss +1 -3
  570. package/src/custom-gradient-picker/utils.js +4 -3
  571. package/src/custom-select-control/index.js +2 -1
  572. package/src/custom-select-control/stories/index.js +1 -2
  573. package/src/date-time/date/index.tsx +2 -2
  574. package/src/date-time/date/style.scss +10 -0
  575. package/src/date-time/date/test/index.tsx +1 -1
  576. package/src/date-time/date-time/index.tsx +6 -8
  577. package/src/date-time/stories/date-time.tsx +4 -6
  578. package/src/date-time/stories/date.tsx +2 -3
  579. package/src/date-time/time/test/index.tsx +12 -12
  580. package/src/dimension-control/index.js +1 -2
  581. package/src/divider/styles.ts +2 -3
  582. package/src/draggable/index.js +3 -3
  583. package/src/draggable/index.native.js +12 -4
  584. package/src/drop-zone/provider.js +1 -2
  585. package/src/dropdown/index.js +2 -2
  586. package/src/dropdown-menu/index.js +11 -1
  587. package/src/dropdown-menu/index.native.js +11 -1
  588. package/src/external-link/README.md +18 -0
  589. package/src/external-link/{index.js → index.tsx} +26 -6
  590. package/src/external-link/stories/index.tsx +36 -0
  591. package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
  592. package/src/external-link/types.ts +15 -0
  593. package/src/flex/flex/hook.js +4 -1
  594. package/src/focal-point-picker/controls.js +1 -5
  595. package/src/focal-point-picker/index.js +2 -8
  596. package/src/focal-point-picker/media.js +2 -5
  597. package/src/font-size-picker/index.js +3 -1
  598. package/src/form-toggle/index.js +2 -1
  599. package/src/form-toggle/test/index.js +1 -2
  600. package/src/form-token-field/index.tsx +694 -0
  601. package/src/form-token-field/stories/index.tsx +103 -0
  602. package/src/form-token-field/style.scss +2 -1
  603. package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +45 -29
  604. package/src/form-token-field/test/index.js +64 -31
  605. package/src/form-token-field/test/lib/{token-field-wrapper.js → token-field-wrapper.tsx} +24 -9
  606. package/src/form-token-field/token-input.tsx +76 -0
  607. package/src/form-token-field/{token.js → token.tsx} +4 -2
  608. package/src/form-token-field/types.ts +178 -0
  609. package/src/gradient-picker/index.js +4 -3
  610. package/src/heading/hook.ts +5 -4
  611. package/src/higher-order/navigate-regions/index.js +7 -5
  612. package/src/higher-order/with-filters/test/index.js +43 -36
  613. package/src/higher-order/with-focus-return/index.js +14 -13
  614. package/src/higher-order/with-spoken-messages/index.js +8 -7
  615. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  616. package/src/icon/index.tsx +2 -2
  617. package/src/input-control/index.tsx +2 -1
  618. package/src/input-control/input-field.tsx +2 -1
  619. package/src/input-control/reducer/reducer.ts +23 -21
  620. package/src/input-control/utils.ts +1 -1
  621. package/src/item-group/stories/index.js +2 -1
  622. package/src/menu-item/test/index.js +2 -1
  623. package/src/menu-items-choice/index.js +2 -5
  624. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
  625. package/src/mobile/bottom-sheet/cell.native.js +2 -3
  626. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
  627. package/src/mobile/bottom-sheet/index.native.js +14 -17
  628. package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
  629. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
  630. package/src/mobile/color-settings/index.native.js +2 -4
  631. package/src/mobile/global-styles-context/index.native.js +8 -7
  632. package/src/mobile/gradient/index.native.js +12 -9
  633. package/src/mobile/gradient/test/index.native.js +1 -3
  634. package/src/mobile/html-text-input/index.native.js +2 -3
  635. package/src/mobile/inserter-button/index.native.js +2 -6
  636. package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
  637. package/src/mobile/media-edit/index.native.js +2 -3
  638. package/src/mobile/segmented-control/index.native.js +4 -5
  639. package/src/mobile/utils/test/index.native.js +3 -12
  640. package/src/modal/index.js +1 -1
  641. package/src/navigable-container/container.js +3 -2
  642. package/src/navigable-container/test/menu.js +1 -2
  643. package/src/navigable-container/test/tabbable.js +1 -2
  644. package/src/navigation/context.js +2 -5
  645. package/src/navigation/index.js +2 -1
  646. package/src/navigation/item/index.js +2 -1
  647. package/src/navigation/stories/controlled-state.js +1 -1
  648. package/src/navigation/stories/more-examples.js +2 -3
  649. package/src/navigation/test/index.js +252 -52
  650. package/src/navigator/navigator-back-button/hook.ts +14 -12
  651. package/src/navigator/navigator-button/hook.ts +14 -13
  652. package/src/navigator/navigator-provider/component.tsx +2 -6
  653. package/src/navigator/navigator-screen/component.tsx +3 -3
  654. package/src/notice/index.js +2 -1
  655. package/src/notice/list.js +3 -1
  656. package/src/panel/body.js +2 -1
  657. package/src/placeholder/README.md +7 -6
  658. package/src/placeholder/index.js +27 -10
  659. package/src/placeholder/style.scss +23 -0
  660. package/src/radio-control/README.md +17 -23
  661. package/src/radio-control/index.tsx +107 -0
  662. package/src/radio-control/stories/index.tsx +72 -0
  663. package/src/radio-control/types.ts +32 -0
  664. package/src/range-control/index.js +4 -2
  665. package/src/range-control/input-range.js +2 -5
  666. package/src/range-control/utils.js +3 -1
  667. package/src/resizable-box/resize-tooltip/index.tsx +2 -1
  668. package/src/resizable-box/resize-tooltip/utils.ts +1 -5
  669. package/src/responsive-wrapper/index.js +2 -4
  670. package/src/sandbox/test/index.js +4 -6
  671. package/src/select-control/index.tsx +3 -1
  672. package/src/select-control/stories/index.tsx +3 -4
  673. package/src/slot-fill/fill.js +1 -5
  674. package/src/slot-fill/slot.js +12 -2
  675. package/src/snackbar/index.js +1 -1
  676. package/src/snackbar/list.js +2 -1
  677. package/src/tab-panel/index.js +3 -1
  678. package/src/text/hook.js +4 -1
  679. package/src/text/utils.js +2 -3
  680. package/src/text-control/stories/index.tsx +4 -6
  681. package/src/toggle-control/index.js +1 -2
  682. package/src/toggle-control/index.native.js +2 -6
  683. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
  684. package/src/toolbar/index.js +1 -2
  685. package/src/tools-panel/tools-panel/hook.ts +2 -4
  686. package/src/tools-panel/tools-panel-header/hook.ts +2 -5
  687. package/src/tooltip/index.js +1 -0
  688. package/src/tree-grid/roving-tab-index-item.js +2 -4
  689. package/src/tree-grid/test/index.js +2 -3
  690. package/src/tree-select/README.md +2 -2
  691. package/src/tree-select/index.tsx +99 -0
  692. package/src/tree-select/stories/index.tsx +80 -0
  693. package/src/tree-select/types.ts +35 -0
  694. package/src/ui/context/wordpress-component.ts +4 -5
  695. package/src/ui/form-group/form-group-content.js +4 -4
  696. package/src/unit-control/index.tsx +7 -9
  697. package/src/unit-control/stories/index.tsx +8 -12
  698. package/src/unit-control/test/index.tsx +4 -7
  699. package/src/utils/hooks/stories/use-cx.js +8 -7
  700. package/src/utils/hooks/test/use-controlled-state.js +2 -1
  701. package/src/utils/unit-values.ts +2 -1
  702. package/src/utils/values.js +2 -3
  703. package/src/z-stack/README.md +14 -3
  704. package/src/z-stack/component.tsx +24 -29
  705. package/src/z-stack/stories/index.tsx +76 -0
  706. package/src/z-stack/types.ts +33 -0
  707. package/tsconfig.json +5 -0
  708. package/tsconfig.tsbuildinfo +1 -1
  709. package/src/external-link/stories/index.js +0 -23
  710. package/src/form-token-field/index.js +0 -725
  711. package/src/form-token-field/stories/index.js +0 -102
  712. package/src/form-token-field/token-input.js +0 -81
  713. package/src/radio-control/index.js +0 -69
  714. package/src/radio-control/stories/index.js +0 -41
  715. package/src/tree-select/index.js +0 -48
  716. package/src/tree-select/stories/index.js +0 -80
  717. package/src/z-stack/stories/index.js +0 -70
@@ -31,7 +31,6 @@ import {
31
31
  getHorizontalRelativeGradientPosition,
32
32
  } from './utils';
33
33
  import {
34
- GRADIENT_MARKERS_WIDTH,
35
34
  MINIMUM_SIGNIFICANT_MOVE,
36
35
  KEYBOARD_CONTROL_POINT_VARIATION,
37
36
  } from './constants';
@@ -61,6 +60,7 @@ function ControlPointButton( { isOpen, position, color, ...additionalProps } ) {
61
60
  ) }
62
61
  style={ {
63
62
  left: `${ position }%`,
63
+ transform: 'translateX( -50% )',
64
64
  } }
65
65
  { ...additionalProps }
66
66
  />
@@ -89,7 +89,7 @@ function GradientColorPickerDropdown( {
89
89
  result.position = 'bottom left';
90
90
  }
91
91
  return result;
92
- }, [ gradientPickerDomRef.current, isRenderedInSidebar ] );
92
+ }, [ gradientPickerDomRef, isRenderedInSidebar ] );
93
93
  return (
94
94
  <CustomColorPickerDropdown
95
95
  isRenderedInSidebar={ isRenderedInSidebar }
@@ -115,14 +115,10 @@ function ControlPoints( {
115
115
  const onMouseMove = ( event ) => {
116
116
  const relativePosition = getHorizontalRelativeGradientPosition(
117
117
  event.clientX,
118
- gradientPickerDomRef.current,
119
- GRADIENT_MARKERS_WIDTH
118
+ gradientPickerDomRef.current
120
119
  );
121
- const {
122
- initialPosition,
123
- index,
124
- significantMoveHappened,
125
- } = controlPointMoveState.current;
120
+ const { initialPosition, index, significantMoveHappened } =
121
+ controlPointMoveState.current;
126
122
  if (
127
123
  ! significantMoveHappened &&
128
124
  Math.abs( initialPosition - relativePosition ) >=
@@ -150,9 +146,15 @@ function ControlPoints( {
150
146
  }
151
147
  };
152
148
 
149
+ // Adding `cleanEventListeners` to the dependency array below requires the function itself to be wrapped in a `useCallback`
150
+ // This memoization would prevent the event listeners from being properly cleaned.
151
+ // Instead, we'll pass a ref to the function in our `useEffect` so `cleanEventListeners` itself is no longer a dependency.
152
+ const cleanEventListenersRef = useRef();
153
+ cleanEventListenersRef.current = cleanEventListeners;
154
+
153
155
  useEffect( () => {
154
156
  return () => {
155
- cleanEventListeners();
157
+ cleanEventListenersRef.current();
156
158
  };
157
159
  }, [] );
158
160
 
@@ -312,12 +314,14 @@ function InsertPoint( {
312
314
  } }
313
315
  className="components-custom-gradient-picker__insert-point"
314
316
  icon={ plus }
315
- style={ {
316
- left:
317
- insertPosition !== null
318
- ? `${ insertPosition }%`
319
- : undefined,
320
- } }
317
+ style={
318
+ insertPosition !== null
319
+ ? {
320
+ left: `${ insertPosition }%`,
321
+ transform: 'translateX( -50% )',
322
+ }
323
+ : undefined
324
+ }
321
325
  />
322
326
  ) }
323
327
  renderContent={ () => (
@@ -15,10 +15,7 @@ import { useRef, useReducer } from '@wordpress/element';
15
15
  */
16
16
  import ControlPoints from './control-points';
17
17
  import { getHorizontalRelativeGradientPosition } from './utils';
18
- import {
19
- INSERT_POINT_WIDTH,
20
- MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT,
21
- } from './constants';
18
+ import { MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT } from './constants';
22
19
 
23
20
  function customGradientBarReducer( state, action ) {
24
21
  switch ( action.type ) {
@@ -80,7 +77,7 @@ export default function CustomGradientBar( {
80
77
  disableAlpha = false,
81
78
  __experimentalIsRenderedInSidebar,
82
79
  } ) {
83
- const gradientPickerDomRef = useRef();
80
+ const gradientMarkersContainerDomRef = useRef();
84
81
 
85
82
  const [ gradientBarState, gradientBarStateDispatch ] = useReducer(
86
83
  customGradientBarReducer,
@@ -89,8 +86,7 @@ export default function CustomGradientBar( {
89
86
  const onMouseEnterAndMove = ( event ) => {
90
87
  const insertPosition = getHorizontalRelativeGradientPosition(
91
88
  event.clientX,
92
- gradientPickerDomRef.current,
93
- INSERT_POINT_WIDTH
89
+ gradientMarkersContainerDomRef.current
94
90
  );
95
91
 
96
92
  // If the insert point is close to an existing control point don't show it.
@@ -121,7 +117,6 @@ export default function CustomGradientBar( {
121
117
 
122
118
  return (
123
119
  <div
124
- ref={ gradientPickerDomRef }
125
120
  className={ classnames(
126
121
  'components-custom-gradient-picker__gradient-bar',
127
122
  { 'has-gradient': hasGradient }
@@ -131,14 +126,19 @@ export default function CustomGradientBar( {
131
126
  style={ { background } }
132
127
  onMouseLeave={ onMouseLeave }
133
128
  >
134
- <div className="components-custom-gradient-picker__markers-container">
129
+ <div
130
+ ref={ gradientMarkersContainerDomRef }
131
+ className="components-custom-gradient-picker__markers-container"
132
+ >
135
133
  { ! disableInserter &&
136
134
  ( isMovingInserter || isInsertingControlPoint ) && (
137
135
  <ControlPoints.InsertPoint
138
136
  __experimentalIsRenderedInSidebar={
139
137
  __experimentalIsRenderedInSidebar
140
138
  }
141
- gradientPickerDomRef={ gradientPickerDomRef }
139
+ gradientPickerDomRef={
140
+ gradientMarkersContainerDomRef
141
+ }
142
142
  disableAlpha={ disableAlpha }
143
143
  insertPosition={ gradientBarState.insertPosition }
144
144
  value={ controlPoints }
@@ -161,7 +161,7 @@ export default function CustomGradientBar( {
161
161
  }
162
162
  disableAlpha={ disableAlpha }
163
163
  disableRemove={ disableInserter }
164
- gradientPickerDomRef={ gradientPickerDomRef }
164
+ gradientPickerDomRef={ gradientMarkersContainerDomRef }
165
165
  ignoreMarkerPosition={
166
166
  isInsertingControlPoint
167
167
  ? gradientBarState.insertPosition
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { getHorizontalRelativeGradientPosition } from '../utils';
5
+
6
+ describe( 'getHorizontalRelativeGradientPosition', () => {
7
+ it( 'should return relative percentage position', () => {
8
+ const containerElement = {
9
+ getBoundingClientRect: () => ( {
10
+ x: 0,
11
+ width: 1000,
12
+ } ),
13
+ };
14
+
15
+ expect(
16
+ getHorizontalRelativeGradientPosition( 500, containerElement )
17
+ ).toBe( 50 );
18
+ } );
19
+
20
+ it( 'should subtract the x position of the container from the mouse position', () => {
21
+ const containerElement = {
22
+ getBoundingClientRect: () => ( {
23
+ x: 50,
24
+ width: 1000,
25
+ } ),
26
+ };
27
+
28
+ expect(
29
+ getHorizontalRelativeGradientPosition( 550, containerElement )
30
+ ).toBe( 50 );
31
+ } );
32
+
33
+ it( 'should clamp to a whole percentage number', () => {
34
+ const containerElement = {
35
+ getBoundingClientRect: () => ( {
36
+ x: 0,
37
+ width: 1000,
38
+ } ),
39
+ };
40
+
41
+ expect(
42
+ getHorizontalRelativeGradientPosition( 333, containerElement )
43
+ ).toBe( 33 );
44
+ } );
45
+
46
+ it( 'should clamp to zero when mouse position is less the x position', () => {
47
+ const containerElement = {
48
+ getBoundingClientRect: () => ( {
49
+ x: 50,
50
+ width: 1000,
51
+ } ),
52
+ };
53
+
54
+ expect(
55
+ getHorizontalRelativeGradientPosition( 2, containerElement )
56
+ ).toBe( 0 );
57
+ } );
58
+
59
+ it( 'should clamp to 100 when mouse position is greater than width', () => {
60
+ const containerElement = {
61
+ getBoundingClientRect: () => ( {
62
+ x: 0,
63
+ width: 1000,
64
+ } ),
65
+ };
66
+
67
+ expect(
68
+ getHorizontalRelativeGradientPosition( 1500, containerElement )
69
+ ).toBe( 100 );
70
+ } );
71
+
72
+ it( 'should return undefined if no containerElement is provided', () => {
73
+ const containerElement = undefined;
74
+
75
+ expect(
76
+ getHorizontalRelativeGradientPosition( 1500, containerElement )
77
+ ).toBeUndefined();
78
+ } );
79
+ } );
@@ -1,11 +1,7 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import {
5
- MINIMUM_DISTANCE_BETWEEN_POINTS,
6
- MINIMUM_ABSOLUTE_LEFT_POSITION,
7
- INSERT_POINT_WIDTH,
8
- } from './constants';
4
+ import { MINIMUM_DISTANCE_BETWEEN_POINTS } from './constants';
9
5
 
10
6
  /**
11
7
  * Control point for the gradient bar.
@@ -171,29 +167,21 @@ export function updateControlPointColorByPosition(
171
167
  /**
172
168
  * Gets the horizontal coordinate when dragging a control point with the mouse.
173
169
  *
174
- * @param {number} mouseXCoordinate Horizontal coordinate of the mouse position.
175
- * @param {Element} containerElement Container for the gradient picker.
176
- * @param {number} positionedElementWidth Width of the positioned element.
170
+ * @param {number} mouseXCoordinate Horizontal coordinate of the mouse position.
171
+ * @param {Element} containerElement Container for the gradient picker.
177
172
  *
178
173
  * @return {number} Whole number percentage from the left.
179
174
  */
180
175
  export function getHorizontalRelativeGradientPosition(
181
176
  mouseXCoordinate,
182
- containerElement,
183
- positionedElementWidth
177
+ containerElement
184
178
  ) {
185
179
  if ( ! containerElement ) {
186
180
  return;
187
181
  }
188
182
  const { x, width } = containerElement.getBoundingClientRect();
189
- const absolutePositionValue =
190
- mouseXCoordinate -
191
- x -
192
- MINIMUM_ABSOLUTE_LEFT_POSITION -
193
- positionedElementWidth / 2;
194
- const availableWidth =
195
- width - MINIMUM_ABSOLUTE_LEFT_POSITION - INSERT_POINT_WIDTH;
183
+ const absolutePositionValue = mouseXCoordinate - x;
196
184
  return Math.round(
197
- clampPercent( ( absolutePositionValue * 100 ) / availableWidth )
185
+ clampPercent( ( absolutePositionValue * 100 ) / width )
198
186
  );
199
187
  }
@@ -10,12 +10,10 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
10
10
  width: 100%;
11
11
  height: $grid-unit-60;
12
12
  margin-bottom: $grid-unit-20+$grid-unit-05;
13
- /*rtl:ignore*/
14
- padding-right: $components-custom-gradient-picker__padding;
15
13
 
16
14
  .components-custom-gradient-picker__markers-container {
17
15
  position: relative;
18
- width: calc(100% - #{ $grid-unit-40 });
16
+ width: calc(100% - #{ $grid-unit-60 });
19
17
  margin-left: auto;
20
18
  margin-right: auto;
21
19
  }
@@ -44,9 +44,10 @@ export function getGradientAstWithDefault( value ) {
44
44
 
45
45
  if ( gradientAST.orientation?.type === 'directional' ) {
46
46
  gradientAST.orientation.type = 'angular';
47
- gradientAST.orientation.value = DIRECTIONAL_ORIENTATION_ANGLE_MAP[
48
- gradientAST.orientation.value
49
- ].toString();
47
+ gradientAST.orientation.value =
48
+ DIRECTIONAL_ORIENTATION_ANGLE_MAP[
49
+ gradientAST.orientation.value
50
+ ].toString();
50
51
  }
51
52
 
52
53
  if ( gradientAST.colorStops.some( hasUnsupportedLength ) ) {
@@ -180,7 +180,8 @@ export default function CustomSelectControl( {
180
180
  'is-highlighted':
181
181
  index === highlightedIndex,
182
182
  'has-hint': !! item.__experimentalHint,
183
- 'is-next-36px-default-size': __next36pxDefaultSize,
183
+ 'is-next-36px-default-size':
184
+ __next36pxDefaultSize,
184
185
  }
185
186
  ),
186
187
  style: item.style,
@@ -55,8 +55,7 @@ WithLongLabels.args = {
55
55
  },
56
56
  {
57
57
  key: 'reallylonglabel3',
58
- name:
59
- 'That really is ok though because you should stress test your UIs.',
58
+ name: 'That really is ok though because you should stress test your UIs.',
60
59
  },
61
60
  ],
62
61
  };
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import moment from 'moment';
5
5
  import type { Moment } from 'moment';
6
- import { noop } from 'lodash';
7
6
  // Needed to initialise the default datepicker styles.
8
7
  // See: https://github.com/airbnb/react-dates#initialize
9
8
  import 'react-dates/initialize';
@@ -27,6 +26,7 @@ import { Day, NavPrevButton, NavNextButton } from './styles';
27
26
 
28
27
  const TIMEZONELESS_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
29
28
  const ARIAL_LABEL_TIME_FORMAT = 'dddd, LL';
29
+ const noop = () => {};
30
30
 
31
31
  function DatePickerDay( { day, events = [] }: DatePickerDayProps ) {
32
32
  const ref = useRef< HTMLDivElement >( null );
@@ -64,7 +64,7 @@ function DatePickerDay( { day, events = [] }: DatePickerDayProps ) {
64
64
  );
65
65
 
66
66
  parentNode.setAttribute( 'aria-label', dayWithEventsDescription );
67
- }, [ events.length ] );
67
+ }, [ day, events.length ] );
68
68
 
69
69
  return (
70
70
  <Day
@@ -53,6 +53,11 @@
53
53
  border: none;
54
54
  font-size: $default-font-size;
55
55
  border-radius: $radius-round;
56
+ background: $white;
57
+
58
+ &:hover {
59
+ color: var(--wp-admin-theme-color);
60
+ }
56
61
 
57
62
  &:focus {
58
63
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 0 0 #{ $border-width-focus + $border-width } $white;
@@ -60,12 +65,17 @@
60
65
  }
61
66
  }
62
67
 
68
+ .CalendarDay__today {
69
+ background: $gray-100;
70
+ }
71
+
63
72
  .CalendarDay__selected {
64
73
  background: var(--wp-admin-theme-color);
65
74
  border: 2px solid transparent; // This indicates selection in Windows 10 high contrast mode.
66
75
 
67
76
  &:hover {
68
77
  background: var(--wp-admin-theme-color-darker-20);
78
+ color: $white;
69
79
  }
70
80
 
71
81
  &:focus {
@@ -28,7 +28,7 @@ describe( 'DatePicker', () => {
28
28
  it( "should highlight today's date when not provided a currentDate", () => {
29
29
  render( <DatePicker /> );
30
30
 
31
- const todayDescription = moment().format( 'dddd, MMM D, YYYY' );
31
+ const todayDescription = moment().format( 'dddd, MMMM D, YYYY' );
32
32
  expect(
33
33
  screen.getByRole( 'button', { name: todayDescription } )
34
34
  ).toHaveClass( 'CalendarDay__selected' );
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { noop } from 'lodash';
5
4
  import type { ForwardedRef } from 'react';
6
5
 
7
6
  /**
@@ -25,6 +24,8 @@ import { Spacer } from '../../spacer';
25
24
 
26
25
  export { DatePicker, TimePicker };
27
26
 
27
+ const noop = () => {};
28
+
28
29
  function UnforwardedDateTimePicker(
29
30
  {
30
31
  currentDate,
@@ -42,22 +43,19 @@ function UnforwardedDateTimePicker(
42
43
  deprecated( 'Help button in wp.components.DateTimePicker', {
43
44
  since: '13.4',
44
45
  version: '14.6', // Six months of plugin releases.
45
- hint:
46
- 'Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.',
46
+ hint: 'Set the `__nextRemoveHelpButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.',
47
47
  } );
48
48
  }
49
49
  if ( ! __nextRemoveResetButton ) {
50
50
  deprecated( 'Reset button in wp.components.DateTimePicker', {
51
51
  since: '13.4',
52
52
  version: '14.6', // Six months of plugin releases.
53
- hint:
54
- 'Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.',
53
+ hint: 'Set the `__nextRemoveResetButton` prop to `true` to remove this warning and opt in to the new behaviour, which will become the default in a future version.',
55
54
  } );
56
55
  }
57
56
 
58
- const [ calendarHelpIsVisible, setCalendarHelpIsVisible ] = useState(
59
- false
60
- );
57
+ const [ calendarHelpIsVisible, setCalendarHelpIsVisible ] =
58
+ useState( false );
61
59
 
62
60
  function onClickDescriptionToggle() {
63
61
  setCalendarHelpIsVisible( ! calendarHelpIsVisible );
@@ -53,9 +53,8 @@ export const Default: ComponentStory< typeof DateTimePicker > = Template.bind(
53
53
  {}
54
54
  );
55
55
 
56
- export const WithEvents: ComponentStory<
57
- typeof DateTimePicker
58
- > = Template.bind( {} );
56
+ export const WithEvents: ComponentStory< typeof DateTimePicker > =
57
+ Template.bind( {} );
59
58
  WithEvents.args = {
60
59
  currentDate: new Date(),
61
60
  events: [
@@ -66,9 +65,8 @@ WithEvents.args = {
66
65
  ],
67
66
  };
68
67
 
69
- export const WithInvalidDates: ComponentStory<
70
- typeof DateTimePicker
71
- > = Template.bind( {} );
68
+ export const WithInvalidDates: ComponentStory< typeof DateTimePicker > =
69
+ Template.bind( {} );
72
70
  WithInvalidDates.args = {
73
71
  currentDate: new Date(),
74
72
  isInvalidDate: isWeekend,
@@ -64,9 +64,8 @@ WithEvents.args = {
64
64
  ],
65
65
  };
66
66
 
67
- export const WithInvalidDates: ComponentStory<
68
- typeof DatePicker
69
- > = Template.bind( {} );
67
+ export const WithInvalidDates: ComponentStory< typeof DatePicker > =
68
+ Template.bind( {} );
70
69
  WithInvalidDates.args = {
71
70
  currentDate: new Date(),
72
71
  isInvalidDate: isWeekend,
@@ -366,20 +366,20 @@ describe( 'TimePicker', () => {
366
366
  />
367
367
  );
368
368
 
369
- const monthInput = ( screen.getByLabelText(
370
- 'Month'
371
- ) as HTMLInputElement ).value;
369
+ const monthInput = (
370
+ screen.getByLabelText( 'Month' ) as HTMLInputElement
371
+ ).value;
372
372
  const dayInput = ( screen.getByLabelText( 'Day' ) as HTMLInputElement )
373
373
  .value;
374
- const yearInput = ( screen.getByLabelText(
375
- 'Year'
376
- ) as HTMLInputElement ).value;
377
- const hoursInput = ( screen.getByLabelText(
378
- 'Hours'
379
- ) as HTMLInputElement ).value;
380
- const minutesInput = ( screen.getByLabelText(
381
- 'Minutes'
382
- ) as HTMLInputElement ).value;
374
+ const yearInput = (
375
+ screen.getByLabelText( 'Year' ) as HTMLInputElement
376
+ ).value;
377
+ const hoursInput = (
378
+ screen.getByLabelText( 'Hours' ) as HTMLInputElement
379
+ ).value;
380
+ const minutesInput = (
381
+ screen.getByLabelText( 'Minutes' ) as HTMLInputElement
382
+ ).value;
383
383
 
384
384
  expect( Number.isNaN( parseInt( monthInput, 10 ) ) ).toBe( false );
385
385
  expect( Number.isNaN( parseInt( dayInput, 10 ) ) ).toBe( false );
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { isFunction } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -35,7 +34,7 @@ export function DimensionControl( props ) {
35
34
 
36
35
  if ( ! theSize || value === theSize.slug ) {
37
36
  onChange( undefined );
38
- } else if ( isFunction( onChange ) ) {
37
+ } else if ( typeof onChange === 'function' ) {
39
38
  onChange( theSize.slug );
40
39
  }
41
40
  };
@@ -57,9 +57,8 @@ const renderBorder = ( {
57
57
  'aria-orientation': orientation = 'horizontal',
58
58
  }: Props ) => {
59
59
  return css( {
60
- [ orientation === 'vertical'
61
- ? 'borderRight'
62
- : 'borderBottom' ]: '1px solid currentColor',
60
+ [ orientation === 'vertical' ? 'borderRight' : 'borderBottom' ]:
61
+ '1px solid currentColor',
63
62
  } );
64
63
  };
65
64
 
@@ -144,9 +144,9 @@ export default function Draggable( {
144
144
  cloneWrapper.style.transform = `translate( ${ x }px, ${ y }px )`;
145
145
 
146
146
  // Hack: Remove iFrames as it's causing the embeds drag clone to freeze.
147
- Array.from(
148
- clone.querySelectorAll( 'iframe' )
149
- ).forEach( ( child ) => child.parentNode.removeChild( child ) );
147
+ Array.from( clone.querySelectorAll( 'iframe' ) ).forEach(
148
+ ( child ) => child.parentNode.removeChild( child )
149
+ );
150
150
 
151
151
  cloneWrapper.appendChild( clone );
152
152
 
@@ -142,7 +142,16 @@ const Draggable = ( {
142
142
 
143
143
  const providerValue = useMemo( () => {
144
144
  return { panGestureRef, isDragging, isPanActive, draggingId };
145
- }, [] );
145
+ }, [
146
+ // `isDragging`, `isPanActive` and `draggingId` are created using the
147
+ // `useSharedValue` hook provided by the `react-native-reanimated`, which in
148
+ // theory should guarantee that the value of these variables remains stable.
149
+ // ESLint can't pick this up, and that's why they have to be specified as
150
+ // dependencies for this hook call.
151
+ isDragging,
152
+ isPanActive,
153
+ draggingId,
154
+ ] );
146
155
 
147
156
  return (
148
157
  <GestureDetector gesture={ panGesture }>
@@ -180,9 +189,8 @@ const DraggableTrigger = ( {
180
189
  onLongPressEnd,
181
190
  testID,
182
191
  } ) => {
183
- const { panGestureRef, isDragging, isPanActive, draggingId } = useContext(
184
- Context
185
- );
192
+ const { panGestureRef, isDragging, isPanActive, draggingId } =
193
+ useContext( Context );
186
194
 
187
195
  const gestureHandler = useAnimatedGestureHandler( {
188
196
  onActive: () => {
@@ -6,8 +6,7 @@ import deprecated from '@wordpress/deprecated';
6
6
  export default function DropZoneProvider( { children } ) {
7
7
  deprecated( 'wp.components.DropZoneProvider', {
8
8
  since: '5.8',
9
- hint:
10
- 'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.',
9
+ hint: 'wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code.',
11
10
  } );
12
11
  return children;
13
12
  }
@@ -46,11 +46,11 @@ export default function Dropdown( props ) {
46
46
 
47
47
  useEffect(
48
48
  () => () => {
49
- if ( onToggle ) {
49
+ if ( onToggle && isOpen ) {
50
50
  onToggle( false );
51
51
  }
52
52
  },
53
- []
53
+ [ onToggle, isOpen ]
54
54
  );
55
55
 
56
56
  function toggle() {
@@ -3,7 +3,7 @@
3
3
  * External dependencies
4
4
  */
5
5
  import classnames from 'classnames';
6
- import { flatMap, isEmpty, isFunction } from 'lodash';
6
+ import { flatMap, isEmpty } from 'lodash';
7
7
 
8
8
  /**
9
9
  * WordPress dependencies
@@ -34,6 +34,16 @@ function mergeProps( defaultProps = {}, props = {} ) {
34
34
  return mergedProps;
35
35
  }
36
36
 
37
+ /**
38
+ * Whether the argument is a function.
39
+ *
40
+ * @param {*} maybeFunc The argument to check.
41
+ * @return {boolean} True if the argument is a function, false otherwise.
42
+ */
43
+ function isFunction( maybeFunc ) {
44
+ return typeof maybeFunc === 'function';
45
+ }
46
+
37
47
  function DropdownMenu( dropdownMenuProps ) {
38
48
  const {
39
49
  children,
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { flatMap, isEmpty, isFunction } from 'lodash';
5
+ import { flatMap, isEmpty } from 'lodash';
6
6
  import { Platform } from 'react-native';
7
7
  /**
8
8
  * WordPress dependencies
@@ -34,6 +34,16 @@ function mergeProps( defaultProps = {}, props = {} ) {
34
34
  return mergedProps;
35
35
  }
36
36
 
37
+ /**
38
+ * Whether the argument is a function.
39
+ *
40
+ * @param {*} maybeFunc The argument to check.
41
+ * @return {boolean} True if the argument is a function, false otherwise.
42
+ */
43
+ function isFunction( maybeFunc ) {
44
+ return typeof maybeFunc === 'function';
45
+ }
46
+
37
47
  function DropdownMenu( {
38
48
  children,
39
49
  className,