@wordpress/components 28.8.3 → 28.9.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 (329) hide show
  1. package/CHANGELOG.md +27 -3
  2. package/build/autocomplete/index.js +4 -1
  3. package/build/autocomplete/index.js.map +1 -1
  4. package/build/border-box-control/border-box-control/component.js +3 -14
  5. package/build/border-box-control/border-box-control/component.js.map +1 -1
  6. package/build/border-control/border-control/component.js +1 -2
  7. package/build/border-control/border-control/component.js.map +1 -1
  8. package/build/border-control/border-control-dropdown/component.js +2 -14
  9. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  10. package/build/border-control/styles.js +13 -13
  11. package/build/border-control/styles.js.map +1 -1
  12. package/build/border-control/types.js.map +1 -1
  13. package/build/box-control/index.js +4 -4
  14. package/build/box-control/index.js.map +1 -1
  15. package/build/box-control/types.js.map +1 -1
  16. package/build/composite/group-label.js +7 -1
  17. package/build/composite/group-label.js.map +1 -1
  18. package/build/composite/group.js +7 -1
  19. package/build/composite/group.js.map +1 -1
  20. package/build/composite/hover.js +8 -2
  21. package/build/composite/hover.js.map +1 -1
  22. package/build/composite/index.js +5 -1
  23. package/build/composite/index.js.map +1 -1
  24. package/build/composite/item.js +16 -1
  25. package/build/composite/item.js.map +1 -1
  26. package/build/composite/row.js +7 -1
  27. package/build/composite/row.js.map +1 -1
  28. package/build/composite/typeahead.js +8 -2
  29. package/build/composite/typeahead.js.map +1 -1
  30. package/build/date-time/date/index.js +4 -2
  31. package/build/date-time/date/index.js.map +1 -1
  32. package/build/index.js +36 -5
  33. package/build/index.js.map +1 -1
  34. package/build/navigator/index.js +128 -32
  35. package/build/navigator/index.js.map +1 -1
  36. package/build/navigator/legacy.js +179 -0
  37. package/build/navigator/legacy.js.map +1 -0
  38. package/build/navigator/{navigator-provider → navigator}/component.js +5 -40
  39. package/build/navigator/navigator/component.js.map +1 -0
  40. package/build/navigator/navigator-back-button/component.js +2 -38
  41. package/build/navigator/navigator-back-button/component.js.map +1 -1
  42. package/build/navigator/navigator-back-button/hook.js +1 -1
  43. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  44. package/build/navigator/navigator-button/component.js +2 -37
  45. package/build/navigator/navigator-button/component.js.map +1 -1
  46. package/build/navigator/navigator-button/hook.js +1 -1
  47. package/build/navigator/navigator-button/hook.js.map +1 -1
  48. package/build/navigator/navigator-screen/component.js +40 -62
  49. package/build/navigator/navigator-screen/component.js.map +1 -1
  50. package/build/navigator/navigator-screen/use-screen-animate-presence.js +114 -0
  51. package/build/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
  52. package/build/navigator/navigator-to-parent-button/component.js +3 -7
  53. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  54. package/build/navigator/styles.js +78 -35
  55. package/build/navigator/styles.js.map +1 -1
  56. package/build/navigator/types.js.map +1 -1
  57. package/build/navigator/use-navigator.js +4 -1
  58. package/build/navigator/use-navigator.js.map +1 -1
  59. package/build/search-control/index.js +5 -2
  60. package/build/search-control/index.js.map +1 -1
  61. package/build/tabs/styles.js +3 -3
  62. package/build/tabs/styles.js.map +1 -1
  63. package/build/tabs/tablist.js +61 -28
  64. package/build/tabs/tablist.js.map +1 -1
  65. package/build/tabs/use-track-overflow.js +73 -0
  66. package/build/tabs/use-track-overflow.js.map +1 -0
  67. package/build/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
  68. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  69. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -3
  70. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  71. package/build/toggle-group-control/toggle-group-control/component.js +73 -8
  72. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  73. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  74. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  75. package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -19
  76. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  77. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -9
  78. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  79. package/build/toggle-group-control/types.js.map +1 -1
  80. package/build/utils/element-rect.js +22 -13
  81. package/build/utils/element-rect.js.map +1 -1
  82. package/build/utils/hooks/use-on-value-update.js +3 -7
  83. package/build/utils/hooks/use-on-value-update.js.map +1 -1
  84. package/build-module/autocomplete/index.js +4 -1
  85. package/build-module/autocomplete/index.js.map +1 -1
  86. package/build-module/border-box-control/border-box-control/component.js +3 -14
  87. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  88. package/build-module/border-control/border-control/component.js +1 -2
  89. package/build-module/border-control/border-control/component.js.map +1 -1
  90. package/build-module/border-control/border-control-dropdown/component.js +2 -14
  91. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  92. package/build-module/border-control/styles.js +13 -13
  93. package/build-module/border-control/styles.js.map +1 -1
  94. package/build-module/border-control/types.js.map +1 -1
  95. package/build-module/box-control/index.js +4 -4
  96. package/build-module/box-control/index.js.map +1 -1
  97. package/build-module/box-control/types.js.map +1 -1
  98. package/build-module/composite/group-label.js +7 -1
  99. package/build-module/composite/group-label.js.map +1 -1
  100. package/build-module/composite/group.js +7 -1
  101. package/build-module/composite/group.js.map +1 -1
  102. package/build-module/composite/hover.js +8 -2
  103. package/build-module/composite/hover.js.map +1 -1
  104. package/build-module/composite/index.js +5 -1
  105. package/build-module/composite/index.js.map +1 -1
  106. package/build-module/composite/item.js +16 -1
  107. package/build-module/composite/item.js.map +1 -1
  108. package/build-module/composite/row.js +7 -1
  109. package/build-module/composite/row.js.map +1 -1
  110. package/build-module/composite/typeahead.js +8 -2
  111. package/build-module/composite/typeahead.js.map +1 -1
  112. package/build-module/date-time/date/index.js +4 -2
  113. package/build-module/date-time/date/index.js.map +1 -1
  114. package/build-module/index.js +14 -4
  115. package/build-module/index.js.map +1 -1
  116. package/build-module/navigator/index.js +130 -5
  117. package/build-module/navigator/index.js.map +1 -1
  118. package/build-module/navigator/legacy.js +167 -0
  119. package/build-module/navigator/legacy.js.map +1 -0
  120. package/build-module/navigator/{navigator-provider → navigator}/component.js +4 -39
  121. package/build-module/navigator/navigator/component.js.map +1 -0
  122. package/build-module/navigator/navigator-back-button/component.js +1 -37
  123. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  124. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  125. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  126. package/build-module/navigator/navigator-button/component.js +1 -36
  127. package/build-module/navigator/navigator-button/component.js.map +1 -1
  128. package/build-module/navigator/navigator-button/hook.js +1 -1
  129. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  130. package/build-module/navigator/navigator-screen/component.js +39 -61
  131. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  132. package/build-module/navigator/navigator-screen/use-screen-animate-presence.js +106 -0
  133. package/build-module/navigator/navigator-screen/use-screen-animate-presence.js.map +1 -0
  134. package/build-module/navigator/navigator-to-parent-button/component.js +2 -6
  135. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  136. package/build-module/navigator/styles.js +77 -33
  137. package/build-module/navigator/styles.js.map +1 -1
  138. package/build-module/navigator/types.js.map +1 -1
  139. package/build-module/navigator/use-navigator.js +4 -1
  140. package/build-module/navigator/use-navigator.js.map +1 -1
  141. package/build-module/search-control/index.js +5 -2
  142. package/build-module/search-control/index.js.map +1 -1
  143. package/build-module/tabs/styles.js +3 -3
  144. package/build-module/tabs/styles.js.map +1 -1
  145. package/build-module/tabs/tablist.js +62 -29
  146. package/build-module/tabs/tablist.js.map +1 -1
  147. package/build-module/tabs/use-track-overflow.js +67 -0
  148. package/build-module/tabs/use-track-overflow.js.map +1 -0
  149. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +4 -2
  150. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  151. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +9 -3
  152. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  153. package/build-module/toggle-group-control/toggle-group-control/component.js +76 -10
  154. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  155. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  156. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  157. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +12 -22
  158. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  159. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +7 -8
  160. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  161. package/build-module/toggle-group-control/types.js.map +1 -1
  162. package/build-module/utils/element-rect.js +22 -12
  163. package/build-module/utils/element-rect.js.map +1 -1
  164. package/build-module/utils/hooks/use-on-value-update.js +3 -6
  165. package/build-module/utils/hooks/use-on-value-update.js.map +1 -1
  166. package/build-style/style-rtl.css +26 -13
  167. package/build-style/style.css +26 -13
  168. package/build-types/autocomplete/index.d.ts.map +1 -1
  169. package/build-types/border-box-control/border-box-control/component.d.ts +5 -15
  170. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  171. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +2 -1
  172. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  173. package/build-types/border-box-control/stories/index.story.d.ts +3 -2
  174. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  175. package/build-types/border-control/border-control/component.d.ts +3 -2
  176. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  177. package/build-types/border-control/border-control-dropdown/component.d.ts +2 -1
  178. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  179. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  180. package/build-types/border-control/stories/index.story.d.ts +15 -30
  181. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  182. package/build-types/border-control/styles.d.ts.map +1 -1
  183. package/build-types/border-control/types.d.ts +12 -7
  184. package/build-types/border-control/types.d.ts.map +1 -1
  185. package/build-types/box-control/index.d.ts +4 -4
  186. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  187. package/build-types/box-control/types.d.ts +3 -3
  188. package/build-types/composite/group-label.d.ts.map +1 -1
  189. package/build-types/composite/index.d.ts.map +1 -1
  190. package/build-types/composite/item.d.ts.map +1 -1
  191. package/build-types/composite/stories/index.story.d.ts +22 -0
  192. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  193. package/build-types/composite/test/index.d.ts +2 -0
  194. package/build-types/composite/test/index.d.ts.map +1 -0
  195. package/build-types/date-time/date/index.d.ts.map +1 -1
  196. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  197. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  198. package/build-types/index.d.ts +23 -4
  199. package/build-types/index.d.ts.map +1 -1
  200. package/build-types/navigator/index.d.ts +171 -5
  201. package/build-types/navigator/index.d.ts.map +1 -1
  202. package/build-types/navigator/legacy.d.ts +226 -0
  203. package/build-types/navigator/legacy.d.ts.map +1 -0
  204. package/build-types/navigator/navigator/component.d.ts +3 -0
  205. package/build-types/navigator/navigator/component.d.ts.map +1 -0
  206. package/build-types/navigator/navigator-back-button/component.d.ts +0 -35
  207. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  208. package/build-types/navigator/navigator-button/component.d.ts +0 -34
  209. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  210. package/build-types/navigator/navigator-screen/component.d.ts +0 -35
  211. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  212. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +16 -0
  213. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -0
  214. package/build-types/navigator/navigator-to-parent-button/component.d.ts +0 -4
  215. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  216. package/build-types/navigator/stories/index.story.d.ts +5 -5
  217. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  218. package/build-types/navigator/styles.d.ts +20 -7
  219. package/build-types/navigator/styles.d.ts.map +1 -1
  220. package/build-types/navigator/types.d.ts +19 -1
  221. package/build-types/navigator/types.d.ts.map +1 -1
  222. package/build-types/navigator/use-navigator.d.ts +4 -1
  223. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  224. package/build-types/select-control/stories/index.story.d.ts +7 -0
  225. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  226. package/build-types/tabs/stories/index.story.d.ts +2 -1
  227. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  228. package/build-types/tabs/styles.d.ts.map +1 -1
  229. package/build-types/tabs/tablist.d.ts.map +1 -1
  230. package/build-types/tabs/use-track-overflow.d.ts +17 -0
  231. package/build-types/tabs/use-track-overflow.d.ts.map +1 -0
  232. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +2 -2
  233. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  234. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +2 -2
  235. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  236. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  237. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  238. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  239. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +0 -1
  240. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  241. package/build-types/toggle-group-control/types.d.ts +2 -1
  242. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  243. package/build-types/utils/element-rect.d.ts +8 -0
  244. package/build-types/utils/element-rect.d.ts.map +1 -1
  245. package/build-types/utils/hooks/use-on-value-update.d.ts.map +1 -1
  246. package/package.json +19 -19
  247. package/src/autocomplete/index.tsx +4 -1
  248. package/src/border-box-control/border-box-control/README.md +22 -26
  249. package/src/border-box-control/border-box-control/component.tsx +3 -14
  250. package/src/border-box-control/stories/index.story.tsx +2 -1
  251. package/src/border-control/border-control/README.md +26 -36
  252. package/src/border-control/border-control/component.tsx +1 -2
  253. package/src/border-control/border-control-dropdown/component.tsx +1 -15
  254. package/src/border-control/stories/index.story.tsx +4 -10
  255. package/src/border-control/styles.ts +0 -1
  256. package/src/border-control/test/index.js +2 -15
  257. package/src/border-control/types.ts +12 -7
  258. package/src/box-control/README.md +9 -12
  259. package/src/box-control/index.tsx +4 -4
  260. package/src/box-control/stories/index.story.tsx +1 -1
  261. package/src/box-control/types.ts +3 -3
  262. package/src/composite/group-label.tsx +7 -5
  263. package/src/composite/group.tsx +7 -7
  264. package/src/composite/hover.tsx +7 -7
  265. package/src/composite/index.tsx +6 -1
  266. package/src/composite/item.tsx +19 -1
  267. package/src/composite/legacy/test/index.tsx +22 -21
  268. package/src/composite/row.tsx +7 -7
  269. package/src/composite/stories/index.story.tsx +42 -0
  270. package/src/composite/test/index.tsx +123 -0
  271. package/src/composite/typeahead.tsx +7 -7
  272. package/src/date-time/date/index.tsx +2 -0
  273. package/src/dropdown/stories/index.story.tsx +1 -0
  274. package/src/dropdown/style.scss +10 -13
  275. package/src/dropdown-menu/stories/index.story.tsx +3 -0
  276. package/src/index.ts +19 -1
  277. package/src/menu-group/style.scss +4 -1
  278. package/src/menu-items-choice/style.scss +2 -0
  279. package/src/navigator/README.md +176 -0
  280. package/src/navigator/index.tsx +131 -0
  281. package/src/navigator/legacy.ts +169 -0
  282. package/src/navigator/{navigator-provider → navigator}/component.tsx +6 -44
  283. package/src/navigator/navigator-back-button/component.tsx +1 -37
  284. package/src/navigator/navigator-back-button/hook.ts +1 -1
  285. package/src/navigator/navigator-button/component.tsx +1 -36
  286. package/src/navigator/navigator-button/hook.ts +1 -1
  287. package/src/navigator/navigator-screen/component.tsx +48 -76
  288. package/src/navigator/navigator-screen/use-screen-animate-presence.ts +177 -0
  289. package/src/navigator/navigator-to-parent-button/component.tsx +2 -7
  290. package/src/navigator/stories/index.story.tsx +55 -54
  291. package/src/navigator/styles.ts +112 -41
  292. package/src/navigator/test/index.tsx +47 -47
  293. package/src/navigator/types.ts +19 -1
  294. package/src/navigator/use-navigator.ts +4 -1
  295. package/src/search-control/index.tsx +2 -2
  296. package/src/select-control/stories/index.story.tsx +14 -1
  297. package/src/tabs/stories/index.story.tsx +106 -0
  298. package/src/tabs/styles.ts +54 -20
  299. package/src/tabs/tablist.tsx +60 -26
  300. package/src/tabs/use-track-overflow.ts +76 -0
  301. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +208 -44
  302. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +18 -10
  303. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +21 -9
  304. package/src/toggle-group-control/toggle-group-control/component.tsx +114 -6
  305. package/src/toggle-group-control/toggle-group-control/styles.ts +41 -0
  306. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +10 -27
  307. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +0 -11
  308. package/src/toggle-group-control/types.ts +3 -1
  309. package/src/tools-panel/tools-panel/README.md +10 -10
  310. package/src/utils/element-rect.ts +32 -15
  311. package/src/utils/hooks/use-on-value-update.ts +3 -6
  312. package/tsconfig.tsbuildinfo +1 -1
  313. package/build/navigator/navigator-provider/component.js.map +0 -1
  314. package/build/utils/hooks/use-event.js +0 -41
  315. package/build/utils/hooks/use-event.js.map +0 -1
  316. package/build-module/navigator/navigator-provider/component.js.map +0 -1
  317. package/build-module/utils/hooks/use-event.js +0 -35
  318. package/build-module/utils/hooks/use-event.js.map +0 -1
  319. package/build-types/navigator/navigator-provider/component.d.ts +0 -37
  320. package/build-types/navigator/navigator-provider/component.d.ts.map +0 -1
  321. package/build-types/utils/hooks/use-event.d.ts +0 -20
  322. package/build-types/utils/hooks/use-event.d.ts.map +0 -1
  323. package/src/navigator/index.ts +0 -6
  324. package/src/navigator/navigator-back-button/README.md +0 -15
  325. package/src/navigator/navigator-button/README.md +0 -38
  326. package/src/navigator/navigator-provider/README.md +0 -94
  327. package/src/navigator/navigator-screen/README.md +0 -33
  328. package/src/navigator/navigator-to-parent-button/README.md +0 -17
  329. package/src/utils/hooks/use-event.ts +0 -38
