@wordpress/components 33.1.1-next.v.202605131032.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
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen, waitFor, getByText } from '@testing-library/react';
4
+ import {
5
+ act,
6
+ render,
7
+ screen,
8
+ waitFor,
9
+ getByText,
10
+ } from '@testing-library/react';
5
11
  import userEvent from '@testing-library/user-event';
6
12
  import type { CSSProperties } from 'react';
7
13
 
@@ -663,4 +669,135 @@ describe( 'Popover', () => {
663
669
  } );
664
670
  } );
665
671
  } );
672
+
673
+ describe( 'wp compat overlay slot', () => {
674
+ function createOverlaySlot() {
675
+ const slot = document.createElement( 'div' );
676
+ slot.setAttribute( 'data-wp-compat-overlay-slot', '' );
677
+ const slotButton = document.createElement( 'button' );
678
+ slotButton.textContent = 'Slotted item';
679
+ slot.appendChild( slotButton );
680
+ document.body.appendChild( slot );
681
+ return { slot, slotButton };
682
+ }
683
+
684
+ it( 'should not call onFocusOutside when focus moves into the wp compat overlay slot', async () => {
685
+ const user = userEvent.setup();
686
+ const onFocusOutside = jest.fn();
687
+ const { slot, slotButton } = createOverlaySlot();
688
+
689
+ render(
690
+ <Popover onFocusOutside={ onFocusOutside }>
691
+ <button>Inside popover</button>
692
+ </Popover>
693
+ );
694
+
695
+ await user.click( screen.getByText( 'Inside popover' ) );
696
+ await user.click( slotButton );
697
+
698
+ await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
699
+ expect( onFocusOutside ).not.toHaveBeenCalled();
700
+
701
+ document.body.removeChild( slot );
702
+ } );
703
+
704
+ it( 'should not call onFocusOutside when focus returns from the slot to a popover descendant', async () => {
705
+ const user = userEvent.setup();
706
+ const onFocusOutside = jest.fn();
707
+ const { slot, slotButton } = createOverlaySlot();
708
+
709
+ render(
710
+ <Popover onFocusOutside={ onFocusOutside }>
711
+ <button>Inside popover</button>
712
+ </Popover>
713
+ );
714
+
715
+ const insideButton = screen.getByText( 'Inside popover' );
716
+ await user.click( insideButton );
717
+ await user.click( slotButton );
718
+ insideButton.focus();
719
+
720
+ await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
721
+ expect( onFocusOutside ).not.toHaveBeenCalled();
722
+
723
+ document.body.removeChild( slot );
724
+ } );
725
+
726
+ it( 'should not call onFocusOutside when focus is restored to a popover descendant by the time the blur check runs', async () => {
727
+ // Mimics the base-ui `Select` backdrop dismissal: focus drops
728
+ // to `body` (so the captured `relatedTarget` is `null`), then
729
+ // is synchronously restored to the popover before the blur
730
+ // check runs.
731
+ const onFocusOutside = jest.fn();
732
+ const { slot, slotButton } = createOverlaySlot();
733
+
734
+ render(
735
+ <Popover
736
+ data-testid="popover"
737
+ onFocusOutside={ onFocusOutside }
738
+ >
739
+ <button>Trigger</button>
740
+ </Popover>
741
+ );
742
+
743
+ const trigger = screen.getByText( 'Trigger' );
744
+ const floating = screen.getByTestId( 'popover' );
745
+
746
+ await act( async () => {
747
+ slotButton.focus();
748
+ floating.dispatchEvent(
749
+ new FocusEvent( 'blur', {
750
+ bubbles: true,
751
+ relatedTarget: null,
752
+ } )
753
+ );
754
+ trigger.focus();
755
+ await new Promise( ( resolve ) => setTimeout( resolve, 50 ) );
756
+ } );
757
+
758
+ expect( onFocusOutside ).not.toHaveBeenCalled();
759
+
760
+ document.body.removeChild( slot );
761
+ } );
762
+
763
+ it( 'should still call onFocusOutside when focus moves to a sibling outside the slot', async () => {
764
+ const user = userEvent.setup();
765
+ const onFocusOutside = jest.fn();
766
+
767
+ render(
768
+ <>
769
+ <Popover onFocusOutside={ onFocusOutside }>
770
+ <button>Inside popover</button>
771
+ </Popover>
772
+ <button>Outside</button>
773
+ </>
774
+ );
775
+
776
+ await user.click( screen.getByText( 'Inside popover' ) );
777
+ await user.click( screen.getByText( 'Outside' ) );
778
+
779
+ await waitFor( () => {
780
+ expect( onFocusOutside ).toHaveBeenCalledTimes( 1 );
781
+ } );
782
+ } );
783
+ } );
784
+
785
+ it( 'should call a consumer-provided onKeyDown alongside close-on-Escape', async () => {
786
+ const user = userEvent.setup();
787
+ const onClose = jest.fn();
788
+ const onKeyDown = jest.fn();
789
+
790
+ render(
791
+ <Popover onClose={ onClose } onKeyDown={ onKeyDown }>
792
+ <button>Inside popover</button>
793
+ </Popover>
794
+ );
795
+
796
+ await user.click( screen.getByText( 'Inside popover' ) );
797
+ await user.keyboard( '[Escape]' );
798
+
799
+ expect( onKeyDown ).toHaveBeenCalled();
800
+ expect( onKeyDown.mock.calls[ 0 ][ 0 ].key ).toBe( 'Escape' );
801
+ expect( onClose ).toHaveBeenCalledTimes( 1 );
802
+ } );
666
803
  } );
