@wordpress/components 29.0.1-next.a9f418477.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 (944) hide show
  1. package/CHANGELOG.md +50 -10
  2. package/LICENSE.md +1 -1
  3. package/build/alignment-matrix-control/icon.js +1 -0
  4. package/build/alignment-matrix-control/icon.js.map +1 -1
  5. package/build/alignment-matrix-control/index.js +1 -0
  6. package/build/alignment-matrix-control/index.js.map +1 -1
  7. package/build/autocomplete/autocompleter-ui.js +1 -0
  8. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  9. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  10. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  11. package/build/autocomplete/get-default-use-items.js +1 -0
  12. package/build/autocomplete/get-default-use-items.js.map +1 -1
  13. package/build/autocomplete/index.js +1 -0
  14. package/build/autocomplete/index.js.map +1 -1
  15. package/build/badge/index.js +64 -0
  16. package/build/badge/index.js.map +1 -0
  17. package/build/badge/types.js +6 -0
  18. package/build/badge/types.js.map +1 -0
  19. package/build/border-box-control/utils.js +1 -0
  20. package/build/border-box-control/utils.js.map +1 -1
  21. package/build/border-control/border-control-dropdown/component.js +1 -0
  22. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  23. package/build/border-control/border-control-style-picker/component.js +1 -0
  24. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  25. package/build/box-control/index.js +18 -14
  26. package/build/box-control/index.js.map +1 -1
  27. package/build/box-control/input-control.js +222 -0
  28. package/build/box-control/input-control.js.map +1 -0
  29. package/build/box-control/types.js.map +1 -1
  30. package/build/box-control/utils.js +101 -48
  31. package/build/box-control/utils.js.map +1 -1
  32. package/build/button/index.native.js +1 -0
  33. package/build/button/index.native.js.map +1 -1
  34. package/build/button/types.js.map +1 -1
  35. package/build/button-group/index.js +10 -0
  36. package/build/button-group/index.js.map +1 -1
  37. package/build/button-group/types.js.map +1 -1
  38. package/build/color-indicator/index.native.js +1 -0
  39. package/build/color-indicator/index.native.js.map +1 -1
  40. package/build/color-palette/index.js +1 -0
  41. package/build/color-palette/index.js.map +1 -1
  42. package/build/color-palette/index.native.js +1 -0
  43. package/build/color-palette/index.native.js.map +1 -1
  44. package/build/color-palette/utils.js +1 -0
  45. package/build/color-palette/utils.js.map +1 -1
  46. package/build/combobox-control/index.js +1 -0
  47. package/build/combobox-control/index.js.map +1 -1
  48. package/build/composite/legacy/index.js +1 -0
  49. package/build/composite/legacy/index.js.map +1 -1
  50. package/build/context/context-connect.js +1 -0
  51. package/build/context/context-connect.js.map +1 -1
  52. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  53. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  54. package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
  55. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  56. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
  57. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  58. package/build/custom-gradient-picker/index.js +1 -0
  59. package/build/custom-gradient-picker/index.js.map +1 -1
  60. package/build/custom-gradient-picker/serializer.js +1 -0
  61. package/build/custom-gradient-picker/serializer.js.map +1 -1
  62. package/build/custom-gradient-picker/utils.js +1 -0
  63. package/build/custom-gradient-picker/utils.js.map +1 -1
  64. package/build/custom-select-control/index.js +2 -3
  65. package/build/custom-select-control/index.js.map +1 -1
  66. package/build/custom-select-control-v2/custom-select.js +2 -3
  67. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  68. package/build/dashicon/index.js +1 -0
  69. package/build/dashicon/index.js.map +1 -1
  70. package/build/date-time/date/index.js +2 -0
  71. package/build/date-time/date/index.js.map +1 -1
  72. package/build/date-time/date/use-lilius/index.js +1 -0
  73. package/build/date-time/date/use-lilius/index.js.map +1 -1
  74. package/build/date-time/time/index.js +1 -0
  75. package/build/date-time/time/index.js.map +1 -1
  76. package/build/dimension-control/index.js +2 -0
  77. package/build/dimension-control/index.js.map +1 -1
  78. package/build/dimension-control/sizes.js +1 -0
  79. package/build/dimension-control/sizes.js.map +1 -1
  80. package/build/draggable/index.js +1 -0
  81. package/build/draggable/index.js.map +1 -1
  82. package/build/draggable/index.native.js +1 -0
  83. package/build/draggable/index.native.js.map +1 -1
  84. package/build/dropdown-menu/index.js +1 -0
  85. package/build/dropdown-menu/index.js.map +1 -1
  86. package/build/dropdown-menu/index.native.js +1 -0
  87. package/build/dropdown-menu/index.native.js.map +1 -1
  88. package/build/duotone-picker/color-list-picker/index.js +1 -0
  89. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  90. package/build/duotone-picker/duotone-picker.js +1 -0
  91. package/build/duotone-picker/duotone-picker.js.map +1 -1
  92. package/build/duotone-picker/utils.js +1 -0
  93. package/build/duotone-picker/utils.js.map +1 -1
  94. package/build/external-link/index.js +1 -0
  95. package/build/external-link/index.js.map +1 -1
  96. package/build/font-size-picker/font-size-picker-select.js +1 -0
  97. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  98. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  99. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  100. package/build/font-size-picker/index.js +1 -0
  101. package/build/font-size-picker/index.js.map +1 -1
  102. package/build/font-size-picker/index.native.js +1 -0
  103. package/build/font-size-picker/index.native.js.map +1 -1
  104. package/build/font-size-picker/styles.js +9 -9
  105. package/build/font-size-picker/styles.js.map +1 -1
  106. package/build/font-size-picker/utils.js +1 -0
  107. package/build/font-size-picker/utils.js.map +1 -1
  108. package/build/form-token-field/index.js +1 -0
  109. package/build/form-token-field/index.js.map +1 -1
  110. package/build/form-token-field/suggestions-list.js +1 -0
  111. package/build/form-token-field/suggestions-list.js.map +1 -1
  112. package/build/gradient-picker/index.js +1 -0
  113. package/build/gradient-picker/index.js.map +1 -1
  114. package/build/guide/index.js +1 -0
  115. package/build/guide/index.js.map +1 -1
  116. package/build/guide/page-control.js +1 -0
  117. package/build/guide/page-control.js.map +1 -1
  118. package/build/h-stack/hook.js +1 -0
  119. package/build/h-stack/hook.js.map +1 -1
  120. package/build/heading/hook.js +1 -1
  121. package/build/heading/hook.js.map +1 -1
  122. package/build/higher-order/navigate-regions/index.js +1 -0
  123. package/build/higher-order/navigate-regions/index.js.map +1 -1
  124. package/build/higher-order/with-fallback-styles/index.js +1 -0
  125. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  126. package/build/higher-order/with-filters/index.js +1 -0
  127. package/build/higher-order/with-filters/index.js.map +1 -1
  128. package/build/higher-order/with-notices/index.js +1 -0
  129. package/build/higher-order/with-notices/index.js.map +1 -1
  130. package/build/input-control/index.js +9 -0
  131. package/build/input-control/index.js.map +1 -1
  132. package/build/input-control/types.js.map +1 -1
  133. package/build/keyboard-shortcuts/index.js +1 -0
  134. package/build/keyboard-shortcuts/index.js.map +1 -1
  135. package/build/menu/checkbox-item.js +2 -0
  136. package/build/menu/checkbox-item.js.map +1 -1
  137. package/build/menu/index.js +25 -94
  138. package/build/menu/index.js.map +1 -1
  139. package/build/menu/item.js +10 -1
  140. package/build/menu/item.js.map +1 -1
  141. package/build/menu/popover.js +89 -0
  142. package/build/menu/popover.js.map +1 -0
  143. package/build/menu/radio-item.js +2 -0
  144. package/build/menu/radio-item.js.map +1 -1
  145. package/build/menu/styles.js +16 -16
  146. package/build/menu/styles.js.map +1 -1
  147. package/build/menu/submenu-trigger-item.js +58 -0
  148. package/build/menu/submenu-trigger-item.js.map +1 -0
  149. package/build/menu/trigger-button.js +45 -0
  150. package/build/menu/trigger-button.js.map +1 -0
  151. package/build/menu/types.js.map +1 -1
  152. package/build/menu-items-choice/index.js +1 -0
  153. package/build/menu-items-choice/index.js.map +1 -1
  154. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  155. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  156. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  157. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  158. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
  159. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  160. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  161. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  162. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  163. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  164. package/build/mobile/gradient/index.native.js +1 -0
  165. package/build/mobile/gradient/index.native.js.map +1 -1
  166. package/build/mobile/media-edit/index.native.js +1 -0
  167. package/build/mobile/media-edit/index.native.js.map +1 -1
  168. package/build/mobile/picker/index.android.js +1 -0
  169. package/build/mobile/picker/index.android.js.map +1 -1
  170. package/build/mobile/picker/index.ios.js +1 -0
  171. package/build/mobile/picker/index.ios.js.map +1 -1
  172. package/build/mobile/segmented-control/index.native.js +1 -0
  173. package/build/mobile/segmented-control/index.native.js.map +1 -1
  174. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
  175. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  176. package/build/navigable-container/container.js +1 -0
  177. package/build/navigable-container/container.js.map +1 -1
  178. package/build/navigation/back-button/index.js +1 -0
  179. package/build/navigation/back-button/index.js.map +1 -1
  180. package/build/navigation/group/index.js +1 -0
  181. package/build/navigation/group/index.js.map +1 -1
  182. package/build/navigation/index.js +6 -0
  183. package/build/navigation/index.js.map +1 -1
  184. package/build/navigation/item/index.js +1 -0
  185. package/build/navigation/item/index.js.map +1 -1
  186. package/build/navigation/menu/menu-title-search.js +1 -0
  187. package/build/navigation/menu/menu-title-search.js.map +1 -1
  188. package/build/navigation/menu/search-no-results-found.js +1 -0
  189. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  190. package/build/navigation/styles/navigation-styles.js +12 -12
  191. package/build/navigation/styles/navigation-styles.js.map +1 -1
  192. package/build/navigator/navigator/component.js +1 -0
  193. package/build/navigator/navigator/component.js.map +1 -1
  194. package/build/navigator/navigator-screen/component.js +1 -0
  195. package/build/navigator/navigator-screen/component.js.map +1 -1
  196. package/build/navigator/utils/router.js +1 -0
  197. package/build/navigator/utils/router.js.map +1 -1
  198. package/build/notice/index.js +1 -0
  199. package/build/notice/index.js.map +1 -1
  200. package/build/notice/list.js +1 -0
  201. package/build/notice/list.js.map +1 -1
  202. package/build/notice/list.native.js +1 -0
  203. package/build/notice/list.native.js.map +1 -1
  204. package/build/number-control/index.js +1 -0
  205. package/build/number-control/index.js.map +1 -1
  206. package/build/palette-edit/index.js +2 -0
  207. package/build/palette-edit/index.js.map +1 -1
  208. package/build/panel/actions.native.js +1 -0
  209. package/build/panel/actions.native.js.map +1 -1
  210. package/build/private-apis.js +3 -1
  211. package/build/private-apis.js.map +1 -1
  212. package/build/query-controls/index.js +1 -0
  213. package/build/query-controls/index.js.map +1 -1
  214. package/build/query-controls/terms.js +1 -0
  215. package/build/query-controls/terms.js.map +1 -1
  216. package/build/radio-control/index.js +1 -0
  217. package/build/radio-control/index.js.map +1 -1
  218. package/build/radio-control/index.native.js +1 -0
  219. package/build/radio-control/index.native.js.map +1 -1
  220. package/build/radio-group/index.js +6 -0
  221. package/build/radio-group/index.js.map +1 -1
  222. package/build/radio-group/radio.js +2 -3
  223. package/build/radio-group/radio.js.map +1 -1
  224. package/build/range-control/rail.js +1 -0
  225. package/build/range-control/rail.js.map +1 -1
  226. package/build/range-control/styles/range-control-styles.js +28 -28
  227. package/build/range-control/styles/range-control-styles.js.map +1 -1
  228. package/build/resizable-box/index.js +1 -0
  229. package/build/resizable-box/index.js.map +1 -1
  230. package/build/sandbox/index.js +1 -0
  231. package/build/sandbox/index.js.map +1 -1
  232. package/build/sandbox/index.native.js +1 -0
  233. package/build/sandbox/index.native.js.map +1 -1
  234. package/build/search-control/index.native.js +1 -0
  235. package/build/search-control/index.native.js.map +1 -1
  236. package/build/select-control/index.js +10 -0
  237. package/build/select-control/index.js.map +1 -1
  238. package/build/select-control/types.js.map +1 -1
  239. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  240. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  241. package/build/slot-fill/context.js +4 -3
  242. package/build/slot-fill/context.js.map +1 -1
  243. package/build/slot-fill/fill.js +10 -15
  244. package/build/slot-fill/fill.js.map +1 -1
  245. package/build/slot-fill/provider.js +42 -55
  246. package/build/slot-fill/provider.js.map +1 -1
  247. package/build/slot-fill/slot.js +32 -23
  248. package/build/slot-fill/slot.js.map +1 -1
  249. package/build/slot-fill/types.js.map +1 -1
  250. package/build/snackbar/index.js +1 -0
  251. package/build/snackbar/index.js.map +1 -1
  252. package/build/snackbar/list.js +1 -0
  253. package/build/snackbar/list.js.map +1 -1
  254. package/build/tab-panel/index.js +3 -3
  255. package/build/tab-panel/index.js.map +1 -1
  256. package/build/tabs/index.js +22 -4
  257. package/build/tabs/index.js.map +1 -1
  258. package/build/tabs/types.js.map +1 -1
  259. package/build/text/hook.js +6 -6
  260. package/build/text/hook.js.map +1 -1
  261. package/build/text/styles.js +7 -7
  262. package/build/text/styles.js.map +1 -1
  263. package/build/text/utils.js +1 -0
  264. package/build/text/utils.js.map +1 -1
  265. package/build/theme/color-algorithms.js +1 -0
  266. package/build/theme/color-algorithms.js.map +1 -1
  267. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +2 -3
  268. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  269. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  270. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  271. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  272. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  273. package/build/toolbar/toolbar-group/index.js +1 -0
  274. package/build/toolbar/toolbar-group/index.js.map +1 -1
  275. package/build/tools-panel/tools-panel/hook.js +1 -0
  276. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  277. package/build/tools-panel/tools-panel-header/component.js +1 -0
  278. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  279. package/build/tooltip/index.js +2 -3
  280. package/build/tooltip/index.js.map +1 -1
  281. package/build/tree-grid/index.js +1 -0
  282. package/build/tree-grid/index.js.map +1 -1
  283. package/build/tree-select/index.js +11 -2
  284. package/build/tree-select/index.js.map +1 -1
  285. package/build/tree-select/types.js.map +1 -1
  286. package/build/unit-control/index.js +1 -0
  287. package/build/unit-control/index.js.map +1 -1
  288. package/build/unit-control/index.native.js +1 -0
  289. package/build/unit-control/index.native.js.map +1 -1
  290. package/build/unit-control/unit-select-control.js +1 -0
  291. package/build/unit-control/unit-select-control.js.map +1 -1
  292. package/build/unit-control/utils.js +1 -0
  293. package/build/unit-control/utils.js.map +1 -1
  294. package/build/utils/colors-values.js +3 -0
  295. package/build/utils/colors-values.js.map +1 -1
  296. package/build/utils/config-values.js +0 -1
  297. package/build/utils/config-values.js.map +1 -1
  298. package/build/utils/get-valid-children.js +1 -0
  299. package/build/utils/get-valid-children.js.map +1 -1
  300. package/build/utils/hooks/use-animated-offset-rect.js +1 -0
  301. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  302. package/build/utils/hooks/use-cx.js +1 -0
  303. package/build/utils/hooks/use-cx.js.map +1 -1
  304. package/build/utils/math.js +1 -0
  305. package/build/utils/math.js.map +1 -1
  306. package/build/utils/rtl.js +1 -0
  307. package/build/utils/rtl.js.map +1 -1
  308. package/build/utils/values.js +1 -0
  309. package/build/utils/values.js.map +1 -1
  310. package/build/z-stack/component.js +1 -0
  311. package/build/z-stack/component.js.map +1 -1
  312. package/build-module/alignment-matrix-control/icon.js +1 -0
  313. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  314. package/build-module/alignment-matrix-control/index.js +1 -0
  315. package/build-module/alignment-matrix-control/index.js.map +1 -1
  316. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  317. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  318. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  319. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  320. package/build-module/autocomplete/get-default-use-items.js +1 -0
  321. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  322. package/build-module/autocomplete/index.js +1 -0
  323. package/build-module/autocomplete/index.js.map +1 -1
  324. package/build-module/badge/index.js +57 -0
  325. package/build-module/badge/index.js.map +1 -0
  326. package/build-module/badge/types.js +2 -0
  327. package/build-module/badge/types.js.map +1 -0
  328. package/build-module/border-box-control/utils.js +1 -0
  329. package/build-module/border-box-control/utils.js.map +1 -1
  330. package/build-module/border-control/border-control-dropdown/component.js +1 -0
  331. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  332. package/build-module/border-control/border-control-style-picker/component.js +1 -0
  333. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  334. package/build-module/box-control/index.js +20 -16
  335. package/build-module/box-control/index.js.map +1 -1
  336. package/build-module/box-control/input-control.js +214 -0
  337. package/build-module/box-control/input-control.js.map +1 -0
  338. package/build-module/box-control/types.js.map +1 -1
  339. package/build-module/box-control/utils.js +95 -46
  340. package/build-module/box-control/utils.js.map +1 -1
  341. package/build-module/button/index.native.js +1 -0
  342. package/build-module/button/index.native.js.map +1 -1
  343. package/build-module/button/types.js.map +1 -1
  344. package/build-module/button-group/index.js +10 -0
  345. package/build-module/button-group/index.js.map +1 -1
  346. package/build-module/button-group/types.js.map +1 -1
  347. package/build-module/color-indicator/index.native.js +1 -0
  348. package/build-module/color-indicator/index.native.js.map +1 -1
  349. package/build-module/color-palette/index.js +1 -0
  350. package/build-module/color-palette/index.js.map +1 -1
  351. package/build-module/color-palette/index.native.js +1 -0
  352. package/build-module/color-palette/index.native.js.map +1 -1
  353. package/build-module/color-palette/utils.js +1 -0
  354. package/build-module/color-palette/utils.js.map +1 -1
  355. package/build-module/combobox-control/index.js +1 -0
  356. package/build-module/combobox-control/index.js.map +1 -1
  357. package/build-module/composite/legacy/index.js +1 -0
  358. package/build-module/composite/legacy/index.js.map +1 -1
  359. package/build-module/context/context-connect.js +1 -0
  360. package/build-module/context/context-connect.js.map +1 -1
  361. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  362. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  363. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
  364. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  365. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
  366. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  367. package/build-module/custom-gradient-picker/index.js +1 -0
  368. package/build-module/custom-gradient-picker/index.js.map +1 -1
  369. package/build-module/custom-gradient-picker/serializer.js +1 -0
  370. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  371. package/build-module/custom-gradient-picker/utils.js +1 -0
  372. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  373. package/build-module/custom-select-control/index.js +2 -3
  374. package/build-module/custom-select-control/index.js.map +1 -1
  375. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  376. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  377. package/build-module/dashicon/index.js +1 -0
  378. package/build-module/dashicon/index.js.map +1 -1
  379. package/build-module/date-time/date/index.js +2 -0
  380. package/build-module/date-time/date/index.js.map +1 -1
  381. package/build-module/date-time/date/use-lilius/index.js +1 -0
  382. package/build-module/date-time/date/use-lilius/index.js.map +1 -1
  383. package/build-module/date-time/time/index.js +1 -0
  384. package/build-module/date-time/time/index.js.map +1 -1
  385. package/build-module/dimension-control/index.js +2 -0
  386. package/build-module/dimension-control/index.js.map +1 -1
  387. package/build-module/dimension-control/sizes.js +1 -0
  388. package/build-module/dimension-control/sizes.js.map +1 -1
  389. package/build-module/draggable/index.js +1 -0
  390. package/build-module/draggable/index.js.map +1 -1
  391. package/build-module/draggable/index.native.js +1 -0
  392. package/build-module/draggable/index.native.js.map +1 -1
  393. package/build-module/dropdown-menu/index.js +1 -0
  394. package/build-module/dropdown-menu/index.js.map +1 -1
  395. package/build-module/dropdown-menu/index.native.js +1 -0
  396. package/build-module/dropdown-menu/index.native.js.map +1 -1
  397. package/build-module/duotone-picker/color-list-picker/index.js +1 -0
  398. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  399. package/build-module/duotone-picker/duotone-picker.js +1 -0
  400. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  401. package/build-module/duotone-picker/utils.js +1 -0
  402. package/build-module/duotone-picker/utils.js.map +1 -1
  403. package/build-module/external-link/index.js +1 -0
  404. package/build-module/external-link/index.js.map +1 -1
  405. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  406. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  407. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  408. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  409. package/build-module/font-size-picker/index.js +1 -0
  410. package/build-module/font-size-picker/index.js.map +1 -1
  411. package/build-module/font-size-picker/index.native.js +1 -0
  412. package/build-module/font-size-picker/index.native.js.map +1 -1
  413. package/build-module/font-size-picker/styles.js +9 -9
  414. package/build-module/font-size-picker/styles.js.map +1 -1
  415. package/build-module/font-size-picker/utils.js +1 -0
  416. package/build-module/font-size-picker/utils.js.map +1 -1
  417. package/build-module/form-token-field/index.js +1 -0
  418. package/build-module/form-token-field/index.js.map +1 -1
  419. package/build-module/form-token-field/suggestions-list.js +1 -0
  420. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  421. package/build-module/gradient-picker/index.js +1 -0
  422. package/build-module/gradient-picker/index.js.map +1 -1
  423. package/build-module/guide/index.js +1 -0
  424. package/build-module/guide/index.js.map +1 -1
  425. package/build-module/guide/page-control.js +1 -0
  426. package/build-module/guide/page-control.js.map +1 -1
  427. package/build-module/h-stack/hook.js +1 -0
  428. package/build-module/h-stack/hook.js.map +1 -1
  429. package/build-module/heading/hook.js +1 -1
  430. package/build-module/heading/hook.js.map +1 -1
  431. package/build-module/higher-order/navigate-regions/index.js +1 -0
  432. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  433. package/build-module/higher-order/with-fallback-styles/index.js +1 -0
  434. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  435. package/build-module/higher-order/with-filters/index.js +1 -0
  436. package/build-module/higher-order/with-filters/index.js.map +1 -1
  437. package/build-module/higher-order/with-notices/index.js +1 -0
  438. package/build-module/higher-order/with-notices/index.js.map +1 -1
  439. package/build-module/input-control/index.js +9 -0
  440. package/build-module/input-control/index.js.map +1 -1
  441. package/build-module/input-control/types.js.map +1 -1
  442. package/build-module/keyboard-shortcuts/index.js +1 -0
  443. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  444. package/build-module/menu/checkbox-item.js +2 -0
  445. package/build-module/menu/checkbox-item.js.map +1 -1
  446. package/build-module/menu/index.js +28 -97
  447. package/build-module/menu/index.js.map +1 -1
  448. package/build-module/menu/item.js +10 -1
  449. package/build-module/menu/item.js.map +1 -1
  450. package/build-module/menu/popover.js +81 -0
  451. package/build-module/menu/popover.js.map +1 -0
  452. package/build-module/menu/radio-item.js +2 -0
  453. package/build-module/menu/radio-item.js.map +1 -1
  454. package/build-module/menu/styles.js +16 -16
  455. package/build-module/menu/styles.js.map +1 -1
  456. package/build-module/menu/submenu-trigger-item.js +50 -0
  457. package/build-module/menu/submenu-trigger-item.js.map +1 -0
  458. package/build-module/menu/trigger-button.js +37 -0
  459. package/build-module/menu/trigger-button.js.map +1 -0
  460. package/build-module/menu/types.js.map +1 -1
  461. package/build-module/menu-items-choice/index.js +1 -0
  462. package/build-module/menu-items-choice/index.js.map +1 -1
  463. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  464. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  465. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  466. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  467. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
  468. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  469. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  470. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  471. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  472. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  473. package/build-module/mobile/gradient/index.native.js +1 -0
  474. package/build-module/mobile/gradient/index.native.js.map +1 -1
  475. package/build-module/mobile/media-edit/index.native.js +1 -0
  476. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  477. package/build-module/mobile/picker/index.android.js +1 -0
  478. package/build-module/mobile/picker/index.android.js.map +1 -1
  479. package/build-module/mobile/picker/index.ios.js +1 -0
  480. package/build-module/mobile/picker/index.ios.js.map +1 -1
  481. package/build-module/mobile/segmented-control/index.native.js +1 -0
  482. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  483. package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
  484. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  485. package/build-module/navigable-container/container.js +1 -0
  486. package/build-module/navigable-container/container.js.map +1 -1
  487. package/build-module/navigation/back-button/index.js +1 -0
  488. package/build-module/navigation/back-button/index.js.map +1 -1
  489. package/build-module/navigation/group/index.js +1 -0
  490. package/build-module/navigation/group/index.js.map +1 -1
  491. package/build-module/navigation/index.js +6 -0
  492. package/build-module/navigation/index.js.map +1 -1
  493. package/build-module/navigation/item/index.js +1 -0
  494. package/build-module/navigation/item/index.js.map +1 -1
  495. package/build-module/navigation/menu/menu-title-search.js +1 -0
  496. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  497. package/build-module/navigation/menu/search-no-results-found.js +1 -0
  498. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  499. package/build-module/navigation/styles/navigation-styles.js +12 -12
  500. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  501. package/build-module/navigator/navigator/component.js +1 -0
  502. package/build-module/navigator/navigator/component.js.map +1 -1
  503. package/build-module/navigator/navigator-screen/component.js +1 -0
  504. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  505. package/build-module/navigator/utils/router.js +1 -0
  506. package/build-module/navigator/utils/router.js.map +1 -1
  507. package/build-module/notice/index.js +1 -0
  508. package/build-module/notice/index.js.map +1 -1
  509. package/build-module/notice/list.js +1 -0
  510. package/build-module/notice/list.js.map +1 -1
  511. package/build-module/notice/list.native.js +1 -0
  512. package/build-module/notice/list.native.js.map +1 -1
  513. package/build-module/number-control/index.js +1 -0
  514. package/build-module/number-control/index.js.map +1 -1
  515. package/build-module/palette-edit/index.js +2 -0
  516. package/build-module/palette-edit/index.js.map +1 -1
  517. package/build-module/panel/actions.native.js +1 -0
  518. package/build-module/panel/actions.native.js.map +1 -1
  519. package/build-module/private-apis.js +3 -1
  520. package/build-module/private-apis.js.map +1 -1
  521. package/build-module/query-controls/index.js +1 -0
  522. package/build-module/query-controls/index.js.map +1 -1
  523. package/build-module/query-controls/terms.js +1 -0
  524. package/build-module/query-controls/terms.js.map +1 -1
  525. package/build-module/radio-control/index.js +1 -0
  526. package/build-module/radio-control/index.js.map +1 -1
  527. package/build-module/radio-control/index.native.js +1 -0
  528. package/build-module/radio-control/index.native.js.map +1 -1
  529. package/build-module/radio-group/index.js +6 -0
  530. package/build-module/radio-group/index.js.map +1 -1
  531. package/build-module/radio-group/radio.js +1 -2
  532. package/build-module/radio-group/radio.js.map +1 -1
  533. package/build-module/range-control/rail.js +1 -0
  534. package/build-module/range-control/rail.js.map +1 -1
  535. package/build-module/range-control/styles/range-control-styles.js +28 -28
  536. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  537. package/build-module/resizable-box/index.js +1 -0
  538. package/build-module/resizable-box/index.js.map +1 -1
  539. package/build-module/sandbox/index.js +1 -0
  540. package/build-module/sandbox/index.js.map +1 -1
  541. package/build-module/sandbox/index.native.js +1 -0
  542. package/build-module/sandbox/index.native.js.map +1 -1
  543. package/build-module/search-control/index.native.js +1 -0
  544. package/build-module/search-control/index.native.js.map +1 -1
  545. package/build-module/select-control/index.js +10 -0
  546. package/build-module/select-control/index.js.map +1 -1
  547. package/build-module/select-control/types.js.map +1 -1
  548. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  549. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  550. package/build-module/slot-fill/context.js +5 -3
  551. package/build-module/slot-fill/context.js.map +1 -1
  552. package/build-module/slot-fill/fill.js +10 -15
  553. package/build-module/slot-fill/fill.js.map +1 -1
  554. package/build-module/slot-fill/provider.js +42 -55
  555. package/build-module/slot-fill/provider.js.map +1 -1
  556. package/build-module/slot-fill/slot.js +33 -24
  557. package/build-module/slot-fill/slot.js.map +1 -1
  558. package/build-module/slot-fill/types.js.map +1 -1
  559. package/build-module/snackbar/index.js +1 -0
  560. package/build-module/snackbar/index.js.map +1 -1
  561. package/build-module/snackbar/list.js +1 -0
  562. package/build-module/snackbar/list.js.map +1 -1
  563. package/build-module/tab-panel/index.js +2 -2
  564. package/build-module/tab-panel/index.js.map +1 -1
  565. package/build-module/tabs/index.js +22 -4
  566. package/build-module/tabs/index.js.map +1 -1
  567. package/build-module/tabs/types.js.map +1 -1
  568. package/build-module/text/hook.js +6 -6
  569. package/build-module/text/hook.js.map +1 -1
  570. package/build-module/text/styles.js +7 -7
  571. package/build-module/text/styles.js.map +1 -1
  572. package/build-module/text/utils.js +1 -0
  573. package/build-module/text/utils.js.map +1 -1
  574. package/build-module/theme/color-algorithms.js +1 -0
  575. package/build-module/theme/color-algorithms.js.map +1 -1
  576. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +1 -2
  577. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  578. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  579. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  580. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  581. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  582. package/build-module/toolbar/toolbar-group/index.js +1 -0
  583. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  584. package/build-module/tools-panel/tools-panel/hook.js +1 -0
  585. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  586. package/build-module/tools-panel/tools-panel-header/component.js +1 -0
  587. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  588. package/build-module/tooltip/index.js +1 -2
  589. package/build-module/tooltip/index.js.map +1 -1
  590. package/build-module/tree-grid/index.js +1 -0
  591. package/build-module/tree-grid/index.js.map +1 -1
  592. package/build-module/tree-select/index.js +11 -2
  593. package/build-module/tree-select/index.js.map +1 -1
  594. package/build-module/tree-select/types.js.map +1 -1
  595. package/build-module/unit-control/index.js +1 -0
  596. package/build-module/unit-control/index.js.map +1 -1
  597. package/build-module/unit-control/index.native.js +1 -0
  598. package/build-module/unit-control/index.native.js.map +1 -1
  599. package/build-module/unit-control/unit-select-control.js +1 -0
  600. package/build-module/unit-control/unit-select-control.js.map +1 -1
  601. package/build-module/unit-control/utils.js +1 -0
  602. package/build-module/unit-control/utils.js.map +1 -1
  603. package/build-module/utils/colors-values.js +3 -0
  604. package/build-module/utils/colors-values.js.map +1 -1
  605. package/build-module/utils/config-values.js +0 -1
  606. package/build-module/utils/config-values.js.map +1 -1
  607. package/build-module/utils/get-valid-children.js +1 -0
  608. package/build-module/utils/get-valid-children.js.map +1 -1
  609. package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
  610. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  611. package/build-module/utils/hooks/use-cx.js +1 -0
  612. package/build-module/utils/hooks/use-cx.js.map +1 -1
  613. package/build-module/utils/math.js +1 -0
  614. package/build-module/utils/math.js.map +1 -1
  615. package/build-module/utils/rtl.js +1 -0
  616. package/build-module/utils/rtl.js.map +1 -1
  617. package/build-module/utils/values.js +1 -0
  618. package/build-module/utils/values.js.map +1 -1
  619. package/build-module/z-stack/component.js +1 -0
  620. package/build-module/z-stack/component.js.map +1 -1
  621. package/build-style/style-rtl.css +60 -13
  622. package/build-style/style.css +60 -13
  623. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  624. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  625. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  626. package/build-types/animate/stories/index.story.d.ts +7 -7
  627. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  628. package/build-types/badge/index.d.ts +8 -0
  629. package/build-types/badge/index.d.ts.map +1 -0
  630. package/build-types/badge/stories/index.story.d.ts +17 -0
  631. package/build-types/badge/stories/index.story.d.ts.map +1 -0
  632. package/build-types/badge/test/index.d.ts +2 -0
  633. package/build-types/badge/test/index.d.ts.map +1 -0
  634. package/build-types/badge/types.d.ts +13 -0
  635. package/build-types/badge/types.d.ts.map +1 -0
  636. package/build-types/base-control/stories/index.story.d.ts +1 -1
  637. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  638. package/build-types/border-control/stories/index.story.d.ts +5 -5
  639. package/build-types/box-control/index.d.ts +1 -1
  640. package/build-types/box-control/index.d.ts.map +1 -1
  641. package/build-types/box-control/input-control.d.ts +3 -0
  642. package/build-types/box-control/input-control.d.ts.map +1 -0
  643. package/build-types/box-control/stories/index.story.d.ts +356 -11
  644. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  645. package/build-types/box-control/styles/box-control-styles.d.ts +2 -2
  646. package/build-types/box-control/types.d.ts +26 -1
  647. package/build-types/box-control/types.d.ts.map +1 -1
  648. package/build-types/box-control/utils.d.ts +49 -15
  649. package/build-types/box-control/utils.d.ts.map +1 -1
  650. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  651. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  652. package/build-types/button/stories/index.story.d.ts +25 -7
  653. package/build-types/button/stories/index.story.d.ts.map +1 -1
  654. package/build-types/button/types.d.ts +6 -4
  655. package/build-types/button/types.d.ts.map +1 -1
  656. package/build-types/button-group/index.d.ts +3 -1
  657. package/build-types/button-group/index.d.ts.map +1 -1
  658. package/build-types/button-group/stories/index.story.d.ts +6 -0
  659. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  660. package/build-types/button-group/types.d.ts +7 -0
  661. package/build-types/button-group/types.d.ts.map +1 -1
  662. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  663. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  664. package/build-types/color-palette/stories/index.story.d.ts +3 -3
  665. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  666. package/build-types/color-picker/styles.d.ts +2 -2
  667. package/build-types/color-picker/styles.d.ts.map +1 -1
  668. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  669. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  670. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  671. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  672. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  673. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  674. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  675. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  676. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  677. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  678. package/build-types/date-time/date/index.d.ts.map +1 -1
  679. package/build-types/date-time/stories/time.story.d.ts +1 -1
  680. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  681. package/build-types/date-time/time/styles.d.ts +4 -4
  682. package/build-types/dimension-control/index.d.ts.map +1 -1
  683. package/build-types/dimension-control/stories/index.story.d.ts +1 -1
  684. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  685. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  686. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  687. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  688. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  689. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  690. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  691. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  692. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  693. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  694. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  695. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  696. package/build-types/gradient-picker/stories/index.story.d.ts +3 -3
  697. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  698. package/build-types/guide/stories/index.story.d.ts +1 -1
  699. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  700. package/build-types/icon/stories/index.story.d.ts +4 -4
  701. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  702. package/build-types/input-control/index.d.ts +1 -0
  703. package/build-types/input-control/index.d.ts.map +1 -1
  704. package/build-types/input-control/stories/index.story.d.ts +7 -7
  705. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  706. package/build-types/input-control/types.d.ts +11 -2
  707. package/build-types/input-control/types.d.ts.map +1 -1
  708. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  709. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  710. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  711. package/build-types/menu/index.d.ts +10 -1
  712. package/build-types/menu/index.d.ts.map +1 -1
  713. package/build-types/menu/item.d.ts.map +1 -1
  714. package/build-types/menu/popover.d.ts +3 -0
  715. package/build-types/menu/popover.d.ts.map +1 -0
  716. package/build-types/menu/radio-item.d.ts.map +1 -1
  717. package/build-types/menu/stories/index.story.d.ts +9 -9
  718. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  719. package/build-types/menu/submenu-trigger-item.d.ts +3 -0
  720. package/build-types/menu/submenu-trigger-item.d.ts.map +1 -0
  721. package/build-types/menu/trigger-button.d.ts +3 -0
  722. package/build-types/menu/trigger-button.d.ts.map +1 -0
  723. package/build-types/menu/types.d.ts +208 -57
  724. package/build-types/menu/types.d.ts.map +1 -1
  725. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  726. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  727. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  728. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  729. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  730. package/build-types/navigation/index.d.ts.map +1 -1
  731. package/build-types/navigation/item/index.d.ts.map +1 -1
  732. package/build-types/navigation/stories/index.story.d.ts +6 -6
  733. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  734. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  735. package/build-types/notice/stories/index.story.d.ts +4 -4
  736. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  737. package/build-types/number-control/index.d.ts +1 -1
  738. package/build-types/number-control/index.d.ts.map +1 -1
  739. package/build-types/number-control/stories/index.story.d.ts +2 -2
  740. package/build-types/palette-edit/index.d.ts.map +1 -1
  741. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  742. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  743. package/build-types/private-apis.d.ts.map +1 -1
  744. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  745. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  746. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  747. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  748. package/build-types/radio-group/index.d.ts.map +1 -1
  749. package/build-types/radio-group/radio.d.ts.map +1 -1
  750. package/build-types/range-control/index.d.ts +1 -1
  751. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  752. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  753. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  754. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  755. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  756. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  757. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  758. package/build-types/search-control/stories/index.story.d.ts +1 -1
  759. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  760. package/build-types/select-control/index.d.ts +1 -0
  761. package/build-types/select-control/index.d.ts.map +1 -1
  762. package/build-types/select-control/stories/index.story.d.ts +5 -5
  763. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  764. package/build-types/select-control/types.d.ts +1 -1
  765. package/build-types/select-control/types.d.ts.map +1 -1
  766. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  767. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  768. package/build-types/slot-fill/context.d.ts.map +1 -1
  769. package/build-types/slot-fill/fill.d.ts.map +1 -1
  770. package/build-types/slot-fill/provider.d.ts.map +1 -1
  771. package/build-types/slot-fill/slot.d.ts.map +1 -1
  772. package/build-types/slot-fill/types.d.ts +13 -11
  773. package/build-types/slot-fill/types.d.ts.map +1 -1
  774. package/build-types/tab-panel/index.d.ts.map +1 -1
  775. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  776. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  777. package/build-types/tabs/index.d.ts +21 -4
  778. package/build-types/tabs/index.d.ts.map +1 -1
  779. package/build-types/tabs/stories/index.story.d.ts +10 -10
  780. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  781. package/build-types/tabs/types.d.ts +13 -13
  782. package/build-types/tabs/types.d.ts.map +1 -1
  783. package/build-types/text/stories/index.story.d.ts +3 -3
  784. package/build-types/theme/stories/index.story.d.ts +1 -1
  785. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  786. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  787. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  788. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  789. package/build-types/tooltip/index.d.ts.map +1 -1
  790. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  791. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  792. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  793. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  794. package/build-types/tree-select/index.d.ts +3 -2
  795. package/build-types/tree-select/index.d.ts.map +1 -1
  796. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  797. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  798. package/build-types/tree-select/types.d.ts +5 -1
  799. package/build-types/tree-select/types.d.ts.map +1 -1
  800. package/build-types/unit-control/index.d.ts +1 -1
  801. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  802. package/build-types/utils/colors-values.d.ts +3 -0
  803. package/build-types/utils/colors-values.d.ts.map +1 -1
  804. package/build-types/utils/config-values.d.ts +0 -1
  805. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  806. package/package.json +19 -19
  807. package/src/alignment-matrix-control/README.md +16 -15
  808. package/src/angle-picker-control/README.md +10 -9
  809. package/src/badge/README.md +24 -0
  810. package/src/badge/docs-manifest.json +5 -0
  811. package/src/badge/index.tsx +67 -0
  812. package/src/badge/stories/index.story.tsx +54 -0
  813. package/src/badge/styles.scss +49 -0
  814. package/src/badge/test/index.tsx +45 -0
  815. package/src/badge/types.ts +12 -0
  816. package/src/base-control/README.md +22 -21
  817. package/src/box-control/README.md +41 -24
  818. package/src/box-control/index.tsx +28 -14
  819. package/src/box-control/input-control.tsx +299 -0
  820. package/src/box-control/stories/index.story.tsx +12 -0
  821. package/src/box-control/types.ts +27 -1
  822. package/src/box-control/utils.ts +122 -60
  823. package/src/button/README.md +110 -220
  824. package/src/button/docs-manifest.json +5 -0
  825. package/src/button/stories/best-practices.mdx +31 -0
  826. package/src/button/stories/index.story.tsx +18 -0
  827. package/src/button/style.scss +9 -10
  828. package/src/button/test/index.tsx +9 -2
  829. package/src/button/types.ts +6 -4
  830. package/src/button-group/README.md +4 -0
  831. package/src/button-group/index.tsx +11 -1
  832. package/src/button-group/stories/index.story.tsx +8 -1
  833. package/src/button-group/types.ts +7 -0
  834. package/src/custom-select-control/index.tsx +1 -1
  835. package/src/custom-select-control-v2/custom-select.tsx +1 -2
  836. package/src/custom-select-control-v2/stories/index.story.tsx +4 -0
  837. package/src/date-time/date/index.tsx +1 -0
  838. package/src/dimension-control/index.tsx +1 -0
  839. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -4
  840. package/src/disabled/stories/index.story.tsx +1 -0
  841. package/src/drop-zone/stories/index.story.tsx +7 -1
  842. package/src/font-size-picker/styles.ts +1 -0
  843. package/src/form-file-upload/README.md +22 -21
  844. package/src/gradient-picker/README.md +36 -35
  845. package/src/heading/hook.ts +1 -1
  846. package/src/heading/test/__snapshots__/index.tsx.snap +4 -4
  847. package/src/icon/README.md +9 -8
  848. package/src/input-control/README.md +1 -0
  849. package/src/input-control/index.tsx +10 -0
  850. package/src/input-control/stories/index.story.tsx +6 -1
  851. package/src/input-control/test/index.js +9 -3
  852. package/src/input-control/types.ts +11 -2
  853. package/src/menu/checkbox-item.tsx +2 -1
  854. package/src/menu/index.tsx +61 -165
  855. package/src/menu/item.tsx +17 -2
  856. package/src/menu/popover.tsx +103 -0
  857. package/src/menu/radio-item.tsx +2 -1
  858. package/src/menu/stories/index.story.tsx +533 -381
  859. package/src/menu/styles.ts +1 -1
  860. package/src/menu/submenu-trigger-item.tsx +61 -0
  861. package/src/menu/test/index.tsx +266 -182
  862. package/src/menu/trigger-button.tsx +46 -0
  863. package/src/menu/types.ts +210 -63
  864. package/src/modal/stories/index.story.tsx +4 -1
  865. package/src/navigation/back-button/index.tsx +1 -0
  866. package/src/navigation/index.tsx +7 -0
  867. package/src/navigation/item/index.tsx +2 -0
  868. package/src/navigation/styles/navigation-styles.tsx +3 -2
  869. package/src/navigation/test/index.tsx +4 -0
  870. package/src/navigator/test/index.tsx +4 -0
  871. package/src/number-control/index.tsx +1 -0
  872. package/src/palette-edit/index.tsx +1 -0
  873. package/src/panel/stories/index.story.tsx +3 -3
  874. package/src/private-apis.ts +2 -0
  875. package/src/radio-group/index.tsx +12 -1
  876. package/src/radio-group/radio.tsx +1 -2
  877. package/src/range-control/styles/range-control-styles.ts +8 -4
  878. package/src/select-control/README.md +3 -0
  879. package/src/select-control/index.tsx +10 -0
  880. package/src/select-control/stories/index.story.tsx +2 -0
  881. package/src/select-control/test/select-control.tsx +7 -1
  882. package/src/select-control/types.ts +1 -0
  883. package/src/slot-fill/context.ts +5 -3
  884. package/src/slot-fill/fill.ts +10 -15
  885. package/src/slot-fill/provider.tsx +63 -64
  886. package/src/slot-fill/slot.tsx +40 -27
  887. package/src/slot-fill/types.ts +23 -11
  888. package/src/style.scss +1 -0
  889. package/src/tab-panel/index.tsx +1 -2
  890. package/src/tab-panel/stories/index.story.tsx +4 -0
  891. package/src/tabs/README.md +151 -187
  892. package/src/tabs/docs-manifest.json +22 -0
  893. package/src/tabs/index.tsx +21 -4
  894. package/src/tabs/stories/best-practices.mdx +99 -0
  895. package/src/tabs/stories/index.story.tsx +5 -0
  896. package/src/tabs/types.ts +13 -14
  897. package/src/text/hook.ts +2 -2
  898. package/src/text/styles.ts +1 -1
  899. package/src/text/test/__snapshots__/index.tsx.snap +3 -3
  900. package/src/text/test/index.tsx +1 -1
  901. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +24 -24
  902. package/src/toggle-group-control/test/index.tsx +7 -1
  903. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -2
  904. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  905. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
  906. package/src/tooltip/index.tsx +1 -2
  907. package/src/tree-grid/stories/index.story.tsx +2 -0
  908. package/src/tree-select/README.md +144 -28
  909. package/src/tree-select/docs-manifest.json +5 -0
  910. package/src/tree-select/index.tsx +11 -2
  911. package/src/tree-select/stories/index.story.tsx +1 -0
  912. package/src/tree-select/types.ts +8 -1
  913. package/src/utils/colors-values.js +3 -0
  914. package/src/utils/config-values.js +0 -1
  915. package/tsconfig.json +0 -3
  916. package/tsconfig.tsbuildinfo +1 -1
  917. package/build/box-control/all-input-control.js +0 -91
  918. package/build/box-control/all-input-control.js.map +0 -1
  919. package/build/box-control/axial-input-controls.js +0 -125
  920. package/build/box-control/axial-input-controls.js.map +0 -1
  921. package/build/box-control/input-controls.js +0 -133
  922. package/build/box-control/input-controls.js.map +0 -1
  923. package/build/slot-fill/use-slot.js +0 -32
  924. package/build/slot-fill/use-slot.js.map +0 -1
  925. package/build-module/box-control/all-input-control.js +0 -84
  926. package/build-module/box-control/all-input-control.js.map +0 -1
  927. package/build-module/box-control/axial-input-controls.js +0 -116
  928. package/build-module/box-control/axial-input-controls.js.map +0 -1
  929. package/build-module/box-control/input-controls.js +0 -124
  930. package/build-module/box-control/input-controls.js.map +0 -1
  931. package/build-module/slot-fill/use-slot.js +0 -24
  932. package/build-module/slot-fill/use-slot.js.map +0 -1
  933. package/build-types/box-control/all-input-control.d.ts +0 -3
  934. package/build-types/box-control/all-input-control.d.ts.map +0 -1
  935. package/build-types/box-control/axial-input-controls.d.ts +0 -3
  936. package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
  937. package/build-types/box-control/input-controls.d.ts +0 -3
  938. package/build-types/box-control/input-controls.d.ts.map +0 -1
  939. package/build-types/slot-fill/use-slot.d.ts +0 -10
  940. package/build-types/slot-fill/use-slot.d.ts.map +0 -1
  941. package/src/box-control/all-input-control.tsx +0 -110
  942. package/src/box-control/axial-input-controls.tsx +0 -165
  943. package/src/box-control/input-controls.tsx +0 -167
  944. package/src/slot-fill/use-slot.ts +0 -27
