@wordpress/components 29.0.0 → 29.1.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 (469) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/LICENSE.md +1 -1
  3. package/build/badge/index.js +64 -0
  4. package/build/badge/index.js.map +1 -0
  5. package/build/badge/types.js +6 -0
  6. package/build/badge/types.js.map +1 -0
  7. package/build/box-control/index.js +5 -1
  8. package/build/box-control/index.js.map +1 -1
  9. package/build/box-control/input-control.js +90 -29
  10. package/build/box-control/input-control.js.map +1 -1
  11. package/build/box-control/types.js.map +1 -1
  12. package/build/box-control/utils.js +50 -0
  13. package/build/box-control/utils.js.map +1 -1
  14. package/build/button-group/index.js +10 -0
  15. package/build/button-group/index.js.map +1 -1
  16. package/build/button-group/types.js.map +1 -1
  17. package/build/custom-select-control/index.js +3 -5
  18. package/build/custom-select-control/index.js.map +1 -1
  19. package/build/custom-select-control-v2/custom-select.js +2 -3
  20. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  21. package/build/date-time/date/index.js +1 -0
  22. package/build/date-time/date/index.js.map +1 -1
  23. package/build/dimension-control/index.js +1 -0
  24. package/build/dimension-control/index.js.map +1 -1
  25. package/build/font-size-picker/styles.js +9 -9
  26. package/build/font-size-picker/styles.js.map +1 -1
  27. package/build/heading/hook.js +1 -1
  28. package/build/heading/hook.js.map +1 -1
  29. package/build/input-control/index.js +9 -0
  30. package/build/input-control/index.js.map +1 -1
  31. package/build/input-control/types.js.map +1 -1
  32. package/build/menu/checkbox-item.js +2 -0
  33. package/build/menu/checkbox-item.js.map +1 -1
  34. package/build/menu/index.js +25 -94
  35. package/build/menu/index.js.map +1 -1
  36. package/build/menu/item.js +10 -1
  37. package/build/menu/item.js.map +1 -1
  38. package/build/menu/popover.js +89 -0
  39. package/build/menu/popover.js.map +1 -0
  40. package/build/menu/radio-item.js +2 -0
  41. package/build/menu/radio-item.js.map +1 -1
  42. package/build/menu/submenu-trigger-item.js +58 -0
  43. package/build/menu/submenu-trigger-item.js.map +1 -0
  44. package/build/menu/trigger-button.js +45 -0
  45. package/build/menu/trigger-button.js.map +1 -0
  46. package/build/menu/types.js.map +1 -1
  47. package/build/navigation/back-button/index.js +1 -0
  48. package/build/navigation/back-button/index.js.map +1 -1
  49. package/build/navigation/index.js +6 -0
  50. package/build/navigation/index.js.map +1 -1
  51. package/build/navigation/item/index.js +1 -0
  52. package/build/navigation/item/index.js.map +1 -1
  53. package/build/number-control/index.js +1 -0
  54. package/build/number-control/index.js.map +1 -1
  55. package/build/palette-edit/index.js +1 -0
  56. package/build/palette-edit/index.js.map +1 -1
  57. package/build/private-apis.js +3 -1
  58. package/build/private-apis.js.map +1 -1
  59. package/build/radio-group/index.js +6 -0
  60. package/build/radio-group/index.js.map +1 -1
  61. package/build/radio-group/radio.js +2 -3
  62. package/build/radio-group/radio.js.map +1 -1
  63. package/build/range-control/styles/range-control-styles.js +28 -28
  64. package/build/range-control/styles/range-control-styles.js.map +1 -1
  65. package/build/select-control/index.js +9 -0
  66. package/build/select-control/index.js.map +1 -1
  67. package/build/select-control/types.js.map +1 -1
  68. package/build/slot-fill/context.js +4 -3
  69. package/build/slot-fill/context.js.map +1 -1
  70. package/build/slot-fill/fill.js +10 -15
  71. package/build/slot-fill/fill.js.map +1 -1
  72. package/build/slot-fill/provider.js +41 -55
  73. package/build/slot-fill/provider.js.map +1 -1
  74. package/build/slot-fill/slot.js +31 -23
  75. package/build/slot-fill/slot.js.map +1 -1
  76. package/build/slot-fill/types.js.map +1 -1
  77. package/build/tab-panel/index.js +2 -3
  78. package/build/tab-panel/index.js.map +1 -1
  79. package/build/tabs/index.js +21 -4
  80. package/build/tabs/index.js.map +1 -1
  81. package/build/tabs/types.js.map +1 -1
  82. package/build/text/hook.js +6 -6
  83. package/build/text/hook.js.map +1 -1
  84. package/build/text/styles.js +7 -7
  85. package/build/text/styles.js.map +1 -1
  86. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +2 -3
  87. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  88. package/build/tooltip/index.js +2 -3
  89. package/build/tooltip/index.js.map +1 -1
  90. package/build/tree-select/index.js +10 -2
  91. package/build/tree-select/index.js.map +1 -1
  92. package/build/tree-select/types.js.map +1 -1
  93. package/build-module/badge/index.js +57 -0
  94. package/build-module/badge/index.js.map +1 -0
  95. package/build-module/badge/types.js +2 -0
  96. package/build-module/badge/types.js.map +1 -0
  97. package/build-module/box-control/index.js +5 -1
  98. package/build-module/box-control/index.js.map +1 -1
  99. package/build-module/box-control/input-control.js +92 -31
  100. package/build-module/box-control/input-control.js.map +1 -1
  101. package/build-module/box-control/types.js.map +1 -1
  102. package/build-module/box-control/utils.js +47 -0
  103. package/build-module/box-control/utils.js.map +1 -1
  104. package/build-module/button-group/index.js +10 -0
  105. package/build-module/button-group/index.js.map +1 -1
  106. package/build-module/button-group/types.js.map +1 -1
  107. package/build-module/custom-select-control/index.js +3 -5
  108. package/build-module/custom-select-control/index.js.map +1 -1
  109. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  110. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  111. package/build-module/date-time/date/index.js +1 -0
  112. package/build-module/date-time/date/index.js.map +1 -1
  113. package/build-module/dimension-control/index.js +1 -0
  114. package/build-module/dimension-control/index.js.map +1 -1
  115. package/build-module/font-size-picker/styles.js +9 -9
  116. package/build-module/font-size-picker/styles.js.map +1 -1
  117. package/build-module/heading/hook.js +1 -1
  118. package/build-module/heading/hook.js.map +1 -1
  119. package/build-module/input-control/index.js +9 -0
  120. package/build-module/input-control/index.js.map +1 -1
  121. package/build-module/input-control/types.js.map +1 -1
  122. package/build-module/menu/checkbox-item.js +2 -0
  123. package/build-module/menu/checkbox-item.js.map +1 -1
  124. package/build-module/menu/index.js +28 -97
  125. package/build-module/menu/index.js.map +1 -1
  126. package/build-module/menu/item.js +10 -1
  127. package/build-module/menu/item.js.map +1 -1
  128. package/build-module/menu/popover.js +81 -0
  129. package/build-module/menu/popover.js.map +1 -0
  130. package/build-module/menu/radio-item.js +2 -0
  131. package/build-module/menu/radio-item.js.map +1 -1
  132. package/build-module/menu/submenu-trigger-item.js +50 -0
  133. package/build-module/menu/submenu-trigger-item.js.map +1 -0
  134. package/build-module/menu/trigger-button.js +37 -0
  135. package/build-module/menu/trigger-button.js.map +1 -0
  136. package/build-module/menu/types.js.map +1 -1
  137. package/build-module/navigation/back-button/index.js +1 -0
  138. package/build-module/navigation/back-button/index.js.map +1 -1
  139. package/build-module/navigation/index.js +6 -0
  140. package/build-module/navigation/index.js.map +1 -1
  141. package/build-module/navigation/item/index.js +1 -0
  142. package/build-module/navigation/item/index.js.map +1 -1
  143. package/build-module/number-control/index.js +1 -0
  144. package/build-module/number-control/index.js.map +1 -1
  145. package/build-module/palette-edit/index.js +1 -0
  146. package/build-module/palette-edit/index.js.map +1 -1
  147. package/build-module/private-apis.js +3 -1
  148. package/build-module/private-apis.js.map +1 -1
  149. package/build-module/radio-group/index.js +6 -0
  150. package/build-module/radio-group/index.js.map +1 -1
  151. package/build-module/radio-group/radio.js +1 -2
  152. package/build-module/radio-group/radio.js.map +1 -1
  153. package/build-module/range-control/styles/range-control-styles.js +28 -28
  154. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  155. package/build-module/select-control/index.js +9 -0
  156. package/build-module/select-control/index.js.map +1 -1
  157. package/build-module/select-control/types.js.map +1 -1
  158. package/build-module/slot-fill/context.js +5 -3
  159. package/build-module/slot-fill/context.js.map +1 -1
  160. package/build-module/slot-fill/fill.js +10 -15
  161. package/build-module/slot-fill/fill.js.map +1 -1
  162. package/build-module/slot-fill/provider.js +41 -55
  163. package/build-module/slot-fill/provider.js.map +1 -1
  164. package/build-module/slot-fill/slot.js +32 -24
  165. package/build-module/slot-fill/slot.js.map +1 -1
  166. package/build-module/slot-fill/types.js.map +1 -1
  167. package/build-module/tab-panel/index.js +1 -2
  168. package/build-module/tab-panel/index.js.map +1 -1
  169. package/build-module/tabs/index.js +21 -4
  170. package/build-module/tabs/index.js.map +1 -1
  171. package/build-module/tabs/types.js.map +1 -1
  172. package/build-module/text/hook.js +6 -6
  173. package/build-module/text/hook.js.map +1 -1
  174. package/build-module/text/styles.js +7 -7
  175. package/build-module/text/styles.js.map +1 -1
  176. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +1 -2
  177. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  178. package/build-module/tooltip/index.js +1 -2
  179. package/build-module/tooltip/index.js.map +1 -1
  180. package/build-module/tree-select/index.js +10 -2
  181. package/build-module/tree-select/index.js.map +1 -1
  182. package/build-module/tree-select/types.js.map +1 -1
  183. package/build-style/style-rtl.css +60 -13
  184. package/build-style/style.css +60 -13
  185. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  186. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  187. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  188. package/build-types/animate/stories/index.story.d.ts +7 -7
  189. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  190. package/build-types/badge/index.d.ts +8 -0
  191. package/build-types/badge/index.d.ts.map +1 -0
  192. package/build-types/badge/stories/index.story.d.ts +17 -0
  193. package/build-types/badge/stories/index.story.d.ts.map +1 -0
  194. package/build-types/badge/test/index.d.ts +2 -0
  195. package/build-types/badge/test/index.d.ts.map +1 -0
  196. package/build-types/badge/types.d.ts +13 -0
  197. package/build-types/badge/types.d.ts.map +1 -0
  198. package/build-types/base-control/stories/index.story.d.ts +1 -1
  199. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  200. package/build-types/border-control/stories/index.story.d.ts +5 -5
  201. package/build-types/box-control/index.d.ts +1 -1
  202. package/build-types/box-control/index.d.ts.map +1 -1
  203. package/build-types/box-control/input-control.d.ts +1 -1
  204. package/build-types/box-control/input-control.d.ts.map +1 -1
  205. package/build-types/box-control/stories/index.story.d.ts +356 -11
  206. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  207. package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
  208. package/build-types/box-control/types.d.ts +17 -0
  209. package/build-types/box-control/types.d.ts.map +1 -1
  210. package/build-types/box-control/utils.d.ts +27 -1
  211. package/build-types/box-control/utils.d.ts.map +1 -1
  212. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  213. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  214. package/build-types/button/stories/index.story.d.ts +7 -7
  215. package/build-types/button/stories/index.story.d.ts.map +1 -1
  216. package/build-types/button-group/index.d.ts +3 -1
  217. package/build-types/button-group/index.d.ts.map +1 -1
  218. package/build-types/button-group/stories/index.story.d.ts +6 -0
  219. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  220. package/build-types/button-group/types.d.ts +7 -0
  221. package/build-types/button-group/types.d.ts.map +1 -1
  222. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  223. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  224. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  225. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  226. package/build-types/color-picker/styles.d.ts +2 -2
  227. package/build-types/color-picker/styles.d.ts.map +1 -1
  228. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  229. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  230. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  231. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  232. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  233. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  234. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  235. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  236. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  237. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  238. package/build-types/date-time/date/index.d.ts.map +1 -1
  239. package/build-types/date-time/stories/time.story.d.ts +1 -1
  240. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  241. package/build-types/date-time/time/styles.d.ts +4 -4
  242. package/build-types/dimension-control/index.d.ts.map +1 -1
  243. package/build-types/dimension-control/stories/index.story.d.ts +1 -1
  244. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  245. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  246. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  247. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  248. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  249. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  250. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  251. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  252. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  253. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  254. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  255. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  256. package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
  257. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  258. package/build-types/guide/stories/index.story.d.ts +1 -1
  259. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  260. package/build-types/icon/stories/index.story.d.ts +4 -4
  261. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  262. package/build-types/input-control/index.d.ts +1 -0
  263. package/build-types/input-control/index.d.ts.map +1 -1
  264. package/build-types/input-control/stories/index.story.d.ts +7 -7
  265. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  266. package/build-types/input-control/types.d.ts +11 -2
  267. package/build-types/input-control/types.d.ts.map +1 -1
  268. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  269. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  270. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  271. package/build-types/menu/index.d.ts +10 -1
  272. package/build-types/menu/index.d.ts.map +1 -1
  273. package/build-types/menu/item.d.ts.map +1 -1
  274. package/build-types/menu/popover.d.ts +3 -0
  275. package/build-types/menu/popover.d.ts.map +1 -0
  276. package/build-types/menu/radio-item.d.ts.map +1 -1
  277. package/build-types/menu/stories/index.story.d.ts +9 -9
  278. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  279. package/build-types/menu/submenu-trigger-item.d.ts +3 -0
  280. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -0
  281. package/build-types/menu/trigger-button.d.ts +3 -0
  282. package/build-types/menu/trigger-button.d.ts.map +1 -0
  283. package/build-types/menu/types.d.ts +208 -57
  284. package/build-types/menu/types.d.ts.map +1 -1
  285. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  286. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  287. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  288. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  289. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  290. package/build-types/navigation/index.d.ts.map +1 -1
  291. package/build-types/navigation/item/index.d.ts.map +1 -1
  292. package/build-types/navigation/stories/index.story.d.ts +6 -6
  293. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  294. package/build-types/notice/stories/index.story.d.ts +4 -4
  295. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  296. package/build-types/number-control/index.d.ts +1 -1
  297. package/build-types/number-control/index.d.ts.map +1 -1
  298. package/build-types/number-control/stories/index.story.d.ts +2 -2
  299. package/build-types/palette-edit/index.d.ts.map +1 -1
  300. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  301. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  302. package/build-types/private-apis.d.ts.map +1 -1
  303. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  304. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  305. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  306. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  307. package/build-types/radio-group/index.d.ts.map +1 -1
  308. package/build-types/radio-group/radio.d.ts.map +1 -1
  309. package/build-types/range-control/index.d.ts +1 -1
  310. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  311. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  312. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  313. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  314. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  315. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  316. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  317. package/build-types/search-control/stories/index.story.d.ts +1 -1
  318. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  319. package/build-types/select-control/index.d.ts +1 -0
  320. package/build-types/select-control/index.d.ts.map +1 -1
  321. package/build-types/select-control/stories/index.story.d.ts +5 -5
  322. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  323. package/build-types/select-control/types.d.ts +1 -1
  324. package/build-types/select-control/types.d.ts.map +1 -1
  325. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  326. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  327. package/build-types/slot-fill/context.d.ts.map +1 -1
  328. package/build-types/slot-fill/fill.d.ts.map +1 -1
  329. package/build-types/slot-fill/provider.d.ts.map +1 -1
  330. package/build-types/slot-fill/slot.d.ts.map +1 -1
  331. package/build-types/slot-fill/types.d.ts +13 -11
  332. package/build-types/slot-fill/types.d.ts.map +1 -1
  333. package/build-types/tab-panel/index.d.ts.map +1 -1
  334. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  335. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  336. package/build-types/tabs/index.d.ts +21 -4
  337. package/build-types/tabs/index.d.ts.map +1 -1
  338. package/build-types/tabs/stories/index.story.d.ts +10 -10
  339. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  340. package/build-types/tabs/types.d.ts +13 -13
  341. package/build-types/tabs/types.d.ts.map +1 -1
  342. package/build-types/text/stories/index.story.d.ts +3 -3
  343. package/build-types/theme/stories/index.story.d.ts +1 -1
  344. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  345. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  346. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  347. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  348. package/build-types/tooltip/index.d.ts.map +1 -1
  349. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  350. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  351. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  352. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  353. package/build-types/tree-select/index.d.ts +3 -2
  354. package/build-types/tree-select/index.d.ts.map +1 -1
  355. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  356. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  357. package/build-types/tree-select/types.d.ts +5 -1
  358. package/build-types/tree-select/types.d.ts.map +1 -1
  359. package/build-types/unit-control/index.d.ts +1 -1
  360. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  361. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  362. package/package.json +19 -19
  363. package/src/alignment-matrix-control/README.md +16 -15
  364. package/src/angle-picker-control/README.md +10 -9
  365. package/src/badge/README.md +24 -0
  366. package/src/badge/docs-manifest.json +5 -0
  367. package/src/badge/index.tsx +67 -0
  368. package/src/badge/stories/index.story.tsx +54 -0
  369. package/src/badge/styles.scss +49 -0
  370. package/src/badge/test/index.tsx +45 -0
  371. package/src/badge/types.ts +12 -0
  372. package/src/base-control/README.md +22 -21
  373. package/src/box-control/README.md +41 -24
  374. package/src/box-control/index.tsx +4 -0
  375. package/src/box-control/input-control.tsx +142 -40
  376. package/src/box-control/stories/index.story.tsx +12 -0
  377. package/src/box-control/types.ts +18 -0
  378. package/src/box-control/utils.ts +60 -0
  379. package/src/button/README.md +51 -50
  380. package/src/button/style.scss +9 -10
  381. package/src/button/test/index.tsx +9 -2
  382. package/src/button-group/README.md +4 -0
  383. package/src/button-group/index.tsx +11 -1
  384. package/src/button-group/stories/index.story.tsx +8 -1
  385. package/src/button-group/types.ts +7 -0
  386. package/src/custom-select-control/index.tsx +3 -3
  387. package/src/custom-select-control-v2/custom-select.tsx +1 -2
  388. package/src/custom-select-control-v2/stories/index.story.tsx +4 -0
  389. package/src/date-time/date/index.tsx +1 -0
  390. package/src/dimension-control/index.tsx +1 -0
  391. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  392. package/src/disabled/stories/index.story.tsx +1 -0
  393. package/src/drop-zone/stories/index.story.tsx +7 -1
  394. package/src/font-size-picker/styles.ts +1 -0
  395. package/src/form-file-upload/README.md +22 -21
  396. package/src/gradient-picker/README.md +36 -35
  397. package/src/heading/hook.ts +1 -1
  398. package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
  399. package/src/icon/README.md +9 -8
  400. package/src/input-control/README.md +1 -0
  401. package/src/input-control/index.tsx +10 -0
  402. package/src/input-control/stories/index.story.tsx +6 -1
  403. package/src/input-control/test/index.js +9 -3
  404. package/src/input-control/types.ts +11 -2
  405. package/src/menu/checkbox-item.tsx +2 -1
  406. package/src/menu/index.tsx +61 -165
  407. package/src/menu/item.tsx +17 -2
  408. package/src/menu/popover.tsx +103 -0
  409. package/src/menu/radio-item.tsx +2 -1
  410. package/src/menu/stories/index.story.tsx +533 -381
  411. package/src/menu/submenu-trigger-item.tsx +61 -0
  412. package/src/menu/test/index.tsx +266 -182
  413. package/src/menu/trigger-button.tsx +46 -0
  414. package/src/menu/types.ts +210 -63
  415. package/src/modal/stories/index.story.tsx +4 -1
  416. package/src/navigation/back-button/index.tsx +1 -0
  417. package/src/navigation/index.tsx +7 -0
  418. package/src/navigation/item/index.tsx +2 -0
  419. package/src/navigation/test/index.tsx +4 -0
  420. package/src/navigator/test/index.tsx +4 -0
  421. package/src/number-control/index.tsx +1 -0
  422. package/src/palette-edit/index.tsx +1 -0
  423. package/src/panel/stories/index.story.tsx +3 -3
  424. package/src/private-apis.ts +2 -0
  425. package/src/radio-group/index.tsx +12 -1
  426. package/src/radio-group/radio.tsx +1 -2
  427. package/src/range-control/styles/range-control-styles.ts +8 -4
  428. package/src/select-control/README.md +3 -0
  429. package/src/select-control/index.tsx +10 -0
  430. package/src/select-control/stories/index.story.tsx +2 -0
  431. package/src/select-control/test/select-control.tsx +7 -1
  432. package/src/select-control/types.ts +1 -0
  433. package/src/slot-fill/context.ts +5 -3
  434. package/src/slot-fill/fill.ts +10 -15
  435. package/src/slot-fill/provider.tsx +63 -64
  436. package/src/slot-fill/slot.tsx +40 -27
  437. package/src/slot-fill/types.ts +23 -11
  438. package/src/style.scss +1 -0
  439. package/src/tab-panel/index.tsx +1 -2
  440. package/src/tab-panel/stories/index.story.tsx +4 -0
  441. package/src/tabs/README.md +151 -187
  442. package/src/tabs/docs-manifest.json +22 -0
  443. package/src/tabs/index.tsx +21 -4
  444. package/src/tabs/stories/best-practices.mdx +99 -0
  445. package/src/tabs/stories/index.story.tsx +5 -0
  446. package/src/tabs/types.ts +13 -14
  447. package/src/text/hook.ts +2 -2
  448. package/src/text/styles.ts +1 -1
  449. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  450. package/src/text/test/index.tsx +1 -1
  451. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +2 -2
  452. package/src/toggle-group-control/test/index.tsx +7 -1
  453. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -2
  454. package/src/tooltip/index.tsx +1 -2
  455. package/src/tree-grid/stories/index.story.tsx +2 -0
  456. package/src/tree-select/README.md +144 -28
  457. package/src/tree-select/docs-manifest.json +5 -0
  458. package/src/tree-select/index.tsx +11 -2
  459. package/src/tree-select/stories/index.story.tsx +1 -0
  460. package/src/tree-select/types.ts +8 -1
  461. package/tsconfig.json +0 -3
  462. package/tsconfig.tsbuildinfo +1 -1
  463. package/build/slot-fill/use-slot.js +0 -32
  464. package/build/slot-fill/use-slot.js.map +0 -1
  465. package/build-module/slot-fill/use-slot.js +0 -24
  466. package/build-module/slot-fill/use-slot.js.map +0 -1
  467. package/build-types/slot-fill/use-slot.d.ts +0 -10
  468. package/build-types/slot-fill/use-slot.d.ts.map +0 -1
  469. package/src/slot-fill/use-slot.ts +0 -27
