@wordpress/components 23.2.0 → 23.3.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 (377) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/build/alignment-matrix-control/utils.js +2 -2
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/autocomplete/autocompleter-ui.js +1 -3
  6. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  7. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  8. package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  9. package/build/border-control/border-control-dropdown/component.js +8 -4
  10. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  11. package/build/button/deprecated.js +8 -6
  12. package/build/button/deprecated.js.map +1 -1
  13. package/build/button/index.js +52 -23
  14. package/build/button/index.js.map +1 -1
  15. package/build/button/types.js +6 -0
  16. package/build/button/types.js.map +1 -0
  17. package/build/color-list-picker/index.js.map +1 -1
  18. package/build/color-list-picker/types.js +6 -0
  19. package/build/color-list-picker/types.js.map +1 -0
  20. package/build/color-palette/index.js +9 -61
  21. package/build/color-palette/index.js.map +1 -1
  22. package/build/color-palette/index.native.js +24 -9
  23. package/build/color-palette/index.native.js.map +1 -1
  24. package/build/color-palette/utils.js +103 -0
  25. package/build/color-palette/utils.js.map +1 -0
  26. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -1
  27. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  28. package/build/date-time/date/index.js.map +1 -1
  29. package/build/dropdown/index.js +20 -8
  30. package/build/dropdown/index.js.map +1 -1
  31. package/build/form-token-field/token.js +1 -1
  32. package/build/form-token-field/token.js.map +1 -1
  33. package/build/gradient-picker/index.js +9 -1
  34. package/build/gradient-picker/index.js.map +1 -1
  35. package/build/h-stack/component.js +0 -1
  36. package/build/h-stack/component.js.map +1 -1
  37. package/build/input-control/input-field.js +4 -2
  38. package/build/input-control/input-field.js.map +1 -1
  39. package/build/keyboard-shortcuts/index.js +44 -16
  40. package/build/keyboard-shortcuts/index.js.map +1 -1
  41. package/build/keyboard-shortcuts/types.js +6 -0
  42. package/build/keyboard-shortcuts/types.js.map +1 -0
  43. package/build/modal/index.js +1 -1
  44. package/build/modal/index.js.map +1 -1
  45. package/build/notice/index.js +16 -18
  46. package/build/notice/index.js.map +1 -1
  47. package/build/notice/list.js +23 -8
  48. package/build/notice/list.js.map +1 -1
  49. package/build/notice/types.js +6 -0
  50. package/build/notice/types.js.map +1 -0
  51. package/build/number-control/index.js +1 -1
  52. package/build/number-control/index.js.map +1 -1
  53. package/build/query-controls/author-select.js +7 -3
  54. package/build/query-controls/author-select.js.map +1 -1
  55. package/build/query-controls/category-select.js +7 -3
  56. package/build/query-controls/category-select.js.map +1 -1
  57. package/build/query-controls/index.js +68 -20
  58. package/build/query-controls/index.js.map +1 -1
  59. package/build/query-controls/terms.js +4 -3
  60. package/build/query-controls/terms.js.map +1 -1
  61. package/build/query-controls/types.js +6 -0
  62. package/build/query-controls/types.js.map +1 -0
  63. package/build/slot-fill/bubbles-virtually/fill.js +1 -0
  64. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  65. package/build/slot-fill/slot.js +1 -0
  66. package/build/slot-fill/slot.js.map +1 -1
  67. package/build/slot-fill/use-slot.js +1 -11
  68. package/build/slot-fill/use-slot.js.map +1 -1
  69. package/build/snackbar/index.js.map +1 -1
  70. package/build/snackbar/list.js.map +1 -1
  71. package/build/tab-panel/index.js +36 -8
  72. package/build/tab-panel/index.js.map +1 -1
  73. package/build/tree-grid/index.js +1 -1
  74. package/build/tree-grid/index.js.map +1 -1
  75. package/build/tree-select/index.js +2 -6
  76. package/build/tree-select/index.js.map +1 -1
  77. package/build-module/alignment-matrix-control/utils.js +2 -2
  78. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  79. package/build-module/autocomplete/autocompleter-ui.js +1 -2
  80. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  81. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  82. package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  83. package/build-module/border-control/border-control-dropdown/component.js +7 -4
  84. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  85. package/build-module/button/deprecated.js +8 -5
  86. package/build-module/button/deprecated.js.map +1 -1
  87. package/build-module/button/index.js +51 -22
  88. package/build-module/button/index.js.map +1 -1
  89. package/build-module/button/types.js +2 -0
  90. package/build-module/button/types.js.map +1 -0
  91. package/build-module/color-list-picker/index.js.map +1 -1
  92. package/build-module/color-list-picker/types.js +2 -0
  93. package/build-module/color-list-picker/types.js.map +1 -0
  94. package/build-module/color-palette/index.js +7 -54
  95. package/build-module/color-palette/index.js.map +1 -1
  96. package/build-module/color-palette/index.native.js +24 -8
  97. package/build-module/color-palette/index.native.js.map +1 -1
  98. package/build-module/color-palette/utils.js +79 -0
  99. package/build-module/color-palette/utils.js.map +1 -0
  100. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -1
  101. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  102. package/build-module/date-time/date/index.js +1 -1
  103. package/build-module/date-time/date/index.js.map +1 -1
  104. package/build-module/dropdown/index.js +19 -8
  105. package/build-module/dropdown/index.js.map +1 -1
  106. package/build-module/form-token-field/token.js +1 -1
  107. package/build-module/form-token-field/token.js.map +1 -1
  108. package/build-module/gradient-picker/index.js +9 -2
  109. package/build-module/gradient-picker/index.js.map +1 -1
  110. package/build-module/h-stack/component.js +0 -1
  111. package/build-module/h-stack/component.js.map +1 -1
  112. package/build-module/input-control/input-field.js +4 -2
  113. package/build-module/input-control/input-field.js.map +1 -1
  114. package/build-module/keyboard-shortcuts/index.js +48 -16
  115. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  116. package/build-module/keyboard-shortcuts/types.js +2 -0
  117. package/build-module/keyboard-shortcuts/types.js.map +1 -0
  118. package/build-module/modal/index.js +1 -1
  119. package/build-module/modal/index.js.map +1 -1
  120. package/build-module/notice/index.js +14 -15
  121. package/build-module/notice/index.js.map +1 -1
  122. package/build-module/notice/list.js +23 -8
  123. package/build-module/notice/list.js.map +1 -1
  124. package/build-module/notice/types.js +2 -0
  125. package/build-module/notice/types.js.map +1 -0
  126. package/build-module/number-control/index.js +1 -1
  127. package/build-module/number-control/index.js.map +1 -1
  128. package/build-module/query-controls/author-select.js +7 -3
  129. package/build-module/query-controls/author-select.js.map +1 -1
  130. package/build-module/query-controls/category-select.js +8 -4
  131. package/build-module/query-controls/category-select.js.map +1 -1
  132. package/build-module/query-controls/index.js +64 -20
  133. package/build-module/query-controls/index.js.map +1 -1
  134. package/build-module/query-controls/terms.js +8 -4
  135. package/build-module/query-controls/terms.js.map +1 -1
  136. package/build-module/query-controls/types.js +2 -0
  137. package/build-module/query-controls/types.js.map +1 -0
  138. package/build-module/slot-fill/bubbles-virtually/fill.js +1 -0
  139. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  140. package/build-module/slot-fill/slot.js +1 -0
  141. package/build-module/slot-fill/slot.js.map +1 -1
  142. package/build-module/slot-fill/use-slot.js +2 -12
  143. package/build-module/slot-fill/use-slot.js.map +1 -1
  144. package/build-module/snackbar/index.js.map +1 -1
  145. package/build-module/snackbar/list.js.map +1 -1
  146. package/build-module/tab-panel/index.js +36 -8
  147. package/build-module/tab-panel/index.js.map +1 -1
  148. package/build-module/tree-grid/index.js +1 -1
  149. package/build-module/tree-grid/index.js.map +1 -1
  150. package/build-module/tree-select/index.js +2 -6
  151. package/build-module/tree-select/index.js.map +1 -1
  152. package/build-style/style-rtl.css +5 -0
  153. package/build-style/style.css +5 -0
  154. package/build-types/border-box-control/border-box-control/hook.d.ts +1 -1
  155. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +1 -1
  156. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +171 -160
  157. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  158. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
  159. package/build-types/border-control/border-control/hook.d.ts +1 -1
  160. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  161. package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -1
  162. package/build-types/button/deprecated.d.ts +143 -7
  163. package/build-types/button/deprecated.d.ts.map +1 -1
  164. package/build-types/button/index.d.ts +20 -3
  165. package/build-types/button/index.d.ts.map +1 -1
  166. package/build-types/button/stories/index.d.ts +20 -0
  167. package/build-types/button/stories/index.d.ts.map +1 -0
  168. package/build-types/button/test/index.d.ts +2 -0
  169. package/build-types/button/test/index.d.ts.map +1 -0
  170. package/build-types/button/types.d.ts +134 -0
  171. package/build-types/button/types.d.ts.map +1 -0
  172. package/build-types/color-list-picker/index.d.ts +5 -0
  173. package/build-types/color-list-picker/index.d.ts.map +1 -0
  174. package/build-types/color-list-picker/types.d.ts +42 -0
  175. package/build-types/color-list-picker/types.d.ts.map +1 -0
  176. package/build-types/color-palette/index.d.ts +2 -4
  177. package/build-types/color-palette/index.d.ts.map +1 -1
  178. package/build-types/color-palette/stories/index.d.ts +2 -2
  179. package/build-types/color-palette/styles.d.ts +1 -1
  180. package/build-types/color-palette/types.d.ts +1 -1
  181. package/build-types/color-palette/types.d.ts.map +1 -1
  182. package/build-types/color-palette/utils.d.ts +14 -0
  183. package/build-types/color-palette/utils.d.ts.map +1 -0
  184. package/build-types/color-picker/styles.d.ts +2 -2
  185. package/build-types/date-time/date/index.d.ts.map +1 -1
  186. package/build-types/date-time/date/styles.d.ts +3 -3
  187. package/build-types/dropdown/index.d.ts +4 -4
  188. package/build-types/dropdown/index.d.ts.map +1 -1
  189. package/build-types/dropdown/stories/index.d.ts.map +1 -1
  190. package/build-types/dropdown/types.d.ts +9 -10
  191. package/build-types/dropdown/types.d.ts.map +1 -1
  192. package/build-types/font-size-picker/styles.d.ts +2 -2
  193. package/build-types/h-stack/component.d.ts +0 -1
  194. package/build-types/h-stack/component.d.ts.map +1 -1
  195. package/build-types/input-control/input-field.d.ts.map +1 -1
  196. package/build-types/keyboard-shortcuts/index.d.ts +38 -0
  197. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -0
  198. package/build-types/keyboard-shortcuts/stories/index.d.ts +12 -0
  199. package/build-types/keyboard-shortcuts/stories/index.d.ts.map +1 -0
  200. package/build-types/keyboard-shortcuts/test/index.d.ts +2 -0
  201. package/build-types/keyboard-shortcuts/test/index.d.ts.map +1 -0
  202. package/build-types/keyboard-shortcuts/types.d.ts +48 -0
  203. package/build-types/keyboard-shortcuts/types.d.ts.map +1 -0
  204. package/build-types/modal/index.d.ts.map +1 -1
  205. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  206. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
  207. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  208. package/build-types/navigator/navigator-button/hook.d.ts +2 -2
  209. package/build-types/notice/index.d.ts +16 -0
  210. package/build-types/notice/index.d.ts.map +1 -0
  211. package/build-types/notice/list.d.ts +32 -0
  212. package/build-types/notice/list.d.ts.map +1 -0
  213. package/build-types/notice/stories/index.d.ts +17 -0
  214. package/build-types/notice/stories/index.d.ts.map +1 -0
  215. package/build-types/notice/test/index.d.ts +2 -0
  216. package/build-types/notice/test/index.d.ts.map +1 -0
  217. package/build-types/notice/test/list.d.ts +2 -0
  218. package/build-types/notice/test/list.d.ts.map +1 -0
  219. package/build-types/notice/types.d.ts +128 -0
  220. package/build-types/notice/types.d.ts.map +1 -0
  221. package/build-types/number-control/styles/number-control-styles.d.ts +2 -2
  222. package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
  223. package/build-types/placeholder/stories/index.d.ts.map +1 -1
  224. package/build-types/query-controls/author-select.d.ts +4 -0
  225. package/build-types/query-controls/author-select.d.ts.map +1 -0
  226. package/build-types/query-controls/category-select.d.ts +4 -0
  227. package/build-types/query-controls/category-select.d.ts.map +1 -0
  228. package/build-types/query-controls/index.d.ts +30 -0
  229. package/build-types/query-controls/index.d.ts.map +1 -0
  230. package/build-types/query-controls/stories/index.d.ts +13 -0
  231. package/build-types/query-controls/stories/index.d.ts.map +1 -0
  232. package/build-types/query-controls/terms.d.ts +13 -0
  233. package/build-types/query-controls/terms.d.ts.map +1 -0
  234. package/build-types/query-controls/test/terms.d.ts +2 -0
  235. package/build-types/query-controls/test/terms.d.ts.map +1 -0
  236. package/build-types/query-controls/types.d.ts +131 -0
  237. package/build-types/query-controls/types.d.ts.map +1 -0
  238. package/build-types/range-control/index.d.ts +1 -1
  239. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  240. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  241. package/build-types/snackbar/index.d.ts +9 -2
  242. package/build-types/snackbar/index.d.ts.map +1 -1
  243. package/build-types/snackbar/list.d.ts.map +1 -1
  244. package/build-types/snackbar/types.d.ts +15 -88
  245. package/build-types/snackbar/types.d.ts.map +1 -1
  246. package/build-types/tab-panel/index.d.ts.map +1 -1
  247. package/build-types/tab-panel/types.d.ts +1 -1
  248. package/build-types/tab-panel/types.d.ts.map +1 -1
  249. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
  250. package/build-types/tree-select/index.d.ts.map +1 -1
  251. package/build-types/ui/form-group/form-group.d.ts +2 -2
  252. package/package.json +18 -17
  253. package/src/alignment-matrix-control/utils.tsx +2 -2
  254. package/src/autocomplete/autocompleter-ui.js +1 -2
  255. package/src/autocomplete/test/index.js +1 -5
  256. package/src/border-box-control/border-box-control-linked-button/component.tsx +1 -1
  257. package/src/border-box-control/border-box-control-linked-button/hook.ts +1 -1
  258. package/src/border-control/border-control-dropdown/component.tsx +9 -8
  259. package/src/box-control/test/index.js +11 -35
  260. package/src/button/README.md +49 -55
  261. package/src/button/{deprecated.js → deprecated.tsx} +19 -4
  262. package/src/button/{index.js → index.tsx} +95 -34
  263. package/src/button/stories/index.tsx +106 -0
  264. package/src/button/style.scss +3 -2
  265. package/src/button/test/{index.js → index.tsx} +30 -7
  266. package/src/button/types.ts +138 -0
  267. package/src/checkbox-control/test/index.tsx +1 -5
  268. package/src/color-list-picker/{index.js → index.tsx} +3 -2
  269. package/src/color-list-picker/types.ts +46 -0
  270. package/src/color-palette/README.md +1 -1
  271. package/src/color-palette/index.native.js +11 -4
  272. package/src/color-palette/index.tsx +11 -67
  273. package/src/color-palette/test/index.tsx +4 -14
  274. package/src/color-palette/test/utils.ts +1 -1
  275. package/src/color-palette/types.ts +1 -1
  276. package/src/color-palette/utils.ts +98 -0
  277. package/src/color-picker/test/index.js +6 -15
  278. package/src/combobox-control/test/index.js +1 -6
  279. package/src/confirm-dialog/test/index.js +9 -29
  280. package/src/custom-gradient-picker/gradient-bar/utils.js +1 -1
  281. package/src/date-time/date/index.tsx +2 -1
  282. package/src/date-time/date/test/index.tsx +2 -8
  283. package/src/date-time/time/test/index.tsx +9 -29
  284. package/src/dimension-control/test/index.test.js +2 -8
  285. package/src/disabled/test/index.tsx +1 -5
  286. package/src/draggable/test/index.native.js +4 -4
  287. package/src/dropdown/README.md +1 -8
  288. package/src/dropdown/index.tsx +17 -6
  289. package/src/dropdown/stories/index.tsx +3 -3
  290. package/src/dropdown/test/index.tsx +2 -8
  291. package/src/dropdown/types.ts +9 -10
  292. package/src/dropdown-menu/README.md +1 -1
  293. package/src/dropdown-menu/stories/index.js +96 -27
  294. package/src/dropdown-menu/test/index.js +2 -8
  295. package/src/external-link/test/index.tsx +1 -6
  296. package/src/focal-point-picker/test/index.js +3 -11
  297. package/src/font-size-picker/test/index.tsx +14 -44
  298. package/src/form-file-upload/test/index.tsx +2 -17
  299. package/src/form-toggle/test/index.tsx +1 -5
  300. package/src/form-token-field/test/index.tsx +80 -163
  301. package/src/form-token-field/token.tsx +1 -1
  302. package/src/gradient-picker/index.js +15 -4
  303. package/src/guide/test/index.js +5 -17
  304. package/src/h-stack/component.tsx +0 -1
  305. package/src/higher-order/with-filters/test/index.js +24 -24
  306. package/src/higher-order/with-focus-outside/test/index.js +11 -25
  307. package/src/higher-order/with-focus-return/test/index.js +1 -5
  308. package/src/input-control/input-field.tsx +3 -1
  309. package/src/input-control/test/index.js +1 -6
  310. package/src/isolated-event-container/test/index.js +2 -8
  311. package/src/keyboard-shortcuts/README.md +1 -1
  312. package/src/keyboard-shortcuts/index.tsx +93 -0
  313. package/src/keyboard-shortcuts/stories/index.tsx +60 -0
  314. package/src/keyboard-shortcuts/test/{index.js → index.tsx} +16 -6
  315. package/src/keyboard-shortcuts/types.ts +51 -0
  316. package/src/modal/index.tsx +1 -2
  317. package/src/navigable-container/test/navigable-menu.js +5 -17
  318. package/src/navigable-container/test/tababble-container.js +3 -11
  319. package/src/navigation/test/index.js +3 -11
  320. package/src/navigator/test/index.tsx +6 -20
  321. package/src/notice/README.md +89 -42
  322. package/src/notice/{index.js → index.tsx} +28 -20
  323. package/src/notice/list.tsx +72 -0
  324. package/src/notice/stories/index.tsx +119 -0
  325. package/src/notice/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  326. package/src/notice/test/{index.js → index.tsx} +7 -4
  327. package/src/notice/test/{list.js → list.tsx} +0 -0
  328. package/src/notice/types.ts +136 -0
  329. package/src/number-control/index.tsx +1 -1
  330. package/src/number-control/test/index.tsx +28 -86
  331. package/src/panel/test/body.js +2 -8
  332. package/src/placeholder/stories/index.tsx +1 -0
  333. package/src/query-controls/README.md +56 -56
  334. package/src/query-controls/author-select.tsx +37 -0
  335. package/src/query-controls/category-select.tsx +46 -0
  336. package/src/query-controls/index.tsx +192 -0
  337. package/src/query-controls/stories/index.tsx +205 -0
  338. package/src/query-controls/terms.ts +57 -0
  339. package/src/query-controls/test/{terms.js → terms.ts} +36 -20
  340. package/src/query-controls/types.ts +150 -0
  341. package/src/select-control/test/select-control.tsx +1 -6
  342. package/src/slot-fill/bubbles-virtually/fill.js +1 -0
  343. package/src/slot-fill/slot.js +1 -1
  344. package/src/slot-fill/use-slot.js +6 -16
  345. package/src/snackbar/index.tsx +6 -5
  346. package/src/snackbar/list.tsx +4 -2
  347. package/src/snackbar/types.ts +18 -92
  348. package/src/tab-panel/index.tsx +38 -16
  349. package/src/tab-panel/style.scss +8 -0
  350. package/src/tab-panel/test/index.tsx +35 -7
  351. package/src/tab-panel/types.ts +1 -1
  352. package/src/theme/test/index.tsx +4 -4
  353. package/src/toggle-group-control/stories/index.tsx +1 -0
  354. package/src/toggle-group-control/test/index.tsx +7 -23
  355. package/src/toolbar/stories/index.js +75 -72
  356. package/src/tools-panel/stories/index.js +3 -0
  357. package/src/tools-panel/test/index.js +1 -1
  358. package/src/tree-grid/index.js +1 -1
  359. package/src/tree-select/index.tsx +3 -6
  360. package/src/ui/context/test/context-connect.tsx +2 -0
  361. package/src/ui/context/test/wordpress-component.tsx +2 -0
  362. package/src/unit-control/test/index.tsx +21 -74
  363. package/src/utils/hooks/test/use-latest-ref.js +15 -18
  364. package/tsconfig.json +1 -4
  365. package/tsconfig.tsbuildinfo +1 -1
  366. package/build-types/radio-context/index.d.ts +0 -6
  367. package/build-types/radio-context/index.d.ts.map +0 -1
  368. package/src/button/stories/index.js +0 -179
  369. package/src/keyboard-shortcuts/index.js +0 -56
  370. package/src/notice/list.js +0 -48
  371. package/src/notice/stories/index.js +0 -46
  372. package/src/query-controls/author-select.js +0 -23
  373. package/src/query-controls/category-select.js +0 -31
  374. package/src/query-controls/index.js +0 -122
  375. package/src/query-controls/terms.js +0 -40
  376. package/src/toolbar/stories/toolbar-button.js +0 -32
  377. package/src/toolbar/stories/toolbar-group.js +0 -33
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { Author, Category, TermWithParentAndChildren } from './types';
5
+ /**
6
+ * Returns terms in a tree form.
7
+ *
8
+ * @param flatTerms Array of terms in flat format.
9
+ *
10
+ * @return Terms in tree format.
11
+ */
12
+ export declare function buildTermsTree(flatTerms: readonly (Author | Category)[]): TermWithParentAndChildren[];
13
+ //# sourceMappingURL=terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms.d.ts","sourceRoot":"","sources":["../../src/query-controls/terms.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EACX,MAAM,EACN,QAAQ,EACR,yBAAyB,EAEzB,MAAM,SAAS,CAAC;AAEjB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAE,SAAS,EAAE,SAAS,CAAE,MAAM,GAAG,QAAQ,CAAE,EAAE,+BAkC1E"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=terms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terms.d.ts","sourceRoot":"","sources":["../../../src/query-controls/test/terms.ts"],"names":[],"mappings":""}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { FormTokenFieldProps } from '../form-token-field/types';
5
+ import type { TreeSelectProps } from '../tree-select/types';
6
+ export declare type Author = {
7
+ id: number;
8
+ name: string;
9
+ };
10
+ export declare type Category = {
11
+ id: number;
12
+ name: string;
13
+ parent: number;
14
+ };
15
+ export declare type TermWithParentAndChildren = {
16
+ id: string;
17
+ name: string;
18
+ parent: number | null;
19
+ children: TermWithParentAndChildren[];
20
+ };
21
+ export declare type TermsByParent = Record<string, TermWithParentAndChildren[]>;
22
+ export declare type CategorySelectProps = Pick<TreeSelectProps, 'label' | 'noOptionLabel'> & {
23
+ categoriesList: Category[];
24
+ onChange: (newCategory: string) => void;
25
+ selectedCategoryId?: Category['id'];
26
+ };
27
+ export declare type AuthorSelectProps = Pick<TreeSelectProps, 'label' | 'noOptionLabel'> & {
28
+ authorList?: Author[];
29
+ onChange: (newAuthor: string) => void;
30
+ selectedAuthorId?: Author['id'];
31
+ };
32
+ declare type Order = 'asc' | 'desc';
33
+ declare type OrderBy = 'date' | 'title';
34
+ declare type BaseQueryControlsProps = {
35
+ /**
36
+ * An array of the authors to select from.
37
+ */
38
+ authorList?: AuthorSelectProps['authorList'];
39
+ /**
40
+ * The maximum number of items.
41
+ *
42
+ * @default 100
43
+ */
44
+ maxItems?: number;
45
+ /**
46
+ * The minimum number of items.
47
+ *
48
+ * @default 1
49
+ */
50
+ minItems?: number;
51
+ /**
52
+ * The selected number of items to retrieve via the query.
53
+ */
54
+ numberOfItems?: number;
55
+ /**
56
+ * A function that receives the new author value.
57
+ * If not specified, the author controls are not rendered.
58
+ */
59
+ onAuthorChange?: AuthorSelectProps['onChange'];
60
+ /**
61
+ * A function that receives the new number of items.
62
+ * If not specified, then the number of items
63
+ * range control is not rendered.
64
+ */
65
+ onNumberOfItemsChange?: (newNumber?: number) => void;
66
+ /**
67
+ * A function that receives the new order value.
68
+ * If this prop or the `onOrderByChange` prop are not specified,
69
+ * then the order controls are not rendered.
70
+ */
71
+ onOrderChange?: (newOrder: Order) => void;
72
+ /**
73
+ * A function that receives the new orderby value.
74
+ * If this prop or the `onOrderChange` prop are not specified,
75
+ * then the order controls are not rendered.
76
+ */
77
+ onOrderByChange?: (newOrderBy: OrderBy) => void;
78
+ /**
79
+ * The order in which to retrieve posts.
80
+ */
81
+ order?: Order;
82
+ /**
83
+ * The meta key by which to order posts.
84
+ */
85
+ orderBy?: OrderBy;
86
+ /**
87
+ * The selected author ID.
88
+ */
89
+ selectedAuthorId?: AuthorSelectProps['selectedAuthorId'];
90
+ };
91
+ export declare type QueryControlsWithSingleCategorySelectionProps = BaseQueryControlsProps & {
92
+ /**
93
+ * An array of categories. When passed in conjunction with the
94
+ * `onCategoryChange` prop, it causes the component to render UI that allows
95
+ * selecting one category at a time.
96
+ */
97
+ categoriesList?: CategorySelectProps['categoriesList'];
98
+ /**
99
+ * The selected category for the `categoriesList` prop.
100
+ */
101
+ selectedCategoryId?: CategorySelectProps['selectedCategoryId'];
102
+ /**
103
+ * A function that receives the new category value. If not specified, the
104
+ * category controls are not rendered.
105
+ * The function's signature changes depending on whether multiple category
106
+ * selection is enabled or not.
107
+ */
108
+ onCategoryChange?: CategorySelectProps['onChange'];
109
+ };
110
+ export declare type QueryControlsWithMultipleCategorySelectionProps = BaseQueryControlsProps & {
111
+ /**
112
+ * An object of categories with the category name as the key. When passed in
113
+ * conjunction with the `onCategoryChange` prop, it causes the component to
114
+ * render UI that enables multiple selection.
115
+ */
116
+ categorySuggestions?: Record<Category['name'], Category>;
117
+ /**
118
+ * The selected categories for the `categorySuggestions` prop.
119
+ */
120
+ selectedCategories?: Category[];
121
+ /**
122
+ * A function that receives the new category value. If not specified, the
123
+ * category controls are not rendered.
124
+ * The function's signature changes depending on whether multiple category
125
+ * selection is enabled or not.
126
+ */
127
+ onCategoryChange?: FormTokenFieldProps['onChange'];
128
+ };
129
+ export declare type QueryControlsProps = QueryControlsWithSingleCategorySelectionProps | QueryControlsWithMultipleCategorySelectionProps;
130
+ export {};
131
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/query-controls/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,oBAAY,MAAM,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,yBAAyB,GAAG;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,yBAAyB,EAAE,CAAC;CACtC,CAAC;AAEF,oBAAY,aAAa,GAAG,MAAM,CAAE,MAAM,EAAE,yBAAyB,EAAE,CAAE,CAAC;AAE1E,oBAAY,mBAAmB,GAAG,IAAI,CACrC,eAAe,EACf,OAA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BAAgB,CAAC,EAAE,iBAAiB,CAAE,kBAAkB,CAAE,CAAC;CAC3D,CAAC;AAEF,oBAAY,6CAA6C,GACxD,sBAAsB,GAAG;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAE,gBAAgB,CAAE,CAAC;IACzD;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAE,oBAAoB,CAAE,CAAC;IACjE;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAE,UAAU,CAAE,CAAC;CACrD,CAAC;AAEH,oBAAY,+CAA+C,GAC1D,sBAAsB,GAAG;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAE,QAAQ,CAAE,MAAM,CAAE,EAAE,QAAQ,CAAE,CAAC;IAC7D;;OAEG;IACH,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAChC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAE,UAAU,CAAE,CAAC;CACrD,CAAC;AAEH,oBAAY,kBAAkB,GAC3B,6CAA6C,GAC7C,+CAA+C,CAAC"}
@@ -52,6 +52,6 @@ export declare const RangeControl: import("react").ForwardRefExoticComponent<Pic
52
52
  trackColor?: import("csstype").Property.Color | undefined;