@@ -1,10 +1,6 @@
1
- # BorderControl
1
+ # BorderControl
2
2
 
3
- <div class="callout callout-alert">
4
- This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
5
- </div>
6
- <br />
7
- This component provides control over a border's color, style, and width.
3
+ An input control for a border's color, style, and width.
8
4
 
9
5
  ## Development guidelines
10
6
 
@@ -21,7 +17,7 @@ a "shape" abstraction.
21
17
 
22
18
  ```jsx
23
19
  import { useState } from 'react';
24
- import { __experimentalBorderControl as BorderControl } from '@wordpress/components';
20
+ import { BorderControl } from '@wordpress/components';
25
21
  import { __ } from '@wordpress/i18n';
26
22
 
27
23
  const colors = [
@@ -58,41 +54,41 @@ colors are organized by multiple origins.
58
54
 
59
55
  Each color may be an object containing a `name` and `color` value.
60
56
 
61
- - Required: No
62
- - Default: `[]`
57
+ - Required: No
58
+ - Default: `[]`
63
59
 
64
60
  ### `disableCustomColors`: `boolean`
65
61
 
66
62
  This toggles the ability to choose custom colors.
67
63
 
68
- - Required: No
64
+ - Required: No
69
65
 
70
66
  ### `disableUnits`: `boolean`
71
67
 
72
68
  This controls whether unit selection should be disabled.
73
69
 
74
- - Required: No
70
+ - Required: No
75
71
 
76
72
  ### `enableAlpha`: `boolean`
77
73
 
78
74
  This controls whether the alpha channel will be offered when selecting
79
75
  custom colors.
80
76
 
81
- - Required: No
82
- - Default: `false`
77
+ - Required: No
78
+ - Default: `true`
83
79
 
84
80
  ### `enableStyle`: `boolean`
85
81
 
86
82
  This controls whether to support border style selection.
87
83
 
88
- - Required: No
89
- - Default: `true`
84
+ - Required: No
85
+ - Default: `true`
90
86
 
91
87
  ### `hideLabelFromVision`: `boolean`
92
88
 
93
89
  Provides control over whether the label will only be visible to screen readers.
94
90
 
95
- - Required: No
91
+ - Required: No
96
92
 
97
93
  ### `isCompact`: `boolean`
98
94
 
@@ -100,7 +96,7 @@ This flags the `BorderControl` to render with a more compact appearance. It
100
96
  restricts the width of the control and prevents it from expanding to take up
101
97
  additional space.
102
98
 
103
- - Required: No
99
+ - Required: No
104
100
 
105
101
  ### `label`: `string`
106
102
 
@@ -109,7 +105,7 @@ If provided, a label will be generated using this as the content.
109
105
  _Whether it is visible only to screen readers is controlled via
110
106
  `hideLabelFromVision`._
111
107
 
112
- - Required: No
108
+ - Required: No
113
109
 
114
110
  ### `onChange`: `( value?: Object ) => void`
115
111
 
@@ -118,7 +114,7 @@ that selects or clears, border color, style, or width.
118
114
 
119
115
  _Note: the value may be `undefined` if a user clears all border properties._
120
116
 
121
- - Required: Yes
117
+ - Required: Yes
122
118
 
123
119
  ### `shouldSanitizeBorder`: `boolean`
124
120
 
@@ -126,23 +122,16 @@ If opted into, sanitizing the border means that if no width or color have been
126
122
  selected, the border style is also cleared and `undefined` is returned as the
127
123
  new border value.
128
124
 
129
- - Required: No
130
- - Default: true
131
-
132
- ### `showDropdownHeader`: `boolean`
133
-
134
- Whether or not to render a header for the border color and style picker
135
- dropdown. The header includes a label for the color picker and a close button.
136
-
137
- - Required: No
125
+ - Required: No
126
+ - Default: `true`
138
127
 
139
128
  ### `size`: `string`
140
129
 
141
130
  Size of the control.
142
131
 
143
- - Required: No
144
- - Default: `default`
145
- - Allowed values: `default`, `__unstable-large`
132
+ - Required: No
133
+ - Default: `default`
134
+ - Allowed values: `default`, `__unstable-large`
146
135
 
147
136
  ### `value`: `Object`
148
137
 
@@ -150,6 +139,7 @@ An object representing a border or `undefined`. Used to set the current border
150
139
  configuration for this component.
151
140
 
152
141
  Example:
142
+
153
143
  ```js
