@wordpress/components 33.1.1-next.v.202605131006.0 → 34.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 (435) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/build/autocomplete/index.cjs +5 -4
  3. package/build/autocomplete/index.cjs.map +3 -3
  4. package/build/border-control/border-control-dropdown/component.cjs +33 -33
  5. package/build/border-control/border-control-dropdown/component.cjs.map +3 -3
  6. package/build/box-control/index.cjs +0 -6
  7. package/build/box-control/index.cjs.map +2 -2
  8. package/build/box-control/utils.cjs +0 -38
  9. package/build/box-control/utils.cjs.map +3 -3
  10. package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
  11. package/build/disabled/index.cjs +1 -1
  12. package/build/disabled/index.cjs.map +2 -2
  13. package/build/draggable/index.cjs +101 -7
  14. package/build/draggable/index.cjs.map +3 -3
  15. package/build/form-token-field/index.cjs +41 -7
  16. package/build/form-token-field/index.cjs.map +2 -2
  17. package/build/higher-order/with-notices/index.cjs +3 -15
  18. package/build/higher-order/with-notices/index.cjs.map +2 -2
  19. package/build/index.cjs +0 -17
  20. package/build/index.cjs.map +2 -2
  21. package/build/input-control/input-base.cjs +31 -34
  22. package/build/input-control/input-base.cjs.map +2 -2
  23. package/build/notice/index.cjs +33 -35
  24. package/build/notice/index.cjs.map +2 -2
  25. package/build/popover/index.cjs +12 -0
  26. package/build/popover/index.cjs.map +2 -2
  27. package/build/responsive-wrapper/index.cjs +4 -3
  28. package/build/responsive-wrapper/index.cjs.map +2 -2
  29. package/build/tabs/styles.cjs +5 -5
  30. package/build/tabs/styles.cjs.map +2 -2
  31. package/build/tooltip/index.cjs +2 -1
  32. package/build/tooltip/index.cjs.map +2 -2
  33. package/build-module/autocomplete/index.mjs +6 -5
  34. package/build-module/autocomplete/index.mjs.map +2 -2
  35. package/build-module/border-control/border-control-dropdown/component.mjs +34 -34
  36. package/build-module/border-control/border-control-dropdown/component.mjs.map +2 -2
  37. package/build-module/box-control/index.mjs +0 -2
  38. package/build-module/box-control/index.mjs.map +2 -2
  39. package/build-module/box-control/utils.mjs +0 -27
  40. package/build-module/box-control/utils.mjs.map +2 -2
  41. package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
  42. package/build-module/disabled/index.mjs +1 -1
  43. package/build-module/disabled/index.mjs.map +2 -2
  44. package/build-module/draggable/index.mjs +101 -7
  45. package/build-module/draggable/index.mjs.map +3 -3
  46. package/build-module/form-token-field/index.mjs +41 -7
  47. package/build-module/form-token-field/index.mjs.map +2 -2
  48. package/build-module/higher-order/with-notices/index.mjs +4 -16
  49. package/build-module/higher-order/with-notices/index.mjs.map +2 -2
  50. package/build-module/index.mjs +87 -99
  51. package/build-module/index.mjs.map +2 -2
  52. package/build-module/input-control/input-base.mjs +31 -34
  53. package/build-module/input-control/input-base.mjs.map +2 -2
  54. package/build-module/notice/index.mjs +34 -36
  55. package/build-module/notice/index.mjs.map +2 -2
  56. package/build-module/popover/index.mjs +12 -0
  57. package/build-module/popover/index.mjs.map +2 -2
  58. package/build-module/responsive-wrapper/index.mjs +4 -3
  59. package/build-module/responsive-wrapper/index.mjs.map +2 -2
  60. package/build-module/tabs/styles.mjs +5 -5
  61. package/build-module/tabs/styles.mjs.map +2 -2
  62. package/build-module/tooltip/index.mjs +2 -1
  63. package/build-module/tooltip/index.mjs.map +2 -2
  64. package/build-style/style-rtl.css +64 -66
  65. package/build-style/style.css +64 -66
  66. package/build-types/autocomplete/index.d.ts.map +1 -1
  67. package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
  68. package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
  69. package/build-types/border-box-control/border-box-control/hook.d.ts +24 -10
  70. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  71. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +26 -12
  72. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  73. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +24 -10
  74. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  75. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +25 -11
  76. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  77. package/build-types/border-control/border-control/hook.d.ts +24 -10
  78. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  79. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  80. package/build-types/border-control/border-control-dropdown/hook.d.ts +23 -9
  81. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  82. package/build-types/box-control/index.d.ts +0 -1
  83. package/build-types/box-control/index.d.ts.map +1 -1
  84. package/build-types/box-control/styles/box-control-styles.d.ts +3 -4
  85. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  86. package/build-types/box-control/utils.d.ts +0 -13
  87. package/build-types/box-control/utils.d.ts.map +1 -1
  88. package/build-types/button/stories/e2e/index.story.d.ts +1 -0
  89. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  90. package/build-types/card/card/hook.d.ts +25 -11
  91. package/build-types/card/card/hook.d.ts.map +1 -1
  92. package/build-types/card/card-body/hook.d.ts +25 -11
  93. package/build-types/card/card-body/hook.d.ts.map +1 -1
  94. package/build-types/card/card-divider/hook.d.ts +26 -12
  95. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  96. package/build-types/card/card-footer/hook.d.ts +25 -11
  97. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  98. package/build-types/card/card-header/hook.d.ts +25 -11
  99. package/build-types/card/card-header/hook.d.ts.map +1 -1
  100. package/build-types/card/card-media/hook.d.ts +25 -11
  101. package/build-types/card/card-media/hook.d.ts.map +1 -1
  102. package/build-types/color-picker/styles.d.ts +3 -4
  103. package/build-types/color-picker/styles.d.ts.map +1 -1
  104. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  105. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  106. package/build-types/custom-select-control-v2/styles.d.ts +4 -12
  107. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  108. package/build-types/date-time/time-picker/styles.d.ts +4 -4
  109. package/build-types/draggable/index.d.ts.map +1 -1
  110. package/build-types/draggable/stories/index.story.d.ts +4 -5
  111. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  112. package/build-types/draggable/types.d.ts +4 -0
  113. package/build-types/draggable/types.d.ts.map +1 -1
  114. package/build-types/elevation/hook.d.ts +25 -11
  115. package/build-types/elevation/hook.d.ts.map +1 -1
  116. package/build-types/flex/flex/hook.d.ts +25 -11
  117. package/build-types/flex/flex/hook.d.ts.map +1 -1
  118. package/build-types/flex/flex-block/hook.d.ts +25 -11
  119. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  120. package/build-types/flex/flex-item/hook.d.ts +25 -11
  121. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  122. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  123. package/build-types/form-token-field/index.d.ts.map +1 -1
  124. package/build-types/grid/hook.d.ts +25 -11
  125. package/build-types/grid/hook.d.ts.map +1 -1
  126. package/build-types/h-stack/hook.d.ts +25 -11
  127. package/build-types/h-stack/hook.d.ts.map +1 -1
  128. package/build-types/heading/hook.d.ts +25 -11
  129. package/build-types/heading/hook.d.ts.map +1 -1
  130. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -3
  131. package/build-types/higher-order/with-filters/index.d.ts +1 -6
  132. package/build-types/higher-order/with-filters/index.d.ts.map +1 -1
  133. package/build-types/higher-order/with-notices/index.d.ts +2 -4
  134. package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
  135. package/build-types/icon/stories/index.story.d.ts +0 -6
  136. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  137. package/build-types/index.d.ts +1 -6
  138. package/build-types/index.d.ts.map +1 -1
  139. package/build-types/input-control/reducer/reducer.d.ts +1 -1
  140. package/build-types/item-group/item/hook.d.ts +25 -11
  141. package/build-types/item-group/item/hook.d.ts.map +1 -1
  142. package/build-types/item-group/item-group/hook.d.ts +25 -11
  143. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  144. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  145. package/build-types/menu/styles.d.ts +7 -21
  146. package/build-types/menu/styles.d.ts.map +1 -1
  147. package/build-types/modal/use-modal-exit-animation.d.ts +1 -1
  148. package/build-types/navigator/navigator-back-button/hook.d.ts +26 -12
  149. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  150. package/build-types/navigator/navigator-button/hook.d.ts +26 -12
  151. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  152. package/build-types/notice/index.d.ts.map +1 -1
  153. package/build-types/notice/types.d.ts +1 -2
  154. package/build-types/notice/types.d.ts.map +1 -1
  155. package/build-types/number-control/index.d.ts +1 -1
  156. package/build-types/number-control/index.d.ts.map +1 -1
  157. package/build-types/number-control/stories/index.story.d.ts +1 -1
  158. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  159. package/build-types/popover/index.d.ts.map +1 -1
  160. package/build-types/popover/types.d.ts +2 -2
  161. package/build-types/popover/types.d.ts.map +1 -1
  162. package/build-types/range-control/index.d.ts +2 -3
  163. package/build-types/range-control/index.d.ts.map +1 -1
  164. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  165. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  166. package/build-types/range-control/types.d.ts +1 -5
  167. package/build-types/range-control/types.d.ts.map +1 -1
  168. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  169. package/build-types/scrollable/hook.d.ts +25 -11
  170. package/build-types/scrollable/hook.d.ts.map +1 -1
  171. package/build-types/snackbar/index.d.ts +2 -2
  172. package/build-types/snackbar/types.d.ts +2 -2
  173. package/build-types/snackbar/types.d.ts.map +1 -1
  174. package/build-types/spacer/hook.d.ts +25 -11
  175. package/build-types/spacer/hook.d.ts.map +1 -1
  176. package/build-types/surface/hook.d.ts +25 -11
  177. package/build-types/surface/hook.d.ts.map +1 -1
  178. package/build-types/tab-panel/stories/index.story.d.ts +0 -6
  179. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  180. package/build-types/tabs/stories/index.story.d.ts +0 -6
  181. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  182. package/build-types/tabs/styles.d.ts +3 -9
  183. package/build-types/tabs/styles.d.ts.map +1 -1
  184. package/build-types/text/hook.d.ts +25 -11
  185. package/build-types/text/hook.d.ts.map +1 -1
  186. package/build-types/tools-panel/tools-panel/hook.d.ts +25 -11
  187. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  188. package/build-types/tools-panel/tools-panel-header/hook.d.ts +25 -11
  189. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  190. package/build-types/tools-panel/tools-panel-item/hook.d.ts +25 -11
  191. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  192. package/build-types/tooltip/index.d.ts.map +1 -1
  193. package/build-types/truncate/hook.d.ts +25 -11
  194. package/build-types/truncate/hook.d.ts.map +1 -1
  195. package/build-types/unit-control/index.d.ts +1 -1
  196. package/build-types/unit-control/index.d.ts.map +1 -1
  197. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  198. package/build-types/utils/get-node-text.d.ts.map +1 -1
  199. package/build-types/v-stack/hook.d.ts +25 -11
  200. package/build-types/v-stack/hook.d.ts.map +1 -1
  201. package/build-types/validated-form-controls/components/number-control.d.ts +1 -1
  202. package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
  203. package/build-types/validated-form-controls/components/range-control.d.ts +2 -3
  204. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  205. package/build-types/validated-form-controls/control-with-error.d.ts +4 -1
  206. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  207. package/package.json +27 -25
  208. package/src/autocomplete/README.md +1 -1
  209. package/src/autocomplete/index.tsx +25 -7
  210. package/src/badge/stories/e2e/index.story.tsx +21 -0
  211. package/src/border-control/border-control-dropdown/component.tsx +36 -37
  212. package/src/box-control/index.tsx +0 -1
  213. package/src/box-control/utils.ts +0 -43
  214. package/src/button/stories/e2e/index.story.tsx +11 -0
  215. package/src/composite/stories/index.story.tsx +0 -1
  216. package/src/custom-gradient-picker/gradient-bar/index.tsx +1 -1
  217. package/src/disabled/index.tsx +1 -1
  218. package/src/draggable/index.tsx +32 -10
  219. package/src/draggable/stories/index.story.tsx +11 -6
  220. package/src/draggable/style.module.scss +29 -0
  221. package/src/draggable/types.ts +4 -0
  222. package/src/form-file-upload/README.md +1 -1
  223. package/src/form-token-field/index.tsx +84 -8
  224. package/src/form-token-field/test/index.tsx +189 -0
  225. package/src/h-stack/hook.tsx +1 -1
  226. package/src/higher-order/with-notices/index.tsx +4 -21
  227. package/src/higher-order/with-notices/test/index.tsx +0 -18
  228. package/src/icon/stories/index.story.tsx +2 -14
  229. package/src/index.ts +0 -6
  230. package/src/input-control/input-base.tsx +2 -2
  231. package/src/menu/README.md +7 -7
  232. package/src/menu/stories/index.story.tsx +0 -1
  233. package/src/menu/test/index.tsx +9 -4
  234. package/src/modal/style.scss +2 -1
  235. package/src/notice/README.md +1 -2
  236. package/src/notice/index.tsx +57 -64
  237. package/src/notice/style.scss +49 -41
  238. package/src/notice/test/__snapshots__/index.tsx.snap +23 -23
  239. package/src/notice/test/index.tsx +5 -5
  240. package/src/notice/types.ts +1 -2
  241. package/src/popover/index.tsx +29 -1
  242. package/src/popover/test/index.tsx +138 -1
  243. package/src/popover/types.ts +2 -4
  244. package/src/range-control/stories/index.story.tsx +0 -1
  245. package/src/range-control/types.ts +1 -5
  246. package/src/responsive-wrapper/index.tsx +7 -3
  247. package/src/snackbar/README.md +1 -1
  248. package/src/snackbar/types.ts +2 -2
  249. package/src/style.scss +0 -1
  250. package/src/tab-panel/stories/index.story.tsx +2 -13
  251. package/src/tab-panel/style.scss +36 -14
  252. package/src/tabs/README.md +1 -1
  253. package/src/tabs/stories/index.story.tsx +2 -14
  254. package/src/tabs/styles.ts +3 -8
  255. package/src/tabs/tablist.tsx +1 -1
  256. package/src/tooltip/index.tsx +7 -1
  257. package/src/tree-grid/test/cell.tsx +0 -1
  258. package/src/tree-grid/test/roving-tab-index-item.tsx +0 -1
  259. package/src/tree-select/README.md +1 -1
  260. package/src/utils/get-node-text.ts +7 -1
  261. package/src/validated-form-controls/control-with-error.tsx +6 -1
  262. package/build/navigation/back-button/index.cjs +0 -86
  263. package/build/navigation/back-button/index.cjs.map +0 -7
  264. package/build/navigation/constants.cjs +0 -34
  265. package/build/navigation/constants.cjs.map +0 -7
  266. package/build/navigation/context.cjs +0 -58
  267. package/build/navigation/context.cjs.map +0 -7
  268. package/build/navigation/group/context.cjs +0 -38
  269. package/build/navigation/group/context.cjs.map +0 -7
  270. package/build/navigation/group/index.cjs +0 -88
  271. package/build/navigation/group/index.cjs.map +0 -7
  272. package/build/navigation/index.cjs +0 -113
  273. package/build/navigation/index.cjs.map +0 -7
  274. package/build/navigation/item/base-content.cjs +0 -44
  275. package/build/navigation/item/base-content.cjs.map +0 -7
  276. package/build/navigation/item/base.cjs +0 -66
  277. package/build/navigation/item/base.cjs.map +0 -7
  278. package/build/navigation/item/index.cjs +0 -119
  279. package/build/navigation/item/index.cjs.map +0 -7
  280. package/build/navigation/item/use-navigation-tree-item.cjs +0 -64
  281. package/build/navigation/item/use-navigation-tree-item.cjs.map +0 -7
  282. package/build/navigation/menu/context.cjs +0 -39
  283. package/build/navigation/menu/context.cjs.map +0 -7
  284. package/build/navigation/menu/index.cjs +0 -114
  285. package/build/navigation/menu/index.cjs.map +0 -7
  286. package/build/navigation/menu/menu-title-search.cjs +0 -111
  287. package/build/navigation/menu/menu-title-search.cjs.map +0 -7
  288. package/build/navigation/menu/menu-title.cjs +0 -104
  289. package/build/navigation/menu/menu-title.cjs.map +0 -7
  290. package/build/navigation/menu/search-no-results-found.cjs +0 -48
  291. package/build/navigation/menu/search-no-results-found.cjs.map +0 -7
  292. package/build/navigation/menu/use-navigation-tree-menu.cjs +0 -51
  293. package/build/navigation/menu/use-navigation-tree-menu.cjs.map +0 -7
  294. package/build/navigation/styles/navigation-styles.cjs +0 -170
  295. package/build/navigation/styles/navigation-styles.cjs.map +0 -7
  296. package/build/navigation/types.cjs +0 -19
  297. package/build/navigation/types.cjs.map +0 -7
  298. package/build/navigation/use-create-navigation-tree.cjs +0 -103
  299. package/build/navigation/use-create-navigation-tree.cjs.map +0 -7
  300. package/build/navigation/use-navigation-tree-nodes.cjs +0 -60
  301. package/build/navigation/use-navigation-tree-nodes.cjs.map +0 -7
  302. package/build/navigation/utils.cjs +0 -45
  303. package/build/navigation/utils.cjs.map +0 -7
  304. package/build-module/navigation/back-button/index.mjs +0 -51
  305. package/build-module/navigation/back-button/index.mjs.map +0 -7
  306. package/build-module/navigation/constants.mjs +0 -8
  307. package/build-module/navigation/constants.mjs.map +0 -7
  308. package/build-module/navigation/context.mjs +0 -32
  309. package/build-module/navigation/context.mjs.map +0 -7
  310. package/build-module/navigation/group/context.mjs +0 -12
  311. package/build-module/navigation/group/context.mjs.map +0 -7
  312. package/build-module/navigation/group/index.mjs +0 -53
  313. package/build-module/navigation/group/index.mjs.map +0 -7
  314. package/build-module/navigation/index.mjs +0 -78
  315. package/build-module/navigation/index.mjs.map +0 -7
  316. package/build-module/navigation/item/base-content.mjs +0 -23
  317. package/build-module/navigation/item/base-content.mjs.map +0 -7
  318. package/build-module/navigation/item/base.mjs +0 -35
  319. package/build-module/navigation/item/base.mjs.map +0 -7
  320. package/build-module/navigation/item/index.mjs +0 -84
  321. package/build-module/navigation/item/index.mjs.map +0 -7
  322. package/build-module/navigation/item/use-navigation-tree-item.mjs +0 -39
  323. package/build-module/navigation/item/use-navigation-tree-item.mjs.map +0 -7
  324. package/build-module/navigation/menu/context.mjs +0 -13
  325. package/build-module/navigation/menu/context.mjs.map +0 -7
  326. package/build-module/navigation/menu/index.mjs +0 -79
  327. package/build-module/navigation/menu/index.mjs.map +0 -7
  328. package/build-module/navigation/menu/menu-title-search.mjs +0 -80
  329. package/build-module/navigation/menu/menu-title-search.mjs.map +0 -7
  330. package/build-module/navigation/menu/menu-title.mjs +0 -73
  331. package/build-module/navigation/menu/menu-title.mjs.map +0 -7
  332. package/build-module/navigation/menu/search-no-results-found.mjs +0 -27
  333. package/build-module/navigation/menu/search-no-results-found.mjs.map +0 -7
  334. package/build-module/navigation/menu/use-navigation-tree-menu.mjs +0 -26
  335. package/build-module/navigation/menu/use-navigation-tree-menu.mjs.map +0 -7
  336. package/build-module/navigation/styles/navigation-styles.mjs +0 -124
  337. package/build-module/navigation/styles/navigation-styles.mjs.map +0 -7
  338. package/build-module/navigation/types.mjs +0 -1
  339. package/build-module/navigation/types.mjs.map +0 -7
  340. package/build-module/navigation/use-create-navigation-tree.mjs +0 -78
  341. package/build-module/navigation/use-create-navigation-tree.mjs.map +0 -7
  342. package/build-module/navigation/use-navigation-tree-nodes.mjs +0 -35
  343. package/build-module/navigation/use-navigation-tree-nodes.mjs.map +0 -7
  344. package/build-module/navigation/utils.mjs +0 -9
  345. package/build-module/navigation/utils.mjs.map +0 -7
  346. package/build-types/navigation/back-button/index.d.ts +0 -7
  347. package/build-types/navigation/back-button/index.d.ts.map +0 -1
  348. package/build-types/navigation/constants.d.ts +0 -3
  349. package/build-types/navigation/constants.d.ts.map +0 -1
  350. package/build-types/navigation/context.d.ts +0 -4
  351. package/build-types/navigation/context.d.ts.map +0 -1
  352. package/build-types/navigation/group/context.d.ts +0 -7
  353. package/build-types/navigation/group/context.d.ts.map +0 -1
  354. package/build-types/navigation/group/index.d.ts +0 -7
  355. package/build-types/navigation/group/index.d.ts.map +0 -1
  356. package/build-types/navigation/index.d.ts +0 -46
  357. package/build-types/navigation/index.d.ts.map +0 -1
  358. package/build-types/navigation/item/base-content.d.ts +0 -3
  359. package/build-types/navigation/item/base-content.d.ts.map +0 -1
  360. package/build-types/navigation/item/base.d.ts +0 -3
  361. package/build-types/navigation/item/base.d.ts.map +0 -1
  362. package/build-types/navigation/item/index.d.ts +0 -7
  363. package/build-types/navigation/item/index.d.ts.map +0 -1
  364. package/build-types/navigation/item/use-navigation-tree-item.d.ts +0 -3
  365. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +0 -1
  366. package/build-types/navigation/menu/context.d.ts +0 -7
  367. package/build-types/navigation/menu/context.d.ts.map +0 -1
  368. package/build-types/navigation/menu/index.d.ts +0 -7
  369. package/build-types/navigation/menu/index.d.ts.map +0 -1
  370. package/build-types/navigation/menu/menu-title-search.d.ts +0 -3
  371. package/build-types/navigation/menu/menu-title-search.d.ts.map +0 -1
  372. package/build-types/navigation/menu/menu-title.d.ts +0 -3
  373. package/build-types/navigation/menu/menu-title.d.ts.map +0 -1
  374. package/build-types/navigation/menu/search-no-results-found.d.ts +0 -3
  375. package/build-types/navigation/menu/search-no-results-found.d.ts.map +0 -1
  376. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +0 -3
  377. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +0 -1
  378. package/build-types/navigation/stories/index.story.d.ts +0 -23
  379. package/build-types/navigation/stories/index.story.d.ts.map +0 -1
  380. package/build-types/navigation/stories/utils/controlled-state.d.ts +0 -7
  381. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +0 -1
  382. package/build-types/navigation/stories/utils/default.d.ts +0 -10
  383. package/build-types/navigation/stories/utils/default.d.ts.map +0 -1
  384. package/build-types/navigation/stories/utils/group.d.ts +0 -10
  385. package/build-types/navigation/stories/utils/group.d.ts.map +0 -1
  386. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +0 -10
  387. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +0 -1
  388. package/build-types/navigation/stories/utils/more-examples.d.ts +0 -10
  389. package/build-types/navigation/stories/utils/more-examples.d.ts.map +0 -1
  390. package/build-types/navigation/stories/utils/search.d.ts +0 -10
  391. package/build-types/navigation/stories/utils/search.d.ts.map +0 -1
  392. package/build-types/navigation/styles/navigation-styles.d.ts +0 -55
  393. package/build-types/navigation/styles/navigation-styles.d.ts.map +0 -1
  394. package/build-types/navigation/test/index.d.ts +0 -2
  395. package/build-types/navigation/test/index.d.ts.map +0 -1
  396. package/build-types/navigation/types.d.ts +0 -266
  397. package/build-types/navigation/types.d.ts.map +0 -1
  398. package/build-types/navigation/use-create-navigation-tree.d.ts +0 -15
  399. package/build-types/navigation/use-create-navigation-tree.d.ts.map +0 -1
  400. package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -10
  401. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +0 -1
  402. package/build-types/navigation/utils.d.ts +0 -3
  403. package/build-types/navigation/utils.d.ts.map +0 -1
  404. package/src/draggable/style.scss +0 -21
  405. package/src/navigation/README.md +0 -267
  406. package/src/navigation/back-button/index.tsx +0 -73
  407. package/src/navigation/constants.tsx +0 -2
  408. package/src/navigation/context.tsx +0 -40
  409. package/src/navigation/group/context.tsx +0 -16
  410. package/src/navigation/group/index.tsx +0 -73
  411. package/src/navigation/index.tsx +0 -152
  412. package/src/navigation/item/base-content.tsx +0 -31
  413. package/src/navigation/item/base.tsx +0 -42
  414. package/src/navigation/item/index.tsx +0 -112
  415. package/src/navigation/item/use-navigation-tree-item.tsx +0 -47
  416. package/src/navigation/menu/context.tsx +0 -20
  417. package/src/navigation/menu/index.tsx +0 -105
  418. package/src/navigation/menu/menu-title-search.tsx +0 -99
  419. package/src/navigation/menu/menu-title.tsx +0 -100
  420. package/src/navigation/menu/search-no-results-found.tsx +0 -34
  421. package/src/navigation/menu/use-navigation-tree-menu.tsx +0 -29
  422. package/src/navigation/stories/index.story.tsx +0 -62
  423. package/src/navigation/stories/style.css +0 -25
  424. package/src/navigation/stories/utils/controlled-state.tsx +0 -149
  425. package/src/navigation/stories/utils/default.tsx +0 -92
  426. package/src/navigation/stories/utils/group.tsx +0 -61
  427. package/src/navigation/stories/utils/hide-if-empty.tsx +0 -66
  428. package/src/navigation/stories/utils/more-examples.tsx +0 -162
  429. package/src/navigation/stories/utils/search.tsx +0 -91
  430. package/src/navigation/styles/navigation-styles.tsx +0 -197
  431. package/src/navigation/test/index.tsx +0 -347
  432. package/src/navigation/types.ts +0 -325
  433. package/src/navigation/use-create-navigation-tree.tsx +0 -110
  434. package/src/navigation/use-navigation-tree-nodes.tsx +0 -31
  435. package/src/navigation/utils.tsx +0 -11
