@wordpress/components 29.0.1-next.a9f418477.0 → 29.1.1

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":["_element","require","_hooks","_compose","_jsxRuntime","ANIMATION_FRAME_PERIOD","withFilters","hookName","createHigherOrderComponent","OriginalComponent","namespace","FilteredComponent","ensureFilteredComponent","undefined","applyFilters","FilteredComponentRenderer","Component","constructor","props","componentDidMount","instances","push","length","addAction","onHooksUpdated","componentWillUnmount","filter","instance","removeAction","render","jsx","throttledForceUpdate","debounce","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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA0E,IAAAG,WAAA,GAAAH,OAAA;AAL1E;AACA;AACA;;AAKA,MAAMI,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;AACe,SAASC,WAAWA,CAAEC,QAAgB,EAAG;EACvD,OAAO,IAAAC,mCAA0B,EAAIC,iBAAiB,IAAM;IAC3D,MAAMC,SAAS,GAAG,oBAAoB,GAAGH,QAAQ;;IAEjD;AACF;AACA;AACA;AACA;IACE,IAAII,iBAAsC;;IAE1C;AACF;AACA;AACA;IACE,SAASC,uBAAuBA,CAAA,EAAG;MAClC,IAAKD,iBAAiB,KAAKE,SAAS,EAAG;QACtCF,iBAAiB,GAAG,IAAAG,mBAAY,EAC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5DA,QAAQ,CAACO,WAAW,CAAC,CAAC;MACvB,CAAE,CAAC;IACJ,CAAC,EAAE7B,sBAAuB,CAAC;;IAE3B;AACF;AACA;AACA;AACA;AACA;AACA;IACE,SAASmB,cAAcA,CAAEW,eAAuB,EAAG;MAClD,IAAKA,eAAe,KAAK5B,QAAQ,EAAG;QACnCwB,oBAAoB,CAAC,CAAC;MACvB;IACD;IAEA,OAAOhB,yBAAyB;EACjC,CAAC,EAAE,aAAc,CAAC;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_hooks","_compose","_jsxRuntime","ANIMATION_FRAME_PERIOD","withFilters","hookName","createHigherOrderComponent","OriginalComponent","namespace","FilteredComponent","ensureFilteredComponent","undefined","applyFilters","FilteredComponentRenderer","Component","constructor","props","componentDidMount","instances","push","length","addAction","onHooksUpdated","componentWillUnmount","filter","instance","removeAction","render","jsx","throttledForceUpdate","debounce","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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA0E,IAAAG,WAAA,GAAAH,OAAA;AAL1E;AACA;AACA;;AAKA,MAAMI,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;AAC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G;QACR,oBAAO,IAAAzB,WAAA,CAAA0B,GAAA,EAACnB,iBAAiB;UAAA,GAAM,IAAI,CAACO;QAAK,CAAI,CAAC;MAC/C;IACD;IAEAH,yBAAyB,CAACK,SAAS,GAAG,EAAE;;IAExC;AACF;AACA;AACA;IACE,MAAMW,oBAAoB,GAAG,IAAAC,iBAAQ,EAAE,MAAM;MAC5C;MACA;MACArB,iBAAiB,GAAG,IAAAG,mBAAY,EAC/BP,QAAQ,EACRE,iBACD,CAAwB;;MAExB;MACAM,yBAAyB,CAACK,SAAS,CAACa,OAAO,CAAIN,QAAQ,IAAM;QAC5DA,QAAQ,CAACO,WAAW,CAAC,CAAC;MACvB,CAAE,CAAC;IACJ,CAAC,EAAE7B,sBAAuB,CAAC;;IAE3B;AACF;AACA;AACA;AACA;AACA;AACA;IACE,SAASmB,cAAcA,CAAEW,eAAuB,EAAG;MAClD,IAAKA,eAAe,KAAK5B,QAAQ,EAAG;QACnCwB,oBAAoB,CAAC,CAAC;MACvB;IACD;IAEA,OAAOhB,yBAAyB;EACjC,CAAC,EAAE,aAAc,CAAC;AACnB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_uuid","require","_element","_compose","_list","_interopRequireDefault","_jsxRuntime","_default","exports","default","createHigherOrderComponent","OriginalComponent","Component","props","ref","noticeList","setNoticeList","useState","noticeOperations","useMemo","createNotice","notice","noticeToAdd","id","uuid","current","createErrorNotice","msg","status","content","removeNotice","filter","removeAllNotices","propsOut","noticeUI","length","jsx","className","notices","onRemove","isForwardRef","render","forwardRef"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAd3C;AACA;AACA;AAGA;AACA;AACA;AAIA;AACA;AACA;AAIA;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;AA5B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,EAAGrB,gBAAgB,CAACY;MAAc,CAC1C;IAEH,CAAC;IAED,OAAOU,YAAY,gBAClB,IAAAlC,WAAA,CAAA8B,GAAA,EAACzB,iBAAiB;MAAA,GAAMsB,QAAQ;MAAGnB,GAAG,EAAGA;IAAK,CAAE,CAAC,gBAEjD,IAAAR,WAAA,CAAA8B,GAAA,EAACzB,iBAAiB;MAAA,GAAMsB;IAAQ,CAAI,CACpC;EACF;EAEA,IAAIO,YAAqB;EACzB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAG9B,iBAAiB;EACpC;EACA,IAAK,OAAO8B,MAAM,KAAK,UAAU,EAAG;IACnCD,YAAY,GAAG,IAAI;IACnB,OAAO,IAAAE,mBAAU,EAAE9B,SAAU,CAAC;EAC/B;EACA,OAAOA,SAAS;AACjB,CAAC,EAAE,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_uuid","require","_element","_compose","_list","_interopRequireDefault","_jsxRuntime","_default","exports","default","createHigherOrderComponent","OriginalComponent","Component","props","ref","noticeList","setNoticeList","useState","noticeOperations","useMemo","createNotice","notice","noticeToAdd","id","uuid","current","createErrorNotice","msg","status","content","removeNotice","filter","removeAllNotices","propsOut","noticeUI","length","jsx","className","notices","onRemove","isForwardRef","render","forwardRef"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAd3C;AACA;AACA;AAGA;AACA;AACA;AAIA;AACA;AACA;AAIA;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;AA5BA,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GA6Be,IAAAC,mCAA0B,EAAIC,iBAAiB,IAAM;EACnE,SAASC,SAASA,CACjBC,KAA+B,EAC/BC,GAA8B,EAC7B;IACD,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAG,IAAAC,iBAAQ,EAE3C,EAAG,CAAC;IAEP,MAAMC,gBAAgB,GAAG,IAAAC,gBAAO,EAE7B,MAAM;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IO,YAAqB;EACzB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAG9B,iBAAiB;EACpC;EACA,IAAK,OAAO8B,MAAM,KAAK,UAAU,EAAG;IACnCD,YAAY,GAAG,IAAI;IACnB,OAAO,IAAAE,mBAAU,EAAE9B,SAAU,CAAC;EAC/B;EACA,OAAOA,SAAS;AACjB,CAAC,EAAE,aAAc,CAAC","ignoreList":[]}
@@ -16,6 +16,7 @@ var _space = require("../utils/space");
16
16
  var _utils = require("./utils");