154
144
  {
155
145
  color: '#72aee6',
@@ -158,25 +148,25 @@ Example:
158
148
  }
159
149
  ```
160
150
 
161
- - Required: No
151
+ - Required: No
162
152
 
163
153
  ### `width`: `CSSProperties[ 'width' ]`
164
154
 
165
155
  Controls the visual width of the `BorderControl`. It has no effect if the
166
156
  `isCompact` prop is set to `true`.
167
157
 
168
- - Required: No
158
+ - Required: No
169
159
 
170
160
  ### `withSlider`: `boolean`
171
161
 
172
162
  Flags whether this `BorderControl` should also render a `RangeControl` for
173
163
  additional control over a border's width.
174
164
 
175
- - Required: No
165
+ - Required: No
176
166
 
177
167
  ### `__next40pxDefaultSize`: `boolean`
178
168
 
179
169
  Start opting into the larger default height that will become the default size in a future version.
180
170
 
181
- - Required: No
182
- - Default: `false`
171
+ - Required: No
172
+ - Default: `false`
@@ -91,7 +91,6 @@ const UnconnectedBorderControl = (
91
91
  previousStyleSelection={
92
92
  previousStyleSelection
93
93
  }
94
- showDropdownHeader={ showDropdownHeader }
95
94
  __experimentalIsRenderedInSidebar={
96
95
  __experimentalIsRenderedInSidebar
97
96
  }
@@ -141,7 +140,7 @@ const UnconnectedBorderControl = (
141
140
  * a "shape" abstraction.
142
141
  *
143
142
  * ```jsx