@@ -23,6 +23,7 @@ import {
23
23
  useContextSystem,
24
24
  } from '../context';
25
25
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
26
+ import type { FlexDirection } from '../flex/types';
26
27
 
27
28
  function useUniqueId( idProp?: string ) {
28
29
  const instanceId = useInstanceId( InputBase );
@@ -34,7 +35,7 @@ function useUniqueId( idProp?: string ) {
34
35
  // Adapter to map props for the new ui/flex component.
35
36
  function getUIFlexProps( labelPosition?: LabelPosition ) {
36
37
  const props: {
37
- direction?: string;
38
+ direction?: FlexDirection;
38
39
  gap?: number;
39
40
  justify?: string;
40
41
  expanded?: boolean;
@@ -92,7 +93,6 @@ function InputBase(
92
93
  }, [ __next40pxDefaultSize, size ] );
93
94
 
94
95
  return (
95
- // @ts-expect-error The `direction` prop from Flex (FlexDirection) conflicts with legacy SVGAttributes `direction` (string) that come from React intrinsic prop definitions.
96
96
  <Root
97
97
  { ...restProps }
98
98
  { ...getUIFlexProps( labelPosition ) }
@@ -120,7 +120,7 @@ make disabled elements still accessible via keyboard.
120
120
 
121
121
  ##### `render`
122
122
 
123
- - Type: `ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
123
+ - Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
124
124
  - Required: No
125
125
 
126
126
  Allows the component to be rendered as a different HTML element or React
@@ -245,7 +245,7 @@ The contents of the menu item's prefix, such as an icon.
245
245
 
246
246
  ##### `render`
247
247
 
248
- - Type: `ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
248
+ - Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
249
249
  - Required: No
250
250
 
251
251
  Allows the component to be rendered as a different HTML element or React
@@ -329,14 +329,14 @@ The radio item's name.
329
329
 
330
330
  ##### `onChange`
331
331
 
332
- - Type: `BivariantCallback<(event: ChangeEvent<HTMLInputElement>) => void>`
332
+ - Type: `BivariantCallback<(event: ChangeEvent<HTMLInputElement, Element>) => void>`
333
333
  - Required: No
334
334
 
335
335
  A function that is called when the checkbox's checked state changes.
336
336
 
337
337
  ##### `render`
338
338
 
339
- - Type: `ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
339
+ - Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
340
340
  - Required: No
341
341
 
342
342
  Allows the component to be rendered as a different HTML element or React
@@ -427,14 +427,14 @@ The checkbox menu item's name.
427
427
 
428
428
  ##### `onChange`
429
429
 
430
- - Type: `ChangeEventHandler<HTMLInputElement>`
430
+ - Type: `ChangeEventHandler<HTMLInputElement, HTMLInputElement>`
431
431
  - Required: No
432
432
 
433
433
  A function that is called when the checkbox's checked state changes.
434
434
 
435
435
  ##### `render`
436
436
 
437
- - Type: `ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
437
+ - Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
438
438
  - Required: No
439
439
 
440
440
  Allows the component to be rendered as a different HTML element or React
@@ -575,7 +575,7 @@ The contents of the menu item's prefix, such as an icon.
575
575
 
576
576
  ##### `render`
577
577
 
578
- - Type: `ReactElement<any, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
578
+ - Type: `ReactElement<unknown, string | JSXElementConstructor<any>> | RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }>`
579
579
  - Required: No
580
580
 
581
581
  Allows the component to be rendered as a different HTML element or React
@@ -33,7 +33,6 @@ const meta: Meta< typeof Menu > = {
33
33
  Group: Menu.Group,
34
34
  GroupLabel: Menu.GroupLabel,
35
35
  Separator: Menu.Separator,
36
- // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
37
36
  Context: Menu.Context,
38
37
  RadioItem: Menu.RadioItem,
39
38
  ItemLabel: Menu.ItemLabel,
@@ -156,7 +156,7 @@ describe( 'Menu', () => {
156
156
  await waitForFocusedMenuItem( 'First item' );
157
157
  } );
158
158
 
159
- it( 'should open and focus the first item when pressing the space key on the trigger', async () => {
159
+ it( 'should open when pressing the space key on the trigger', async () => {
160
160
  render(
161
161
  <Menu>
162
162
  <Menu.TriggerButton>Open dropdown</Menu.TriggerButton>
@@ -181,11 +181,16 @@ describe( 'Menu', () => {
181
181
  expect( screen.queryByRole( 'menuitem' ) ).not.toBeInTheDocument();
182
182
 
183
183
  // Keyboard-triggered clicks have `detail: 0`, which Ariakit uses to
184
- // choose the initial item focus path instead of the pointer path.
184
+ // distinguish keyboard activation from pointer activation.
185
185
  await press.Space( toggleButton, { detail: 0 } );
186
186
 
187
- // Menu open, focus is on the first focusable item
188
- await waitForFocusedMenuItem( 'First item' );
187
+ await waitFor( () =>
188
+ expect( toggleButton ).toHaveAttribute(
189
+ 'aria-expanded',
190
+ 'true'
191
+ )
192
+ );
193
+ expect( screen.getByRole( 'menu' ) ).toBeVisible();
189
194
  } );
190
195
 
191
196
  it( 'should close when pressing the escape key', async () => {
@@ -200,7 +200,8 @@
200
200
  align-items: center;
201
201
  height: $header-height + $grid-unit-10; // 72px
202
202
  width: 100%;
203
- z-index: z-index(".components-modal__header");
203
+ // Stack above modal content that may overlap the header.
204
+ z-index: 10;
204
205
  position: absolute;
205
206
  top: 0;
206
207
  left: 0;
@@ -17,7 +17,6 @@ Notices display at the top of the screen, below any toolbars anchored to the top
17
17
  Notices are color-coded to indicate the type of message being communicated:
18
18
 
19
19
  - **Informational** notices are **blue** by default.
20
- - If there is a parent `Theme` component with an `accent` color prop, informational notices will take on that color instead.
21
20
  - **Success** notices are **green.**
22
21
  - **Warning** notices are **yellow.**
23
22
  - **Error** notices are **red.**
@@ -101,7 +100,7 @@ Used to provide a custom spoken message in place of the `children` default.
101
100
 
102
101
  #### `status`: `'warning' | 'success' | 'error' | 'info'`
103
102
 
104
- Determines the color of the notice: `warning` (yellow), `success` (green), `error` (red), or `'info'`. By default `'info'` will be blue, but if there is a parent Theme component with an accent color prop, the notice will take on that color instead.
103
+ Determines the color of the notice: `warning` (yellow), `success` (green), `error` (red), or `'info'`. By default `'info'` will be blue.
105
104
 
106
105
  - Required: No
107
106
  - Default: `info`
@@ -9,7 +9,7 @@ import clsx from 'clsx';
9
9
  import { __ } from '@wordpress/i18n';
10
10
  import { RawHTML, useEffect, renderToString } from '@wordpress/element';
11
11
  import { speak } from '@wordpress/a11y';
12
- import { close } from '@wordpress/icons';
12
+ import { closeSmall } from '@wordpress/icons';
13
13
 
14
14
  /**
15
15
  * Internal dependencies
@@ -93,9 +93,9 @@ function Notice( {
93
93
  }: NoticeProps ) {
94
94
  useSpokenMessage( spokenMessage, politeness );
95
95
 
96
- const classes = clsx( className, 'components-notice', 'is-' + status, {
97
- 'is-dismissible': isDismissible,
98
- } );
96
+ // Dismissibility is not a wrapper modifier; target `.components-notice__dismiss`
97
+ // or `.components-notice:has(.components-notice__dismiss)` from outside CSS.
98
+ const classes = clsx( className, 'components-notice', 'is-' + status );
99
99
 
100
100
  if ( __unstableHTML && typeof children === 'string' ) {
101
101
  children = <RawHTML>{ children }</RawHTML>;
@@ -109,71 +109,64 @@ function Notice( {
109
109
  return (
110
110
  <div className={ classes }>
111
111
  <VisuallyHidden>{ getStatusLabel( status ) }</VisuallyHidden>
112
- <div className="components-notice__content">
113
- { children }
114
- { actions.length > 0 && (
115
- <div className="components-notice__actions">
116
- { actions.map(
117
- (
118
- {
119
- className: buttonCustomClasses,
120
- label,
121
- isPrimary,
122
- variant,
123
- noDefaultClasses = false,
124
- onClick,
125
- url,
126
- disabled,
127
- }: NoticeAction &
128
- // `isPrimary` is a legacy prop included for
129
- // backcompat, but `variant` should be used
130
- // instead.
131
- Pick< DeprecatedButtonProps, 'isPrimary' >,
132
- index
133
- ) => {
134
- let computedVariant = variant;
135
- if (
136
- variant !== 'primary' &&
137
- ! noDefaultClasses
138
- ) {
139
- computedVariant = ! url
140
- ? 'secondary'
141
- : 'link';
142
- }
143
- if (
144
- typeof computedVariant === 'undefined' &&
145
- isPrimary
146
- ) {
147
- computedVariant = 'primary';
148
- }
149
-
150
- return (
151
- <Button
152
- __next40pxDefaultSize
153
- key={ index }
154
- href={ url }
155
- variant={ computedVariant }
156
- onClick={ onClick }
157
- disabled={ disabled }
158
- accessibleWhenDisabled
159
- className={ clsx(
160
- 'components-notice__action',
161
- buttonCustomClasses
162
- ) }
163
- >
164
- { label }
165
- </Button>
166
- );
112
+ <div className="components-notice__content">{ children }</div>
113
+ { actions.length > 0 && (
114
+ <div className="components-notice__actions">
115
+ { actions.map(
116
+ (
117
+ {
118
+ className: buttonCustomClasses,
119
+ label,
120
+ isPrimary,
121
+ variant,
122
+ noDefaultClasses = false,
123
+ onClick,
124
+ url,
125
+ disabled,
126
+ }: NoticeAction &
127
+ // `isPrimary` is a legacy prop included for
128
+ // backcompat, but `variant` should be used
129
+ // instead.
130
+ Pick< DeprecatedButtonProps, 'isPrimary' >,
131
+ index
132
+ ) => {
133
+ let computedVariant = variant;
134
+ if ( variant !== 'primary' && ! noDefaultClasses ) {
135
+ computedVariant = ! url ? 'secondary' : 'link';
136
+ }
137
+ if (
138
+ typeof computedVariant === 'undefined' &&
139
+ isPrimary
140
+ ) {
141
+ computedVariant = 'primary';
167
142
  }
168
- ) }
169
- </div>
170
- ) }
171
- </div>
143
+
144
+ return (
145
+ <Button
146
+ size="compact"
147
+ key={ index }
148
+ href={ url }
149
+ variant={ computedVariant }
150
+ onClick={ onClick }
151
+ disabled={ disabled }
152
+ accessibleWhenDisabled
153
+ className={ clsx(
154
+ 'components-notice__action',
155
+ buttonCustomClasses
156
+ ) }
157
+ >
158
+ { label }
159
+ </Button>
160
+ );
161
+ }
162
+ ) }
163
+ </div>
164
+ ) }
172
165
  { isDismissible && (
173
166
  <Button
174
167
  size="small"
175
168
  className="components-notice__dismiss"
176
- icon={ close }
169
+ icon={ closeSmall }
177
170
  label={ __( 'Close' ) }
178
171
  onClick={ onDismissNotice }
179
172
  />
@@ -1,67 +1,77 @@
1
- @use "sass:color";
2
- @use "@wordpress/base-styles/colors" as *;
3
1
  @use "@wordpress/base-styles/variables" as *;
4
- @use "../utils/theme-variables" as *;
5
2
 
6
3
  .components-notice {
7
- display: flex;
8
- font-family: $default-font;
9
- font-size: $default-font-size;
10
- background-color: $white;
11
- border-left: 4px solid $components-color-accent;
12
- padding: 8px 12px;
13
- align-items: center;
14
- color: $gray-900;
15
-
16
- &.is-dismissible {
17
- position: relative;
4
+ --wp-components-notice-background-color: var(--wpds-color-bg-surface-info-weak);
5
+ --wp-components-notice-border-color: var(--wpds-color-stroke-surface-info);
6
+ --wp-components-notice-text-color: var(--wpds-color-fg-content-info);
18
7
 
19
- .components-notice__content {
20
- margin-right: #{ $button-size-small + $border-width };
21
- }
22
- }
8
+ box-sizing: border-box;
9
+ display: grid;
10
+ grid-template-columns: 1fr auto;
11
+ align-items: start;
12
+ padding: var(--wpds-dimension-padding-md);
13
+ border: var(--wpds-border-width-xs) solid var(--wp-components-notice-border-color);
14
+ border-radius: var(--wpds-border-radius-lg);
15
+ background-color: var(--wp-components-notice-background-color);
16
+ color: var(--wp-components-notice-text-color);
17
+ font-family: var(--wpds-typography-font-family-body);
18
+ font-size: var(--wpds-typography-font-size-md);
19
+ line-height: var(--wpds-typography-line-height-sm);
23
20
 
24
21
  &.is-success {
25
- border-left-color: $alert-green;
26
- background-color: color.adjust($alert-green, $lightness: +45%);
22
+ --wp-components-notice-background-color: var(--wpds-color-bg-surface-success-weak);
23
+ --wp-components-notice-border-color: var(--wpds-color-stroke-surface-success);
24
+ --wp-components-notice-text-color: var(--wpds-color-fg-content-success);
27
25
  }
28
26
 
29
27
  &.is-warning {
30
- border-left-color: $alert-yellow;
31
- background-color: color.adjust($alert-yellow, $lightness: +35%);
28
+ --wp-components-notice-background-color: var(--wpds-color-bg-surface-warning-weak);
29
+ --wp-components-notice-border-color: var(--wpds-color-stroke-surface-warning);
30
+ --wp-components-notice-text-color: var(--wpds-color-fg-content-warning);
32
31
  }
33
32
 
34
33
  &.is-error {
35
- border-left-color: $alert-red;
36
- background-color: color.adjust($alert-red, $lightness: +35%);
34
+ --wp-components-notice-background-color: var(--wpds-color-bg-surface-error-weak);
35
+ --wp-components-notice-border-color: var(--wpds-color-stroke-surface-error);
36
+ --wp-components-notice-text-color: var(--wpds-color-fg-content-error);
37
37
  }
38
38
  }
39
39
 
40
40
  .components-notice__content {
41
- flex-grow: 1;
42
- margin-top: $grid-unit-05;
43
- margin-bottom: $grid-unit-05;
41
+ grid-column: 1;
42
+ grid-row: 1;
43
+
44
+ // Centers single-line copy with the dismiss row when it is present. The same
45
+ // padding is kept when the notice is not dismissible so block height stays
46
+ // consistent across variants, matching `@wordpress/ui` Notice (`.title` /
47
+ // `.description` always use `--text-vertical-padding` whether or not `CloseIcon`
48
+ // is rendered).
49
+ // TODO: Replace `$button-size-small` with a WPDS size token once size tokens
50
+ // land in `@wordpress/theme`.
51
+ padding-block: calc((#{$button-size-small} - 1lh) / 2);
44
52
  }
45
53
 
46
54
  .components-notice__actions {
55
+ grid-column: 1;
56
+ grid-row: 2;
57
+
47
58
  display: flex;
48
59
  flex-wrap: wrap;
49
60
  align-items: center;
50
- gap: $grid-unit-15;
51
- margin-top: $grid-unit-15;
61
+ gap: var(--wpds-dimension-gap-md);
62
+ margin-top: var(--wpds-dimension-gap-sm);
52
63
  }
53
64
 
54
65
  .components-notice__dismiss {
55
- color: $gray-700;
56
-
57
- // Place the dismiss button at the top of the container, even when text wraps onto two lines.
58
- align-self: flex-start;
59
- flex-shrink: 0;
66
+ grid-column: 2;
67
+ grid-row: 1;
68
+ color: var(--wpds-color-fg-interactive-neutral);
69
+ margin-inline-start: var(--wpds-dimension-gap-xs);
60
70
 
61
71
  &:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):hover,
62
72
  &:not(:disabled):not([aria-disabled="true"]):not(.is-secondary):active,
63
73
  &:not(:disabled):not([aria-disabled="true"]):focus {
64
- color: $gray-900;
74
+ color: var(--wpds-color-fg-interactive-neutral-active);
65
75
  background-color: transparent;
66
76
  }
67
77
 
@@ -71,13 +81,11 @@
71
81
  }
72
82
 
73
83
  .components-notice-list {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: var(--wpds-dimension-gap-md);
87
+
74
88
  // The notice should never be wider than the viewport, or the close button might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket.
75
89
  max-width: 100vw;
76
90
  box-sizing: border-box;
77
-
78
- .components-notice__content {
79
- margin-top: $grid-unit-15;
80
- margin-bottom: $grid-unit-15;
81
- line-height: 2;
82
- }
83
91
  }
@@ -3,7 +3,7 @@
3
3
  exports[`Notice should match snapshot 1`] = `
4
4
  <div>
5
5
  <div
6
- class="components-notice is-success is-dismissible"
6
+ class="components-notice is-success"
7
7
  >
8
8
  <div
9
9
  class="components-visually-hidden css-1ragr82-PolymorphicDiv emotion-0"
@@ -18,28 +18,28 @@ exports[`Notice should match snapshot 1`] = `
18
18
  class="components-notice__content"
19
19
  >
20
20
  Example
21
- <div
22
- class="components-notice__actions"
21
+ </div>
22
+ <div
23
+ class="components-notice__actions"
24
+ >
25
+ <a
26
+ class="components-button components-notice__action is-compact is-link"
27
+ href="https://example.com"
28
+ >
29
+ More information
30
+ </a>
31
+ <button
32
+ class="components-button components-notice__action is-secondary is-compact"
33
+ type="button"
34
+ >
35
+ Cancel
36
+ </button>
37
+ <button
38
+ class="components-button components-notice__action is-primary is-compact"
39
+ type="button"
23
40
  >
24
- <a
25
- class="components-button components-notice__action is-next-40px-default-size is-link"
26
- href="https://example.com"
27
- >
28
- More information
29
- </a>
30
- <button
31
- class="components-button components-notice__action is-next-40px-default-size is-secondary"
32
- type="button"
33
- >
34
- Cancel
35
- </button>
36
- <button
37
- class="components-button components-notice__action is-next-40px-default-size is-primary"
38
- type="button"
39
- >
40
- Submit
41
- </button>
42
- </div>
41
+ Submit
42
+ </button>
43
43
  </div>
44
44
  <button
45
45
  aria-label="Close"
@@ -55,7 +55,7 @@ exports[`Notice should match snapshot 1`] = `
55
55
  xmlns="http://www.w3.org/2000/svg"
56
56
  >
57
57
  <path
58
- d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"
58
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
59
59
  />
60
60
  </svg>
61
61
  </button>
@@ -43,14 +43,14 @@ describe( 'Notice', () => {
43
43
  expect( container ).toMatchSnapshot();
44
44
  } );
45
45
 
46
- it( 'should not have is-dismissible class when isDismissible prop is false', () => {
47
- const { container } = render(
46
+ it( 'should not render a dismiss control when isDismissible prop is false', () => {
47
+ render(
48
48
  <Notice isDismissible={ false }>I cannot be dismissed!</Notice>
49
49
  );
50
- const wrapper = getNoticeWrapper( container );
51
50
 
52
- expect( wrapper ).toHaveClass( 'components-notice' );
53
- expect( wrapper ).not.toHaveClass( 'is-dismissible' );
51
+ expect(
52
+ screen.queryByRole( 'button', { name: 'Close' } )
53
+ ).not.toBeInTheDocument();
54
54
  } );
55
55
 
56
56
  it( 'should default to info status', () => {
@@ -53,8 +53,7 @@ export type NoticeProps = {
53
53
  /**
54
54
  * Determines the color of the notice: `warning` (yellow),
55
55
  * `success` (green), `error` (red), or `'info'`.
56
- * By default `'info'` will be blue, but if there is a parent Theme component
57
- * with an accent color prop, the notice will take on that color instead.
56
+ * By default `'info'` will be blue.
58
57
  *
59
58
  * @default 'info'
60
59
  */
@@ -146,6 +146,11 @@ const UnforwardedPopover = (
146
146
  getAnchorRect,
147
147
  isAlternate,
148
148
 
149
+ // `onKeyDown` is forwarded to `useDialog` so the consumer's handler
150
+ // is merged with the close-on-Escape one (rather than being silently
151
+ // overridden by the spread of `dialogProps` further below).
152
+ onKeyDown,
153
+
149
154
  // Rest
150
155
  ...contentProps
151
156
  } = useContextSystem( props, 'Popover' );
@@ -194,7 +199,7 @@ const UnforwardedPopover = (
194
199
  } );
195
200
  }
196
201
 
197
- const arrowRef = useRef< HTMLElement | null >( null );
202
+ const arrowRef = useRef< HTMLElement >( null );
198
203
 
199
204
  const [ fallbackReferenceElement, setFallbackReferenceElement ] =
200
205
  useState< HTMLSpanElement | null >( null );
@@ -279,6 +284,28 @@ const UnforwardedPopover = (
279
284
  ) {
280
285
  return;
281
286
  }
287
+ // Treat focus moves involving portaled descendants as
288
+ // internal: either the next focus target is in the
289
+ // `@wordpress/ui` compat overlay slot, or focus is back
290
+ // inside this popover by the time we evaluate (e.g. when
291
+ // a portaled overlay is dismissed and synchronously
292
+ // restores focus to its trigger).
293
+ // See https://github.com/WordPress/gutenberg/issues/78406.
294
+ const relatedTarget =
295
+ 'relatedTarget' in event ? event.relatedTarget : null;
296
+ if (
297
+ relatedTarget instanceof Element &&
298
+ relatedTarget.closest( '[data-wp-compat-overlay-slot]' )
299
+ ) {
300
+ return;
301
+ }
302
+ if (
303
+ floatingElement &&
304
+ ownerDocument?.activeElement instanceof Element &&
305
+ floatingElement.contains( ownerDocument.activeElement )
306
+ ) {
307
+ return;
308
+ }
282
309
  // Call onFocusOutside if defined or call onClose.
283
310
  if ( onFocusOutside ) {
284
311
  onFocusOutside( event );
@@ -295,6 +322,7 @@ const UnforwardedPopover = (
295
322
  const [ dialogRef, dialogProps ] = useDialog( {
296
323
  constrainTabbing,
297
324
  focusOnMount,
325
+ onKeyDown,
298
326
  __unstableOnClose: onDialogClose,
299
327
  // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)
300
328
  onClose: onDialogClose,