17
17
  var _baseControl = _interopRequireDefault(require("../base-control"));
18
18
  var _useDeprecatedProps = require("../utils/use-deprecated-props");
19
+ var _deprecated36pxSize = require("../utils/deprecated-36px-size");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  /**
21
22
  * External dependencies
@@ -38,6 +39,7 @@ function useUniqueId(idProp) {
38
39
  function UnforwardedInputControl(props, ref) {
39
40
  const {
40
41
  __next40pxDefaultSize,
42
+ __shouldNotWarnDeprecated36pxSize,
41
43
  __unstableStateReducer: stateReducer = state => state,
42
44
  __unstableInputWidth,
43
45
  className,
@@ -68,6 +70,12 @@ function UnforwardedInputControl(props, ref) {
68
70
  const helpProp = !!help ? {
69
71
  'aria-describedby': `${id}__help`
70
72
  } : {};
73
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
74
+ componentName: 'InputControl',
75
+ __next40pxDefaultSize,
76
+ size,
77
+ __shouldNotWarnDeprecated36pxSize
78
+ });
71
79
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_baseControl.default, {
72
80
  className: classes,
73
81
  help: help,
@@ -121,6 +129,7 @@ function UnforwardedInputControl(props, ref) {
121
129
  *
122
130
  * return (
123
131
  * <InputControl
132
+ * __next40pxDefaultSize
124
133
  * value={ value }
125
134
  * onChange={ ( nextValue ) => setValue( nextValue ?? '' ) }
126
135
  * />
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_inputBase","_inputField","_space","_utils","_baseControl","_useDeprecatedProps","_jsxRuntime","noop","useUniqueId","idProp","instanceId","useInstanceId","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","useDeprecated36pxDefaultSizeProp","classes","clsx","draftHookProps","useDraft","onBlur","helpProp","jsx","default","__nextHasNoMarginBottom","children","gap","justify","paddingInlineStart","space","undefined","paddingInlineEnd","exports","forwardRef","_default"],"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":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAAiF,IAAAS,WAAA,GAAAT,OAAA;AArBjF;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AASA,MAAMU,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEC,YAAa,CAAC;EAChD,MAAMC,EAAE,GAAG,2BAA4BH,UAAU,EAAG;EAEpD,OAAOD,MAAM,IAAII,EAAE;AACpB;AAEO,SAASC,uBAAuBA,CACtCC,KAAwB,EACxBC,GAAqC,EACpC;EACD,MAAM;IACLC,qBAAqB;IACrBC,sBAAsB,EAAEC,YAAY,GAAKC,KAAK,IAAMA,KAAK;IACzDC,oBAAoB;IACpBC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,IAA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GA,MAAQ;MACjBC,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGA,KAAO;MACfC,MAAM,EAAGA,MAAQ;MAAAa,QAAA,eAEjB,IAAA1C,WAAA,CAAAuC,GAAA,EAAC5C,WAAA,CAAA6C,OAAU;QAAA,GACLT,SAAS;QAAA,GACTO,QAAQ;QACb3B,qBAAqB,EAAGA,qBAAuB;QAC/CK,SAAS,EAAC,iCAAiC;QAC3CC,QAAQ,EAAGA,QAAU;QACrBV,EAAE,EAAGA,EAAI;QACTa,oBAAoB,EAAGA,oBAAsB;QAC7CK,SAAS,EAAGA,SAAW;QACvBD,UAAU,EAAGA,UAAY;QACzBqB,kBAAkB,EAAGnB,MAAM,GAAG,IAAAoB,YAAK,EAAE,CAAE,CAAC,GAAGC,SAAW;QACtDC,gBAAgB,EAAGnB,MAAM,GAAG,IAAAiB,YAAK,EAAE,CAAE,CAAC,GAAGC,SAAW;QACpDrC,GAAG,EAAGA,GAAK;QACXiB,IAAI,EAAGA,IAAM;QACbd,YAAY,EAAGA,YAAc;QAAA,GACxBsB;MAAc,CACnB;IAAC,CACQ;EAAC,CACA,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM7B,YAAY,GAAA2C,OAAA,CAAA3C,YAAA,GAAG,IAAA4C,mBAAU,EAAE1C,uBAAwB,CAAC;AAAC,IAAA2C,QAAA,GAAAF,OAAA,CAAAT,OAAA,GAEnDlC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_inputBase","_inputField","_space","_utils","_baseControl","_useDeprecatedProps","_deprecated36pxSize","_jsxRuntime","noop","useUniqueId","idProp","instanceId","useInstanceId","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","useDeprecated36pxDefaultSizeProp","classes","clsx","draftHookProps","useDraft","onBlur","helpProp","maybeWarnDeprecated36pxSize","componentName","jsx","default","__nextHasNoMarginBottom","children","gap","justify","paddingInlineStart","space","undefined","paddingInlineEnd","exports","forwardRef","_default"],"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":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AAA4E,IAAAU,WAAA,GAAAV,OAAA;AAtB5E;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAUA,MAAMW,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEC,YAAa,CAAC;EAChD,MAAMC,EAAE,GAAG,2BAA4BH,UAAU,EAAG;EAEpD,OAAOD,MAAM,IAAII,EAAE;AACpB;AAEO,SAASC,uBAAuBA,CACtCC,KAAwB,EACxBC,GAAqC,EACpC;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EnDrC,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
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_jsxRuntime","KeyboardShortcut","target","callback","shortcut","bindGlobal","eventName","useKeyboardShortcut","KeyboardShortcuts","children","shortcuts","useRef","element","Object","entries","map","jsx","Children","count","Fragment","jsxs","ref","_default","exports","default"],"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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAyD,IAAAE,WAAA,GAAAF,OAAA;AAJzD;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,gBAAgBA,CAAE;EAC1BC,MAAM;EACNC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC;AACsB,CAAC,EAAG;EAC1B,IAAAC,4BAAmB,EAAEH,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,SAASE,iBAAiBA,CAAE;EAC3BC,QAAQ;EACRC,SAAS;EACTL,UAAU;EACVC;AACuB,CAAC,EAAG;EAC3B,MAAMJ,MAAM,GAAG,IAAAS,eAAM,EAAE,IAAK,CAAC;EAE7B,MAAMC,OAAO,GAAGC,MAAM,CAACC,OAAO,CAAEJ,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAE,CAAC,CAACK,GAAG,CACpD,CAAE,CAAEX,QAAQ,EAAED,QAAQ,CAAE,kBACvB,IAAAH,WAAA,CAAAgB,GAAA,EAACf,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,CAAEa,iBAAQ,CAACC,KAAK,CAAET,QAAS,CAAC,EAAG;IACnC,oBAAO,IAAAT,WAAA,CAAAgB,GAAA,EAAAhB,WAAA,CAAAmB,QAAA;MAAAV,QAAA,EAAIG;IAAO,CAAI,CAAC;EACxB;EAEA,oBACC,IAAAZ,WAAA,CAAAoB,IAAA;IAAKC,GAAG,EAAGnB,MAAQ;IAAAO,QAAA,GAChBG,OAAO,EACPH,QAAQ;EAAA,CACN,CAAC;AAER;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEchB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_jsxRuntime","KeyboardShortcut","target","callback","shortcut","bindGlobal","eventName","useKeyboardShortcut","KeyboardShortcuts","children","shortcuts","useRef","element","Object","entries","map","jsx","Children","count","Fragment","jsxs","ref","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAyD,IAAAE,WAAA,GAAAF,OAAA;AAJzD;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,gBAAgBA,CAAE;EAC1BC,MAAM;EACNC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC;AACsB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RequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
27
27
  const MenuCheckboxItem = exports.MenuCheckboxItem = (0, _element.forwardRef)(function MenuCheckboxItem({
28
28
  suffix,
29
29
  children,
30
+ disabled = false,
30
31
  hideOnClick = false,
31
32
  ...props
32
33
  }, ref) {
@@ -38,6 +39,7 @@ const MenuCheckboxItem = exports.MenuCheckboxItem = (0, _element.forwardRef)(fun
38
39
  ref: ref,
39
40
  ...props,
40
41
  accessibleWhenDisabled: true,
42
+ disabled: disabled,
41
43
  hideOnClick: hideOnClick,
42
44
  store: menuContext.store,
43
45
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.MenuItemCheck, {
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_icons","_context","Styled","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MenuCheckboxItem","exports","forwardRef","suffix","children","hideOnClick","props","ref","menuContext","useContext","MenuContext","store","Error","jsxs","accessibleWhenDisabled","jsx","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","Icon","icon","check","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":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAL,uBAAA,CAAAC,OAAA;AAAmC,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CA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AEG,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,gEACD,CAAC;EACF;EAEA,oBACC,IAAAjC,WAAA,CAAAkC,IAAA,EAACnC,MAAM,CAACsB,gBAAgB;IACvBO,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVQ,sBAAsB;IACtBT,WAAW,EAAGA,WAAa;IAC3BM,KAAK,EAAGH,WAAW,CAACG,KAAO;IAAAP,QAAA,gBAE3B,IAAAzB,WAAA,CAAAoC,GAAA,EAAC3C,OAAO,CAAC4C,aAAa;MACrBL,KAAK,EAAGH,WAAW,CAACG,KAAO;MAC3BM,MAAM,eAAG,IAAAtC,WAAA,CAAAoC,GAAA,EAACrC,MAAM,CAACwC,iBAAiB,IAAE;MACpC;MAAA;MACAC,KAAK,EAAG;QAAEC,KAAK,EAAE,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAjB,QAAA,eAE3C,IAAAzB,WAAA,CAAAoC,GAAA,EAACvC,MAAA,CAAA8C,IAAI;QAACC,IAAI,EAAGC,YAAO;QAACC,IAAI,EAAG;MAAI,CAAE;IAAC,CACb,CAAC,eAExB,IAAA9C,WAAA,CAAAkC,IAAA,EAACnC,MAAM,CAACgD,sBAAsB;MAAAtB,QAAA,gBAC7B,IAAAzB,WAAA,CAAAoC,GAAA,EAACrC,MAAM,CAACiD,uBAAuB;QAAAvB,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BD,MAAM,iBACP,IAAAxB,WAAA,CAAAoC,GAAA,EAACrC,MAAM,CAACkD,iBAAiB;QAAAxB,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACR,CAAC;AAE5B,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_icons","_context","Styled","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MenuCheckboxItem","exports","forwardRef","suffix","children","disabled","hideOnClick","props","ref","menuContext","useContext","MenuContext","store","Error","jsxs","accessibleWhenDisabled","jsx","MenuItemCheck","render","ItemPrefixWrapper","style","width","height","Icon","icon","check","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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E,MAAM;QAAEC,MAAM,EAAE;MAAO,CAAG;MAAAlB,QAAA,eAE3C,IAAAzB,WAAA,CAAAqC,GAAA,EAACxC,MAAA,CAAA+C,IAAI;QAACC,IAAI,EAAGC,YAAO;QAACC,IAAI,EAAG;MAAI,CAAE;IAAC,CACb,CAAC,eAExB,IAAA/C,WAAA,CAAAmC,IAAA,EAACpC,MAAM,CAACiD,sBAAsB;MAAAvB,QAAA,gBAC7B,IAAAzB,WAAA,CAAAqC,GAAA,EAACtC,MAAM,CAACkD,uBAAuB;QAAAxB,QAAA,EAC5BA;MAAQ,CACqB,CAAC,EAE/BD,MAAM,iBACP,IAAAxB,WAAA,CAAAqC,GAAA,EAACtC,MAAM,CAACmD,iBAAiB;QAAAzB,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CACR,CAAC;AAE5B,CAAE,CAAC","ignoreList":[]}
@@ -4,13 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.Menu = void 0;
7
- var _react = _interopRequireWildcard(require("@ariakit/react"));
8
- var Ariakit = _react;
7
+ var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
9
8
  var _element = require("@wordpress/element");
10
9
  var _i18n = require("@wordpress/i18n");
11
- var _icons = require("@wordpress/icons");
12
10
  var _context = require("../context");
13
- var Styled = _interopRequireWildcard(require("./styles"));
14
11
  var _context2 = require("./context");
15
12
  var _item = require("./item");
16
13
  var _checkboxItem = require("./checkbox-item");
@@ -20,6 +17,9 @@ var _groupLabel = require("./group-label");
20
17
  var _separator = require("./separator");
21
18
  var _itemLabel = require("./item-label");
22
19
  var _itemHelpText = require("./item-help-text");
20
+ var _triggerButton = require("./trigger-button");
21
+ var _submenuTriggerItem = require("./submenu-trigger-item");
22
+ var _popover = require("./popover");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
24
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -35,35 +35,25 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
35
35
  * Internal dependencies
36
36
  */
