@wordpress/components 23.9.0 → 25.0.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 (423) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/CONTRIBUTING.md +75 -1
  3. package/README.md +1 -3
  4. package/build/autocomplete/autocompleter-ui.js +0 -2
  5. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  6. package/build/autocomplete/index.js +2 -0
  7. package/build/autocomplete/index.js.map +1 -1
  8. package/build/button/index.js +2 -0
  9. package/build/button/index.js.map +1 -1
  10. package/build/card/card-media/component.js +2 -1
  11. package/build/card/card-media/component.js.map +1 -1
  12. package/build/color-picker/styles.js +8 -8
  13. package/build/color-picker/styles.js.map +1 -1
  14. package/build/combobox-control/index.js +7 -5
  15. package/build/combobox-control/index.js.map +1 -1
  16. package/build/combobox-control/styles.js +3 -3
  17. package/build/combobox-control/styles.js.map +1 -1
  18. package/build/date-time/date-time/index.js +3 -84
  19. package/build/date-time/date-time/index.js.map +1 -1
  20. package/build/date-time/date-time/styles.js +4 -19
  21. package/build/date-time/date-time/styles.js.map +1 -1
  22. package/build/dimension-control/index.js +1 -1
  23. package/build/dimension-control/index.js.map +1 -1
  24. package/build/draggable/index.js +2 -7
  25. package/build/draggable/index.js.map +1 -1
  26. package/build/dropdown-menu/index.js +87 -11
  27. package/build/dropdown-menu/index.js.map +1 -1
  28. package/build/dropdown-menu/types.js +6 -0
  29. package/build/dropdown-menu/types.js.map +1 -0
  30. package/build/dropdown-menu-v2/index.js +195 -0
  31. package/build/dropdown-menu-v2/index.js.map +1 -0
  32. package/build/dropdown-menu-v2/styles.js +176 -0
  33. package/build/dropdown-menu-v2/styles.js.map +1 -0
  34. package/build/dropdown-menu-v2/types.js +6 -0
  35. package/build/dropdown-menu-v2/types.js.map +1 -0
  36. package/build/form-token-field/index.js +5 -3
  37. package/build/form-token-field/index.js.map +1 -1
  38. package/build/form-token-field/styles.js +3 -3
  39. package/build/form-token-field/styles.js.map +1 -1
  40. package/build/index.native.js +0 -9
  41. package/build/index.native.js.map +1 -1
  42. package/build/input-control/styles/input-control-styles.js +30 -23
  43. package/build/input-control/styles/input-control-styles.js.map +1 -1
  44. package/build/mobile/bottom-sheet/cell.native.js +16 -8
  45. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  46. package/build/mobile/bottom-sheet/range-cell.native.js +3 -2
  47. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  48. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
  49. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  50. package/build/mobile/bottom-sheet/switch-cell.native.js +8 -2
  51. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  52. package/build/mobile/bottom-sheet-select-control/index.native.js +4 -2
  53. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  54. package/build/mobile/bottom-sheet-text-control/index.native.js +4 -2
  55. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  56. package/build/mobile/global-styles-context/index.native.js +13 -1
  57. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  58. package/build/mobile/link-picker/link-picker-results.native.js +3 -1
  59. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  60. package/build/navigable-container/container.js +39 -19
  61. package/build/navigable-container/container.js.map +1 -1
  62. package/build/navigable-container/index.js.map +1 -1
  63. package/build/navigable-container/menu.js +37 -5
  64. package/build/navigable-container/menu.js.map +1 -1
  65. package/build/navigable-container/tabbable.js +45 -4
  66. package/build/navigable-container/tabbable.js.map +1 -1
  67. package/build/navigable-container/types.js +6 -0
  68. package/build/navigable-container/types.js.map +1 -0
  69. package/build/palette-edit/index.js +34 -12
  70. package/build/palette-edit/index.js.map +1 -1
  71. package/build/private-apis.js +13 -1
  72. package/build/private-apis.js.map +1 -1
  73. package/build/range-control/index.native.js +5 -2
  74. package/build/range-control/index.native.js.map +1 -1
  75. package/build/sandbox/index.native.js +6 -2
  76. package/build/sandbox/index.native.js.map +1 -1
  77. package/build/slot-fill/bubbles-virtually/fill.js +2 -1
  78. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  79. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +45 -35
  80. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  81. package/build/slot-fill/bubbles-virtually/use-slot.js +11 -26
  82. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  83. package/build/slot-fill/fill.js +7 -31
  84. package/build/slot-fill/fill.js.map +1 -1
  85. package/build/slot-fill/index.js.map +1 -1
  86. package/build/slot-fill/provider.js +0 -6
  87. package/build/slot-fill/provider.js.map +1 -1
  88. package/build/slot-fill/slot.js +0 -5
  89. package/build/slot-fill/slot.js.map +1 -1
  90. package/build/snackbar/list.js +0 -2
  91. package/build/snackbar/list.js.map +1 -1
  92. package/build/tab-panel/index.js.map +1 -1
  93. package/build/theme/color-algorithms.js +1 -1
  94. package/build/theme/color-algorithms.js.map +1 -1
  95. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  96. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  97. package/build/toolbar/toolbar-button/index.js +1 -2
  98. package/build/toolbar/toolbar-button/index.js.map +1 -1
  99. package/build/toolbar/toolbar-item/index.js +4 -2
  100. package/build/toolbar/toolbar-item/index.js.map +1 -1
  101. package/build/utils/colors-values.js +3 -3
  102. package/build/utils/colors-values.js.map +1 -1
  103. package/build/utils/use-deprecated-props.js +35 -0
  104. package/build/utils/use-deprecated-props.js.map +1 -0
  105. package/build-module/autocomplete/autocompleter-ui.js +1 -3
  106. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  107. package/build-module/autocomplete/index.js +3 -3
  108. package/build-module/autocomplete/index.js.map +1 -1
  109. package/build-module/button/index.js +2 -0
  110. package/build-module/button/index.js.map +1 -1
  111. package/build-module/card/card-media/component.js +2 -1
  112. package/build-module/card/card-media/component.js.map +1 -1
  113. package/build-module/color-picker/styles.js +8 -8
  114. package/build-module/color-picker/styles.js.map +1 -1
  115. package/build-module/combobox-control/index.js +6 -5
  116. package/build-module/combobox-control/index.js.map +1 -1
  117. package/build-module/combobox-control/styles.js +3 -3
  118. package/build-module/combobox-control/styles.js.map +1 -1
  119. package/build-module/date-time/date-time/index.js +6 -81
  120. package/build-module/date-time/date-time/index.js.map +1 -1
  121. package/build-module/date-time/date-time/styles.js +3 -17
  122. package/build-module/date-time/date-time/styles.js.map +1 -1
  123. package/build-module/dimension-control/index.js +1 -1
  124. package/build-module/dimension-control/index.js.map +1 -1
  125. package/build-module/draggable/index.js +2 -7
  126. package/build-module/draggable/index.js.map +1 -1
  127. package/build-module/dropdown-menu/index.js +87 -10
  128. package/build-module/dropdown-menu/index.js.map +1 -1
  129. package/build-module/dropdown-menu/types.js +2 -0
  130. package/build-module/dropdown-menu/types.js.map +1 -0
  131. package/build-module/dropdown-menu-v2/index.js +149 -0
  132. package/build-module/dropdown-menu-v2/index.js.map +1 -0
  133. package/build-module/dropdown-menu-v2/styles.js +153 -0
  134. package/build-module/dropdown-menu-v2/styles.js.map +1 -0
  135. package/build-module/dropdown-menu-v2/types.js +2 -0
  136. package/build-module/dropdown-menu-v2/types.js.map +1 -0
  137. package/build-module/form-token-field/index.js +4 -3
  138. package/build-module/form-token-field/index.js.map +1 -1
  139. package/build-module/form-token-field/styles.js +3 -3
  140. package/build-module/form-token-field/styles.js.map +1 -1
  141. package/build-module/index.native.js +0 -1
  142. package/build-module/index.native.js.map +1 -1
  143. package/build-module/input-control/styles/input-control-styles.js +30 -23
  144. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  145. package/build-module/mobile/bottom-sheet/cell.native.js +16 -8
  146. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  147. package/build-module/mobile/bottom-sheet/range-cell.native.js +3 -2
  148. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  149. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +4 -2
  150. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  151. package/build-module/mobile/bottom-sheet/switch-cell.native.js +7 -2
  152. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  153. package/build-module/mobile/bottom-sheet-select-control/index.native.js +4 -2
  154. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  155. package/build-module/mobile/bottom-sheet-text-control/index.native.js +4 -2
  156. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  157. package/build-module/mobile/global-styles-context/index.native.js +13 -1
  158. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  159. package/build-module/mobile/link-picker/link-picker-results.native.js +3 -1
  160. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  161. package/build-module/navigable-container/container.js +43 -19
  162. package/build-module/navigable-container/container.js.map +1 -1
  163. package/build-module/navigable-container/index.js +0 -2
  164. package/build-module/navigable-container/index.js.map +1 -1
  165. package/build-module/navigable-container/menu.js +36 -4
  166. package/build-module/navigable-container/menu.js.map +1 -1
  167. package/build-module/navigable-container/tabbable.js +44 -3
  168. package/build-module/navigable-container/tabbable.js.map +1 -1
  169. package/build-module/navigable-container/types.js +2 -0
  170. package/build-module/navigable-container/types.js.map +1 -0
  171. package/build-module/palette-edit/index.js +34 -13
  172. package/build-module/palette-edit/index.js.map +1 -1
  173. package/build-module/private-apis.js +12 -1
  174. package/build-module/private-apis.js.map +1 -1
  175. package/build-module/range-control/index.native.js +5 -2
  176. package/build-module/range-control/index.native.js.map +1 -1
  177. package/build-module/sandbox/index.native.js +6 -2
  178. package/build-module/sandbox/index.native.js.map +1 -1
  179. package/build-module/slot-fill/bubbles-virtually/fill.js +2 -1
  180. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  181. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -36
  182. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  183. package/build-module/slot-fill/bubbles-virtually/use-slot.js +12 -27
  184. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  185. package/build-module/slot-fill/fill.js +7 -31
  186. package/build-module/slot-fill/fill.js.map +1 -1
  187. package/build-module/slot-fill/index.js +1 -2
  188. package/build-module/slot-fill/index.js.map +1 -1
  189. package/build-module/slot-fill/provider.js +0 -6
  190. package/build-module/slot-fill/provider.js.map +1 -1
  191. package/build-module/slot-fill/slot.js +0 -5
  192. package/build-module/slot-fill/slot.js.map +1 -1
  193. package/build-module/snackbar/list.js +0 -2
  194. package/build-module/snackbar/list.js.map +1 -1
  195. package/build-module/tab-panel/index.js.map +1 -1
  196. package/build-module/theme/color-algorithms.js +1 -1
  197. package/build-module/theme/color-algorithms.js.map +1 -1
  198. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  199. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  200. package/build-module/toolbar/toolbar-button/index.js +1 -2
  201. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  202. package/build-module/toolbar/toolbar-item/index.js +5 -2
  203. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  204. package/build-module/utils/colors-values.js +3 -3
  205. package/build-module/utils/colors-values.js.map +1 -1
  206. package/build-module/utils/use-deprecated-props.js +25 -0
  207. package/build-module/utils/use-deprecated-props.js.map +1 -0
  208. package/build-style/style-rtl.css +67 -67
  209. package/build-style/style.css +67 -67
  210. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  211. package/build-types/autocomplete/index.d.ts.map +1 -1
  212. package/build-types/autocomplete/types.d.ts +2 -18
  213. package/build-types/autocomplete/types.d.ts.map +1 -1
  214. package/build-types/button/deprecated.d.ts +6 -0
  215. package/build-types/button/deprecated.d.ts.map +1 -1
  216. package/build-types/button/index.d.ts.map +1 -1
  217. package/build-types/button/types.d.ts +7 -0
  218. package/build-types/button/types.d.ts.map +1 -1
  219. package/build-types/card/card-media/component.d.ts +2 -1
  220. package/build-types/card/card-media/component.d.ts.map +1 -1
  221. package/build-types/card/stories/index.d.ts +21 -1
  222. package/build-types/card/stories/index.d.ts.map +1 -1
  223. package/build-types/color-picker/styles.d.ts.map +1 -1
  224. package/build-types/combobox-control/index.d.ts +1 -1
  225. package/build-types/combobox-control/index.d.ts.map +1 -1
  226. package/build-types/combobox-control/stories/index.d.ts.map +1 -1
  227. package/build-types/combobox-control/styles.d.ts +1 -1
  228. package/build-types/combobox-control/types.d.ts +8 -1
  229. package/build-types/combobox-control/types.d.ts.map +1 -1
  230. package/build-types/date-time/date-time/index.d.ts +3 -4
  231. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  232. package/build-types/date-time/date-time/styles.d.ts +0 -4
  233. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  234. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  235. package/build-types/date-time/types.d.ts +0 -14
  236. package/build-types/date-time/types.d.ts.map +1 -1
  237. package/build-types/dimension-control/index.d.ts +1 -1
  238. package/build-types/draggable/index.d.ts.map +1 -1
  239. package/build-types/dropdown-menu/index.d.ts +83 -1
  240. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  241. package/build-types/dropdown-menu/stories/index.d.ts +13 -0
  242. package/build-types/dropdown-menu/stories/index.d.ts.map +1 -0
  243. package/build-types/dropdown-menu/test/index.d.ts +2 -0
  244. package/build-types/dropdown-menu/test/index.d.ts.map +1 -0
  245. package/build-types/dropdown-menu/types.d.ts +134 -0
  246. package/build-types/dropdown-menu/types.d.ts.map +1 -0
  247. package/build-types/dropdown-menu-v2/index.d.ts +17 -0
  248. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -0
  249. package/build-types/dropdown-menu-v2/stories/index.d.ts +13 -0
  250. package/build-types/dropdown-menu-v2/stories/index.d.ts.map +1 -0
  251. package/build-types/dropdown-menu-v2/styles.d.ts +41 -0
  252. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -0
  253. package/build-types/dropdown-menu-v2/test/index.d.ts +2 -0
  254. package/build-types/dropdown-menu-v2/test/index.d.ts.map +1 -0
  255. package/build-types/dropdown-menu-v2/types.d.ts +242 -0
  256. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -0
  257. package/build-types/form-token-field/index.d.ts.map +1 -1
  258. package/build-types/form-token-field/styles.d.ts +1 -1
  259. package/build-types/form-token-field/types.d.ts +8 -1
  260. package/build-types/form-token-field/types.d.ts.map +1 -1
  261. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  262. package/build-types/navigable-container/container.d.ts +20 -1
  263. package/build-types/navigable-container/container.d.ts.map +1 -1
  264. package/build-types/navigable-container/index.d.ts +5 -2
  265. package/build-types/navigable-container/index.d.ts.map +1 -1
  266. package/build-types/navigable-container/menu.d.ts +45 -11
  267. package/build-types/navigable-container/menu.d.ts.map +1 -1
  268. package/build-types/navigable-container/stories/navigable-menu.d.ts +12 -0
  269. package/build-types/navigable-container/stories/navigable-menu.d.ts.map +1 -0
  270. package/build-types/navigable-container/stories/tabbable-container.d.ts +12 -0
  271. package/build-types/navigable-container/stories/tabbable-container.d.ts.map +1 -0
  272. package/build-types/navigable-container/tabbable.d.ts +52 -9
  273. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  274. package/build-types/navigable-container/test/navigable-menu.d.ts +2 -0
  275. package/build-types/navigable-container/test/navigable-menu.d.ts.map +1 -0
  276. package/build-types/navigable-container/test/tababble-container.d.ts +2 -0
  277. package/build-types/navigable-container/test/tababble-container.d.ts.map +1 -0
  278. package/build-types/navigable-container/types.d.ts +61 -0
  279. package/build-types/navigable-container/types.d.ts.map +1 -0
  280. package/build-types/navigator/navigator-back-button/component.d.ts +1 -0
  281. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  282. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -0
  283. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  284. package/build-types/navigator/navigator-button/component.d.ts +1 -0
  285. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  286. package/build-types/navigator/navigator-button/hook.d.ts +1 -0
  287. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  288. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -0
  289. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  290. package/build-types/palette-edit/index.d.ts +1 -1
  291. package/build-types/palette-edit/index.d.ts.map +1 -1
  292. package/build-types/palette-edit/stories/index.d.ts.map +1 -1
  293. package/build-types/palette-edit/types.d.ts +8 -0
  294. package/build-types/palette-edit/types.d.ts.map +1 -1
  295. package/build-types/private-apis.d.ts.map +1 -1
  296. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  297. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  298. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  299. package/build-types/slot-fill/fill.d.ts +4 -2
  300. package/build-types/slot-fill/fill.d.ts.map +1 -1
  301. package/build-types/slot-fill/index.d.ts +1 -2
  302. package/build-types/slot-fill/index.d.ts.map +1 -1
  303. package/build-types/slot-fill/provider.d.ts +0 -2
  304. package/build-types/slot-fill/provider.d.ts.map +1 -1
  305. package/build-types/slot-fill/slot.d.ts.map +1 -1
  306. package/build-types/snackbar/list.d.ts.map +1 -1
  307. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  308. package/build-types/toolbar/stories/index.d.ts.map +1 -1
  309. package/build-types/toolbar/toolbar-button/index.d.ts +6 -0
  310. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  311. package/build-types/toolbar/toolbar-item/index.d.ts +6 -4
  312. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  313. package/build-types/tree-grid/types.d.ts +7 -0
  314. package/build-types/tree-grid/types.d.ts.map +1 -1
  315. package/build-types/ui/context/get-styled-class-name-from-key.d.ts +1 -10
  316. package/build-types/ui/context/get-styled-class-name-from-key.d.ts.map +1 -1
  317. package/build-types/utils/use-deprecated-props.d.ts +9 -0
  318. package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
  319. package/package.json +21 -20
  320. package/src/autocomplete/README.md +78 -52
  321. package/src/autocomplete/autocompleter-ui.tsx +0 -2
  322. package/src/autocomplete/index.tsx +1 -2
  323. package/src/autocomplete/types.ts +3 -19
  324. package/src/button/index.tsx +2 -0
  325. package/src/button/style.scss +18 -18
  326. package/src/button/types.ts +7 -0
  327. package/src/card/card-media/README.md +1 -1
  328. package/src/card/card-media/component.tsx +2 -1
  329. package/src/card/stories/index.tsx +47 -26
  330. package/src/checkbox-control/style.scss +1 -4
  331. package/src/color-picker/styles.ts +7 -2
  332. package/src/combobox-control/index.tsx +24 -18
  333. package/src/combobox-control/stories/index.tsx +0 -1
  334. package/src/combobox-control/styles.ts +4 -4
  335. package/src/combobox-control/types.ts +8 -1
  336. package/src/custom-gradient-picker/style.scss +2 -2
  337. package/src/date-time/README.md +0 -16
  338. package/src/date-time/date-time/index.tsx +17 -155
  339. package/src/date-time/date-time/styles.ts +0 -4
  340. package/src/date-time/stories/date-time.tsx +0 -4
  341. package/src/date-time/types.ts +0 -16
  342. package/src/dimension-control/index.tsx +1 -1
  343. package/src/draggable/index.tsx +1 -9
  344. package/src/dropdown-menu/README.md +12 -22
  345. package/src/dropdown-menu/{index.js → index.tsx} +111 -25
  346. package/src/dropdown-menu/stories/{index.js → index.tsx} +14 -22
  347. package/src/dropdown-menu/test/{index.js → index.tsx} +6 -5
  348. package/src/dropdown-menu/types.ts +143 -0
  349. package/src/dropdown-menu-v2/README.md +392 -0
  350. package/src/dropdown-menu-v2/index.tsx +241 -0
  351. package/src/dropdown-menu-v2/stories/index.tsx +193 -0
  352. package/src/dropdown-menu-v2/styles.ts +263 -0
  353. package/src/dropdown-menu-v2/test/index.tsx +816 -0
  354. package/src/dropdown-menu-v2/types.ts +250 -0
  355. package/src/form-toggle/style.scss +1 -5
  356. package/src/form-token-field/index.tsx +7 -3
  357. package/src/form-token-field/styles.ts +4 -4
  358. package/src/form-token-field/types.ts +8 -1
  359. package/src/index.native.js +0 -1
  360. package/src/input-control/styles/input-control-styles.tsx +7 -0
  361. package/src/mobile/bottom-sheet/cell.native.js +26 -5
  362. package/src/mobile/bottom-sheet/range-cell.native.js +2 -1
  363. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +2 -0
  364. package/src/mobile/bottom-sheet/styles.native.scss +13 -1
  365. package/src/mobile/bottom-sheet/switch-cell.native.js +10 -2
  366. package/src/mobile/bottom-sheet-select-control/index.native.js +2 -0
  367. package/src/mobile/bottom-sheet-text-control/index.native.js +2 -0
  368. package/src/mobile/global-styles-context/index.native.js +12 -1
  369. package/src/mobile/link-picker/link-picker-results.native.js +3 -0
  370. package/src/modal/style.scss +1 -1
  371. package/src/navigable-container/README.md +24 -13
  372. package/src/navigable-container/{container.js → container.tsx} +57 -27
  373. package/src/navigable-container/{index.js → index.tsx} +0 -1
  374. package/src/navigable-container/menu.tsx +100 -0
  375. package/src/navigable-container/stories/{navigable-menu.js → navigable-menu.tsx} +15 -10
  376. package/src/navigable-container/stories/{tabbable-container.js → tabbable-container.tsx} +15 -6
  377. package/src/navigable-container/tabbable.tsx +92 -0
  378. package/src/navigable-container/test/{navigable-menu.js → navigable-menu.tsx} +3 -1
  379. package/src/navigable-container/test/{tababble-container.js → tababble-container.tsx} +53 -24
  380. package/src/navigable-container/types.ts +76 -0
  381. package/src/palette-edit/index.tsx +45 -7
  382. package/src/palette-edit/stories/index.tsx +4 -0
  383. package/src/palette-edit/types.ts +11 -0
  384. package/src/private-apis.ts +22 -0
  385. package/src/range-control/index.native.js +3 -0
  386. package/src/sandbox/index.native.js +4 -0
  387. package/src/search-control/style.scss +2 -0
  388. package/src/slot-fill/bubbles-virtually/fill.js +2 -1
  389. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -60
  390. package/src/slot-fill/bubbles-virtually/use-slot.js +14 -41
  391. package/src/slot-fill/fill.js +4 -26
  392. package/src/slot-fill/index.js +1 -3
  393. package/src/slot-fill/provider.js +0 -6
  394. package/src/slot-fill/slot.js +0 -5
  395. package/src/snackbar/list.tsx +0 -1
  396. package/src/style.scss +6 -0
  397. package/src/tab-panel/index.tsx +1 -1
  398. package/src/theme/color-algorithms.ts +1 -1
  399. package/src/theme/stories/index.tsx +1 -1
  400. package/src/theme/test/color-algorithms.ts +2 -2
  401. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +10 -6
  402. package/src/toggle-group-control/toggle-group-control/styles.ts +6 -1
  403. package/src/toolbar/stories/index.tsx +25 -26
  404. package/src/toolbar/toolbar-button/index.tsx +10 -13
  405. package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
  406. package/src/tooltip/style.scss +2 -2
  407. package/src/tree-grid/README.md +18 -0
  408. package/src/tree-grid/types.ts +7 -0
  409. package/src/utils/colors-values.js +3 -3
  410. package/src/utils/theme-variables.scss +4 -4
  411. package/src/utils/use-deprecated-props.ts +29 -0
  412. package/tsconfig.json +1 -0
  413. package/tsconfig.tsbuildinfo +1 -1
  414. package/build/mobile/readable-content-view/index.native.js +0 -97
  415. package/build/mobile/readable-content-view/index.native.js.map +0 -1
  416. package/build-module/mobile/readable-content-view/index.native.js +0 -81
  417. package/build-module/mobile/readable-content-view/index.native.js.map +0 -1
  418. package/src/CONTRIBUTING.md +0 -78
  419. package/src/README.md +0 -20
  420. package/src/mobile/readable-content-view/index.native.js +0 -85
  421. package/src/mobile/readable-content-view/style.native.scss +0 -30
  422. package/src/navigable-container/menu.js +0 -62
  423. package/src/navigable-container/tabbable.js +0 -46