144
- * import { __experimentalBorderControl as BorderControl } from '@wordpress/components';
143
+ * import { BorderControl } from '@wordpress/components';
145
144
  * import { __ } from '@wordpress/i18n';
146
145
  *
147
146
  * const colors = [
@@ -7,7 +7,6 @@ import type { CSSProperties } from 'react';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __, sprintf } from '@wordpress/i18n';
10
- import { closeSmall } from '@wordpress/icons';
11
10
 
12
11
  /**
13
12
  * Internal dependencies
@@ -17,12 +16,10 @@ import Button from '../../button';
17
16
  import ColorIndicator from '../../color-indicator';
18
17
  import ColorPalette from '../../color-palette';
19
18
  import Dropdown from '../../dropdown';
20
- import { HStack } from '../../h-stack';
21
19
  import { VStack } from '../../v-stack';
22
20
  import type { WordPressComponentProps } from '../../context';
23
21
  import { contextConnect } from '../../context';
24
22
  import { useBorderControlDropdown } from './hook';
25
- import { StyledLabel } from '../../base-control/styles/base-control-styles';
26
23
  import DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';
27
24
 
28
25
  import type { ColorObject } from '../../color-palette/types';
@@ -149,7 +146,6 @@ const BorderControlDropdown = (
149
146
  popoverContentClassName,
150
147
  popoverControlsClassName,
151
148
  resetButtonClassName,
152
- showDropdownHeader,
153
149
  size,
154
150
  __unstablePopoverProps,
155
151
  ...otherProps
@@ -197,17 +193,6 @@ const BorderControlDropdown = (
197
193
  <>
198
194
  <DropdownContentWrapper paddingSize="medium">
199
195
  <VStack className={ popoverControlsClassName } spacing={ 6 }>
200
- { showDropdownHeader ? (
201
- <HStack>
202
- <StyledLabel>{ __( 'Border color' ) }</StyledLabel>
203
- <Button
204
- size="small"
205
- label={ __( 'Close border color' ) }
206
- icon={ closeSmall }
207
- onClick={ onClose }
208
- />
209
- </HStack>
210
- ) : undefined }
211
196
  <ColorPalette
212
197
  className={ popoverContentClassName }
213
198
  value={ color }
@@ -237,6 +222,7 @@ const BorderControlDropdown = (
237
222
  onReset();
238
223
  onClose();
239
224
  } }
225
+ __next40pxDefaultSize
240
226
  >
241
227
  { __( 'Reset' ) }
242
228
  </Button>
@@ -16,7 +16,7 @@ import { BorderControl } from '..';
16
16
  import type { Border } from '../types';
17
17
 
18
18
  const meta: Meta< typeof BorderControl > = {
19
- title: 'Components (Experimental)/BorderControl',
19
+ title: 'Components/BorderControl',
20
20
  component: BorderControl,
21
21
  argTypes: {
22
22
  onChange: {
@@ -93,6 +93,9 @@ export const Default = Template.bind( {} );
93
93
  Default.args = {
94
94
  colors,
95
95
  label: 'Border',
96
+ enableAlpha: true,
97
+ enableStyle: true,
98
+ shouldSanitizeBorder: true,
96
99
  };
97
100
 
98
101
  /**
@@ -133,12 +136,3 @@ WithMultipleOrigins.args = {
133
136
  ...Default.args,
134
137
  colors: multipleOriginColors,
135
138
  };
136
-
137
- /**
138
- * Allow the alpha channel to be edited on each color.
139
- */
140
- export const WithAlphaEnabled = Template.bind( {} );
141
- WithAlphaEnabled.args = {
142
- ...Default.args,
143
- enableAlpha: true,
144
- };
@@ -156,7 +156,6 @@ export const resetButton = css`
156
156
  border-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };
157
157
  border-top-left-radius: 0;
158
158
  border-top-right-radius: 0;
159
- height: 40px;
160
159
  }
161
160
  `;