37
37
 
38
- const UnconnectedMenu = (props, ref) => {
39
- var _props$placement;
38
+ const UnconnectedMenu = props => {
40
39
  const {
41
- // Store props
42
- open,
40
+ children,
43
41
  defaultOpen = false,
42
+ open,
44
43
  onOpenChange,
45
44
  placement,
46
- // Menu trigger props
47
- trigger,
48
- // Menu props
49
- gutter,
50
- children,
51
- shift,
52
- modal = true,
53
45
  // From internal components context
54
- variant,
55
- // Rest
56
- ...otherProps
46
+ variant
57
47
  } = (0, _context.useContextSystem)(props, 'Menu');
58
48
  const parentContext = (0, _element.useContext)(_context2.MenuContext);
59
- const computedDirection = (0, _i18n.isRTL)() ? 'rtl' : 'ltr';
49
+ const rtl = (0, _i18n.isRTL)();
60
50
 
61
51
  // If an explicit value for the `placement` prop is not passed,
62
52
  // apply a default placement of `bottom-start` for the root menu popover,
63
53
  // and of `right-start` for nested menu popovers.
64
- let computedPlacement = (_props$placement = props.placement) !== null && _props$placement !== void 0 ? _props$placement : parentContext?.store ? 'right-start' : 'bottom-start';
54
+ let computedPlacement = placement !== null && placement !== void 0 ? placement : parentContext?.store ? 'right-start' : 'bottom-start';
65
55
  // Swap left/right in case of RTL direction
66
- if (computedDirection === 'rtl') {
56
+ if (rtl) {
67
57
  if (/right/.test(computedPlacement)) {
68
58
  computedPlacement = computedPlacement.replace('right', 'left');
69
59
  } else if (/left/.test(computedPlacement)) {
@@ -79,86 +69,18 @@ const UnconnectedMenu = (props, ref) => {
79
69
  setOpen(willBeOpen) {
80
70
  onOpenChange?.(willBeOpen);
81
71
  },
82
- rtl: computedDirection === 'rtl'
72
+ rtl
83
73
  });
84
74
  const contextValue = (0, _element.useMemo)(() => ({
85
75
  store: menuStore,
86
76
  variant
87
77
  }), [menuStore, variant]);
88
-
89
- // Extract the side from the applied placement — useful for animations.
90
- // Using `currentPlacement` instead of `placement` to make sure that we
91
- // use the final computed placement (including "flips" etc).
92
- const appliedPlacementSide = (0, _react.useStoreState)(menuStore, 'currentPlacement').split('-')[0];
93
- if (menuStore.parent && !((0, _element.isValidElement)(trigger) && _item.MenuItem === trigger.type)) {
94
- // eslint-disable-next-line no-console
95
- console.warn('For nested Menus, the `trigger` should always be a `MenuItem`.');
96
- }
97
- const hideOnEscape = (0, _element.useCallback)(event => {
98
- // Pressing Escape can cause unexpected consequences (ie. exiting
99
- // full screen mode on MacOs, close parent modals...).
100
- event.preventDefault();
101
- // Returning `true` causes the menu to hide.
102
- return true;
103
- }, []);
104
- const wrapperProps = (0, _element.useMemo)(() => ({
105
- dir: computedDirection,
106
- style: {
107
- direction: computedDirection
108
- }
109
- }), [computedDirection]);
110
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
111
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.MenuButton, {
112
- ref: ref,
113
- store: menuStore,
114
- render: menuStore.parent ? (0, _element.cloneElement)(trigger, {
115
- // Add submenu arrow, unless a `suffix` is explicitly specified
116
- suffix: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
117
- children: [trigger.props.suffix, /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.SubmenuChevronIcon, {
118
- "aria-hidden": "true",
119
- icon: _icons.chevronRightSmall,
120
- size: 24,
121
- preserveAspectRatio: "xMidYMid slice"
122
- })]
123
- })
124
- }) : trigger
125
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.Menu, {
126
- ...otherProps,
127
- modal: modal,
128
- store: menuStore
129
- // Root menu has an 8px distance from its trigger,
130
- // otherwise 0 (which causes the submenu to slightly overlap)
131
- ,
132
- gutter: gutter !== null && gutter !== void 0 ? gutter : menuStore.parent ? 0 : 8
133
- // Align nested menu by the same (but opposite) amount
134
- // as the menu container's padding.
135
- ,
136
- shift: shift !== null && shift !== void 0 ? shift : menuStore.parent ? -4 : 0,
137
- hideOnHoverOutside: false,
138
- "data-side": appliedPlacementSide,
139
- wrapperProps: wrapperProps,
140
- hideOnEscape: hideOnEscape,
141
- unmountOnHide: true,
142
- render: renderProps =>
143
- /*#__PURE__*/
144
- // Two wrappers are needed for the entry animation, where the menu
145
- // container scales with a different factor than its contents.
146
- // The {...renderProps} are passed to the inner wrapper, so that the
147
- // menu element is the direct parent of the menu item elements.
148
- (0, _jsxRuntime.jsx)(Styled.MenuPopoverOuterWrapper, {
149
- variant: variant,
150
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.MenuPopoverInnerWrapper, {
151
- ...renderProps
152
- })
153
- }),
154
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context2.MenuContext.Provider, {
155
- value: contextValue,
156
- children: children
157
- })
158
- })]
78
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context2.MenuContext.Provider, {
79
+ value: contextValue,
80
+ children: children
159
81
  });