@@ -0,0 +1,143 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ReactNode } from 'react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { ButtonAsButtonProps } from '../button/types';
9
+ import type { WordPressComponentProps } from '../ui/context';
10
+ import type { DropdownProps } from '../dropdown/types';
11
+ import type { Props as IconProps } from '../icon';
12
+ import type { NavigableMenuProps } from '../navigable-container/types';
13
+
14
+ export type DropdownOption = {
15
+ /**
16
+ * The Dashicon icon slug to be shown for the option.
17
+ */
18
+ icon?: IconProps[ 'icon' ];
19
+ /**
20
+ * A human-readable title to display for the option.
21
+ */
22
+ title: string;
23
+ /**
24
+ * Whether or not the option is disabled.
25
+ *
26
+ * @default false
27
+ */
28
+ isDisabled?: boolean;
29
+ /**
30
+ * A callback function to invoke when the option is selected.
31
+ */
32
+ onClick?: () => void;
33
+ /**
34
+ * Whether or not the control is currently active.
35
+ */
36
+ isActive?: boolean;
37
+ /**
38
+ * Text to use for the internal `Button` component's tooltip.
39
+ */
40
+ label?: string;
41
+ /**
42
+ * The role to apply to the option's HTML element
43
+ */
44
+ role?: HTMLElement[ 'role' ];
45
+ };
46
+
47
+ type DropdownCallbackProps = {
48
+ isOpen: boolean;
49
+ onToggle: () => void;
50
+ onClose: () => void;
51
+ };
52
+
53
+ // Manually including `as` prop because `WordPressComponentProps` polymorhpism
54
+ // creates a union that is too large for TypeScript to handle.
55
+ type ToggleProps = Partial<
56
+ Omit<
57
+ WordPressComponentProps< ButtonAsButtonProps, 'button', false >,
58
+ 'label' | 'text'
59
+ >
60
+ > & {
61
+ as?: React.ElementType | keyof JSX.IntrinsicElements;
62
+ };
63
+
64
+ export type DropdownMenuProps = {
65
+ /**
66
+ * The Dashicon icon slug to be shown in the collapsed menu button.
67
+ *
68
+ * @default "menu"
69
+ */
70
+ icon?: IconProps[ 'icon' ] | null;
71
+ /**
72
+ * A human-readable label to present as accessibility text on the focused
73
+ * collapsed menu button.
74
+ */
75
+ label: string;
76
+ /**
77
+ * A class name to apply to the dropdown menu's toggle element wrapper.
78
+ */
79
+ className?: string;
80
+ /**
81
+ * Properties of `popoverProps` object will be passed as props to the nested
82
+ * `Popover` component.
83
+ * Use this object to modify props available for the `Popover` component that
84
+ * are not already exposed in the `DropdownMenu` component, e.g.: the
85
+ * direction in which the popover should open relative to its parent node
86
+ * set with `position` prop.
87
+ */
88
+ popoverProps?: DropdownProps[ 'popoverProps' ];
89
+ /**
90
+ * Properties of `toggleProps` object will be passed as props to the nested
91
+ * `Button` component in the `renderToggle` implementation of the `Dropdown`
92
+ * component used internally.
93
+ * Use this object to modify props available for the `Button` component that
94
+ * are not already exposed in the `DropdownMenu` component, e.g.: the tooltip
95
+ * text displayed on hover set with `tooltip` prop.
96
+ */
97
+ toggleProps?: ToggleProps;
98
+ /**
99
+ * Properties of `menuProps` object will be passed as props to the nested
100
+ * `NavigableMenu` component in the `renderContent` implementation of the
101
+ * `Dropdown` component used internally.
102
+ * Use this object to modify props available for the `NavigableMenu`
103
+ * component that are not already exposed in the `DropdownMenu` component,
104
+ * e.g.: the orientation of the menu set with `orientation` prop.
105
+ */
106
+ menuProps?: Omit< Partial< NavigableMenuProps >, 'children' >;
107
+ /**
108
+ * In some contexts, the arrow down key used to open the dropdown menu might
109
+ * need to be disabled—for example when that key is used to perform another
110
+ * action.
111
+ *
112
+ * @default false
113
+ */
114
+ disableOpenOnArrowDown?: boolean;
115
+ /**
116
+ * Text to display on the nested `Button` component in the `renderToggle`
117
+ * implementation of the `Dropdown` component used internally.
118
+ */
119
+ text?: string;
120
+ /**
121
+ * Whether or not `no-icons` should be added to the menu's `className`.
122
+ */
123
+ noIcons?: boolean;
124
+ /**
125
+ * A [function render prop](https://reactjs.org/docs/render-props.html#using-props-other-than-render)
126
+ * which should return an element or elements valid for use in a DropdownMenu:
127
+ * `MenuItem`, `MenuItemsChoice`, or `MenuGroup`. Its first argument is a
128
+ * props object including the same values as given to a `Dropdown`'s
129
+ * `renderContent` (`isOpen`, `onToggle`, `onClose`).
130
+ *
131
+ * A valid DropdownMenu must specify a `controls` or `children` prop, or both.
132
+ */
133
+ children?: ( callbackProps: DropdownCallbackProps ) => ReactNode;
134
+ /**
135
+ * An array or nested array of objects describing the options to be shown in
136
+ * the expanded menu. Each object should include an `icon` Dashicon slug
137
+ * string, a human-readable `title` string, `isDisabled` boolean flag, and
138
+ * an `onClick` function callback to invoke when the option is selected.
139
+ *
140
+ * A valid DropdownMenu must specify a `controls` or `children` prop, or both.
141
+ */
142
+ controls?: DropdownOption[] | DropdownOption[][];
143
+ };
@@ -0,0 +1,392 @@
1
+ # `DropdownMenu` (v2)
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
+ `DropdownMenu` displays a menu to the user (such as a set of actions or functions) triggered by a button.
8
+
9
+
10
+ ## Design guidelines
11
+
12
+ ### Usage
13
+
14
+ #### When to use a DropdownMenu
15
+
16
+ Use a DropdownMenu when you want users to:
17
+
18
+ - Choose an action or change a setting from a list, AND
19
+ - Only see the available choices contextually.
20
+
21
+ `DropdownMenu` is a React component to render an expandable menu of buttons. It is similar in purpose to a `<select>` element, with the distinction that it does not maintain a value. Instead, each option behaves as an action button.
22
+
23
+ If you need to display all the available options at all times, consider using a Toolbar instead. Use a `DropdownMenu` to display a list of actions after the user interacts with a button.
24
+
25
+ **Do**
26
+ Use a `DropdownMenu` to display a list of actions after the user interacts with an icon.
27
+
28
+ **Don’t** use a `DropdownMenu` for important actions that should always be visible. Use a `Toolbar` instead.
29
+
30
+ **Don’t**
31
+ Don’t use a `DropdownMenu` for frequently used actions. Use a `Toolbar` instead.
32
+
33
+ #### Behavior
34
+
35
+ Generally, the parent button should indicate that interacting with it will show a `DropdownMenu`.
36
+
37
+ The parent button should retain the same visual styling regardless of whether the `DropdownMenu` is displayed or not.
38
+
39
+ #### Placement
40
+
41
+ The `DropdownMenu` should typically appear directly below, or below and to the left of, the parent button. If there isn’t enough space below to display the full `DropdownMenu`, it can be displayed instead above the parent button.
42
+
43
+ ## Development guidelines
44
+
45
+ This component is still highly experimental, and it's not normally accessible to consumers of the `@wordpress/components` package.
46
+
47
+ The component exposes a set of components that are meant to be used in combination with each other in order to implement a `DropdownMenu` correctly.
48
+
49
+ ### `DropdownMenu`
50
+
51
+ The root component, used to specify the menu's trigger and its contents.
52
+
53
+ #### Props
54
+
55
+ The component accepts the following props:
56
+
57
+ ##### `trigger`: `React.ReactNode`
58
+
59
+ The trigger button
60
+
61
+ - Required: yes
62
+
63
+ ##### `children`: `React.ReactNode`
64
+
65
+ The contents of the dropdown
66
+
67
+ - Required: yes
68
+
69
+ ##### `defaultOpen`: `boolean`
70
+
71
+ The open state of the dropdown menu when it is initially rendered. Use when you do not need to control its open state.
72
+
73
+ - Required: no
74
+
75
+ ##### `open`: `boolean`
76
+
77
+ The controlled open state of the dropdown menu. Must be used in conjunction with `onOpenChange`
78
+
79
+ - Required: no
80
+
81
+ ##### `onOpenChange`: `(open: boolean) => void`
82
+
83
+ Event handler called when the open state of the dropdown menu changes.
84
+
85
+ - Required: no
86
+
87
+ ##### `modal`: `boolean`
88
+
89
+ The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
90
+
91
+ - Required: no
92
+ - Default: `true`
93
+
94
+ ##### `side`: `"bottom" | "left" | "right" | "top"`
95
+
96
+ The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
97
+
98
+ - Required: no
99
+ - Default: `"bottom"`
100
+
101
+ ##### `sideOffset`: `number`
102
+
103
+ The distance in pixels from the trigger.
104
+
105
+ - Required: no
106
+ - Default: `0`
107
+
108
+ ##### `align`: `"end" | "start" | "center"`
109
+
110
+ The preferred alignment against the trigger. May change when collisions occur.
111
+
112
+ - Required: no
113
+ - Default: `"center"`
114
+
115
+ ##### `alignOffset`: `number`
116
+
117
+ An offset in pixels from the "start" or "end" alignment options.
118
+
119
+ - Required: no
120
+ - Default: `0`
121
+
122
+ ### `DropdownMenuItem`
123
+
124
+ Used to render a menu item.
125
+
126
+ #### Props
127
+
128
+ The component accepts the following props:
129
+
130
+ ##### `children`: `React.ReactNode`
131
+
132
+ The contents of the item
133
+
134
+ - Required: yes
135
+
136
+ ##### `disabled`: `boolean`
137
+
138
+ - Required: no
139
+ - Default: `false`
140
+
141
+ ##### `onSelect`: `(event: Event) => void`
142
+
143
+ Event handler called when the user selects an item (via mouse or keyboard). Calling `event.preventDefault` in this handler will prevent the dropdown menu from closing when selecting that item.
144
+
145
+ - Required: no
146
+
147
+ ##### `textValue`: `string`
148
+
149
+ Optional text used for typeahead purposes. By default the typeahead behavior will use the `.textContent` of the item. Use this when the content is complex, or you have non-textual content inside.
150
+
151
+ - Required: no
152
+
153
+ ##### `prefix`: `React.ReactNode`
154
+
155
+ The contents of the item's prefix.
156
+
157
+ - Required: no
158
+
159
+ ##### `suffix`: `React.ReactNode`
160
+
161
+ The contents of the item's suffix.
162
+
163
+ - Required: no
164
+
165
+ ### `DropdownSubMenu`
166
+
167
+ Used to render a nested submenu.
168
+
169
+ #### Props
170
+
171
+ The component accepts the following props:
172
+ ##### `trigger`: `React.ReactNode`
173
+
174
+ The contents rendered inside the trigger. The trigger should be an instance of the `DropdownSubMenuTrigger` component.
175
+
176
+ - Required: yes
177
+
178
+ ##### `children`: `React.ReactNode`
179
+
180
+ The contents of the dropdown
181
+
182
+ - Required: yes
183
+
184
+ ##### `defaultOpen`: `boolean`
185
+
186
+ The open state of the dropdown menu when it is initially rendered. Use when you do not need to control its open state.
187
+
188
+ - Required: no
189
+
190
+ ##### `open`: `boolean`
191
+
192
+ The controlled open state of the dropdown menu. Must be used in conjunction with `onOpenChange`
193
+
194
+ - Required: no
195
+
196
+ ##### `onOpenChange`: `(open: boolean) => void`
197
+
198
+ Event handler called when the open state of the dropdown menu changes.
199
+
200
+ - Required: no
201
+
202
+ ##### `disabled`: `boolean`
203
+
204
+ When `true`, prevents the user from interacting with the item.
205
+
206
+ - Required: no
207
+
208
+ ##### `textValue`: `string`
209
+
210
+ Optional text used for typeahead purposes for the trigger. By default the typeahead behavior will use the `.textContent` of the trigger. Use this when the content is complex, or you have non-textual content inside.
211
+
212
+ - Required: no
213
+
214
+ ### `DropdownSubMenuTrigger`
215
+
216
+ Used to render a submenu trigger.
217
+
218
+ #### Props
219
+
220
+ The component accepts the following props:
221
+
222
+ ##### `children`: `React.ReactNode`
223
+
224
+ The contents of the item
225
+
226
+ - Required: yes
227
+
228
+ ##### `prefix`: `React.ReactNode`
229
+
230
+ The contents of the item's prefix.
231
+
232
+ - Required: no
233
+
234
+ ##### `suffix`: `React.ReactNode`
235
+
236
+ The contents of the item's suffix.
237
+
238
+ - Default: a chevron icon
239
+ - Required: The standard chevron icon for a submenu trigger
240
+
241
+ ### `DropdownMenuCheckboxItem`
242
+
243
+ Used to render a checkbox item.
244
+
245
+ #### Props
246
+
247
+ The component accepts the following props:
248
+
249
+ ##### `children`: `React.ReactNode`
250
+
251
+ The contents of the checkbox item
252
+
253
+ - Required: yes
254
+
255
+ ##### `checked`: `boolean`
256
+
257
+ The controlled checked state of the item. Must be used in conjunction with `onCheckedChange`.
258
+
259
+ - Required: no
260
+ - Default: `false`
261
+
262
+ ##### `onCheckedChange`: `(checked: boolean) => void)`
263
+
264
+ Event handler called when the checked state changes.
265
+
266
+ - Required: no
267
+
268
+ ##### `disabled`: `boolean`
269
+
270
+ When `true`, prevents the user from interacting with the item.
271
+
272
+ - Required: no
273
+
274
+ ##### `onSelect`: `(event: Event) => void`
275
+
276
+ Event handler called when the user selects an item (via mouse or keyboard). Calling `event.preventDefault` in this handler will prevent the dropdown menu from closing when selecting that item.
277
+
278
+ - Required: no
279
+
280
+ ##### `textValue`: `string`
281
+
282
+ Optional text used for typeahead purposes. By default the typeahead behavior will use the `.textContent` of the item. Use this when the content is complex, or you have non-textual content inside.
283
+
284
+ - Required: no
285
+
286
+ ##### `suffix`: `React.ReactNode`
287
+
288
+ The contents of the checkbox item's suffix.
289
+
290
+ - Required: no
291
+
292
+ ### `DropdownMenuRadioGroup`
293
+
294
+ Used to render a radio group.
295
+
296
+ #### Props
297
+
298
+ The component accepts the following props:
299
+
300
+ ##### `children`: `React.ReactNode`
301
+
302
+ The contents of the radio group
303
+
304
+ - Required: yes
305
+
306
+ ##### `value`: `string`
307
+
308
+ The value of the selected item in the group.
309
+
310
+ - Required: no
311
+
312
+ ##### `onValueChange`: `(value: string) => void`
313
+
314
+ Event handler called when the value changes.
315
+
316
+ - Required: no
317
+
318
+ ### `DropdownMenuRadioItem`
319
+
320
+ Used to render a radio item.
321
+
322
+ #### Props
323
+
324
+ The component accepts the following props:
325
+
326
+ ##### `children`: `React.ReactNode`
327
+
328
+ The contents of the item.
329
+
330
+ - Required: yes
331
+
332
+ ##### `value`: `string`
333
+
334
+ The unique value of the item.
335
+
336
+ - Required: yes
337
+
338
+ ##### `disabled`: `boolean`
339
+
340
+ When `true`, prevents the user from interacting with the item.
341
+
342
+ - Required: no
343
+
344
+ ##### `onSelect`: `(event: Event) => void`
345
+
346
+ Event handler called when the user selects an item (via mouse or keyboard). Calling `event.preventDefault` in this handler will prevent the dropdown menu from closing when selecting that item.
347
+
348
+ - Required: no
349
+
350
+ ##### `textValue`: `string`
351
+
352
+ Optional text used for typeahead purposes. By default the typeahead behavior will use the `.textContent` of the item. Use this when the content is complex, or you have non-textual content inside.
353
+
354
+ - Required: no
355
+
356
+ ##### `suffix`: `React.ReactNode
357
+
358
+ The contents of the radio item's suffix.
359
+
360
+ - Required: no
361
+
362
+ ### `DropdownMenuLabel`
363
+
364
+ Used to render a group label.
365
+
366
+ #### Props
367
+
368
+ The component accepts the following props:
369
+
370
+ ##### `children`: `React.ReactNode`
371
+
372
+ The contents of the group.
373
+
374
+ - Required: yes
375
+
376
+ ### `DropdownMenuGroup`
377
+
378
+ Used to group menu items.
379
+
380
+ #### Props
381
+
382
+ The component accepts the following props:
383
+
384
+ ##### `children`: `React.ReactNode`
385
+
386
+ The contents of the group.
387
+
388
+ - Required: yes
389
+
390
+ ### `DropdownMenuSeparatorProps`
391
+
392
+ Used to render a visual separator.