@@ -1 +1 @@
1
- {"version":3,"names":["Component","addAction","applyFilters","removeAction","createHigherOrderComponent","debounce","jsx","_jsx","ANIMATION_FRAME_PERIOD","withFilters","hookName","OriginalComponent","namespace","FilteredComponent","ensureFilteredComponent","undefined","FilteredComponentRenderer","constructor","props","componentDidMount","instances","push","length","onHooksUpdated","componentWillUnmount","filter","instance","render","throttledForceUpdate","forEach","forceUpdate","updatedHookName"],"sources":["@wordpress/components/src/higher-order/with-filters/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { addAction, applyFilters, removeAction } from '@wordpress/hooks';\nimport { createHigherOrderComponent, debounce } from '@wordpress/compose';\n\nconst ANIMATION_FRAME_PERIOD = 16;\n\n/**\n * Creates a higher-order component which adds filtering capability to the\n * wrapped component. Filters get applied when the original component is about\n * to be mounted. When a filter is added or removed that matches the hook name,\n * the wrapped component re-renders.\n *\n * @param hookName Hook name exposed to be used by filters.\n *\n * @return Higher-order component factory.\n *\n * ```jsx\n * import { withFilters } from '@wordpress/components';\n * import { addFilter } from '@wordpress/hooks';\n *\n * const MyComponent = ( { title } ) => <h1>{ title }</h1>;\n *\n * const ComponentToAppend = () => <div>Appended component</div>;\n *\n * function withComponentAppended( FilteredComponent ) {\n * \treturn ( props ) => (\n * \t\t<>\n * \t\t\t<FilteredComponent { ...props } />\n * \t\t\t<ComponentToAppend />\n * \t\t</>\n * \t);\n * }\n *\n * addFilter(\n * \t'MyHookName',\n * \t'my-plugin/with-component-appended',\n * \twithComponentAppended\n * );\n *\n * const MyComponentWithFilters = withFilters( 'MyHookName' )( MyComponent );\n * ```\n */\nexport default function withFilters( hookName: string ) {\n\treturn createHigherOrderComponent( ( OriginalComponent ) => {\n\t\tconst namespace = 'core/with-filters/' + hookName;\n\n\t\t/**\n\t\t * The component definition with current filters applied. Each instance\n\t\t * reuse this shared reference as an optimization to avoid excessive\n\t\t * calls to `applyFilters` when many instances exist.\n\t\t */\n\t\tlet FilteredComponent: React.ComponentType;\n\n\t\t/**\n\t\t * Initializes the FilteredComponent variable once, if not already\n\t\t * assigned. Subsequent calls are effectively a noop.\n\t\t */\n\t\tfunction ensureFilteredComponent() {\n\t\t\tif ( FilteredComponent === undefined ) {\n\t\t\t\tFilteredComponent = applyFilters(\n\t\t\t\t\thookName,\n\t\t\t\t\tOriginalComponent\n\t\t\t\t) as React.ComponentType;\n\t\t\t}\n\t\t}\n\n\t\tclass FilteredComponentRenderer extends Component {\n\t\t\tstatic instances: FilteredComponentRenderer[];\n\n\t\t\tconstructor( props: { [ key: string ]: any } ) {\n\t\t\t\tsuper( props );\n\n\t\t\t\tensureFilteredComponent();\n\t\t\t}\n\n\t\t\tcomponentDidMount() {\n\t\t\t\tFilteredComponentRenderer.instances.push( this );\n\n\t\t\t\t// If there were previously no mounted instances for components\n\t\t\t\t// filtered on this hook, add the hook handler.\n\t\t\t\tif ( FilteredComponentRenderer.instances.length === 1 ) {\n\t\t\t\t\taddAction( 'hookRemoved', namespace, onHooksUpdated );\n\t\t\t\t\taddAction( 'hookAdded', namespace, onHooksUpdated );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcomponentWillUnmount() {\n\t\t\t\tFilteredComponentRenderer.instances =\n\t\t\t\t\tFilteredComponentRenderer.instances.filter(\n\t\t\t\t\t\t( instance ) => instance !== this\n\t\t\t\t\t);\n\n\t\t\t\t// If this was the last of the mounted components filtered on\n\t\t\t\t// this hook, remove the hook handler.\n\t\t\t\tif ( FilteredComponentRenderer.instances.length === 0 ) {\n\t\t\t\t\tremoveAction( 'hookRemoved', namespace );\n\t\t\t\t\tremoveAction( 'hookAdded', namespace );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trender() {\n\t\t\t\treturn <FilteredComponent { ...this.props } />;\n\t\t\t}\n\t\t}\n\n\t\tFilteredComponentRenderer.instances = [];\n\n\t\t/**\n\t\t * Updates the FilteredComponent definition, forcing a render for each\n\t\t * mounted instance. This occurs a maximum of once per animation frame.\n\t\t */\n\t\tconst throttledForceUpdate = debounce( () => {\n\t\t\t// Recreate the filtered component, only after delay so that it's\n\t\t\t// computed once, even if many filters added.\n\t\t\tFilteredComponent = applyFilters(\n\t\t\t\thookName,\n\t\t\t\tOriginalComponent\n\t\t\t) as React.ComponentType;\n\n\t\t\t// Force each instance to render.\n\t\t\tFilteredComponentRenderer.instances.forEach( ( instance ) => {\n\t\t\t\tinstance.forceUpdate();\n\t\t\t} );\n\t\t}, ANIMATION_FRAME_PERIOD );\n\n\t\t/**\n\t\t * When a filter is added or removed for the matching hook name, each\n\t\t * mounted instance should re-render with the new filters having been\n\t\t * applied to the original component.\n\t\t *\n\t\t * @param updatedHookName Name of the hook that was updated.\n\t\t */\n\t\tfunction onHooksUpdated( updatedHookName: string ) {\n\t\t\tif ( updatedHookName === hookName ) {\n\t\t\t\tthrottledForceUpdate();\n\t\t\t}\n\t\t}\n\n\t\treturn FilteredComponentRenderer;\n\t}, 'withFilters' );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,YAAY,EAAEC,YAAY,QAAQ,kBAAkB;AACxE,SAASC,0BAA0B,EAAEC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1E,MAAMC,sBAAsB,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAEC,QAAgB,EAAG;EACvD,OAAON,0BAA0B,CAAIO,iBAAiB,IAAM;IAC3D,MAAMC,SAAS,GAAG,oBAAoB,GAAGF,QAAQ;;IAEjD;AACF;AACA;AACA;AACA;IACE,IAAIG,iBAAsC;;IAE1C;AACF;AACA;AACA;IACE,SAASC,uBAAuBA,CAAA,EAAG;MAClC,IAAKD,iBAAiB,KAAKE,SAAS,EAAG;QACtCF,iBAAiB,GAAG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,CAAC;IACJ,CAAC,EAAEtB,sBAAuB,CAAC;;IAE3B;AACF;AACA;AACA;AACA;AACA;AACA;IACE,SAASe,cAAcA,CAAEQ,eAAuB,EAAG;MAClD,IAAKA,eAAe,KAAKrB,QAAQ,EAAG;QACnCkB,oBAAoB,CAAC,CAAC;MACvB;IACD;IAEA,OAAOZ,yBAAyB;EACjC,CAAC,EAAE,aAAc,CAAC;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["Component","addAction","applyFilters","removeAction","createHigherOrderComponent","debounce","jsx","_jsx","ANIMATION_FRAME_PERIOD","withFilters","hookName","OriginalComponent","namespace","FilteredComponent","ensureFilteredComponent","undefined","FilteredComponentRenderer","constructor","props","componentDidMount","instances","push","length","onHooksUpdated","componentWillUnmount","filter","instance","render","throttledForceUpdate","forEach","forceUpdate","updatedHookName"],"sources":["@wordpress/components/src/higher-order/with-filters/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { addAction, applyFilters, removeAction } from '@wordpress/hooks';\nimport { createHigherOrderComponent, debounce } from '@wordpress/compose';\n\nconst ANIMATION_FRAME_PERIOD = 16;\n\n/**\n * Creates a higher-order component which adds filtering capability to the\n * wrapped component. Filters get applied when the original component is about\n * to be mounted. When a filter is added or removed that matches the hook name,\n * the wrapped component re-renders.\n *\n * @param hookName Hook name exposed to be used by filters.\n *\n * @return Higher-order component factory.\n *\n * ```jsx\n * import { withFilters } from '@wordpress/components';\n * import { addFilter } from '@wordpress/hooks';\n *\n * const MyComponent = ( { title } ) => <h1>{ title }</h1>;\n *\n * const ComponentToAppend = () => <div>Appended component</div>;\n *\n * function withComponentAppended( FilteredComponent ) {\n * \treturn ( props ) => (\n * \t\t<>\n * \t\t\t<FilteredComponent { ...props } />\n * \t\t\t<ComponentToAppend />\n * \t\t</>\n * \t);\n * }\n *\n * addFilter(\n * \t'MyHookName',\n * \t'my-plugin/with-component-appended',\n * \twithComponentAppended\n * );\n *\n * const MyComponentWithFilters = withFilters( 'MyHookName' )( MyComponent );\n * ```\n */\nexport default function withFilters( hookName: string ) {\n\treturn createHigherOrderComponent( ( OriginalComponent ) => {\n\t\tconst namespace = 'core/with-filters/' + hookName;\n\n\t\t/**\n\t\t * The component definition with current filters applied. Each instance\n\t\t * reuse this shared reference as an optimization to avoid excessive\n\t\t * calls to `applyFilters` when many instances exist.\n\t\t */\n\t\tlet FilteredComponent: React.ComponentType;\n\n\t\t/**\n\t\t * Initializes the FilteredComponent variable once, if not already\n\t\t * assigned. Subsequent calls are effectively a noop.\n\t\t */\n\t\tfunction ensureFilteredComponent() {\n\t\t\tif ( FilteredComponent === undefined ) {\n\t\t\t\tFilteredComponent = applyFilters(\n\t\t\t\t\thookName,\n\t\t\t\t\tOriginalComponent\n\t\t\t\t) as React.ComponentType;\n\t\t\t}\n\t\t}\n\n\t\tclass FilteredComponentRenderer extends Component {\n\t\t\tstatic instances: FilteredComponentRenderer[];\n\n\t\t\tconstructor( props: { [ key: string ]: any } ) {\n\t\t\t\tsuper( props );\n\n\t\t\t\tensureFilteredComponent();\n\t\t\t}\n\n\t\t\tcomponentDidMount() {\n\t\t\t\tFilteredComponentRenderer.instances.push( this );\n\n\t\t\t\t// If there were previously no mounted instances for components\n\t\t\t\t// filtered on this hook, add the hook handler.\n\t\t\t\tif ( FilteredComponentRenderer.instances.length === 1 ) {\n\t\t\t\t\taddAction( 'hookRemoved', namespace, onHooksUpdated );\n\t\t\t\t\taddAction( 'hookAdded', namespace, onHooksUpdated );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcomponentWillUnmount() {\n\t\t\t\tFilteredComponentRenderer.instances =\n\t\t\t\t\tFilteredComponentRenderer.instances.filter(\n\t\t\t\t\t\t( instance ) => instance !== this\n\t\t\t\t\t);\n\n\t\t\t\t// If this was the last of the mounted components filtered on\n\t\t\t\t// this hook, remove the hook handler.\n\t\t\t\tif ( FilteredComponentRenderer.instances.length === 0 ) {\n\t\t\t\t\tremoveAction( 'hookRemoved', namespace );\n\t\t\t\t\tremoveAction( 'hookAdded', namespace );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trender() {\n\t\t\t\treturn <FilteredComponent { ...this.props } />;\n\t\t\t}\n\t\t}\n\n\t\tFilteredComponentRenderer.instances = [];\n\n\t\t/**\n\t\t * Updates the FilteredComponent definition, forcing a render for each\n\t\t * mounted instance. This occurs a maximum of once per animation frame.\n\t\t */\n\t\tconst throttledForceUpdate = debounce( () => {\n\t\t\t// Recreate the filtered component, only after delay so that it's\n\t\t\t// computed once, even if many filters added.\n\t\t\tFilteredComponent = applyFilters(\n\t\t\t\thookName,\n\t\t\t\tOriginalComponent\n\t\t\t) as React.ComponentType;\n\n\t\t\t// Force each instance to render.\n\t\t\tFilteredComponentRenderer.instances.forEach( ( instance ) => {\n\t\t\t\tinstance.forceUpdate();\n\t\t\t} );\n\t\t}, ANIMATION_FRAME_PERIOD );\n\n\t\t/**\n\t\t * When a filter is added or removed for the matching hook name, each\n\t\t * mounted instance should re-render with the new filters having been\n\t\t * applied to the original component.\n\t\t *\n\t\t * @param updatedHookName Name of the hook that was updated.\n\t\t */\n\t\tfunction onHooksUpdated( updatedHookName: string ) {\n\t\t\tif ( updatedHookName === hookName ) {\n\t\t\t\tthrottledForceUpdate();\n\t\t\t}\n\t\t}\n\n\t\treturn FilteredComponentRenderer;\n\t}, 'withFilters' );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,YAAY,EAAEC,YAAY,QAAQ,kBAAkB;AACxE,SAASC,0BAA0B,EAAEC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1E,MAAMC,sBAAsB,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AK,CAAI,CAAC;MAC/C;IACD;IAEAF,yBAAyB,CAACI,SAAS,GAAG,EAAE;;IAExC;AACF;AACA;AACA;IACE,MAAMQ,oBAAoB,GAAGvB,QAAQ,CAAE,MAAM;MAC5C;MACA;MACAQ,iBAAiB,GAAGX,YAAY,CAC/BQ,QAAQ,EACRC,iBACD,CAAwB;;MAExB;MACAK,yBAAyB,CAACI,SAAS,CAACS,OAAO,CAAIH,QAAQ,IAAM;QAC5DA,QAAQ,CAACI,WAAW,CAAC,CAAC;MACvB,CAAE,CAAC;IACJ,CAAC,EAAEtB,sBAAuB,CAAC;;IAE3B;AACF;AACA;AACA;AACA;AACA;AACA;IACE,SAASe,cAAcA,CAAEQ,eAAuB,EAAG;MAClD,IAAKA,eAAe,KAAKrB,QAAQ,EAAG;QACnCkB,oBAAoB,CAAC,CAAC;MACvB;IACD;IAEA,OAAOZ,yBAAyB;EACjC,CAAC,EAAE,aAAc,CAAC;AACnB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["v4","uuid","forwardRef","useState","useMemo","createHigherOrderComponent","NoticeList","jsx","_jsx","OriginalComponent","Component","props","ref","noticeList","setNoticeList","noticeOperations","createNotice","notice","noticeToAdd","id","current","createErrorNotice","msg","status","content","removeNotice","filter","removeAllNotices","propsOut","noticeUI","length","className","notices","onRemove","isForwardRef","render"],"sources":["@wordpress/components/src/higher-order/with-notices/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState, useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NoticeList from '../../notice/list';\nimport type { WithNoticeProps } from './types';\n\n/**\n * Override the default edit UI to include notices if supported.\n *\n * Wrapping the original component with `withNotices` encapsulates the component\n * with the additional props `noticeOperations` and `noticeUI`.\n *\n * ```jsx\n * import { withNotices, Button } from '@wordpress/components';\n *\n * const MyComponentWithNotices = withNotices(\n * \t( { noticeOperations, noticeUI } ) => {\n * \t\tconst addError = () =>\n * \t\t\tnoticeOperations.createErrorNotice( 'Error message' );\n * \t\treturn (\n * \t\t\t<div>\n * \t\t\t\t{ noticeUI }\n * \t\t\t\t<Button variant=\"secondary\" onClick={ addError }>\n * \t\t\t\t\tAdd error\n * \t\t\t\t</Button>\n * \t\t\t</div>\n * \t\t);\n * \t}\n * );\n * ```\n *\n * @param OriginalComponent Original component.\n *\n * @return Wrapped component.\n */\nexport default createHigherOrderComponent( ( OriginalComponent ) => {\n\tfunction Component(\n\t\tprops: { [ key: string ]: any },\n\t\tref: React.ForwardedRef< any >\n\t) {\n\t\tconst [ noticeList, setNoticeList ] = useState<\n\t\t\tWithNoticeProps[ 'noticeList' ]\n\t\t>( [] );\n\n\t\tconst noticeOperations = useMemo<\n\t\t\tWithNoticeProps[ 'noticeOperations' ]\n\t\t>( () => {\n\t\t\tconst createNotice: WithNoticeProps[ 'noticeOperations' ][ 'createNotice' ] =\n\t\t\t\t( notice ) => {\n\t\t\t\t\tconst noticeToAdd = notice.id\n\t\t\t\t\t\t? notice\n\t\t\t\t\t\t: { ...notice, id: uuid() };\n\t\t\t\t\tsetNoticeList( ( current ) => [ ...current, noticeToAdd ] );\n\t\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tcreateNotice,\n\t\t\t\tcreateErrorNotice: ( msg ) => {\n\t\t\t\t\t// @ts-expect-error TODO: Missing `id`, potentially a bug\n\t\t\t\t\tcreateNotice( {\n\t\t\t\t\t\tstatus: 'error',\n\t\t\t\t\t\tcontent: msg,\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tremoveNotice: ( id ) => {\n\t\t\t\t\tsetNoticeList( ( current ) =>\n\t\t\t\t\t\tcurrent.filter( ( notice ) => notice.id !== id )\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tremoveAllNotices: () => {\n\t\t\t\t\tsetNoticeList( [] );\n\t\t\t\t},\n\t\t\t};\n\t\t}, [] );\n\n\t\tconst propsOut = {\n\t\t\t...props,\n\t\t\tnoticeList,\n\t\t\tnoticeOperations,\n\t\t\tnoticeUI: noticeList.length > 0 && (\n\t\t\t\t<NoticeList\n\t\t\t\t\tclassName=\"components-with-notices-ui\"\n\t\t\t\t\tnotices={ noticeList }\n\t\t\t\t\tonRemove={ noticeOperations.removeNotice }\n\t\t\t\t/>\n\t\t\t),\n\t\t};\n\n\t\treturn isForwardRef ? (\n\t\t\t<OriginalComponent { ...propsOut } ref={ ref } />\n\t\t) : (\n\t\t\t<OriginalComponent { ...propsOut } />\n\t\t);\n\t}\n\n\tlet isForwardRef: boolean;\n\t// @ts-expect-error - `render` will only be present when OriginalComponent was wrapped with forwardRef().\n\tconst { render } = OriginalComponent;\n\t// Returns a forwardRef if OriginalComponent appears to be a forwardRef.\n\tif ( typeof render === 'function' ) {\n\t\tisForwardRef = true;\n\t\treturn forwardRef( Component );\n\t}\n\treturn Component;\n}, 'withNotices' );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,IAAIC,IAAI,QAAQ,MAAM;;AAEjC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AAClE,SAASC,0BAA0B,QAAQ,oBAAoB;;AAE/D;AACA;AACA;AACA,OAAOC,UAAU,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeH,0BAA0B,CAAII,iBAAiB,IAAM;EACnE,SAASC,SAASA,CACjBC,KAA+B,EAC/BC,GAA8B,EAC7B;IACD,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGX,Q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ACzB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAG1B,iBAAiB;EACpC;EACA,IAAK,OAAO0B,MAAM,KAAK,UAAU,EAAG;IACnCD,YAAY,GAAG,IAAI;IACnB,OAAOhC,UAAU,CAAEQ,SAAU,CAAC;EAC/B;EACA,OAAOA,SAAS;AACjB,CAAC,EAAE,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["v4","uuid","forwardRef","useState","useMemo","createHigherOrderComponent","NoticeList","jsx","_jsx","OriginalComponent","Component","props","ref","noticeList","setNoticeList","noticeOperations","createNotice","notice","noticeToAdd","id","current","createErrorNotice","msg","status","content","removeNotice","filter","removeAllNotices","propsOut","noticeUI","length","className","notices","onRemove","isForwardRef","render"],"sources":["@wordpress/components/src/higher-order/with-notices/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuid } from 'uuid';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState, useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NoticeList from '../../notice/list';\nimport type { WithNoticeProps } from './types';\n\n/**\n * Override the default edit UI to include notices if supported.\n *\n * Wrapping the original component with `withNotices` encapsulates the component\n * with the additional props `noticeOperations` and `noticeUI`.\n *\n * ```jsx\n * import { withNotices, Button } from '@wordpress/components';\n *\n * const MyComponentWithNotices = withNotices(\n * \t( { noticeOperations, noticeUI } ) => {\n * \t\tconst addError = () =>\n * \t\t\tnoticeOperations.createErrorNotice( 'Error message' );\n * \t\treturn (\n * \t\t\t<div>\n * \t\t\t\t{ noticeUI }\n * \t\t\t\t<Button variant=\"secondary\" onClick={ addError }>\n * \t\t\t\t\tAdd error\n * \t\t\t\t</Button>\n * \t\t\t</div>\n * \t\t);\n * \t}\n * );\n * ```\n *\n * @param OriginalComponent Original component.\n *\n * @return Wrapped component.\n */\nexport default createHigherOrderComponent( ( OriginalComponent ) => {\n\tfunction Component(\n\t\tprops: { [ key: string ]: any },\n\t\tref: React.ForwardedRef< any >\n\t) {\n\t\tconst [ noticeList, setNoticeList ] = useState<\n\t\t\tWithNoticeProps[ 'noticeList' ]\n\t\t>( [] );\n\n\t\tconst noticeOperations = useMemo<\n\t\t\tWithNoticeProps[ 'noticeOperations' ]\n\t\t>( () => {\n\t\t\tconst createNotice: WithNoticeProps[ 'noticeOperations' ][ 'createNotice' ] =\n\t\t\t\t( notice ) => {\n\t\t\t\t\tconst noticeToAdd = notice.id\n\t\t\t\t\t\t? notice\n\t\t\t\t\t\t: { ...notice, id: uuid() };\n\t\t\t\t\tsetNoticeList( ( current ) => [ ...current, noticeToAdd ] );\n\t\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tcreateNotice,\n\t\t\t\tcreateErrorNotice: ( msg ) => {\n\t\t\t\t\t// @ts-expect-error TODO: Missing `id`, potentially a bug\n\t\t\t\t\tcreateNotice( {\n\t\t\t\t\t\tstatus: 'error',\n\t\t\t\t\t\tcontent: msg,\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t\tremoveNotice: ( id ) => {\n\t\t\t\t\tsetNoticeList( ( current ) =>\n\t\t\t\t\t\tcurrent.filter( ( notice ) => notice.id !== id )\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tremoveAllNotices: () => {\n\t\t\t\t\tsetNoticeList( [] );\n\t\t\t\t},\n\t\t\t};\n\t\t}, [] );\n\n\t\tconst propsOut = {\n\t\t\t...props,\n\t\t\tnoticeList,\n\t\t\tnoticeOperations,\n\t\t\tnoticeUI: noticeList.length > 0 && (\n\t\t\t\t<NoticeList\n\t\t\t\t\tclassName=\"components-with-notices-ui\"\n\t\t\t\t\tnotices={ noticeList }\n\t\t\t\t\tonRemove={ noticeOperations.removeNotice }\n\t\t\t\t/>\n\t\t\t),\n\t\t};\n\n\t\treturn isForwardRef ? (\n\t\t\t<OriginalComponent { ...propsOut } ref={ ref } />\n\t\t) : (\n\t\t\t<OriginalComponent { ...propsOut } />\n\t\t);\n\t}\n\n\tlet isForwardRef: boolean;\n\t// @ts-expect-error - `render` will only be present when OriginalComponent was wrapped with forwardRef().\n\tconst { render } = OriginalComponent;\n\t// Returns a forwardRef if OriginalComponent appears to be a forwardRef.\n\tif ( typeof render === 'function' ) {\n\t\tisForwardRef = true;\n\t\treturn forwardRef( Component );\n\t}\n\treturn Component;\n}, 'withNotices' );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,IAAIC,IAAI,QAAQ,MAAM;;AAEjC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AAClE,SAASC,0BAA0B,QAAQ,oBAAoB;;AAE/D;AACA;AACA;AACA,OAAOC,UAAU,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeH,0BAA0B,CAAII,iBAAiB,IAAM;EACnE,SAASC,SAASA,CACjBC,KAA+B,EAC/BC,GAA8B,EAC7B;IACD,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGX,QAAQ,CAE3C,EAAG,CAAC;IAEP,MAAMY,gBAAgB,GAAGX,OAAO,CAE7B,MAAM;MACR,MAAMY,YAAqE,GACxEC,MAAM,IAAM;QACb,MAAMC,WAAW,GAAGD,MAAM,CAACE,EAAE,GAC1BF,MAAM,GACN;UAAE,GAAGA,MAAM;UAAEE,EAAE,EAAElB,IAAI,CAAC;QAAE,CAAC;QAC5Ba,aAAa,CAAIM,OAAO,IAAM,CAAE,GAAGA,OAAO,EAAEF,WAAW,CAAG,CAAC;MAC5D,CAAC;MAEF,OAAO;QACNF,YAAY;QACZK,iBAAiB,EAAIC,GAAG,IAAM;UAC7B;UACAN,YAAY,CAAE;YACbO,MAAM,EAAE,OAAO;YACfC,OAAO,EAAEF;UACV,CAAE,CAAC;QACJ,CAAC;QACDG,YAAY,EAAIN,EAAE,IAAM;UACvBL,aAAa,CAAIM,OAAO,IACvBA,OAAO,CAACM,MAAM,CAAIT,MAAM,IAAMA,MAAM,CAACE,EAAE,KAAKA,EAAG,CAChD,CAAC;QACF,CAAC;QACDQ,gBAAgB,EAAEA,CAAA,KAAM;UACvBb,aAAa,CAAE,EAAG,CAAC;QACpB;MACD,CAAC;IACF,CAAC,EAAE,EAAG,CAAC;IAEP,MAAMc,QAAQ,GAAG;MAChB,GAAGjB,KAAK;MACRE,UAAU;MACVE,gBAAgB;MAChBc,QAAQ,EAAEhB,UAAU,CAACiB,MAAM,GAAG,CAAC,iBAC9BtB,IAAA,CAACF,UAAU;QACVyB,SAAS,EAAC,4BAA4B;QACtCC,OAAO,EAAGnB,UAAY;QACtBoB,QAAQ,EAAGlB,gBAAgB,CAACU;MAAc,CAC1C;IAEH,CAAC;IAED,OAAOS,YAAY,gBAClB1B,IAAA,CAACC,iBAAiB;MAAA,GAAMmB,QAAQ;MAAGhB,GAAG,EAAGA;IAAK,CAAE,CAAC,gBAEjDJ,IAAA,CAACC,iBAAiB;MAAA,GAAMmB;IAAQ,CAAI,CACpC;EACF;EAEA,IAAIM,YAAqB;EACzB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAG1B,iBAAiB;EACpC;EACA,IAAK,OAAO0B,MAAM,KAAK,UAAU,EAAG;IACnCD,YAAY,GAAG,IAAI;IACnB,OAAOhC,UAAU,CAAEQ,SAAU,CAAC;EAC/B;EACA,OAAOA,SAAS;AACjB,CAAC,EAAE,aAAc,CAAC","ignoreList":[]}
@@ -17,6 +17,7 @@ import { space } from '../utils/space';
17
17
  import { useDraft } from './utils';
18
18
  import BaseControl from '../base-control';
19
19
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
20
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const noop = () => {};
22
23
  function useUniqueId(idProp) {
@@ -27,6 +28,7 @@ function useUniqueId(idProp) {
27
28
  export function UnforwardedInputControl(props, ref) {
28
29
  const {
29
30
  __next40pxDefaultSize,
31
+ __shouldNotWarnDeprecated36pxSize,
30
32
  __unstableStateReducer: stateReducer = state => state,
31
33
  __unstableInputWidth,
32
34
  className,
@@ -57,6 +59,12 @@ export function UnforwardedInputControl(props, ref) {
57
59
  const helpProp = !!help ? {
58
60
  'aria-describedby': `${id}__help`
59
61
  } : {};
62
+ maybeWarnDeprecated36pxSize({
63
+ componentName: 'InputControl',
64
+ __next40pxDefaultSize,
65
+ size,
66
+ __shouldNotWarnDeprecated36pxSize
67
+ });
60
68
  return /*#__PURE__*/_jsx(BaseControl, {
61
69
  className: classes,
62
70
  help: help,
@@ -110,6 +118,7 @@ export function UnforwardedInputControl(props, ref) {
110
118
  *
111
119
  * return (
112
120
  * <InputControl
121
+ * __next40pxDefaultSize
113
122
  * value={ value }
114
123
  * onChange={ ( nextValue ) => setValue( nextValue ?? '' ) }
115
124
  * />
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useInstanceId","forwardRef","InputBase","InputField","space","useDraft","BaseControl","useDeprecated36pxDefaultSizeProp","jsx","_jsx","noop","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","props","ref","__next40pxDefaultSize","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","help","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","style","suffix","value","restProps","classes","draftHookProps","onBlur","helpProp","__nextHasNoMarginBottom","children","gap","justify","paddingInlineStart","undefined","paddingInlineEnd"],"sources":["@wordpress/components/src/input-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\nimport { space } from '../utils/space';\nimport { useDraft } from './utils';\nimport BaseControl from '../base-control';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function UnforwardedInputControl(\n\tprops: InputControlProps,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tsuffix,\n\t\tvalue,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< InputControlProps >( props );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = clsx( 'components-input-control', className );\n\n\tconst draftHookProps = useDraft( {\n\t\tvalue,\n\t\tonBlur: restProps.onBlur,\n\t\tonChange,\n\t} );\n\n\tconst helpProp = !! help ? { 'aria-describedby': `${ id }__help` } : {};\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName={ classes }\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom\n\t\t>\n\t\t\t<InputBase\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tgap={ 3 }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tjustify=\"left\"\n\t\t\t\tlabel={ label }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\tprefix={ prefix }\n\t\t\t\tsize={ size }\n\t\t\t\tstyle={ style }\n\t\t\t\tsuffix={ suffix }\n\t\t\t>\n\t\t\t\t<InputField\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t{ ...helpProp }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tonValidate={ onValidate }\n\t\t\t\t\tpaddingInlineStart={ prefix ? space( 1 ) : undefined }\n\t\t\t\t\tpaddingInlineEnd={ suffix ? space( 1 ) : undefined }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tsize={ size }\n\t\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\t\t{ ...draftHookProps }\n\t\t\t\t/>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * InputControl components let users enter and edit text. This is an experimental component\n * intended to (in time) merge with or replace `TextControl`.\n *\n * ```jsx\n * import { __experimentalInputControl as InputControl } from '@wordpress/components';\n * import { useState } from 'react';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '' );\n *\n * return (\n * \t<InputControl\n * \t\tvalue={ value }\n * \t\tonChange={ ( nextValue ) => setValue( nextValue ?? '' ) }\n * \t/>\n * );\n * };\n * ```\n */\nexport const InputControl = forwardRef( UnforwardedInputControl );\n\nexport default InputControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM3B,YAAY,GAAGb,UAAU,CAAEe,uBAAwB,CAAC;AAEjE,eAAeF,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","forwardRef","InputBase","InputField","space","useDraft","BaseControl","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","jsx","_jsx","noop","useUniqueId","idProp","instanceId","InputControl","id","UnforwardedInputControl","props","ref","__next40pxDefaultSize","__shouldNotWarnDeprecated36pxSize","__unstableStateReducer","stateReducer","state","__unstableInputWidth","className","disabled","help","hideLabelFromVision","isPressEnterToChange","label","labelPosition","onChange","onValidate","onKeyDown","prefix","size","style","suffix","value","restProps","classes","draftHookProps","onBlur","helpProp","componentName","__nextHasNoMarginBottom","children","gap","justify","paddingInlineStart","undefined","paddingInlineEnd"],"sources":["@wordpress/components/src/input-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InputBase from './input-base';\nimport InputField from './input-field';\nimport type { InputControlProps } from './types';\nimport { space } from '../utils/space';\nimport { useDraft } from './utils';\nimport BaseControl from '../base-control';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( InputControl );\n\tconst id = `inspector-input-control-${ instanceId }`;\n\n\treturn idProp || id;\n}\n\nexport function UnforwardedInputControl(\n\tprops: InputControlProps,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t__unstableStateReducer: stateReducer = ( state ) => state,\n\t\t__unstableInputWidth,\n\t\tclassName,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tid: idProp,\n\t\tisPressEnterToChange = false,\n\t\tlabel,\n\t\tlabelPosition = 'top',\n\t\tonChange = noop,\n\t\tonValidate = noop,\n\t\tonKeyDown = noop,\n\t\tprefix,\n\t\tsize = 'default',\n\t\tstyle,\n\t\tsuffix,\n\t\tvalue,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< InputControlProps >( props );\n\n\tconst id = useUniqueId( idProp );\n\tconst classes = clsx( 'components-input-control', className );\n\n\tconst draftHookProps = useDraft( {\n\t\tvalue,\n\t\tonBlur: restProps.onBlur,\n\t\tonChange,\n\t} );\n\n\tconst helpProp = !! help ? { 'aria-describedby': `${ id }__help` } : {};\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'InputControl',\n\t\t__next40pxDefaultSize,\n\t\tsize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tclassName={ classes }\n\t\t\thelp={ help }\n\t\t\tid={ id }\n\t\t\t__nextHasNoMarginBottom\n\t\t>\n\t\t\t<InputBase\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tgap={ 3 }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\tid={ id }\n\t\t\t\tjustify=\"left\"\n\t\t\t\tlabel={ label }\n\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\tprefix={ prefix }\n\t\t\t\tsize={ size }\n\t\t\t\tstyle={ style }\n\t\t\t\tsuffix={ suffix }\n\t\t\t>\n\t\t\t\t<InputField\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\t{ ...helpProp }\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\tclassName=\"components-input-control__input\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t\tonValidate={ onValidate }\n\t\t\t\t\tpaddingInlineStart={ prefix ? space( 1 ) : undefined }\n\t\t\t\t\tpaddingInlineEnd={ suffix ? space( 1 ) : undefined }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tsize={ size }\n\t\t\t\t\tstateReducer={ stateReducer }\n\t\t\t\t\t{ ...draftHookProps }\n\t\t\t\t/>\n\t\t\t</InputBase>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * InputControl components let users enter and edit text. This is an experimental component\n * intended to (in time) merge with or replace `TextControl`.\n *\n * ```jsx\n * import { __experimentalInputControl as InputControl } from '@wordpress/components';\n * import { useState } from 'react';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '' );\n *\n * return (\n * \t<InputControl\n * \t\t\t__next40pxDefaultSize\n * \t\tvalue={ value }\n * \t\tonChange={ ( nextValue ) => setValue( nextValue ?? '' ) }\n * \t/>\n * );\n * };\n * ```\n */\nexport const InputControl = forwardRef( UnforwardedInputControl );\n\nexport default InputControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,UAAU,MAAM,eAAe;AAEtC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,QAAQ,QAAQ,SAAS;AAClC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,gCAAgC,QAAQ,+BAA+B;AAChF,SAASC,2BAA2B,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5E,MAAMC,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AAO,MAAM5B,YAAY,GAAGd,UAAU,CAAEgB,uBAAwB,CAAC;AAEjE,eAAeF,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/input-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tCSSProperties,\n\tReactNode,\n\tSyntheticEvent,\n\tHTMLInputTypeAttribute,\n} from 'react';\nimport type { useDrag } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport type { StateReducer } from './reducer/state';\nimport type { WordPressComponentProps } from '../context';\nimport type { FlexProps } from '../flex/types';\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type LabelPosition = 'top' | 'bottom' | 'side' | 'edge';\n\nexport type DragDirection = 'n' | 's' | 'e' | 'w';\n\nexport type DragProps = Parameters< Parameters< typeof useDrag >[ 0 ] >[ 0 ];\n\nexport type Size = 'default' | 'small' | 'compact' | '__unstable-large';\n\ninterface BaseProps {\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t * @ignore\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * The position of the label.\n\t *\n\t * @default 'top'\n\t */\n\tlabelPosition?: LabelPosition;\n\t/**\n\t * Adjusts the size of the input.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: Size;\n}\n\nexport type InputChangeCallback< P = {} > = (\n\tnextValue: string | undefined,\n\textra: { event: SyntheticEvent } & P\n) => void;\n\nexport interface InputFieldProps\n\textends Omit< BaseProps, '__next36pxDefaultSize' > {\n\t/**\n\t * Determines the drag axis.\n\t *\n\t * @default 'n'\n\t */\n\tdragDirection?: DragDirection;\n\t/**\n\t * If `isDragEnabled` is true, this controls the amount of `px` to have been dragged before\n\t * the drag gesture is actually triggered.\n\t *\n\t * @default 10\n\t */\n\tdragThreshold?: number;\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default false\n\t */\n\tisDragEnabled?: boolean;\n\t/**\n\t * If true, the `ENTER` key press is required in order to trigger an `onChange`.\n\t * If enabled, a change is also triggered when tabbing away (`onBlur`).\n\t *\n\t * @default false\n\t */\n\tisPressEnterToChange?: boolean;\n\t/**\n\t * A function that receives the value of the input.\n\t */\n\tonChange?: InputChangeCallback;\n\tonValidate?: (\n\t\tnextValue: string,\n\t\tevent?: SyntheticEvent< HTMLInputElement >\n\t) => void;\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n\tstateReducer?: StateReducer;\n\t/**\n\t * The current value of the input.\n\t */\n\tvalue?: string;\n\tonDragEnd?: ( dragProps: DragProps ) => void;\n\tonDragStart?: ( dragProps: DragProps ) => void;\n\tonDrag?: ( dragProps: DragProps ) => void;\n\t/**\n\t * Type of the input element to render.\n\t *\n\t * @default 'text'\n\t */\n\ttype?: HTMLInputTypeAttribute;\n}\n\nexport interface InputBaseProps extends BaseProps, FlexProps {\n\tchildren: ReactNode;\n\t/**\n\t * Renders an element on the left side of the input.\n\t *\n\t * By default, the prefix is aligned with the edge of the input border, with no padding.\n\t * If you want to apply standard padding in accordance with the size variant, wrap the element in\n\t * the provided `<InputControlPrefixWrapper>` component.\n\t *\n\t * @example\n\t * import {\n\t * __experimentalInputControl as InputControl,\n\t * __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t * } from '@wordpress/components';\n\t *\n\t * <InputControl\n\t * prefix={<InputControlPrefixWrapper>@</InputControlPrefixWrapper>}\n\t * />\n\t */\n\tprefix?: ReactNode;\n\t/**\n\t * Renders an element on the right side of the input.\n\t *\n\t * By default, the suffix is aligned with the edge of the input border, with no padding.\n\t * If you want to apply standard padding in accordance with the size variant, wrap the element in\n\t * the provided `<InputControlSuffixWrapper>` component.\n\t *\n\t * @example\n\t * import {\n\t * __experimentalInputControl as InputControl,\n\t * __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n\t * } from '@wordpress/components';\n\t *\n\t * <InputControl\n\t * suffix={<InputControlSuffixWrapper>%</InputControlSuffixWrapper>}\n\t * />\n\t */\n\tsuffix?: ReactNode;\n\t/**\n\t * If true, the `input` will be disabled.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * Whether to hide the border when not focused.\n\t *\n\t * @default false\n\t */\n\tisBorderless?: boolean;\n}\n\nexport interface InputControlProps\n\textends Omit<\n\t\t\tInputBaseProps,\n\t\t\t'children' | 'isBorderless' | keyof FlexProps\n\t\t>,\n\t\tPick< BaseControlProps, 'help' >,\n\t\t/**\n\t\t * The `prefix` prop in `WordPressComponentProps< InputFieldProps, 'input', false >` comes from the\n\t\t * `HTMLInputAttributes` and clashes with the one from `InputBaseProps`. So we have to omit it from\n\t\t * `WordPressComponentProps< InputFieldProps, 'input', false >` in order that `InputBaseProps[ 'prefix' ]`\n\t\t * be the only prefix prop. Otherwise it tries to do a union of the two prefix properties and you end up\n\t\t * with an unresolvable type.\n\t\t *\n\t\t * `paddingInlineStart`, and `paddingInlineEnd` are managed internally by\n\t\t * the InputControl, but the rest of the props for InputField are passed through.\n\t\t */\n\t\tOmit<\n\t\t\tWordPressComponentProps< InputFieldProps, 'input', false >,\n\t\t\t| 'stateReducer'\n\t\t\t| 'prefix'\n\t\t\t| 'paddingInlineStart'\n\t\t\t| 'paddingInlineEnd'\n\t\t> {\n\t__unstableStateReducer?: InputFieldProps[ 'stateReducer' ];\n}\n\nexport interface InputControlLabelProps {\n\tchildren: ReactNode;\n\thideLabelFromVision?: BaseProps[ 'hideLabelFromVision' ];\n\tlabelPosition?: BaseProps[ 'labelPosition' ];\n\tsize?: BaseProps[ 'size' ];\n}\n\nexport type PrefixSuffixWrapperProps = {\n\t/**\n\t * The content to be inserted.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Internal prop used to control the padding size of the wrapper.\n\t *\n\t * @ignore\n\t */\n\tsize?: BaseProps[ 'size' ];\n\t/**\n\t * Internal prop used to control the padding size of the wrapper.\n\t *\n\t * @ignore\n\t */\n\t__next40pxDefaultSize?: BaseProps[ '__next40pxDefaultSize' ];\n\t/**\n\t * Adjust the wrapper based on the prefix or suffix content.\n\t *\n\t * - `'default'`: Standard padding for text content.\n\t * - `'icon'`: For icons.\n\t * - `'control'`: For controls, like buttons or selects.\n\t *\n\t * @default 'default'\n\t */\n\tvariant?: 'default' | 'icon' | 'control';\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/input-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tCSSProperties,\n\tReactNode,\n\tSyntheticEvent,\n\tHTMLInputTypeAttribute,\n} from 'react';\nimport type { useDrag } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport type { StateReducer } from './reducer/state';\nimport type { WordPressComponentProps } from '../context';\nimport type { FlexProps } from '../flex/types';\nimport type { BaseControlProps } from '../base-control/types';\n\nexport type LabelPosition = 'top' | 'bottom' | 'side' | 'edge';\n\nexport type DragDirection = 'n' | 's' | 'e' | 'w';\n\nexport type DragProps = Parameters< Parameters< typeof useDrag >[ 0 ] >[ 0 ];\n\nexport type Size = 'default' | 'small' | 'compact' | '__unstable-large';\n\ninterface BaseProps {\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t * @ignore\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Do not throw a warning for the deprecated 36px default size.\n\t * For internal components of other components that already throw the warning.\n\t *\n\t * @ignore\n\t */\n\t__shouldNotWarnDeprecated36pxSize?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * The position of the label.\n\t *\n\t * @default 'top'\n\t */\n\tlabelPosition?: LabelPosition;\n\t/**\n\t * Adjusts the size of the input.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: Size;\n}\n\nexport type InputChangeCallback< P = {} > = (\n\tnextValue: string | undefined,\n\textra: { event: SyntheticEvent } & P\n) => void;\n\nexport interface InputFieldProps\n\textends Omit< BaseProps, '__next36pxDefaultSize' > {\n\t/**\n\t * Determines the drag axis.\n\t *\n\t * @default 'n'\n\t */\n\tdragDirection?: DragDirection;\n\t/**\n\t * If `isDragEnabled` is true, this controls the amount of `px` to have been dragged before\n\t * the drag gesture is actually triggered.\n\t *\n\t * @default 10\n\t */\n\tdragThreshold?: number;\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default false\n\t */\n\tisDragEnabled?: boolean;\n\t/**\n\t * If true, the `ENTER` key press is required in order to trigger an `onChange`.\n\t * If enabled, a change is also triggered when tabbing away (`onBlur`).\n\t *\n\t * @default false\n\t */\n\tisPressEnterToChange?: boolean;\n\t/**\n\t * A function that receives the value of the input.\n\t */\n\tonChange?: InputChangeCallback;\n\tonValidate?: (\n\t\tnextValue: string,\n\t\tevent?: SyntheticEvent< HTMLInputElement >\n\t) => void;\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n\tstateReducer?: StateReducer;\n\t/**\n\t * The current value of the input.\n\t */\n\tvalue?: string;\n\tonDragEnd?: ( dragProps: DragProps ) => void;\n\tonDragStart?: ( dragProps: DragProps ) => void;\n\tonDrag?: ( dragProps: DragProps ) => void;\n\t/**\n\t * Type of the input element to render.\n\t *\n\t * @default 'text'\n\t */\n\ttype?: HTMLInputTypeAttribute;\n}\n\nexport interface InputBaseProps extends BaseProps, FlexProps {\n\tchildren: ReactNode;\n\t/**\n\t * Renders an element on the left side of the input.\n\t *\n\t * By default, the prefix is aligned with the edge of the input border, with no padding.\n\t * If you want to apply standard padding in accordance with the size variant, wrap the element in\n\t * the provided `<InputControlPrefixWrapper>` component.\n\t *\n\t * ```jsx\n\t * import {\n\t * __experimentalInputControl as InputControl,\n\t * __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t * } from '@wordpress/components';\n\t *\n\t * <InputControl\n\t * prefix={<InputControlPrefixWrapper>@</InputControlPrefixWrapper>}\n\t * />\n\t * ```\n\t */\n\tprefix?: ReactNode;\n\t/**\n\t * Renders an element on the right side of the input.\n\t *\n\t * By default, the suffix is aligned with the edge of the input border, with no padding.\n\t * If you want to apply standard padding in accordance with the size variant, wrap the element in\n\t * the provided `<InputControlSuffixWrapper>` component.\n\t *\n\t * ```jsx\n\t * import {\n\t * __experimentalInputControl as InputControl,\n\t * __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n\t * } from '@wordpress/components';\n\t *\n\t * <InputControl\n\t * suffix={<InputControlSuffixWrapper>%</InputControlSuffixWrapper>}\n\t * />\n\t * ```\n\t */\n\tsuffix?: ReactNode;\n\t/**\n\t * If true, the `input` will be disabled.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * Whether to hide the border when not focused.\n\t *\n\t * @default false\n\t */\n\tisBorderless?: boolean;\n}\n\nexport interface InputControlProps\n\textends Omit<\n\t\t\tInputBaseProps,\n\t\t\t'children' | 'isBorderless' | keyof FlexProps\n\t\t>,\n\t\tPick< BaseControlProps, 'help' >,\n\t\t/**\n\t\t * The `prefix` prop in `WordPressComponentProps< InputFieldProps, 'input', false >` comes from the\n\t\t * `HTMLInputAttributes` and clashes with the one from `InputBaseProps`. So we have to omit it from\n\t\t * `WordPressComponentProps< InputFieldProps, 'input', false >` in order that `InputBaseProps[ 'prefix' ]`\n\t\t * be the only prefix prop. Otherwise it tries to do a union of the two prefix properties and you end up\n\t\t * with an unresolvable type.\n\t\t *\n\t\t * `paddingInlineStart`, and `paddingInlineEnd` are managed internally by\n\t\t * the InputControl, but the rest of the props for InputField are passed through.\n\t\t */\n\t\tOmit<\n\t\t\tWordPressComponentProps< InputFieldProps, 'input', false >,\n\t\t\t| 'stateReducer'\n\t\t\t| 'prefix'\n\t\t\t| 'paddingInlineStart'\n\t\t\t| 'paddingInlineEnd'\n\t\t> {\n\t__unstableStateReducer?: InputFieldProps[ 'stateReducer' ];\n}\n\nexport interface InputControlLabelProps {\n\tchildren: ReactNode;\n\thideLabelFromVision?: BaseProps[ 'hideLabelFromVision' ];\n\tlabelPosition?: BaseProps[ 'labelPosition' ];\n\tsize?: BaseProps[ 'size' ];\n}\n\nexport type PrefixSuffixWrapperProps = {\n\t/**\n\t * The content to be inserted.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Internal prop used to control the padding size of the wrapper.\n\t *\n\t * @ignore\n\t */\n\tsize?: BaseProps[ 'size' ];\n\t/**\n\t * Internal prop used to control the padding size of the wrapper.\n\t *\n\t * @ignore\n\t */\n\t__next40pxDefaultSize?: BaseProps[ '__next40pxDefaultSize' ];\n\t/**\n\t * Adjust the wrapper based on the prefix or suffix content.\n\t *\n\t * - `'default'`: Standard padding for text content.\n\t * - `'icon'`: For icons.\n\t * - `'control'`: For controls, like buttons or selects.\n\t *\n\t * @default 'default'\n\t */\n\tvariant?: 'default' | 'icon' | 'control';\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["useRef","Children","useKeyboardShortcut","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","KeyboardShortcut","target","callback","shortcut","bindGlobal","eventName","KeyboardShortcuts","children","shortcuts","element","Object","entries","map","count","ref"],"sources":["@wordpress/components/src/keyboard-shortcuts/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, Children } from '@wordpress/element';\nimport { useKeyboardShortcut } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { KeyboardShortcutProps, KeyboardShortcutsProps } from './types';\n\nfunction KeyboardShortcut( {\n\ttarget,\n\tcallback,\n\tshortcut,\n\tbindGlobal,\n\teventName,\n}: KeyboardShortcutProps ) {\n\tuseKeyboardShortcut( shortcut, callback, {\n\t\tbindGlobal,\n\t\ttarget,\n\t\teventName,\n\t} );\n\n\treturn null;\n}\n\n/**\n * `KeyboardShortcuts` is a component which handles keyboard sequences during the lifetime of the rendering element.\n *\n * When passed children, it will capture key events which occur on or within the children. If no children are passed, events are captured on the document.\n *\n * It uses the [Mousetrap](https://craig.is/killing/mice) library to implement keyboard sequence bindings.\n *\n * ```jsx\n * import { KeyboardShortcuts } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyKeyboardShortcuts = () => {\n * \tconst [ isAllSelected, setIsAllSelected ] = useState( false );\n * \tconst selectAll = () => {\n * \t\tsetIsAllSelected( true );\n * \t};\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t<KeyboardShortcuts\n * \t\t\t\tshortcuts={ {\n * \t\t\t\t\t'mod+a': selectAll,\n * \t\t\t\t} }\n * \t\t\t/>\n * \t\t\t[cmd/ctrl + A] Combination pressed? { isAllSelected ? 'Yes' : 'No' }\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nfunction KeyboardShortcuts( {\n\tchildren,\n\tshortcuts,\n\tbindGlobal,\n\teventName,\n}: KeyboardShortcutsProps ) {\n\tconst target = useRef( null );\n\n\tconst element = Object.entries( shortcuts ?? {} ).map(\n\t\t( [ shortcut, callback ] ) => (\n\t\t\t<KeyboardShortcut\n\t\t\t\tkey={ shortcut }\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tcallback={ callback }\n\t\t\t\tbindGlobal={ bindGlobal }\n\t\t\t\teventName={ eventName }\n\t\t\t\ttarget={ target }\n\t\t\t/>\n\t\t)\n\t);\n\n\t// Render as non-visual if there are no children pressed. Keyboard\n\t// events will be bound to the document instead.\n\tif ( ! Children.count( children ) ) {\n\t\treturn <>{ element }</>;\n\t}\n\n\treturn (\n\t\t<div ref={ target }>\n\t\t\t{ element }\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;;AAExD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,SAASC,gBAAgBA,CAAE;EAC1BC,MAAM;EACNC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC;AACsB,CAAC,EAAG;EAC1BZ,mBAAmB,CAAEU,QAAQ,EAAED,QAAQ,EAAE;IACxCE,UAAU;IACVH,MAAM;IACNI;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAE;EAC3BC,QAAQ;EACRC,SAAS;EACTJ,UAAU;EACVC;AACuB,CAAC,EAAG;EAC3B,MAAMJ,MAAM,GAAGV,MAAM,CAAE,IAAK,CAAC;EAE7B,MAAMkB,OAAO,GAAGC,MAAM,CAACC,OAAO,CAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAE,CAAC,CAACI,GAAG,CACpD,CAAE,CAAET,QAAQ,EAAED,QAAQ,CAAE,kBACvBP,IAAA,CAACK,gBAAgB;IAEhBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IACrBE,UAAU,EAAGA,UAAY;IACzBC,SAAS,EAAGA,SAAW;IACvBJ,MAAM,EAAGA;EAAQ,GALXE,QAMN,CAEH,CAAC;;EAED;EACA;EACA,IAAK,CAAEX,QAAQ,CAACqB,KAAK,CAAEN,QAAS,CAAC,EAAG;IACnC,oBAAOZ,IAAA,CAAAE,SAAA;MAAAU,QAAA,EAAIE;IAAO,CAAI,CAAC;EACxB;EAEA,oBACCV,KAAA;IAAKe,GAAG,EAAGb,MAAQ;IAAAM,QAAA,GAChBE,OAAO,EACPF,QAAQ;EAAA,CACN,CAAC;AAER;AAEA,eAAeD,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useRef","Children","useKeyboardShortcut","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","KeyboardShortcut","target","callback","shortcut","bindGlobal","eventName","KeyboardShortcuts","children","shortcuts","element","Object","entries","map","count","ref"],"sources":["@wordpress/components/src/keyboard-shortcuts/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, Children } from '@wordpress/element';\nimport { useKeyboardShortcut } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { KeyboardShortcutProps, KeyboardShortcutsProps } from './types';\n\nfunction KeyboardShortcut( {\n\ttarget,\n\tcallback,\n\tshortcut,\n\tbindGlobal,\n\teventName,\n}: KeyboardShortcutProps ) {\n\tuseKeyboardShortcut( shortcut, callback, {\n\t\tbindGlobal,\n\t\ttarget,\n\t\teventName,\n\t} );\n\n\treturn null;\n}\n\n/**\n * `KeyboardShortcuts` is a component which handles keyboard sequences during the lifetime of the rendering element.\n *\n * When passed children, it will capture key events which occur on or within the children. If no children are passed, events are captured on the document.\n *\n * It uses the [Mousetrap](https://craig.is/killing/mice) library to implement keyboard sequence bindings.\n *\n * ```jsx\n * import { KeyboardShortcuts } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyKeyboardShortcuts = () => {\n * \tconst [ isAllSelected, setIsAllSelected ] = useState( false );\n * \tconst selectAll = () => {\n * \t\tsetIsAllSelected( true );\n * \t};\n *\n * \treturn (\n * \t\t<div>\n * \t\t\t<KeyboardShortcuts\n * \t\t\t\tshortcuts={ {\n * \t\t\t\t\t'mod+a': selectAll,\n * \t\t\t\t} }\n * \t\t\t/>\n * \t\t\t[cmd/ctrl + A] Combination pressed? { isAllSelected ? 'Yes' : 'No' }\n * \t\t</div>\n * \t);\n * };\n * ```\n */\nfunction KeyboardShortcuts( {\n\tchildren,\n\tshortcuts,\n\tbindGlobal,\n\teventName,\n}: KeyboardShortcutsProps ) {\n\tconst target = useRef( null );\n\n\tconst element = Object.entries( shortcuts ?? {} ).map(\n\t\t( [ shortcut, callback ] ) => (\n\t\t\t<KeyboardShortcut\n\t\t\t\tkey={ shortcut }\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tcallback={ callback }\n\t\t\t\tbindGlobal={ bindGlobal }\n\t\t\t\teventName={ eventName }\n\t\t\t\ttarget={ target }\n\t\t\t/>\n\t\t)\n\t);\n\n\t// Render as non-visual if there are no children pressed. Keyboard\n\t// events will be bound to the document instead.\n\tif ( ! Children.count( children ) ) {\n\t\treturn <>{ element }</>;\n\t}\n\n\treturn (\n\t\t<div ref={ target }>\n\t\t\t{ element }\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;;AAExD;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,SAASC,gBAAgBA,CAAE;EAC1BC,MAAM;EACNC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC;AACsB,CAAC,EAAG;EAC1BZ,mBAAmB,CAAEU,QAAQ,EAAED,QAAQ,EAAE;IACxCE,UAAU;IACVH,MAAM;IACNI;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAE;EAC3BC,QAAQ;EACRC,SAAS;EACTJ,UAAU;EACVC;AACuB,CAAC,EAAG;EAC3B,MAAMJ,MAAM,GAAGV,MAAM,CAAE,IAAK,CAAC;EAE7B,MAAMkB,OAAO,GAAGC,MAAM,CAACC,OAAO,CAAEH,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAE,CAAC,CAACI,GAAG,CACpD,CAAE,CAAET,QAAQ,EAAED,QAAQ,CAAE,kBACvBP,IAAA,CAACK,gBAAgB;IAEhBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IACrBE,UAAU,EAAGA,UAAY;IACzBC,SAAS,EAAGA,SAAW;IACvBJ,MAAM,EAAGA;EAAQ,GALXE,QAMN,CAEH,CAAC;;EAED;EACA;EACA,IAAK,CAAEX,QAAQ,CAACqB,KAAK,CAAEN,QAAS,CAAC,EAAG;IACnC,oBAAOZ,IAAA,CAAAE,SAAA;MAAAU,QAAA,EAAIE;IAAO,CAAI,CAAC;EACxB;EAEA,oBACCV,KAAA;IAAKe,GAAG,EAAGb,MAAQ;IAAAM,QAAA,GAChBE,OAAO,EACPF,QAAQ;EAAA,CACN,CAAC;AAER;AAEA,eAAeD,iBAAiB","ignoreList":[]}
@@ -19,6 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  export const MenuCheckboxItem = forwardRef(function MenuCheckboxItem({
20
20
  suffix,
21
21
  children,
22
+ disabled = false,
22
23
  hideOnClick = false,
23
24
  ...props
24
25
  }, ref) {
@@ -30,6 +31,7 @@ export const MenuCheckboxItem = forwardRef(function MenuCheckboxItem({
30
31
  ref: ref,
31
32
  ...props,
32
33
  accessibleWhenDisabled: true,
34
+ disabled: disabled,
33
35
  hideOnClick: hideOnClick,
34
36
  store: menuContext.store,
35
37
  children: [/*#__PURE__*/_jsx(Ariakit.MenuItemCheck, {
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","Icon","check","MenuContext","Styled","jsx","_jsx","jsxs","_jsxs","MenuCheckboxItem","suffix","children","hideOnClick","props","ref","menuContext","store","Error","accessibleWhenDisabled","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/checkbox-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuCheckboxItemProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuCheckboxItemProps, 'div', false >\n>( function MenuCheckboxItem(\n\t{ suffix, children, hideOnClick = false, ...props },\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.CheckboxItem can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ menuContext.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuCheckboxItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,OAAO,MAAMC,gBAAgB,GAAGV,UAAU,CAGvC,SAASU,gBAAgBA,CAC3B;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,WAAW,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACnDC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGf,UAAU,CAAEG,WAAY,CAAC;EAE7C,IAAK,CAAEY,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,gEACD,CAAC;EACF;EAEA,oBACCT,KAAA,CAACJ,MAAM,CAACK,gBAAgB;IACvBK,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVK,sBAAsB;IACtBN,WAAW,EAAGA,WAAa;IAC3BI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAL,QAAA,gBAE3BL,IAAA,CAACR,OAAO,CAACqB,aAAa;MACrBH,KAAK,EAAGD,WAAW,CAACC,KAAO;MAC3BI,MAAM,eAAGd,IAAA,CAACF,MAAM,CAACiB,iBAAiB,IAAE;MACpC;MAAA;MACAC,KAAK,EAAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAb,QAAA,eAE3CL,IAAA,CAACL,IAAI;QAACwB,IAAI,EAAGvB,KAAO;QAACwB,IAAI,EAAG;MAAI,CAAE;IAAC,CACb,CAAC,eAExBlB,KAAA,CAACJ,MAAM,CAACuB,sBAAsB;MAAAhB,QAAA,gBAC7BL,IAAA,CAACF,MAAM,CAACwB,uBAAuB;QAAAjB,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BD,MAAM,iBACPJ,IAAA,CAACF,MAAM,CAACyB,iBAAiB;QAAAlB,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACR,CAAC;AAE5B,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","Icon","check","MenuContext","Styled","jsx","_jsx","jsxs","_jsxs","MenuCheckboxItem","suffix","children","disabled","hideOnClick","props","ref","menuContext","store","Error","accessibleWhenDisabled","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","icon","size","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/checkbox-item.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuCheckboxItemProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuCheckboxItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuCheckboxItemProps, 'div', false >\n>( function MenuCheckboxItem(\n\t{ suffix, children, disabled = false, hideOnClick = false, ...props },\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.CheckboxItem can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuCheckboxItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t<Ariakit.MenuItemCheck\n\t\t\t\tstore={ menuContext.store }\n\t\t\t\trender={ <Styled.ItemPrefixWrapper /> }\n\t\t\t\t// Override some ariakit inline styles\n\t\t\t\tstyle={ { width: 'auto', height: 'auto' } }\n\t\t\t>\n\t\t\t\t<Icon icon={ check } size={ 24 } />\n\t\t\t</Ariakit.MenuItemCheck>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuCheckboxItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAE9C;AACA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QAAAnB,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACR,CAAC;AAE5B,CAAE,CAAC","ignoreList":[]}
@@ -2,20 +2,17 @@
2
2
  * External dependencies
3
3
  */
4
4
  import * as Ariakit from '@ariakit/react';
5
- import { useStoreState } from '@ariakit/react';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
9
8
  */
10
- import { useContext, useMemo, cloneElement, isValidElement, useCallback } from '@wordpress/element';
11
- import { isRTL } from '@wordpress/i18n';
12
- import { chevronRightSmall } from '@wordpress/icons';
9
+ import { useContext, useMemo } from '@wordpress/element';
10
+ import { isRTL as isRTLFn } from '@wordpress/i18n';
13
11
 
14
12
  /**
15
13
  * Internal dependencies
16
14
  */
17
- import { useContextSystem, contextConnect } from '../context';
18
- import * as Styled from './styles';
15
+ import { useContextSystem, contextConnectWithoutRef } from '../context';
19
16
  import { MenuContext } from './context';
20
17
  import { MenuItem } from './item';
21
18
  import { MenuCheckboxItem } from './checkbox-item';
@@ -25,36 +22,29 @@ import { MenuGroupLabel } from './group-label';
25
22
  import { MenuSeparator } from './separator';
26
23
  import { MenuItemLabel } from './item-label';
27
24
  import { MenuItemHelpText } from './item-help-text';
28
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
29
- const UnconnectedMenu = (props, ref) => {
30
- var _props$placement;
25
+ import { MenuTriggerButton } from './trigger-button';
26
+ import { MenuSubmenuTriggerItem } from './submenu-trigger-item';
27
+ import { MenuPopover } from './popover';
28
+ import { jsx as _jsx } from "react/jsx-runtime";
29
+ const UnconnectedMenu = props => {
31
30
  const {
32
- // Store props
33
- open,
31
+ children,
34
32
  defaultOpen = false,
33
+ open,
35
34
  onOpenChange,
36
35
  placement,
37
- // Menu trigger props
38
- trigger,
39
- // Menu props
40
- gutter,
41
- children,
42
- shift,
43
- modal = true,
44
36
  // From internal components context
45
- variant,
46
- // Rest
47
- ...otherProps
37
+ variant
48
38
  } = useContextSystem(props, 'Menu');
49
39
  const parentContext = useContext(MenuContext);
50
- const computedDirection = isRTL() ? 'rtl' : 'ltr';
40
+ const rtl = isRTLFn();
51
41
 
52
42
  // If an explicit value for the `placement` prop is not passed,
53
43
  // apply a default placement of `bottom-start` for the root menu popover,
54
44
  // and of `right-start` for nested menu popovers.
55
- let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start';
45
+ let computedPlacement = placement !== null && placement !== void 0 ? placement : parentContext?.store ? 'right-start' : 'bottom-start';
56
46
  // Swap left/right in case of RTL direction
57
- if (computedDirection === 'rtl') {
47
+ if (rtl) {
58
48
  if (/right/.test(computedPlacement)) {
59
49
  computedPlacement = computedPlacement.replace('right', 'left');
60
50
  } else if (/left/.test(computedPlacement)) {
@@ -70,86 +60,18 @@ const UnconnectedMenu = (props, ref) => {
70
60
  setOpen(willBeOpen) {
71
61
  onOpenChange?.(willBeOpen);
72
62
  },
73
- rtl: computedDirection === 'rtl'
63
+ rtl
74
64
  });
75
65
  const contextValue = useMemo(() => ({
76
66
  store: menuStore,
77
67
  variant
78
68
  }), [menuStore, variant]);
79
-
80
- // Extract the side from the applied placement — useful for animations.
81
- // Using `currentPlacement` instead of `placement` to make sure that we
82
- // use the final computed placement (including "flips" etc).
83
- const appliedPlacementSide = useStoreState(menuStore, 'currentPlacement').split('-')[0];
84
- if (menuStore.parent && !(isValidElement(trigger) && MenuItem === trigger.type)) {
85
- // eslint-disable-next-line no-console
86
- console.warn('For nested Menus, the `trigger` should always be a `MenuItem`.');
87
- }
88
- const hideOnEscape = useCallback(event => {
89
- // Pressing Escape can cause unexpected consequences (ie. exiting
90
- // full screen mode on MacOs, close parent modals...).
91
- event.preventDefault();
92
- // Returning `true` causes the menu to hide.
93
- return true;
94
- }, []);
95
- const wrapperProps = useMemo(() => ({
96
- dir: computedDirection,
97
- style: {
98
- direction: computedDirection
99
- }
100
- }), [computedDirection]);
101
- return /*#__PURE__*/_jsxs(_Fragment, {
102
- children: [/*#__PURE__*/_jsx(Ariakit.MenuButton, {
103
- ref: ref,
104
- store: menuStore,
105
- render: menuStore.parent ? cloneElement(trigger, {
106
- // Add submenu arrow, unless a `suffix` is explicitly specified
107
- suffix: /*#__PURE__*/_jsxs(_Fragment, {
108
- children: [trigger.props.suffix, /*#__PURE__*/_jsx(Styled.SubmenuChevronIcon, {
109
- "aria-hidden": "true",
110
- icon: chevronRightSmall,
111
- size: 24,
112
- preserveAspectRatio: "xMidYMid slice"
113
- })]
114
- })
115
- }) : trigger
116
- }), /*#__PURE__*/_jsx(Ariakit.Menu, {
117
- ...otherProps,
118
- modal: modal,
119
- store: menuStore
120
- // Root menu has an 8px distance from its trigger,
121
- // otherwise 0 (which causes the submenu to slightly overlap)
122
- ,
123
- gutter: gutter !== null && gutter !== void 0 ? gutter : menuStore.parent ? 0 : 8
124
- // Align nested menu by the same (but opposite) amount
125
- // as the menu container's padding.
126
- ,
127
- shift: shift !== null && shift !== void 0 ? shift : menuStore.parent ? -4 : 0,
128
- hideOnHoverOutside: false,
129
- "data-side": appliedPlacementSide,
130
- wrapperProps: wrapperProps,
131
- hideOnEscape: hideOnEscape,
132
- unmountOnHide: true,
133
- render: renderProps =>
134
- /*#__PURE__*/
135
- // Two wrappers are needed for the entry animation, where the menu
136
- // container scales with a different factor than its contents.
137
- // The {...renderProps} are passed to the inner wrapper, so that the
138
- // menu element is the direct parent of the menu item elements.
139
- _jsx(Styled.MenuPopoverOuterWrapper, {
140
- variant: variant,
141
- children: /*#__PURE__*/_jsx(Styled.MenuPopoverInnerWrapper, {
142
- ...renderProps
143
- })
144
- }),
145
- children: /*#__PURE__*/_jsx(MenuContext.Provider, {
146
- value: contextValue,
147
- children: children
148
- })
149
- })]
69
+ return /*#__PURE__*/_jsx(MenuContext.Provider, {
70
+ value: contextValue,
71
+ children: children
150
72
  });
151
73
  };
152
- export const Menu = Object.assign(contextConnect(UnconnectedMenu, 'Menu'), {
74
+ export const Menu = Object.assign(contextConnectWithoutRef(UnconnectedMenu, 'Menu'), {
153
75
  Context: Object.assign(MenuContext, {
154
76
  displayName: 'Menu.Context'
155
77
  }),
@@ -176,6 +98,15 @@ export const Menu = Object.assign(contextConnect(UnconnectedMenu, 'Menu'), {
176
98
  }),
177
99
  ItemHelpText: Object.assign(MenuItemHelpText, {
178
100
  displayName: 'Menu.ItemHelpText'
101
+ }),
102
+ Popover: Object.assign(MenuPopover, {
103
+ displayName: 'Menu.Popover'
104
+ }),
105
+ TriggerButton: Object.assign(MenuTriggerButton, {
106
+ displayName: 'Menu.TriggerButton'
107
+ }),
108
+ SubmenuTriggerItem: Object.assign(MenuSubmenuTriggerItem, {
109
+ displayName: 'Menu.SubmenuTriggerItem'
179
110
  })
180
111
  });
181
112
  export default Menu;
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useStoreState","useContext","useMemo","cloneElement","isValidElement","useCallback","isRTL","chevronRightSmall","useContextSystem","contextConnect","Styled","MenuContext","MenuItem","MenuCheckboxItem","MenuRadioItem","MenuGroup","MenuGroupLabel","MenuSeparator","MenuItemLabel","MenuItemHelpText","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","UnconnectedMenu","props","ref","_props$placement","open","defaultOpen","onOpenChange","placement","trigger","gutter","children","shift","modal","variant","otherProps","parentContext","computedDirection","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","appliedPlacementSide","split","type","console","warn","hideOnEscape","event","preventDefault","wrapperProps","dir","style","direction","MenuButton","render","suffix","SubmenuChevronIcon","icon","size","preserveAspectRatio","Menu","hideOnHoverOutside","unmountOnHide","renderProps","MenuPopoverOuterWrapper","MenuPopoverInnerWrapper","Provider","value","Object","assign","Context","displayName","Item","RadioItem","CheckboxItem","Group","GroupLabel","Separator","ItemLabel","ItemHelpText"],"sources":["@wordpress/components/src/menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseContext,\n\tuseMemo,\n\tcloneElement,\n\tisValidElement,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnect } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuContext as MenuContextType, MenuProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\nimport { MenuItem } from './item';\nimport { MenuCheckboxItem } from './checkbox-item';\nimport { MenuRadioItem } from './radio-item';\nimport { MenuGroup } from './group';\nimport { MenuGroupLabel } from './group-label';\nimport { MenuSeparator } from './separator';\nimport { MenuItemLabel } from './item-label';\nimport { MenuItemHelpText } from './item-help-text';\n\nconst UnconnectedMenu = (\n\tprops: WordPressComponentProps< MenuProps, 'div', false >,\n\tref: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst {\n\t\t// Store props\n\t\topen,\n\t\tdefaultOpen = false,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// Menu trigger props\n\t\ttrigger,\n\n\t\t// Menu props\n\t\tgutter,\n\t\tchildren,\n\t\tshift,\n\t\tmodal = true,\n\n\t\t// From internal components context\n\t\tvariant,\n\n\t\t// Rest\n\t\t...otherProps\n\t} = useContextSystem< typeof props & Pick< MenuContextType, 'variant' > >(\n\t\tprops,\n\t\t'Menu'\n\t);\n\n\tconst parentContext = useContext( MenuContext );\n\n\tconst computedDirection = isRTL() ? 'rtl' : 'ltr';\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root menu popover,\n\t// and of `right-start` for nested menu popovers.\n\tlet computedPlacement =\n\t\tprops.placement ??\n\t\t( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( computedDirection === 'rtl' ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst menuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl: computedDirection === 'rtl',\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: menuStore, variant } ),\n\t\t[ menuStore, variant ]\n\t);\n\n\t// Extract the side from the applied placement — useful for animations.\n\t// Using `currentPlacement` instead of `placement` to make sure that we\n\t// use the final computed placement (including \"flips\" etc).\n\tconst appliedPlacementSide = useStoreState(\n\t\tmenuStore,\n\t\t'currentPlacement'\n\t).split( '-' )[ 0 ];\n\n\tif (\n\t\tmenuStore.parent &&\n\t\t! ( isValidElement( trigger ) && MenuItem === trigger.type )\n\t) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t'For nested Menus, the `trigger` should always be a `MenuItem`.'\n\t\t);\n\t}\n\n\tconst hideOnEscape = useCallback(\n\t\t( event: React.KeyboardEvent< Element > ) => {\n\t\t\t// Pressing Escape can cause unexpected consequences (ie. exiting\n\t\t\t// full screen mode on MacOs, close parent modals...).\n\t\t\tevent.preventDefault();\n\t\t\t// Returning `true` causes the menu to hide.\n\t\t\treturn true;\n\t\t},\n\t\t[]\n\t);\n\n\tconst wrapperProps = useMemo(\n\t\t() => ( {\n\t\t\tdir: computedDirection,\n\t\t\tstyle: {\n\t\t\t\tdirection:\n\t\t\t\t\tcomputedDirection as React.CSSProperties[ 'direction' ],\n\t\t\t},\n\t\t} ),\n\t\t[ computedDirection ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ /* Menu trigger */ }\n\t\t\t<Ariakit.MenuButton\n\t\t\t\tref={ ref }\n\t\t\t\tstore={ menuStore }\n\t\t\t\trender={\n\t\t\t\t\tmenuStore.parent\n\t\t\t\t\t\t? cloneElement( trigger, {\n\t\t\t\t\t\t\t\t// Add submenu arrow, unless a `suffix` is explicitly specified\n\t\t\t\t\t\t\t\tsuffix: (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ trigger.props.suffix }\n\t\t\t\t\t\t\t\t\t\t<Styled.SubmenuChevronIcon\n\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t\t\t\t\t\t\tpreserveAspectRatio=\"xMidYMid slice\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: trigger\n\t\t\t\t}\n\t\t\t/>\n\n\t\t\t{ /* Menu popover */ }\n\t\t\t<Ariakit.Menu\n\t\t\t\t{ ...otherProps }\n\t\t\t\tmodal={ modal }\n\t\t\t\tstore={ menuStore }\n\t\t\t\t// Root menu has an 8px distance from its trigger,\n\t\t\t\t// otherwise 0 (which causes the submenu to slightly overlap)\n\t\t\t\tgutter={ gutter ?? ( menuStore.parent ? 0 : 8 ) }\n\t\t\t\t// Align nested menu by the same (but opposite) amount\n\t\t\t\t// as the menu container's padding.\n\t\t\t\tshift={ shift ?? ( menuStore.parent ? -4 : 0 ) }\n\t\t\t\thideOnHoverOutside={ false }\n\t\t\t\tdata-side={ appliedPlacementSide }\n\t\t\t\twrapperProps={ wrapperProps }\n\t\t\t\thideOnEscape={ hideOnEscape }\n\t\t\t\tunmountOnHide\n\t\t\t\trender={ ( renderProps ) => (\n\t\t\t\t\t// Two wrappers are needed for the entry animation, where the menu\n\t\t\t\t\t// container scales with a different factor than its contents.\n\t\t\t\t\t// The {...renderProps} are passed to the inner wrapper, so that the\n\t\t\t\t\t// menu element is the direct parent of the menu item elements.\n\t\t\t\t\t<Styled.MenuPopoverOuterWrapper variant={ variant }>\n\t\t\t\t\t\t<Styled.MenuPopoverInnerWrapper { ...renderProps } />\n\t\t\t\t\t</Styled.MenuPopoverOuterWrapper>\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<MenuContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</MenuContext.Provider>\n\t\t\t</Ariakit.Menu>\n\t\t</>\n\t);\n};\n\nexport const Menu = Object.assign( contextConnect( UnconnectedMenu, 'Menu' ), {\n\tContext: Object.assign( MenuContext, {\n\t\tdisplayName: 'Menu.Context',\n\t} ),\n\tItem: Object.assign( MenuItem, {\n\t\tdisplayName: 'Menu.Item',\n\t} ),\n\tRadioItem: Object.assign( MenuRadioItem, {\n\t\tdisplayName: 'Menu.RadioItem',\n\t} ),\n\tCheckboxItem: Object.assign( MenuCheckboxItem, {\n\t\tdisplayName: 'Menu.CheckboxItem',\n\t} ),\n\tGroup: Object.assign( MenuGroup, {\n\t\tdisplayName: 'Menu.Group',\n\t} ),\n\tGroupLabel: Object.assign( MenuGroupLabel, {\n\t\tdisplayName: 'Menu.GroupLabel',\n\t} ),\n\tSeparator: Object.assign( MenuSeparator, {\n\t\tdisplayName: 'Menu.Separator',\n\t} ),\n\tItemLabel: Object.assign( MenuItemLabel, {\n\t\tdisplayName: 'Menu.ItemLabel',\n\t} ),\n\tItemHelpText: Object.assign( MenuItemHelpText, {\n\t\tdisplayName: 'Menu.ItemHelpText',\n\t} ),\n} );\n\nexport default Menu;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,aAAa,QAAQ,gBAAgB;;AAE9C;AACA;AACA;AACA,SACCC,UAAU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,CAACC,MAAM,CAAEhE,gBAAgB,EAAE;IAC9CkE,WAAW,EAAE;EACd,CAAE;AACH,CAAE,CAAC;AAEH,eAAeX,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","useContext","useMemo","isRTL","isRTLFn","useContextSystem","contextConnectWithoutRef","MenuContext","MenuItem","MenuCheckboxItem","MenuRadioItem","MenuGroup","MenuGroupLabel","MenuSeparator","MenuItemLabel","MenuItemHelpText","MenuTriggerButton","MenuSubmenuTriggerItem","MenuPopover","jsx","_jsx","UnconnectedMenu","props","children","defaultOpen","open","onOpenChange","placement","variant","parentContext","rtl","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","contextValue","Provider","value","Menu","Object","assign","Context","displayName","Item","RadioItem","CheckboxItem","Group","GroupLabel","Separator","ItemLabel","ItemHelpText","Popover","TriggerButton","SubmenuTriggerItem"],"sources":["@wordpress/components/src/menu/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo } from '@wordpress/element';\nimport { isRTL as isRTLFn } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, contextConnectWithoutRef } from '../context';\nimport type { MenuContext as MenuContextType, MenuProps } from './types';\nimport { MenuContext } from './context';\nimport { MenuItem } from './item';\nimport { MenuCheckboxItem } from './checkbox-item';\nimport { MenuRadioItem } from './radio-item';\nimport { MenuGroup } from './group';\nimport { MenuGroupLabel } from './group-label';\nimport { MenuSeparator } from './separator';\nimport { MenuItemLabel } from './item-label';\nimport { MenuItemHelpText } from './item-help-text';\nimport { MenuTriggerButton } from './trigger-button';\nimport { MenuSubmenuTriggerItem } from './submenu-trigger-item';\nimport { MenuPopover } from './popover';\n\nconst UnconnectedMenu = ( props: MenuProps ) => {\n\tconst {\n\t\tchildren,\n\t\tdefaultOpen = false,\n\t\topen,\n\t\tonOpenChange,\n\t\tplacement,\n\n\t\t// From internal components context\n\t\tvariant,\n\t} = useContextSystem<\n\t\t// @ts-expect-error TODO: missing 'className' in MenuProps\n\t\ttypeof props & Pick< MenuContextType, 'variant' >\n\t>( props, 'Menu' );\n\n\tconst parentContext = useContext( MenuContext );\n\n\tconst rtl = isRTLFn();\n\n\t// If an explicit value for the `placement` prop is not passed,\n\t// apply a default placement of `bottom-start` for the root menu popover,\n\t// and of `right-start` for nested menu popovers.\n\tlet computedPlacement =\n\t\tplacement ?? ( parentContext?.store ? 'right-start' : 'bottom-start' );\n\t// Swap left/right in case of RTL direction\n\tif ( rtl ) {\n\t\tif ( /right/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'right',\n\t\t\t\t'left'\n\t\t\t) as typeof computedPlacement;\n\t\t} else if ( /left/.test( computedPlacement ) ) {\n\t\t\tcomputedPlacement = computedPlacement.replace(\n\t\t\t\t'left',\n\t\t\t\t'right'\n\t\t\t) as typeof computedPlacement;\n\t\t}\n\t}\n\n\tconst menuStore = Ariakit.useMenuStore( {\n\t\tparent: parentContext?.store,\n\t\topen,\n\t\tdefaultOpen,\n\t\tplacement: computedPlacement,\n\t\tfocusLoop: true,\n\t\tsetOpen( willBeOpen ) {\n\t\t\tonOpenChange?.( willBeOpen );\n\t\t},\n\t\trtl,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( { store: menuStore, variant } ),\n\t\t[ menuStore, variant ]\n\t);\n\n\treturn (\n\t\t<MenuContext.Provider value={ contextValue }>\n\t\t\t{ children }\n\t\t</MenuContext.Provider>\n\t);\n};\n\nexport const Menu = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedMenu, 'Menu' ),\n\t{\n\t\tContext: Object.assign( MenuContext, {\n\t\t\tdisplayName: 'Menu.Context',\n\t\t} ),\n\t\tItem: Object.assign( MenuItem, {\n\t\t\tdisplayName: 'Menu.Item',\n\t\t} ),\n\t\tRadioItem: Object.assign( MenuRadioItem, {\n\t\t\tdisplayName: 'Menu.RadioItem',\n\t\t} ),\n\t\tCheckboxItem: Object.assign( MenuCheckboxItem, {\n\t\t\tdisplayName: 'Menu.CheckboxItem',\n\t\t} ),\n\t\tGroup: Object.assign( MenuGroup, {\n\t\t\tdisplayName: 'Menu.Group',\n\t\t} ),\n\t\tGroupLabel: Object.assign( MenuGroupLabel, {\n\t\t\tdisplayName: 'Menu.GroupLabel',\n\t\t} ),\n\t\tSeparator: Object.assign( MenuSeparator, {\n\t\t\tdisplayName: 'Menu.Separator',\n\t\t} ),\n\t\tItemLabel: Object.assign( MenuItemLabel, {\n\t\t\tdisplayName: 'Menu.ItemLabel',\n\t\t} ),\n\t\tItemHelpText: Object.assign( MenuItemHelpText, {\n\t\t\tdisplayName: 'Menu.ItemHelpText',\n\t\t} ),\n\t\tPopover: Object.assign( MenuPopover, {\n\t\t\tdisplayName: 'Menu.Popover',\n\t\t} ),\n\t\tTriggerButton: Object.assign( MenuTriggerButton, {\n\t\t\tdisplayName: 'Menu.TriggerButton',\n\t\t} ),\n\t\tSubmenuTriggerItem: Object.assign( MenuSubmenuTriggerItem, {\n\t\t\tdisplayName: 'Menu.SubmenuTriggerItem',\n\t\t} ),\n\t}\n);\n\nexport default Menu;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,KAAK,IAAIC,OAAO,QAAQ,iBAAiB;;AAElD;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,wBAAwB,QAAQ,YAAY;AAEvE,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,aAAa,QAAQ,cAAc;AAC5C,SAASC,SAAS,QAAQ,SAAS;AACnC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,aAAa,QAAQ,aAAa;AAC3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S,OAAO,EAAEZ,MAAM,CAACC,MAAM,CAAE5B,WAAW,EAAE;IACpC8B,WAAW,EAAE;EACd,CAAE,CAAC;EACHU,aAAa,EAAEb,MAAM,CAACC,MAAM,CAAE9B,iBAAiB,EAAE;IAChDgC,WAAW,EAAE;EACd,CAAE,CAAC;EACHW,kBAAkB,EAAEd,MAAM,CAACC,MAAM,CAAE7B,sBAAsB,EAAE;IAC1D+B,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAED,eAAeJ,IAAI","ignoreList":[]}
@@ -14,19 +14,28 @@ export const MenuItem = forwardRef(function MenuItem({
14
14
  prefix,
15
15
  suffix,
16
16
  children,
17
+ disabled = false,
17
18
  hideOnClick = true,
19
+ store,
18
20
  ...props
19
21
  }, ref) {
20
22
  const menuContext = useContext(MenuContext);
21
23
  if (!menuContext?.store) {
22
24
  throw new Error('Menu.Item can only be rendered inside a Menu component');
23
25
  }
26
+
27
+ // In most cases, the menu store will be retrieved from context (ie. the store
28
+ // created by the top-level menu component). But in rare cases (ie.
29
+ // `Menu.SubmenuTriggerItem`), the context store wouldn't be correct. This is
30
+ // why the component accepts a `store` prop to override the context store.
31
+ const computedStore = store !== null && store !== void 0 ? store : menuContext.store;
24
32
  return /*#__PURE__*/_jsxs(Styled.MenuItem, {
25
33
  ref: ref,
26
34
  ...props,
27
35
  accessibleWhenDisabled: true,
36
+ disabled: disabled,
28
37
  hideOnClick: hideOnClick,
29
- store: menuContext.store,
38
+ store: computedStore,
30
39
  children: [/*#__PURE__*/_jsx(Styled.ItemPrefixWrapper, {
31
40
  children: prefix
32
41
  }), /*#__PURE__*/_jsxs(Styled.MenuItemContentWrapper, {
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","useContext","Styled","MenuContext","jsx","_jsx","jsxs","_jsxs","MenuItem","prefix","suffix","children","hideOnClick","props","ref","menuContext","store","Error","accessibleWhenDisabled","ItemPrefixWrapper","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/item.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\n\nexport const MenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuItemProps, 'div', false >\n>( function MenuItem(\n\t{ prefix, suffix, children, hideOnClick = true, ...props },\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Item can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ menuContext.store }\n\t\t>\n\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,WAAW,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExC,OAAO,MAAMC,QAAQ,GAAGR,UAAU,CAG/B,SAASQ,QAAQA,CACnB;EAAEC,MAAM;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,WAAW,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EAC1DC,GAAG,EACF;EACD,MAAMC,WAAW,GAAGd,UAAU,CAAEE,WAAY,CAAC;EAE7C,IAAK,CAAEY,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,wDACD,CAAC;EACF;EAEA,oBACCV,KAAA,CAACL,MAAM,CAACM,QAAQ;IACfM,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVK,sBAAsB;IACtBN,WAAW,EAAGA,WAAa;IAC3BI,KAAK,EAAGD,WAAW,CAACC,KAAO;IAAAL,QAAA,gBAE3BN,IAAA,CAACH,MAAM,CAACiB,iBAAiB;MAAAR,QAAA,EAAGF;IAAM,CAA4B,CAAC,eAE/DF,KAAA,CAACL,MAAM,CAACkB,sBAAsB;MAAAT,QAAA,gBAC7BN,IAAA,CAACH,MAAM,CAACmB,uBAAuB;QAAAV,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BD,MAAM,iBACPL,IAAA,CAACH,MAAM,CAACoB,iBAAiB;QAAAX,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CAChB,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useContext","Styled","MenuContext","jsx","_jsx","jsxs","_jsxs","MenuItem","prefix","suffix","children","disabled","hideOnClick","store","props","ref","menuContext","Error","computedStore","accessibleWhenDisabled","ItemPrefixWrapper","MenuItemContentWrapper","MenuItemChildrenWrapper","ItemSuffixWrapper"],"sources":["@wordpress/components/src/menu/item.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { MenuItemProps } from './types';\nimport * as Styled from './styles';\nimport { MenuContext } from './context';\n\nexport const MenuItem = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< MenuItemProps, 'div', false >\n>( function MenuItem(\n\t{\n\t\tprefix,\n\t\tsuffix,\n\t\tchildren,\n\t\tdisabled = false,\n\t\thideOnClick = true,\n\t\tstore,\n\t\t...props\n\t},\n\tref\n) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Item can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\t// In most cases, the menu store will be retrieved from context (ie. the store\n\t// created by the top-level menu component). But in rare cases (ie.\n\t// `Menu.SubmenuTriggerItem`), the context store wouldn't be correct. This is\n\t// why the component accepts a `store` prop to override the context store.\n\tconst computedStore = store ?? menuContext.store;\n\n\treturn (\n\t\t<Styled.MenuItem\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\thideOnClick={ hideOnClick }\n\t\t\tstore={ computedStore }\n\t\t>\n\t\t\t<Styled.ItemPrefixWrapper>{ prefix }</Styled.ItemPrefixWrapper>\n\n\t\t\t<Styled.MenuItemContentWrapper>\n\t\t\t\t<Styled.MenuItemChildrenWrapper>\n\t\t\t\t\t{ children }\n\t\t\t\t</Styled.MenuItemChildrenWrapper>\n\n\t\t\t\t{ suffix && (\n\t\t\t\t\t<Styled.ItemSuffixWrapper>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t</Styled.ItemSuffixWrapper>\n\t\t\t\t) }\n\t\t\t</Styled.MenuItemContentWrapper>\n\t\t</Styled.MenuItem>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAGA,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,SAASC,WAAW,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEx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