@@ -92,6 +92,7 @@ const MySelectControl = () => {
92
92
  { label: 'Small', value: '25%' },
93
93
  ] }
94
94
  onChange={ ( newSize ) => setSize( newSize ) }
95
+ __next40pxDefaultSize
95
96
  __nextHasNoMarginBottom
96
97
  />
97
98
  );
@@ -114,6 +115,7 @@ Render a user interface to select multiple users from a list.
114
115
  { value: 'b', label: 'User B' },
115
116
  { value: 'c', label: 'User c' },
116
117
  ] }
118
+ __next40pxDefaultSize
117
119
  __nextHasNoMarginBottom
118
120
  />
119
121
  ```
@@ -129,6 +131,7 @@ const [ item, setItem ] = useState( '' );
129
131
  label={ __( 'My dinosaur' ) }
130
132
  value={ item } // e.g: value = 'a'
131
133
  onChange={ ( selection ) => { setItem( selection ) } }
134
+ __next40pxDefaultSize
132
135
  __nextHasNoMarginBottom
133
136
  >
134
137
  <optgroup label="Theropods">
@@ -18,6 +18,7 @@ import type { WordPressComponentProps } from '../context';
18
18
  import type { SelectControlProps } from './types';
19
19
  import SelectControlChevronDown from './chevron-down';
20
20
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
21
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
21
22
 
22
23
  function useUniqueId( idProp?: string ) {
23
24
  const instanceId = useInstanceId( SelectControl );
@@ -65,6 +66,7 @@ function UnforwardedSelectControl< V extends string >(
65
66
  variant = 'default',
66
67
  __next40pxDefaultSize = false,
67
68
  __nextHasNoMarginBottom = false,
69
+ __shouldNotWarnDeprecated36pxSize,
68
70
  ...restProps
69
71
  } = useDeprecated36pxDefaultSizeProp( props );
70
72
  const id = useUniqueId( idProp );
@@ -94,6 +96,13 @@ function UnforwardedSelectControl< V extends string >(
94
96
 
95
97
  const classes = clsx( 'components-select-control', className );
96
98
 
99
+ maybeWarnDeprecated36pxSize( {
100
+ componentName: 'SelectControl',
101
+ __next40pxDefaultSize,
102
+ size,
103
+ __shouldNotWarnDeprecated36pxSize,
104
+ } );
105
+
97
106
  return (
98
107
  <BaseControl
99
108
  help={ help }
@@ -154,6 +163,7 @@ function UnforwardedSelectControl< V extends string >(
154
163
  *
155
164
  * return (
156
165
  * <SelectControl
166
+ * __next40pxDefaultSize
157
167
  * __nextHasNoMarginBottom
158
168
  * label="Size"
159
169
  * value={ size }
@@ -65,6 +65,7 @@ const SelectControlWithState: StoryFn< typeof SelectControl > = ( props ) => {
65
65
 
66
66
  export const Default = SelectControlWithState.bind( {} );
67
67
  Default.args = {
68
+ __next40pxDefaultSize: true,
68
69
  __nextHasNoMarginBottom: true,
69
70
  label: 'Label',
70
71
  options: [
@@ -87,6 +88,7 @@ WithLabelAndHelpText.args = {
87
88
  */
88
89
  export const WithCustomChildren = SelectControlWithState.bind( {} );
89
90
  WithCustomChildren.args = {
91
+ __next40pxDefaultSize: true,
90
92
  __nextHasNoMarginBottom: true,
91
93
  label: 'Label',
92
94
  children: (
@@ -12,7 +12,13 @@ import _SelectControl from '..';
12
12
  const SelectControl = (
13
13
  props: React.ComponentProps< typeof _SelectControl >
14
14
  ) => {
15
- return <_SelectControl { ...props } __nextHasNoMarginBottom />;
15
+ return (
16
+ <_SelectControl
17
+ { ...props }
18
+ __nextHasNoMarginBottom
19
+ __next40pxDefaultSize
20
+ />
21
+ );
16
22
  };
17
23
 
18
24
  describe( 'SelectControl', () => {
@@ -13,6 +13,7 @@ type SelectControlBaseProps< V extends string > = Pick<
13
13
  InputBaseProps,
14
14
  | '__next36pxDefaultSize'
15
15
  | '__next40pxDefaultSize'
16
+ | '__shouldNotWarnDeprecated36pxSize'
16
17
  | 'disabled'
17
18
  | 'hideLabelFromVision'
18
19
  | 'label'
@@ -1,20 +1,22 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { observableMap } from '@wordpress/compose';
4
5
  import { createContext } from '@wordpress/element';
6
+
5
7
  /**
6
8
  * Internal dependencies
7
9
  */
8
10
  import type { BaseSlotFillContext } from './types';
9
11
 
10
12
  const initialValue: BaseSlotFillContext = {
13
+ slots: observableMap(),
14
+ fills: observableMap(),
11
15
  registerSlot: () => {},
12
16
  unregisterSlot: () => {},
13
17
  registerFill: () => {},
14
18
  unregisterFill: () => {},
15
- getSlot: () => undefined,
16
- getFills: () => [],
17
- subscribe: () => () => {},
19
+ updateFill: () => {},
18
20
  };
19
21
  export const SlotFillContext = createContext( initialValue );
20
22
 
@@ -7,31 +7,26 @@ import { useContext, useLayoutEffect, useRef } from '@wordpress/element';
7
7
  * Internal dependencies
8
8
  */
9
9
  import SlotFillContext from './context';
10
- import useSlot from './use-slot';
11
10
  import type { FillComponentProps } from './types';
12
11
 
13
12
  export default function Fill( { name, children }: FillComponentProps ) {
14
13
  const registry = useContext( SlotFillContext );
15
- const slot = useSlot( name );
14
+ const instanceRef = useRef( {} );
15
+ const childrenRef = useRef( children );
16
16
 
17
- const ref = useRef( {
18
- name,
19
- children,
20
- } );
17
+ useLayoutEffect( () => {
18
+ childrenRef.current = children;
19
+ }, [ children ] );
21
20
 
22
21
  useLayoutEffect( () => {
23
- const refValue = ref.current;
24
- refValue.name = name;
25
- registry.registerFill( name, refValue );
26
- return () => registry.unregisterFill( name, refValue );
22
+ const instance = instanceRef.current;
23
+ registry.registerFill( name, instance, childrenRef.current );
24
+ return () => registry.unregisterFill( name, instance );
27
25
  }, [ registry, name ] );
28
26
 
29
27
  useLayoutEffect( () => {
30
- ref.current.children = children;
31
- if ( slot ) {
32
- slot.rerender();
33
- }
34
- }, [ slot, children ] );
28
+ registry.updateFill( name, instanceRef.current, childrenRef.current );
29
+ } );
35
30
 
36
31
  return null;
37
32
  }
@@ -8,103 +8,102 @@ import { useState } from '@wordpress/element';
8
8
  */
9
9
  import SlotFillContext from './context';
10
10
  import type {
11
- FillComponentProps,
11
+ FillInstance,
12
+ FillChildren,
13
+ BaseSlotInstance,
12
14
  BaseSlotFillContext,
13
15
  SlotFillProviderProps,
14
16
  SlotKey,
15
- Rerenderable,
16
17
  } from './types';
18
+ import { observableMap } from '@wordpress/compose';
17
19
 
18
20
  function createSlotRegistry(): BaseSlotFillContext {
19
- const slots: Record< SlotKey, Rerenderable > = {};
20
- const fills: Record< SlotKey, FillComponentProps[] > = {};
21
- let listeners: Array< () => void > = [];
22
-
23
- function registerSlot( name: SlotKey, slot: Rerenderable ) {
24
- const previousSlot = slots[ name ];
25
- slots[ name ] = slot;
26
- triggerListeners();
27
-
28
- // Sometimes the fills are registered after the initial render of slot
29
- // But before the registerSlot call, we need to rerender the slot.
30
- forceUpdateSlot( name );
31
-
32
- // If a new instance of a slot is being mounted while another with the
33
- // same name exists, force its update _after_ the new slot has been
34
- // assigned into the instance, such that its own rendering of children
35
- // will be empty (the new Slot will subsume all fills for this name).
36
- if ( previousSlot ) {
37
- previousSlot.rerender();
38
- }
39
- }
40
-
41
- function registerFill( name: SlotKey, instance: FillComponentProps ) {
42
- fills[ name ] = [ ...( fills[ name ] || [] ), instance ];
43
- forceUpdateSlot( name );
21
+ const slots = observableMap< SlotKey, BaseSlotInstance >();
22
+ const fills = observableMap<
23
+ SlotKey,
24
+ { instance: FillInstance; children: FillChildren }[]
25
+ >();
26
+
27
+ function registerSlot( name: SlotKey, instance: BaseSlotInstance ) {
28
+ slots.set( name, instance );
44
29
  }
45
30
 
46
- function unregisterSlot( name: SlotKey, instance: Rerenderable ) {
31
+ function unregisterSlot( name: SlotKey, instance: BaseSlotInstance ) {
47
32
  // If a previous instance of a Slot by this name unmounts, do nothing,
48
33
  // as the slot and its fills should only be removed for the current
49
34
  // known instance.
50
- if ( slots[ name ] !== instance ) {
35
+ if ( slots.get( name ) !== instance ) {
51
36
  return;
52
37
  }
53
38
 
54
- delete slots[ name ];
55
- triggerListeners();
39
+ slots.delete( name );
56
40
  }
57
41
 
58
- function unregisterFill( name: SlotKey, instance: FillComponentProps ) {
59
- fills[ name ] =
60
- fills[ name ]?.filter( ( fill ) => fill !== instance ) ?? [];
61
- forceUpdateSlot( name );
42
+ function registerFill(
43
+ name: SlotKey,
44
+ instance: FillInstance,
45
+ children: FillChildren
46
+ ) {
47
+ fills.set( name, [
48
+ ...( fills.get( name ) || [] ),
49
+ { instance, children },
50
+ ] );
62
51
  }
63
52
 
64
- function getSlot( name: SlotKey ): Rerenderable | undefined {
65
- return slots[ name ];
53
+ function unregisterFill( name: SlotKey, instance: FillInstance ) {
54
+ const fillsForName = fills.get( name );
55
+ if ( ! fillsForName ) {
56
+ return;
57
+ }
58
+
59
+ fills.set(
60
+ name,
61
+ fillsForName.filter( ( fill ) => fill.instance !== instance )
62
+ );
66
63
  }
67
64
 
68
- function getFills(
65
+ function updateFill(
69
66
  name: SlotKey,
70
- slotInstance: Rerenderable
71
- ): FillComponentProps[] {
72
- // Fills should only be returned for the current instance of the slot
73
- // in which they occupy.
74
- if ( slots[ name ] !== slotInstance ) {
75
- return [];
67
+ instance: FillInstance,
68
+ children: FillChildren
69
+ ) {
70
+ const fillsForName = fills.get( name );
71
+ if ( ! fillsForName ) {
72
+ return;
76
73
  }
77
- return fills[ name ];
78
- }
79
-
80
- function forceUpdateSlot( name: SlotKey ) {
81
- const slot = getSlot( name );
82
74
 
83
- if ( slot ) {
84
- slot.rerender();
75
+ const fillForInstance = fillsForName.find(
76
+ ( f ) => f.instance === instance
77
+ );
78
+ if ( ! fillForInstance ) {
79
+ return;
85
80
  }
86
- }
87
81
 
88
- function triggerListeners() {
89
- listeners.forEach( ( listener ) => listener() );
90
- }
91
-
92
- function subscribe( listener: () => void ) {
93
- listeners.push( listener );
82
+ if ( fillForInstance.children === children ) {
83
+ return;
84
+ }
94
85
 
95
- return () => {
96
- listeners = listeners.filter( ( l ) => l !== listener );
97
- };
86
+ fills.set(
87
+ name,
88
+ fillsForName.map( ( f ) => {
89
+ if ( f.instance === instance ) {
90
+ // Replace with new record with updated `children`.
91
+ return { instance, children };
92
+ }
93
+
94
+ return f;
95
+ } )
96
+ );
98
97
  }
99
98
 
100
99
  return {
100
+ slots,
101
+ fills,
101
102
  registerSlot,
102
103
  unregisterSlot,
103
104
  registerFill,
104
105
  unregisterFill,
105
- getSlot,
106
- getFills,
107
- subscribe,
106
+ updateFill,
108
107
  };
109
108
  }
110
109
 
@@ -6,10 +6,10 @@ import type { ReactElement, ReactNode, Key } from 'react';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
+ import { useObservableValue } from '@wordpress/compose';
9
10
  import {
10
11
  useContext,
11
- useEffect,
12
- useReducer,
12
+ useLayoutEffect,
13
13
  useRef,
14
14
  Children,
15
15
  cloneElement,
@@ -32,41 +32,48 @@ function isFunction( maybeFunc: any ): maybeFunc is Function {
32
32
  return typeof maybeFunc === 'function';
33
33
  }
34
34
 
35
+ function addKeysToChildren( children: ReactNode ) {
36
+ return Children.map( children, ( child, childIndex ) => {
37
+ if ( ! child || typeof child === 'string' ) {
38
+ return child;
39
+ }
40
+ let childKey: Key = childIndex;
41
+ if ( typeof child === 'object' && 'key' in child && child?.key ) {
42
+ childKey = child.key;
43
+ }
44
+
45
+ return cloneElement( child as ReactElement, {
46
+ key: childKey,
47
+ } );
48
+ } );
49
+ }
50
+
35
51
  function Slot( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) {
36
52
  const registry = useContext( SlotFillContext );
37
- const [ , rerender ] = useReducer( () => [], [] );
38
- const ref = useRef( { rerender } );
53
+ const instanceRef = useRef( {} );
39
54
 
40
55
  const { name, children, fillProps = {} } = props;
41
56
 
42
- useEffect( () => {
43
- const refValue = ref.current;
44
- registry.registerSlot( name, refValue );
45
- return () => registry.unregisterSlot( name, refValue );
57
+ useLayoutEffect( () => {
58
+ const instance = instanceRef.current;
59
+ registry.registerSlot( name, instance );
60
+ return () => registry.unregisterSlot( name, instance );
46
61
  }, [ registry, name ] );
47
62
 
48
- const fills: ReactNode[] = ( registry.getFills( name, ref.current ) ?? [] )
63
+ let fills = useObservableValue( registry.fills, name ) ?? [];
64
+ const currentSlot = useObservableValue( registry.slots, name );
65
+
66
+ // Fills should only be rendered in the currently registered instance of the slot.
67
+ if ( currentSlot !== instanceRef.current ) {
68
+ fills = [];
69
+ }
70
+
71
+ const renderedFills = fills
49
72
  .map( ( fill ) => {
50
73
  const fillChildren = isFunction( fill.children )
51
74
  ? fill.children( fillProps )
52
75
  : fill.children;
53
- return Children.map( fillChildren, ( child, childIndex ) => {
54
- if ( ! child || typeof child === 'string' ) {
55
- return child;
56
- }
57
- let childKey: Key = childIndex;
58
- if (
59
- typeof child === 'object' &&
60
- 'key' in child &&
61
- child?.key
62
- ) {
63
- childKey = child.key;
64
- }
65
-
66
- return cloneElement( child as ReactElement, {
67
- key: childKey,
68
- } );
69
- } );
76
+ return addKeysToChildren( fillChildren );
70
77
  } )
71
78
  .filter(
72
79
  // In some cases fills are rendered only when some conditions apply.
@@ -75,7 +82,13 @@ function Slot( props: Omit< SlotComponentProps, 'bubblesVirtually' > ) {
75
82
  ( element ) => ! isEmptyElement( element )
76
83
  );
77
84
 
78
- return <>{ isFunction( children ) ? children( fills ) : fills }</>;
85
+ return (
86
+ <>
87
+ { isFunction( children )
88
+ ? children( renderedFills )
89
+ : renderedFills }
90
+ </>
91
+ );
79
92
  }
80
93
 
81
94
  export default Slot;
@@ -84,6 +84,10 @@ export type SlotComponentProps =
84
84
  style?: never;
85
85
  } );
86
86
 
87
+ export type FillChildren =
88
+ | ReactNode
89
+ | ( ( fillProps: FillProps ) => ReactNode );
90
+
87
91
  export type FillComponentProps = {
88
92
  /**
89
93
  * The name of the slot to fill into.
@@ -93,7 +97,7 @@ export type FillComponentProps = {
93
97
  /**
94
98
  * Children elements or render function.
95
99
  */
96
- children?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );
100
+ children?: FillChildren;
97
101
  };
98
102
 
99
103
  export type SlotFillProviderProps = {
@@ -109,8 +113,8 @@ export type SlotFillProviderProps = {
109
113
  };
110
114
 
111
115
  export type SlotRef = RefObject< HTMLElement >;
112
- export type Rerenderable = { rerender: () => void };
113
116
  export type FillInstance = {};
117
+ export type BaseSlotInstance = {};
114
118
 
115
119
  export type SlotFillBubblesVirtuallyContext = {
116
120
  slots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;
@@ -128,14 +132,22 @@ export type SlotFillBubblesVirtuallyContext = {
128
132
  };
129
133
 
130
134
  export type BaseSlotFillContext = {
131
- registerSlot: ( name: SlotKey, slot: Rerenderable ) => void;
132
- unregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;
133
- registerFill: ( name: SlotKey, instance: FillComponentProps ) => void;
134
- unregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;
135
- getSlot: ( name: SlotKey ) => Rerenderable | undefined;
136
- getFills: (
135
+ slots: ObservableMap< SlotKey, BaseSlotInstance >;
136
+ fills: ObservableMap<
137
+ SlotKey,
138
+ { instance: FillInstance; children: FillChildren }[]
139
+ >;
140
+ registerSlot: ( name: SlotKey, slot: BaseSlotInstance ) => void;
141
+ unregisterSlot: ( name: SlotKey, slot: BaseSlotInstance ) => void;
142
+ registerFill: (
143
+ name: SlotKey,
144
+ instance: FillInstance,
145
+ children: FillChildren
146
+ ) => void;
147
+ unregisterFill: ( name: SlotKey, instance: FillInstance ) => void;
148
+ updateFill: (
137
149
  name: SlotKey,
138
- slotInstance: Rerenderable
139
- ) => FillComponentProps[];
140
- subscribe: ( listener: () => void ) => () => void;
150
+ instance: FillInstance,
151
+ children: FillChildren
152
+ ) => void;
141
153
  };
package/src/style.scss CHANGED
@@ -10,6 +10,7 @@
10
10
  // Components
11
11
  @import "./animate/style.scss";
12
12
  @import "./autocomplete/style.scss";
13
+ @import "./badge/styles.scss";
13
14
  @import "./button-group/style.scss";
14
15
  @import "./button/style.scss";
15
16
  @import "./checkbox-control/style.scss";
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import * as Ariakit from '@ariakit/react';
5
- import { useStoreState } from '@ariakit/react';
6
5
  import clsx from 'clsx';
7
6
  import type { ForwardedRef } from 'react';
8
7
 
@@ -125,7 +124,7 @@ const UnforwardedTabPanel = (
125
124
  } );
126
125
 
127
126
  const selectedTabName = extractTabName(
128
- useStoreState( tabStore, 'selectedId' )
127
+ Ariakit.useStoreState( tabStore, 'selectedId' )
129
128
  );
130
129
 
131
130
  const setTabStoreSelectedId = useCallback(
@@ -2,6 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import type { Meta, StoryFn } from '@storybook/react';
5
+ import { fn } from '@storybook/test';
5
6
 
6
7
  /**
7
8
  * WordPress dependencies
@@ -22,6 +23,9 @@ const meta: Meta< typeof TabPanel > = {
22
23
  controls: { expanded: true },
23
24
  docs: { canvas: { sourceState: 'shown' } },
24
25
  },
26
+ args: {
27
+ onSelect: fn(),
28
+ },
25
29
  };
26
30
  export default meta;
27
31