53
53
  type?: "stepper" | undefined;
54
54
  withInputField?: boolean | undefined;
55
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "color" | "help" | "icon" | "disabled" | "children" | "label" | "as" | "type" | "onFocus" | "onBlur" | "onMouseLeave" | "onMouseMove" | "step" | "__nextHasNoMarginBottom" | "hideLabelFromVision" | "isShiftStepEnabled" | "shiftStep" | "showTooltip" | "marks" | "railColor" | "trackColor" | keyof import("./types").NumericProps | "renderTooltipContent" | "afterIcon" | "allowReset" | "beforeIcon" | "currentInput" | "initialPosition" | "resetFallbackValue" | "separatorType" | "withInputField"> & import("react").RefAttributes<HTMLInputElement>>;
55
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "color" | "help" | "icon" | "disabled" | "children" | "label" | "as" | "type" | "onFocus" | "onBlur" | "onMouseLeave" | "onMouseMove" | "step" | "showTooltip" | "__nextHasNoMarginBottom" | "hideLabelFromVision" | "isShiftStepEnabled" | "shiftStep" | "marks" | "railColor" | "trackColor" | keyof import("./types").NumericProps | "renderTooltipContent" | "afterIcon" | "allowReset" | "beforeIcon" | "currentInput" | "initialPosition" | "resetFallbackValue" | "separatorType" | "withInputField"> & import("react").RefAttributes<HTMLInputElement>>;
56
56
  export default RangeControl;