@@ -1,6 +1,6 @@
1
1
  import type { Placement } from '@floating-ui/react-dom';
2
2
  import type { useFocusOnMount } from '@wordpress/compose';
3
- import type { MutableRefObject, ReactNode, SyntheticEvent } from 'react';
3
+ import type { RefObject, ReactNode, SyntheticEvent } from 'react';
4
4
 
5
5
  type PositionYAxis = 'top' | 'middle' | 'bottom';
6
6
  type PositionXAxis = 'left' | 'center' | 'right';
@@ -12,9 +12,7 @@ type DomRectWithOwnerDocument = DOMRect & {
12
12
 
13
13
  type PopoverPlacement = Placement | 'overlay';
14
14
 
15
- export type PopoverAnchorRefReference = MutableRefObject<
16
- Element | null | undefined
17
- >;
15
+ export type PopoverAnchorRefReference = RefObject< Element | null | undefined >;
18
16
  export type PopoverAnchorRefTopBottom = { top: Element; bottom: Element };
19
17
 
20
18
  export type VirtualElement = Pick< Element, 'getBoundingClientRect' > & {
@@ -35,7 +35,6 @@ const meta: Meta< typeof RangeControl > = {
35
35
  },
36
36
  color: { control: { type: 'color' } },
37
37
  help: { control: { type: 'text' } },
38
- icon: { control: false },
39
38
  marks: { control: { type: 'object' } },
40
39
  onBlur: { control: false },
41
40
  onChange: { control: false },
@@ -114,10 +114,6 @@ export type RangeControlProps = Pick<
114
114
  * `undefined`.
115
115
  */
116
116
  currentInput?: number;
117
- /**
118
- * An icon to be shown above the slider next to its container title.
119
- */
120
- icon?: string;
121
117
  /**
122
118
  * The slider starting position, used when no `value` is passed.
123
119
  * The `initialPosition` will be clamped between the provided `min`
@@ -153,7 +149,7 @@ export type RangeControlProps = Pick<
153
149
  *
154
150
  * @default () => void
155
151
  */
156
- onChange?: ( value?: number ) => void;
152
+ onChange?: ( value: number | undefined ) => void;
157
153
  /**
158
154
  * Callback for when `RangeControl` input gains focus.
159
155
  *
@@ -45,16 +45,20 @@ function ResponsiveWrapper( {
45
45
  aspectRatio = `${ naturalWidth } / ${ naturalHeight }`;
46
46
  }
47
47
 
48
+ const ch = children as React.ReactElement<
49
+ Pick< React.HTMLAttributes< Element >, 'className' | 'style' >
50
+ >;
51
+
48
52
  return (
49
53
  <TagName className="components-responsive-wrapper">
50
54
  <div>
51
- { cloneElement( children, {
55
+ { cloneElement( ch, {
52
56
  className: clsx(
53
57
  'components-responsive-wrapper__content',
54
- children.props.className
58
+ ch.props.className
55
59
  ),
56
60
  style: {
57
- ...children.props.style,
61
+ ...ch.props.style,
58
62
  aspectRatio,
59
63
  },
60
64
  } ) }
@@ -61,7 +61,7 @@ The icon to render in the snackbar.
61
61
  - Required: No
62
62
  - Default: `null`
63
63
 
64
- #### `listRef`: `MutableRefObject< HTMLDivElement | null >`
64
+ #### `listRef`: `RefObject< HTMLDivElement | null >`
65
65
 
66
66
  A ref to the list that contains the snackbar.
67
67
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { MutableRefObject, ReactNode } from 'react';
4
+ import type { RefObject, ReactNode } from 'react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -25,7 +25,7 @@ type SnackbarOnlyProps = {
25
25
  /**
26
26
  * A ref to the list that contains the snackbar.
27
27
  */
28
- listRef?: MutableRefObject< HTMLDivElement | null >;
28
+ listRef?: RefObject< HTMLDivElement | null >;
29
29
  };
30
30
 
31
31
  export type SnackbarProps = Pick<
package/src/style.scss CHANGED
@@ -12,7 +12,6 @@
12
12
  @use "./combobox-control/style.scss" as *;
13
13
  @use "./color-palette/style.scss" as *;
14
14
  @use "./custom-gradient-picker/style.scss" as *;
15
- @use "./draggable/style.scss" as *;
16
15
  @use "./drop-zone/style.scss" as *;
17
16
  @use "./dropdown/style.scss" as *;
18
17
  @use "./dropdown-menu/style.scss" as *;
@@ -1,17 +1,6 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import type { Meta, StoryFn } from '@storybook/react-vite';
5
2
  import { fn } from 'storybook/test';
6
-
7
- /**
8
- * WordPress dependencies
9
- */
10
3
  import { link, more, wordpress } from '@wordpress/icons';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
4
  import TabPanel from '..';
16
5
 
17
6
  const meta: Meta< typeof TabPanel > = {
@@ -22,9 +11,9 @@ const meta: Meta< typeof TabPanel > = {
22
11
  controls: { expanded: true },
23
12
  docs: { canvas: { sourceState: 'shown' } },
24
13
  componentStatus: {
25
- status: 'use-with-caution',
14
+ status: 'not-recommended',
26
15
  whereUsed: 'global',
27
- notes: 'When building for the Gutenberg repo, use `Tabs` instead. Otherwise, continue using for now.',
16
+ notes: 'Use `Tabs` from `@wordpress/ui` instead.',
28
17
  },
29
18
  },
30
19
  args: {
@@ -1,11 +1,10 @@
1
- @use "@wordpress/base-styles/colors" as *;
2
1
  @use "@wordpress/base-styles/variables" as *;
3
- @use "../utils/theme-variables" as *;
4
2
 
5
3
  .components-tab-panel__tabs {
6
4
  display: flex;
7
5
  align-items: stretch;
8
6
  flex-direction: row;
7
+
9
8
  &[aria-orientation="vertical"] {
10
9
  flex-direction: column;
11
10
  }
@@ -19,9 +18,19 @@
19
18
  border: none;
20
19
  box-shadow: none;
21
20
  cursor: var(--wpds-cursor-control);
22
- padding: 3px $grid-unit-20; // Use padding to offset the is-active border, this benefits Windows High Contrast mode
21
+ padding: 3px var(--wpds-dimension-padding-lg); // Use padding to offset the is-active border, this benefits Windows High Contrast mode
23
22
  margin-left: 0;
24
- font-weight: $font-weight-regular;
23
+ font-weight: var(--wpds-typography-font-weight-regular);
24
+ color: var(--wpds-color-fg-interactive-neutral);
25
+
26
+ &:disabled,
27
+ &[aria-disabled="true"] {
28
+ color: var(--wpds-color-fg-interactive-neutral-disabled);
29
+ }
30
+
31
+ &:not(:disabled, [aria-disabled="true"]):is(:hover, :focus-visible) {
32
+ color: var(--wpds-color-fg-interactive-neutral-active);
33
+ }
25
34
 
26
35
  &:focus:not(:disabled) {
27
36
  position: relative;
@@ -39,8 +48,8 @@
39
48
  pointer-events: none;
40
49
 
41
50
  // Draw the indicator.
42
- background: $components-color-accent;
43
- height: calc(0 * var(--wp-admin-border-width-focus));
51
+ background: var(--wpds-color-stroke-interactive-neutral-strong);
52
+ height: calc(0 * var(--wpds-border-width-focus));
44
53
  border-radius: 0;
45
54
 
46
55
  // Animation
@@ -51,7 +60,7 @@
51
60
 
52
61
  // Active.
53
62
  &.is-active::after {
54
- height: calc(1 * var(--wp-admin-border-width-focus));
63
+ height: calc(1 * var(--wpds-border-width-focus));
55
64
 
56
65
  // Windows high contrast mode.
57
66
  outline: 2px solid transparent;
@@ -62,15 +71,12 @@
62
71
  &::before {
63
72
  content: "";
64
73
  position: absolute;
65
- top: $grid-unit-15;
66
- right: $grid-unit-15;
67
- bottom: $grid-unit-15;
68
- left: $grid-unit-15;
74
+ inset: var(--wpds-dimension-padding-md);
69
75
  pointer-events: none;
70
76
 
71
77
  // Draw the indicator.
72
78
  box-shadow: 0 0 0 0 transparent;
73
- border-radius: $radius-small;
79
+ border-radius: var(--wpds-border-radius-sm);
74
80
 
75
81
  // Animation
76
82
  @media not (prefers-reduced-motion) {
@@ -79,11 +85,25 @@
79
85
  }
80
86
 
81
87
  &:focus-visible::before {
82
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
88
+ box-shadow:
89
+ 0 0 0 var(--wpds-border-width-focus)
90
+ var(--wpds-color-stroke-focus-brand);
83
91
 
84
92
  // Windows high contrast mode.
85
93
  outline: 2px solid transparent;
86
94
  }
95
+
96
+ .components-tab-panel__tabs[aria-orientation="vertical"] & {
97
+ border-radius: var(--wpds-border-radius-sm);
98
+
99
+ &::after {
100
+ display: none;
101
+ }
102
+
103
+ &.is-active {
104
+ background: var(--wpds-color-bg-interactive-neutral-weak-active);
105
+ }
106
+ }
87
107
  }
88
108
 
89
109
  .components-tab-panel__tab-content {
@@ -93,7 +113,9 @@
93
113
  }
94
114
 
95
115
  &:focus-visible {
96
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
116
+ box-shadow:
117
+ 0 0 0 var(--wpds-border-width-focus)
118
+ var(--wpds-color-stroke-focus-brand);
97
119
 
98
120
  // Windows high contrast mode.
99
121
  outline: 2px solid transparent;
@@ -164,7 +164,7 @@ still be accessed via the keyboard when navigating through the tablist.
164
164
 
165
165
  ##### `render`
166
166
 
167
- - Type: `RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<any, string | JSXElementConstructor<any>>`
167
+ - Type: `RenderProp<HTMLAttributes<any> & { ref?: Ref<any>; }> | ReactElement<unknown, string | JSXElementConstructor<any>>`
168
168
  - Required: No
169
169
 
170
170
  Allows the component to be rendered as a different HTML element or React
@@ -1,18 +1,7 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import type { Meta, StoryFn } from '@storybook/react-vite';
5
2
  import { fn } from 'storybook/test';
6
-
7
- /**
8
- * WordPress dependencies
9
- */
10
3
  import { wordpress, more, link } from '@wordpress/icons';
11
4
  import { useState } from '@wordpress/element';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
5
  import { Tabs } from '..';
17
6
  import { Slot, Fill, Provider as SlotFillProvider } from '../../slot-fill';
18
7
  import Button from '../../button';
@@ -27,7 +16,6 @@ const meta: Meta< typeof Tabs > = {
27
16
  'Tabs.TabList': Tabs.TabList,
28
17
  'Tabs.Tab': Tabs.Tab,
29
18
  'Tabs.TabPanel': Tabs.TabPanel,
30
- // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
31
19
  'Tabs.Context': Tabs.Context,
32
20
  },
33
21
  tags: [ 'status-private' ],
@@ -35,9 +23,9 @@ const meta: Meta< typeof Tabs > = {
35
23
  controls: { expanded: true },
36
24
  docs: { canvas: { sourceState: 'shown' } },
37
25
  componentStatus: {
38
- status: 'recommended',
26
+ status: 'not-recommended',
39
27
  whereUsed: 'global',
40
- notes: 'When building for the Gutenberg repo, use this component instead of `TabPanel`. Otherwise, continue using `TabPanel`. Both will be superseded by `Tabs` in `@wordpress/ui`, but continue using these for now.',
28
+ notes: 'Use `Tabs` from `@wordpress/ui` instead.',
41
29
  },
42
30
  },
43
31
  args: {
@@ -99,7 +99,7 @@ export const StyledTabList = styled( Ariakit.TabList )`
99
99
  )
100
100
  );
101
101
  border-bottom: var( --wp-admin-border-width-focus ) solid
102
- ${ COLORS.theme.accent };
102
+ ${ COLORS.theme.gray[ 700 ] };
103
103
  }
104
104
  }
105
105
  &[aria-orientation='vertical'] {
@@ -124,11 +124,7 @@ export const StyledTabList = styled( Ariakit.TabList )`
124
124
  var( --antialiasing-factor )
125
125
  )
126
126
  );
127
- background-color: color-mix(
128
- in srgb,
129
- ${ COLORS.theme.accent },
130
- transparent 96%
131
- );
127
+ background-color: ${ COLORS.theme.gray[ 100 ] };
132
128
  }
133
129
  &[data-select-on-move='true']:has(
134
130
  :is( :focus-visible, [data-focus-visible] )
@@ -173,7 +169,7 @@ export const Tab = styled( Ariakit.Tab )`
173
169
  }
174
170
 
175
171
  &:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ) {
176
- color: ${ COLORS.theme.accent };
172
+ color: ${ COLORS.theme.foreground };
177
173
  }
178
174
 
179
175
  &:focus:not( :disabled ) {
@@ -222,7 +218,6 @@ export const Tab = styled( Ariakit.Tab )`
222
218
  min-height: ${ space( 10 ) };
223
219
 
224
220
  &[aria-selected='true'] {
225
- color: ${ COLORS.theme.accent };
226
221
  fill: currentColor;
227
222
  }
228
223
  }
@@ -133,7 +133,7 @@ export const TabList = forwardRef<
133
133
  <StyledTabList
134
134
  ref={ refs }
135
135
  store={ store }
136
- render={ ( props ) => (
136
+ render={ ( props: React.HTMLAttributes< HTMLDivElement > ) => (
137
137
  <div
138
138
  { ...props }
139
139
  // Fallback to -1 to prevent browsers from making the tablist
@@ -93,7 +93,13 @@ function UnforwardedTooltip(
93
93
  // `aria-label`
94
94
  // See: https://github.com/WordPress/gutenberg/pull/64066
95
95
  // See: https://github.com/WordPress/gutenberg/pull/65989
96
- function addDescribedById( element: React.ReactElement ) {
96
+ function addDescribedById( el: React.ReactElement ) {
97
+ const element = el as React.ReactElement<
98
+ Pick<
99
+ React.HTMLAttributes< Element >,
100
+ 'aria-describedby' | 'aria-label'
101
+ >
102
+ >;
97
103
  return describedById &&
98
104
  mounted &&
99
105
  element.props[ 'aria-describedby' ] === undefined &&
@@ -34,7 +34,6 @@ describe( 'TreeGridCell', () => {
34
34
  </TreeGridCell>
35
35
  )
36
36
  ).toThrow();
37
- expect( console ).toHaveErrored();
38
37
  } );
39
38
 
40
39
  it( 'uses a child render function to render children', () => {
@@ -26,7 +26,6 @@ describe( 'RovingTabIndexItem', () => {
26
26
  expect( () =>
27
27
  render( <RovingTabIndexItem as={ TestButton } /> )
28
28
  ).toThrow();
29
- expect( console ).toHaveErrored();
30
29
  } );
31
30
 
32
31
  it( 'allows another component to be specified as the rendered component using the `as` prop', () => {
@@ -118,7 +118,7 @@ If this property is added, an option will be added with this label to represent
118
118
 
119
119
  ### `onChange`
120
120
 
121
- - Type: `((value: string, extra?: { event?: ChangeEvent<HTMLSelectElement>; }) => void) | undefined`
121
+ - Type: `((value: string, extra?: { event?: ChangeEvent<HTMLSelectElement, Element>; }) => void) | undefined`
122
122
  - Required: No
123
123
 
124
124
  A function that receives the value of the new option that is being selected as input.
@@ -12,7 +12,13 @@ const getNodeText = ( node: React.ReactNode ): string => {
12
12
  return node.map( getNodeText ).join( '' );
13
13
  }
14
14
  if ( 'props' in node ) {
15
- return getNodeText( node.props.children );
15
+ return getNodeText(
16
+ (
17
+ node as React.ReactElement<
18
+ React.PropsWithChildren< unknown >
19
+ >
20
+ ).props.children
21
+ );
16
22
  }
17
23
  return '';
18
24
  }
@@ -60,7 +60,12 @@ type ValidityTarget =
60
60
  | HTMLSelectElement
61
61
  | HTMLTextAreaElement;
62
62
 
63
- function UnforwardedControlWithError< C extends React.ReactElement >(
63
+ function UnforwardedControlWithError<
64
+ C extends React.ReactElement< {
65
+ label: React.ReactNode;
66
+ required: boolean;
67
+ } >,
68
+ >(
64
69
  {
65
70
  required,
66
71
  markWhenOptional,
@@ -1,86 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/components/src/navigation/back-button/index.tsx
31
- var back_button_exports = {};
32
- __export(back_button_exports, {
33
- NavigationBackButton: () => NavigationBackButton,
34
- default: () => back_button_default
35
- });
36
- module.exports = __toCommonJS(back_button_exports);
37
- var import_clsx = __toESM(require("clsx"));
38
- var import_element = require("@wordpress/element");
39
- var import_i18n = require("@wordpress/i18n");
40
- var import_icons = require("@wordpress/icons");
41
- var import_context = require("../context.cjs");
42
- var import_navigation_styles = require("../styles/navigation-styles.cjs");
43
- var import_jsx_runtime = require("react/jsx-runtime");
44
- function UnforwardedNavigationBackButton({
45
- backButtonLabel,
46
- className,
47
- href,
48
- onClick,
49
- parentMenu
50
- }, ref) {
51
- const {
52
- setActiveMenu,
53
- navigationTree
54
- } = (0, import_context.useNavigationContext)();
55
- const classes = (0, import_clsx.default)("components-navigation__back-button", className);
56
- const parentMenuTitle = parentMenu !== void 0 ? navigationTree.getMenu(parentMenu)?.title : void 0;
57
- const handleOnClick = (event) => {
58
- if (typeof onClick === "function") {
59
- onClick(event);
60
- }
61
- const animationDirection = (0, import_i18n.isRTL)() ? "left" : "right";
62
- if (parentMenu && !event.defaultPrevented) {
63
- setActiveMenu(parentMenu, animationDirection);
64
- }
65
- };
66
- const icon = (0, import_i18n.isRTL)() ? import_icons.chevronRight : import_icons.chevronLeft;
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_navigation_styles.MenuBackButtonUI, {
68
- __next40pxDefaultSize: true,
69
- className: classes,
70
- href,
71
- variant: "tertiary",
72
- ref,
73
- onClick: handleOnClick,
74
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, {
75
- icon
76
- }), backButtonLabel || parentMenuTitle || (0, import_i18n.__)("Back")]
77
- });
78
- }
79
- var NavigationBackButton = (0, import_element.forwardRef)(UnforwardedNavigationBackButton);
80
- NavigationBackButton.displayName = "NavigationBackButton";
81
- var back_button_default = NavigationBackButton;
82
- // Annotate the CommonJS export names for ESM import in node:
83
- 0 && (module.exports = {
84
- NavigationBackButton
85
- });
86
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/navigation/back-button/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { MenuBackButtonUI } from '../styles/navigation-styles';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedNavigationBackButton({\n backButtonLabel,\n className,\n href,\n onClick,\n parentMenu\n}, ref) {\n const {\n setActiveMenu,\n navigationTree\n } = useNavigationContext();\n const classes = clsx('components-navigation__back-button', className);\n const parentMenuTitle = parentMenu !== undefined ? navigationTree.getMenu(parentMenu)?.title : undefined;\n const handleOnClick = event => {\n if (typeof onClick === 'function') {\n onClick(event);\n }\n const animationDirection = isRTL() ? 'left' : 'right';\n if (parentMenu && !event.defaultPrevented) {\n setActiveMenu(parentMenu, animationDirection);\n }\n };\n const icon = isRTL() ? chevronRight : chevronLeft;\n return /*#__PURE__*/_jsxs(MenuBackButtonUI, {\n __next40pxDefaultSize: true,\n className: classes,\n href: href,\n variant: \"tertiary\",\n ref: ref,\n onClick: handleOnClick,\n children: [/*#__PURE__*/_jsx(Icon, {\n icon: icon\n }), backButtonLabel || parentMenuTitle || __('Back')]\n });\n}\n\n/**\n * @deprecated Use `Navigator` instead.\n */\nexport const NavigationBackButton = forwardRef(UnforwardedNavigationBackButton);\nNavigationBackButton.displayName = 'NavigationBackButton';\nexport default NavigationBackButton;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAA2B;AAC3B,kBAA0B;AAC1B,mBAAgD;AAKhD,qBAAqC;AACrC,+BAAiC;AACjC,yBAA2C;AAC3C,SAAS,gCAAgC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG,KAAK;AACN,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,EACF,QAAI,qCAAqB;AACzB,QAAM,cAAU,YAAAA,SAAK,sCAAsC,SAAS;AACpE,QAAM,kBAAkB,eAAe,SAAY,eAAe,QAAQ,UAAU,GAAG,QAAQ;AAC/F,QAAM,gBAAgB,WAAS;AAC7B,QAAI,OAAO,YAAY,YAAY;AACjC,cAAQ,KAAK;AAAA,IACf;AACA,UAAM,yBAAqB,mBAAM,IAAI,SAAS;AAC9C,QAAI,cAAc,CAAC,MAAM,kBAAkB;AACzC,oBAAc,YAAY,kBAAkB;AAAA,IAC9C;AAAA,EACF;AACA,QAAM,WAAO,mBAAM,IAAI,4BAAe;AACtC,SAAoB,uCAAAC,MAAM,2CAAkB;AAAA,IAC1C,uBAAuB;AAAA,IACvB,WAAW;AAAA,IACX;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,SAAS;AAAA,IACT,UAAU,CAAc,uCAAAC,KAAK,mBAAM;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,mBAAmB,uBAAmB,gBAAG,MAAM,CAAC;AAAA,EACtD,CAAC;AACH;AAKO,IAAM,2BAAuB,2BAAW,+BAA+B;AAC9E,qBAAqB,cAAc;AACnC,IAAO,sBAAQ;",
6
- "names": ["clsx", "_jsxs", "_jsx"]
7
- }