162
161
 
@@ -148,19 +148,6 @@ describe( 'BorderControl', () => {
148
148
  expect( resetButton ).toBeInTheDocument();
149
149
  } );
150
150
 
151
- it( 'should render color and style popover header', async () => {
152
- const user = userEvent.setup();
153
- const props = createProps( { showDropdownHeader: true } );
154
- render( <BorderControl { ...props } /> );
155
- await openPopover( user );
156
-
157
- const headerLabel = screen.getByText( 'Border color' );
158
- const closeButton = getButton( 'Close border color' );
159
-
160
- expect( headerLabel ).toBeInTheDocument();
161
- expect( closeButton ).toBeInTheDocument();
162
- } );
163
-
164
151
  it( 'should not render style options when opted out of', async () => {
165
152
  const user = userEvent.setup();
166
153
  const props = createProps( { enableStyle: false } );
@@ -346,10 +333,10 @@ describe( 'BorderControl', () => {
346
333
 
347
334
  it( 'should take no action when color and style popover is closed', async () => {
348
335
  const user = userEvent.setup();
349
- const props = createProps( { showDropdownHeader: true } );
336
+ const props = createProps();
350
337
  render( <BorderControl { ...props } /> );
351
338
  await openPopover( user );
352
- await user.click( getButton( 'Close border color' ) );
339
+ await user.keyboard( 'Escape' );
353
340
 
354
341
  expect( props.onChange ).not.toHaveBeenCalled();
355
342
  } );
@@ -18,12 +18,19 @@ export type Border = {
18
18
 
19
19
  export type ColorProps = Pick<
20
20
  ColorPaletteProps,
21
- 'colors' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'
21
+ 'colors' | '__experimentalIsRenderedInSidebar'
22
22
  > & {
23
23
  /**
24
24
  * This toggles the ability to choose custom colors.
25
25
  */
26
26
  disableCustomColors?: boolean;
27
+ /**
28
+ * This controls whether the alpha channel will be offered when selecting
29
+ * custom colors.
30
+ *
31
+ * @default true
32
+ */
33
+ enableAlpha?: boolean;
27
34
  };
28
35
 
29
36
  export type LabelProps = {
@@ -78,9 +85,8 @@ export type BorderControlProps = ColorProps &
78
85
  */
79
86
  shouldSanitizeBorder?: boolean;
80
87
  /**
81
- * Whether or not to show the header for the border color and style
82
- * picker dropdown. The header includes a label for the color picker
83
- * and a close button.
88
+ * @deprecated This prop no longer has any effect.
89
+ * @ignore
84
90
  */
85
91
  showDropdownHeader?: boolean;
86
92
  /**
@@ -139,9 +145,8 @@ export type DropdownProps = ColorProps &
139
145
  */
140
146
  previousStyleSelection?: string;
141
147
  /**
142
- * Whether or not to render a header for the border color and style picker
143
- * dropdown. The header includes a label for the color picker and a
144
- * close button.
148
+ * @deprecated This prop no longer has any effect.
149
+ * @ignore
145
150
  */
146
151
  showDropdownHeader?: boolean;
147
152
  };
@@ -1,18 +1,14 @@
1
1
  # BoxControl
2
2
 
3
- <div class="callout callout-alert">
4
- This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
5
- </div>
6
-
7
- BoxControl components let users set values for Top, Right, Bottom, and Left. This can be used as an input control for values like `padding` or `margin`.
3
+ A control that lets users set values for top, right, bottom, and left. Can be used as an input control for values like `padding` or `margin`.
8
4
 
9
5
  ## Usage
10
6
 
11
7
  ```jsx
12
8
  import { useState } from 'react';
13
- import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
9
+ import { BoxControl } from '@wordpress/components';
14
10
 
15
- const Example = () => {
11
+ function Example() {
16
12
  const [ values, setValues ] = useState( {
17
13
  top: '50px',
18
14
  left: '10%',
@@ -26,23 +22,24 @@ const Example = () => {
26
22
  onChange={ ( nextValues ) => setValues( nextValues ) }
27
23
  />
28
24
  );
29
- };
25
+ }
30
26
  ```
31
27
 
32
28
  ## Props
29
+
33
30
  ### `allowReset`: `boolean`
34
31
 
35
32
  If this property is true, a button to reset the box control is rendered.
36
33
 
37
- - Required: No
38
- - Default: `true`
34
+ - Required: No
35
+ - Default: `true`
39
36
 
40
37
  ### `splitOnAxis`: `boolean`
41
38
 
42
39
  If this property is true, when the box control is unlinked, vertical and horizontal controls can be used instead of updating individual sides.
43
40
 
44
- - Required: No
45
- - Default: `false`
41
+ - Required: No
42
+ - Default: `false`
46
43
 
47
44
  ### `inputProps`: `object`
48
45
 
@@ -47,14 +47,14 @@ function useUniqueId( idProp?: string ) {
47
47
  }
48
48
 
49
49
  /**
50
- * BoxControl components let users set values for Top, Right, Bottom, and Left.
51
- * This can be used as an input control for values like `padding` or `margin`.
50
+ * A control that lets users set values for top, right, bottom, and left. Can be
51
+ * used as an input control for values like `padding` or `margin`.
52
52
  *
53
53
  * ```jsx
54
- * import { __experimentalBoxControl as BoxControl } from '@wordpress/components';
54
+ * import { BoxControl } from '@wordpress/components';
55
55
  * import { useState } from '@wordpress/element';
56
56
  *
57
- * const Example = () => {
57
+ * function Example() {
58
58
  * const [ values, setValues ] = useState( {
59
59
  * top: '50px',
60
60
  * left: '10%',
@@ -14,7 +14,7 @@ import { useState } from '@wordpress/element';
14
14
  import BoxControl from '../';
15
15
 
16
16
  const meta: Meta< typeof BoxControl > = {
17
- title: 'Components (Experimental)/BoxControl',
17
+ title: 'Components/BoxControl',
18
18
  component: BoxControl,
19
19
  argTypes: {
20
20
  values: { control: { type: null } },
@@ -37,13 +37,13 @@ export type BoxControlProps = Pick<
37
37
  /**
38
38
  * Props for the internal `UnitControl` components.
39
39
  *
40
- * @default `{ min: 0 }`
40
+ * @default { min: 0 }
41
41
  */
42
42
  inputProps?: UnitControlPassthroughProps;
43
43
  /**
44
44
  * Heading label for the control.
45
45
  *
46
- * @default `__( 'Box Control' )`
46
+ * @default __( 'Box Control' )
47
47
  */
48
48
  label?: string;
49
49
  /**
@@ -53,7 +53,7 @@ export type BoxControlProps = Pick<
53
53
  /**
54
54
  * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.
55
55
  *
56
- * @default `{ top: undefined, right: undefined, bottom: undefined, left: undefined }`
56
+ * @default { top: undefined, right: undefined, bottom: undefined, left: undefined }
57
57
  */
58
58
  resetValues?: BoxControlValue;
59
59
  /**
@@ -20,11 +20,13 @@ export const CompositeGroupLabel = forwardRef<
20
20
  WordPressComponentProps< CompositeGroupLabelProps, 'div', false >
21
21
  >( function CompositeGroupLabel( props, ref ) {
22
22
  const context = useCompositeContext();
23
+
24
+ // @ts-expect-error The store prop is undocumented and only used by the
25
+ // legacy compat layer. The `store` prop is documented, but its type is
26
+ // obfuscated to discourage its use outside of the component's internals.
27
+ const store = ( props.store ?? context.store ) as Ariakit.CompositeStore;
28
+
23
29
  return (
24
- <Ariakit.CompositeGroupLabel
25
- store={ context.store as Ariakit.CompositeStore }
26
- { ...props }
27
- ref={ ref }
28
- />
30
+ <Ariakit.CompositeGroupLabel store={ store } { ...props } ref={ ref } />
29
31
  );
30
32
  } );
@@ -20,11 +20,11 @@ export const CompositeGroup = forwardRef<
20
20
  WordPressComponentProps< CompositeGroupProps, 'div', false >
21
21
  >( function CompositeGroup( props, ref ) {
22
22
  const context = useCompositeContext();
23
- return (
24
- <Ariakit.CompositeGroup
25
- store={ context.store as Ariakit.CompositeStore }
26
- { ...props }
27
- ref={ ref }
28
- />
29
- );
23
+
24
+ // @ts-expect-error The store prop is undocumented and only used by the
25
+ // legacy compat layer. The `store` prop is documented, but its type is
26
+ // obfuscated to discourage its use outside of the component's internals.
27
+ const store = ( props.store ?? context.store ) as Ariakit.CompositeStore;
28
+
29
+ return <Ariakit.CompositeGroup store={ store } { ...props } ref={ ref } />;
30
30
  } );
@@ -20,11 +20,11 @@ export const CompositeHover = forwardRef<
20
20
  WordPressComponentProps< CompositeHoverProps, 'div', false >
21
21
  >( function CompositeHover( props, ref ) {
22
22
  const context = useCompositeContext();
23
- return (
24
- <Ariakit.CompositeHover
25
- store={ context.store as Ariakit.CompositeStore }
26
- { ...props }
27
- ref={ ref }
28
- />
29
- );
23
+
24
+ // @ts-expect-error The store prop is undocumented and only used by the
25
+ // legacy compat layer. The `store` prop is documented, but its type is
26
+ // obfuscated to discourage its use outside of the component's internals.
27
+ const store = ( props.store ?? context.store ) as Ariakit.CompositeStore;
28
+
29
+ return <Ariakit.CompositeGroup store={ store } { ...props } ref={ ref } />;
30
30
  } );
@@ -73,7 +73,10 @@ export const Composite = Object.assign(
73
73
  },
74
74
  ref
75
75
  ) {
76
- const store = Ariakit.useCompositeStore( {
76
+ // @ts-expect-error The store prop is undocumented and only used by the
77
+ // legacy compat layer.
78
+ const storeProp = props.store as Ariakit.CompositeStore;
79
+ const internalStore = Ariakit.useCompositeStore( {
77
80
  activeId,
78
81
  defaultActiveId,
79
82
  setActiveId,
@@ -85,6 +88,8 @@ export const Composite = Object.assign(
85
88
  rtl,
86
89
  } );
87
90
 
91
+ const store = storeProp ?? internalStore;
92
+
88
93
  const contextValue = useMemo(
89
94
  () => ( {
90
95
  store,
@@ -20,9 +20,27 @@ export const CompositeItem = forwardRef<
20
20
  WordPressComponentProps< CompositeItemProps, 'button', false >
21
21
  >( function CompositeItem( props, ref ) {
22
22
  const context = useCompositeContext();
23
+
24
+ // @ts-expect-error The store prop is undocumented and only used by the
25
+ // legacy compat layer. The `store` prop is documented, but its type is
26
+ // obfuscated to discourage its use outside of the component's internals.
27
+ const store = ( props.store ?? context.store ) as Ariakit.CompositeStore;
28
+
29
+ // If the active item is not connected, Composite may end up in a state
30
+ // where none of the items are tabbable. In this case, we force all items to
31
+ // be tabbable, so that as soon as an item received focus, it becomes active
32
+ // and Composite goes back to working as expected.
33
+ const tabbable = Ariakit.useStoreState( store, ( state ) => {
34
+ return (
35
+ state?.activeId !== null &&
36
+ ! store?.item( state?.activeId )?.element?.isConnected
37
+ );
38
+ } );
39
+
23
40
  return (
24
41
  <Ariakit.CompositeItem
25
- store={ context.store as Ariakit.CompositeStore }
42
+ store={ store }
43
+ tabbable={ tabbable }
26
44
  { ...props }
27
45
  ref={ ref }
28
46
  />