57
57
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/fill.js"],"names":[],"mappings":"AA6BA;;;uCAiCC"}
1
+ {"version":3,"file":"fill.d.ts","sourceRoot":"","sources":["../../../src/slot-fill/bubbles-virtually/fill.js"],"names":[],"mappings":"AA8BA;;;uCAiCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-slot.d.ts","sourceRoot":"","sources":["../../src/slot-fill/use-slot.js"],"names":[],"mappings":";AAWA;;;;;GAKG;AACH,+BAHW,MAAM,GACL,MAAM,CAmBjB"}
1
+ {"version":3,"file":"use-slot.d.ts","sourceRoot":"","sources":["../../src/slot-fill/use-slot.js"],"names":[],"mappings":";AAWA;;;;;GAKG;AACH,+BAHW,MAAM,GACL,MAAM,CASjB"}
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import type { SnackbarProps } from './types';
3
2
  /**
4
3
  * A Snackbar displays a succinct message that is cleared out after a small delay.
5
4
  *
@@ -12,7 +11,15 @@ import type { SnackbarProps } from './types';
12
11
  * );
13
12
  * ```
14
13
  */
15
- export declare const Snackbar: import("react").ForwardRefExoticComponent<SnackbarProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof SnackbarProps> & {
14
+ export declare const Snackbar: import("react").ForwardRefExoticComponent<import("../notice/types").NoticeProps & {
15
+ icon?: import("react").ReactNode;
16
+ explicitDismiss?: boolean | undefined;
17
+ listRef?: import("react").MutableRefObject<HTMLDivElement | null> | undefined;
18
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "as" | keyof import("../notice/types").NoticeProps | keyof {
19
+ icon?: import("react").ReactNode;
20
+ explicitDismiss?: boolean | undefined;
21
+ listRef?: import("react").MutableRefObject<HTMLDivElement | null> | undefined;
22
+ }> & {
16
23
  as?: keyof JSX.IntrinsicElements | undefined;
17
24
  } & import("react").RefAttributes<any>>;
18
25
  export default Snackbar;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":";AAkBA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAqJ3D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;uCAAoC,CAAC;AAE1D,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snackbar/index.tsx"],"names":[],"mappings":";AAwKA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;uCAAoC,CAAC;AAE1D,eAAe,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/snackbar/list.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAU,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsB7D;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAE,EAC7B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,GACR,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,KAAK,CAAE,eAsCrD;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/snackbar/list.tsx"],"names":[],"mappings":";AAmBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAsB7D;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAE,EAC7B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,GACR,EAAE,uBAAuB,CAAE,iBAAiB,EAAE,KAAK,CAAE,eAwCrD;AAED,eAAe,YAAY,CAAC"}
@@ -1,111 +1,38 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { MutableRefObject, ReactNode, SyntheticEvent } from 'react';
5
- export declare type NoticeActionWithURL = {
6
- label: string;
7
- url: string;
8
- onClick?: (event: SyntheticEvent) => void;
9
- };
10
- declare type NoticeActionWithOnClick = {
11
- label: string;
12
- url?: string;
13
- onClick: (event: SyntheticEvent) => void;
14
- };
15
- export declare type NoticeAction = NoticeActionWithURL | NoticeActionWithOnClick;
16
- export declare type Notice = {
17
- id: string;
18
- spokenMessage: string;
19
- actions: NoticeAction[];
20
- icon?: ReactNode;
21
- onDismiss?: () => void;
22
- content: string;
23
- isDismissible: boolean;
24
- explicitDismiss: boolean;
25
- };
26
- export declare type SnackbarProps = {
27
- /**
28
- * The displayed message of a notice.
29
- *
30
- * Also used as the spoken message for assistive technology,
31
- * unless `spokenMessage` is provided as an alternative message.
32
- */
33
- children: string;
34
- /**
35
- * Used to provide a custom spoken message.
36
- *
37
- * @default children
38
- */
39
- spokenMessage?: Notice['spokenMessage'];
40
- /**
41
- * A politeness level for the notice's spoken message. Should be provided as
42
- * one of the valid options for an `aria-live` attribute value. Note that this
43
- * value should be considered a suggestion; assistive technologies may
44
- * override it based on internal heuristics.
45
- *
46
- * A value of `'assertive'` is to be used for important, and usually
47
- * time-sensitive, information. It will interrupt anything else the screen
48
- * reader is announcing in that moment.
49
- * A value of `'polite'` is to be used for advisory information. It should
50
- * not interrupt what the screen reader is announcing in that moment
51
- * (the "speech queue") or interrupt the current task.
52
- *
53
- * @see https://www.w3.org/TR/wai-aria-1.1/#aria-live
54
- *
55
- * @default 'polite'
56
- */
57
- politeness?: 'polite' | 'assertive';
58
- /**
59
- * An array of action objects.
60
- *
61
- * Each member object should contain
62
- * a `label` and either a `url` link string or `onClick` callback function.
63
- *
64
- * @default []
65
- */
66
- actions?: Notice['actions'];
67
- /**
68
- * Called to remove the snackbar from the UI.
69
- */
70
- onRemove?: () => void;
4
+ import type { MutableRefObject, ReactNode } from 'react';
5
+ /**
6
+ * Internal dependencies
7
+ */
8
+ import type { NoticeProps, NoticeChildren } from '../notice/types';
9
+ declare type SnackbarOnlyProps = {
71
10
  /**
72
11
  * The icon to render in the snackbar.
73
12
  *
74
13
  * @default null
75
14
  */
76
- icon?: Notice['icon'];
15
+ icon?: ReactNode;
77
16
  /**
78
17
  * Whether to require user action to dismiss the snackbar.
79
18
  * By default, this is dismissed on a timeout, without user interaction.
80
19
  *
81
20
  * @default false
82
21
  */
83
- explicitDismiss?: Notice['explicitDismiss'];
84
- /**
85
- * A callback executed when the snackbar is dismissed.
86
- *
87
- * It is distinct from onRemove, which _looks_ like a callback but is
88
- * actually the function to call to remove the snackbar from the UI.
89
- */
90
- onDismiss?: Notice['onDismiss'];
22
+ explicitDismiss?: boolean;
91
23
  /**
92
24
  * A ref to the list that contains the snackbar.
93
25
  */
94
26
  listRef?: MutableRefObject<HTMLDivElement | null>;
95
27
  };
28
+ export declare type SnackbarProps = NoticeProps & SnackbarOnlyProps;
96
29
  export declare type SnackbarListProps = {
97
- /**
98
- * Array of notices to render.
99
- */
100
- notices: Notice[];
101
- /**
102
- * Children to be rendered inside the notice list.
103
- */
104
- children?: ReactNode;
105
- /**
106
- * Function called when a notice should be removed / dismissed.
107
- */
108
- onRemove?: (id: Notice['id']) => void;
30
+ notices: Array<Omit<SnackbarProps, 'children'> & {
31
+ id: string;
32
+ content: string;
33
+ }>;
34
+ onRemove: (id: string) => void;
35
+ children?: NoticeChildren | Array<NoticeChildren>;
109
36
  };
110
37
  export {};
111
38
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/snackbar/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEzE,oBAAY,mBAAmB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,CAAE,KAAK,EAAE,cAAc,KAAM,IAAI,CAAC;CAC5C,CAAC;AAEF,aAAK,uBAAuB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAE,KAAK,EAAE,cAAc,KAAM,IAAI,CAAC;CAC3C,CAAC;AAGF,oBAAY,YAAY,GAAG,mBAAmB,GAAG,uBAAuB,CAAC;AAEzE,oBAAY,MAAM,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC3B;;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;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAE,cAAc,GAAG,IAAI,CAAE,CAAC;CACpD,CAAC;AAEF,oBAAY,aAAa,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAE5D,oBAAY,iBAAiB,GAAG;IAC/B,OAAO,EAAE,KAAK,CACb,IAAI,CAAE,aAAa,EAAE,UAAU,CAAE,GAAG;QACnC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KAChB,CACD,CAAC;IACF,QAAQ,EAAE,CAAE,EAAE,EAAE,MAAM,KAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,cAAc,GAAG,KAAK,CAAE,cAAc,CAAE,CAAC;CACpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAoB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAE,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,YAAmB,EACnB,cAAc,EACd,WAA0B,EAC1B,WAAyB,EACzB,QAAQ,GACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eAyFxD;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tab-panel/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAoB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,QAAQ,CAAE,EACzB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,YAAmB,EACnB,cAAc,EACd,WAA0B,EAC1B,WAAyB,EACzB,QAAQ,GACR,EAAE,uBAAuB,CAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAE,eA+GxD;AAED,eAAe,QAAQ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { ReactNode } from 'react';
4
+ import type { MouseEvent, ReactNode } from 'react';
5
5
  /**
6
6
  * Internal dependencies
7
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tab-panel/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,aAAK,GAAG,CAAE,SAAS,GAAG,OAAO,IAAK;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAE,SAAS,CAAE,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AAEvB,oBAAY,cAAc,CAAE,SAAS,GAAG,OAAO,IAAK;IACnD,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAE,KAAK,EAAE,UAAU,KAAM,IAAI,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACd,GAAG,IAAI,CAAE,GAAG,CAAE,SAAS,CAAE,EAAE,WAAW,GAAG,MAAM,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AC/C,CAAC;AAmBrB;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC7C,CAAC;AAUrB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAChD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/toggle-group-control/stories/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQtE;;GAEG;AACH,OAAO,EACN,kBAAkB,EAGlB,MAAM,UAAU,CAAC;AAOlB,QAAA,MAAM,IAAI,EAAE,aAAa,CAAE,OAAO,kBAAkB,CAanD,CAAC;AACF,eAAe,IAAI,CAAC;AAoCpB,eAAO,MAAM,OAAO,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC3C,CAAC;AAYrB;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC/C,CAAC;AAmBrB;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAC7C,CAAC;AAUrB;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAE,OAAO,kBAAkB,CAChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-select/index.tsx"],"names":[],"mappings":";AAaA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAC;AAa5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,wBAAgB,UAAU,CAAE,EAC3B,KAAK,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,IAAS,EACT,GAAG,KAAK,EACR,EAAE,eAAe,eAejB;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-select/index.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,eAAe,EAA+B,MAAM,SAAS,CAAC;AAa5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,wBAAgB,UAAU,CAAE,EAC3B,KAAK,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,IAAS,EACT,GAAG,KAAK,EACR,EAAE,eAAe,eAejB;AAED,eAAe,UAAU,CAAC"}
@@ -30,7 +30,7 @@ declare const ConnectedFormGroup: import("../context").WordPressComponent<import
30
30
  truncate?: boolean | undefined;
31
31
  } & import("../../grid/types").GridProps & {
32
32
  horizontal: true;
33
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "isDestructive" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
33
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "isDestructive" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
34
34
  as?: keyof JSX.IntrinsicElements | undefined;
35
35
  } & import("react").RefAttributes<any>, boolean> | import("../context").WordPressComponent<import("react").ElementType<any>, import("../../text/types").Props & {
36
36
  isBlock?: boolean | undefined;
@@ -47,7 +47,7 @@ declare const ConnectedFormGroup: import("../context").WordPressComponent<import
47
47
  truncate?: boolean | undefined;
48
48
  } & {
49
49
  horizontal: false;
50
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "isDestructive" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
50
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "color" | "display" | "letterSpacing" | "lineHeight" | "ellipsis" | "size" | "help" | "weight" | "horizontal" | "children" | "label" | "as" | "id" | "spacing" | "isDestructive" | "variant" | "isBlock" | "align" | "ellipsizeMode" | "limit" | "numberOfLines" | "adjustLineHeightForInnerControls" | "highlightEscape" | "highlightCaseSensitive" | "highlightSanitize" | "optimizeReadabilityFor" | "truncate" | "upperCase" | "highlightWords" | "labelHidden" | "alignLabel"> & {
51
51
  as?: keyof JSX.IntrinsicElements | undefined;
52
52
  } & import("react").RefAttributes<any>, boolean>;
53
53
  //# sourceMappingURL=form-group.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "23.2.0",
3
+ "version": "23.3.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,21 +38,22 @@
38
38
  "@emotion/utils": "^1.0.0",
39
39
  "@floating-ui/react-dom": "^1.0.0",
40
40
  "@use-gesture/react": "^10.2.6",
41
- "@wordpress/a11y": "^3.25.0",
42
- "@wordpress/compose": "^6.2.0",
43
- "@wordpress/date": "^4.25.0",
44
- "@wordpress/deprecated": "^3.25.0",
45
- "@wordpress/dom": "^3.25.0",
46
- "@wordpress/element": "^5.2.0",
47
- "@wordpress/escape-html": "^2.25.0",
48
- "@wordpress/hooks": "^3.25.0",
49
- "@wordpress/i18n": "^4.25.0",
50
- "@wordpress/icons": "^9.16.0",
51
- "@wordpress/is-shallow-equal": "^4.25.0",
52
- "@wordpress/keycodes": "^3.25.0",
53
- "@wordpress/primitives": "^3.23.0",
54
- "@wordpress/rich-text": "^6.2.0",
55
- "@wordpress/warning": "^2.25.0",
41
+ "@wordpress/a11y": "^3.26.0",
42
+ "@wordpress/compose": "^6.3.0",
43
+ "@wordpress/date": "^4.26.0",
44
+ "@wordpress/deprecated": "^3.26.0",
45
+ "@wordpress/dom": "^3.26.0",
46
+ "@wordpress/element": "^5.3.0",
47
+ "@wordpress/escape-html": "^2.26.0",
48
+ "@wordpress/hooks": "^3.26.0",
49
+ "@wordpress/html-entities": "^3.26.0",
50
+ "@wordpress/i18n": "^4.26.0",
51
+ "@wordpress/icons": "^9.17.0",
52
+ "@wordpress/is-shallow-equal": "^4.26.0",
53
+ "@wordpress/keycodes": "^3.26.0",
54
+ "@wordpress/primitives": "^3.24.0",
55
+ "@wordpress/rich-text": "^6.3.0",
56
+ "@wordpress/warning": "^2.26.0",
56
57
  "change-case": "^4.1.2",
57
58
  "classnames": "^2.3.1",
58
59
  "colord": "^2.7.0",
@@ -80,5 +81,5 @@
80
81
  "publishConfig": {
81
82
  "access": "public"
82
83
  },
83
- "gitHead": "204c880ff65295768e9695dfee6c7a9fee1fdd05"
84
+ "gitHead": "cab6ebe2b4c5dbacfd753dcae4a2406559c4813c"
84
85
  }
@@ -19,8 +19,8 @@ export const ALIGNMENT_LABEL: Record< AlignmentMatrixControlValue, string > = {
19
19
  'top center': __( 'Top Center' ),
20
20
  'top right': __( 'Top Right' ),
21
21
  'center left': __( 'Center Left' ),
22
- 'center center': __( 'Center Center' ),
23
- center: __( 'Center Center' ),
22
+ 'center center': __( 'Center' ),
23
+ center: __( 'Center' ),
24
24
  'center right': __( 'Center Right' ),
25
25
  'bottom left': __( 'Bottom Left' ),
26
26
  'bottom center': __( 'Bottom Center' ),
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { map } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -70,7 +69,7 @@ export function getAutoCompleterUI( autocompleter ) {
70
69
  role="listbox"
71
70
  className="components-autocomplete__results"
72
71
  >
73
- { map( items, ( option, index ) => (
72
+ { items.map( ( option, index ) => (
74
73
  <Button
75
74
  key={ option.key }
76
75
  id={ `components-autocomplete-item-${ instanceId }-${ option.key }` }
@@ -14,14 +14,10 @@ import { useRef } from '@wordpress/element';
14
14
  */
15
15
  import { getAutoCompleterUI } from '../autocompleter-ui';
16
16
 
17
- jest.useFakeTimers();
18
-
19
17
  describe( 'AutocompleterUI', () => {
20
18
  describe( 'click outside behavior', () => {
21
19
  it( 'should call reset function when a click on another element occurs', async () => {
22
- const user = userEvent.setup( {
23
- advanceTimers: jest.advanceTimersByTime,
24
- } );
20
+ const user = userEvent.setup();
25
21
 
26
22
  const resetSpy = jest.fn();
27
23
 
@@ -16,7 +16,7 @@ import { useBorderBoxControlLinkedButton } from './hook';
16
16
  import type { LinkedButtonProps } from '../types';
17
17
 
18
18
  const BorderBoxControlLinkedButton = (
19
- props: WordPressComponentProps< LinkedButtonProps, 'div' >,
19
+ props: WordPressComponentProps< LinkedButtonProps, 'button' >,
20
20
  forwardedRef: React.ForwardedRef< any >
21
21
  ) => {
22
22
  const { className, isLinked, ...buttonProps } =
@@ -13,7 +13,7 @@ import { useCx } from '../../utils/hooks/use-cx';
13
13
  import type { LinkedButtonProps } from '../types';
14
14
 
15
15
  export function useBorderBoxControlLinkedButton(
16
- props: WordPressComponentProps< LinkedButtonProps, 'div' >
16
+ props: WordPressComponentProps< LinkedButtonProps, 'button' >
17
17
  ) {
18
18
  const {
19
19
  className,
@@ -24,7 +24,8 @@ import { useBorderControlDropdown } from './hook';
24
24
  import { StyledLabel } from '../../base-control/styles/base-control-styles';
25
25
  import DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';
26
26
 
27
- import type { ColorObject, PaletteObject } from '../../color-palette/types';
27
+ import type { ColorObject } from '../../color-palette/types';
28
+ import { isMultiplePaletteArray } from '../../color-palette/utils';
28
29
  import type { DropdownProps as DropdownComponentProps } from '../../dropdown/types';
29
30
  import type { ColorProps, DropdownProps } from '../types';
30
31
 
@@ -32,14 +33,15 @@ const getColorObject = (
32
33
  colorValue: CSSProperties[ 'borderColor' ],
33
34
  colors: ColorProps[ 'colors' ] | undefined
34
35
  ) => {
35
- if ( ! colorValue || ! colors || colors.length === 0 ) {
36
+ if ( ! colorValue || ! colors ) {
36
37
  return;
37
38
  }
38
39
 
39
- if ( ( colors as PaletteObject[] )[ 0 ].colors !== undefined ) {
40
+ if ( isMultiplePaletteArray( colors ) ) {
41
+ // Multiple origins
40
42
  let matchedColor;
41
43
 
42
- ( colors as PaletteObject[] ).some( ( origin ) =>
44
+ colors.some( ( origin ) =>
43
45
  origin.colors.some( ( color ) => {
44
46
  if ( color.color === colorValue ) {
45
47
  matchedColor = color;
@@ -53,9 +55,8 @@ const getColorObject = (
53
55
  return matchedColor;
54
56
  }
55
57
 
56
- return ( colors as ColorObject[] ).find(
57
- ( color ) => color.color === colorValue
58
- );
58
+ // Single origin
59
+ return colors.find( ( color ) => color.color === colorValue );
59
60
  };
60
61
 
61
62
  const getToggleAriaLabel = (
@@ -166,7 +167,7 @@ const BorderControlDropdown = (
166
167
  onClick={ onToggle }
167
168
  variant="tertiary"
168
169
  aria-label={ toggleAriaLabel }
169
- position={ dropdownPosition }
170
+ tooltipPosition={ dropdownPosition }
170
171
  label={ __( 'Border color and style picker' ) }
171
172
  showTooltip={ true }
172
173
  >