160
82
  };
161
- const Menu = exports.Menu = Object.assign((0, _context.contextConnect)(UnconnectedMenu, 'Menu'), {
83
+ const Menu = exports.Menu = Object.assign((0, _context.contextConnectWithoutRef)(UnconnectedMenu, 'Menu'), {
162
84
  Context: Object.assign(_context2.MenuContext, {
163
85
  displayName: 'Menu.Context'
164
86
  }),
@@ -185,6 +107,15 @@ const Menu = exports.Menu = Object.assign((0, _context.contextConnect)(Unconnect
185
107
  }),
186
108
  ItemHelpText: Object.assign(_itemHelpText.MenuItemHelpText, {
187
109
  displayName: 'Menu.ItemHelpText'
110
+ }),
111
+ Popover: Object.assign(_popover.MenuPopover, {
112
+ displayName: 'Menu.Popover'
113
+ }),
114
+ TriggerButton: Object.assign(_triggerButton.MenuTriggerButton, {
115
+ displayName: 'Menu.TriggerButton'
116
+ }),
117
+ SubmenuTriggerItem: Object.assign(_submenuTriggerItem.MenuSubmenuTriggerItem, {
118
+ displayName: 'Menu.SubmenuTriggerItem'
188
119
  })
189
120
  });
190
121
  var _default = exports.default = Menu;
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","Ariakit","_element","_i18n","_icons","_context","Styled","_context2","_item","_checkboxItem","_radioItem","_group","_groupLabel","_separator","_itemLabel","_itemHelpText","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedMenu","props","ref","_props$placement","open","defaultOpen","onOpenChange","placement","trigger","gutter","children","shift","modal","variant","otherProps","useContextSystem","parentContext","useContext","MenuContext","computedDirection","isRTL","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","rtl","contextValue","useMemo","appliedPlacementSide","useStoreState","split","isValidElement","MenuItem","type","console","warn","hideOnEscape","useCallback","event","preventDefault","wrapperProps","dir","style","direction","jsxs","Fragment","jsx","MenuButton","render","cloneElement","suffix","SubmenuChevronIcon","icon","chevronRightSmall","size","preserveAspectRatio","Menu","hideOnHoverOutside","unmountOnHide","renderProps","MenuPopoverOuterWrapper","MenuPopoverInnerWrapper","Provider","value","exports","assign","contextConnect","Context","displayName","Item","RadioItem","MenuRadioItem","CheckboxItem","MenuCheckboxItem","Group","MenuGroup","GroupLabel","MenuGroupLabel","Separator","MenuSeparator","ItemLabel","MenuItemLabel","ItemHelpText","MenuItemHelpText","_default"],"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":";;;;;;AAGA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,IAAAC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AC;EACHY,SAAS,EAAE9F,MAAM,CAAC+E,MAAM,CAAEgB,wBAAa,EAAE;IACxCb,WAAW,EAAE;EACd,CAAE,CAAC;EACHc,YAAY,EAAEhG,MAAM,CAAC+E,MAAM,CAAEkB,8BAAgB,EAAE;IAC9Cf,WAAW,EAAE;EACd,CAAE;AACH,CAAE,CAAC;AAAC,IAAAgB,QAAA,GAAApB,OAAA,CAAApF,OAAA,GAEW4E,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_context","_context2","_item","_checkboxItem","_radioItem","_group","_groupLabel","_separator","_itemLabel","_itemHelpText","_triggerButton","_submenuTriggerItem","_popover","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedMenu","props","children","defaultOpen","open","onOpenChange","placement","variant","useContextSystem","parentContext","useContext","MenuContext","rtl","isRTLFn","computedPlacement","store","test","replace","menuStore","useMenuStore","parent","focusLoop","setOpen","willBeOpen","contextValue","useMemo","jsx","Provider","value","Menu","exports","assign","contextConnectWithoutRef","Context","displayName","Item","MenuItem","RadioItem","MenuRadioItem","CheckboxItem","MenuCheckboxItem","Group","MenuGroup","GroupLabel","MenuGroupLabel","Separator","MenuSeparator","ItemLabel","MenuItemLabel","ItemHelpText","MenuItemHelpText","Popover","MenuPopover","TriggerButton","MenuTriggerButton","SubmenuTriggerItem","MenuSubmenuTriggerItem","_default"],"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":";;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,G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AC;EACHW,SAAS,EAAErD,MAAM,CAACuC,MAAM,CAAEe,wBAAa,EAAE;IACxCZ,WAAW,EAAE;EACd,CAAE,CAAC;EACHa,SAAS,EAAEvD,MAAM,CAACuC,MAAM,CAAEiB,wBAAa,EAAE;IACxCd,WAAW,EAAE;EACd,CAAE,CAAC;EACHe,YAAY,EAAEzD,MAAM,CAACuC,MAAM,CAAEmB,8BAAgB,EAAE;IAC9ChB,WAAW,EAAE;EACd,CAAE,CAAC;EACHiB,OAAO,EAAE3D,MAAM,CAACuC,MAAM,CAAEqB,oBAAW,EAAE;IACpClB,WAAW,EAAE;EACd,CAAE,CAAC;EACHmB,aAAa,EAAE7D,MAAM,CAACuC,MAAM,CAAEuB,gCAAiB,EAAE;IAChDpB,WAAW,EAAE;EACd,CAAE,CAAC;EACHqB,kBAAkB,EAAE/D,MAAM,CAACuC,MAAM,CAAEyB,0CAAsB,EAAE;IAC1DtB,WAAW,EAAE;EACd,CAAE;AACH,CACD,CAAC;AAAC,IAAAuB,QAAA,GAAA3B,OAAA,CAAA5C,OAAA,GAEa2C,IAAI","ignoreList":[]}
@@ -22,19 +22,28 @@ const MenuItem = exports.MenuItem = (0, _element.forwardRef)(function MenuItem({
22
22
  prefix,
23
23
  suffix,
24
24
  children,
25
+ disabled = false,
25
26
  hideOnClick = true,
27
+ store,
26
28
  ...props
27
29
  }, ref) {
28
30
  const menuContext = (0, _element.useContext)(_context.MenuContext);
29
31
  if (!menuContext?.store) {
30
32
  throw new Error('Menu.Item can only be rendered inside a Menu component');
31
33
  }
34
+
35
+ // In most cases, the menu store will be retrieved from context (ie. the store
36
+ // created by the top-level menu component). But in rare cases (ie.
37
+ // `Menu.SubmenuTriggerItem`), the context store wouldn't be correct. This is
38
+ // why the component accepts a `store` prop to override the context store.
39
+ const computedStore = store !== null && store !== void 0 ? store : menuContext.store;
32
40
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.MenuItem, {
33
41
  ref: ref,
34
42
  ...props,
35
43
  accessibleWhenDisabled: true,
44
+ disabled: disabled,
36
45
  hideOnClick: hideOnClick,
37
- store: menuContext.store,
46
+ store: computedStore,
38
47
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Styled.ItemPrefixWrapper, {
39
48
  children: prefix
40
49
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Styled.MenuItemContentWrapper, {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","Styled","_interopRequireWildcard","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MenuItem","exports","forwardRef","prefix","suffix","children","hideOnClick","props","ref","menuContext","useContext","MenuContext","store","Error","jsxs","accessibleWhenDisabled","jsx","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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ACxC,MAAM,CAAC4C,iBAAiB;QAAAf,QAAA,EACtBD;MAAM,CACiB,CAC1B;IAAA,CAC6B,CAAC;EAAA,CAChB,CAAC;AAEpB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","Styled","_interopRequireWildcard","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","MenuItem","exports","forwardRef","prefix","suffix","children","disabled","hideOnClick","store","props","ref","menuContext","useContext","MenuContext","Error","computedStore","jsxs","accessibleWhenDisabled","jsx","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":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,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