@wordpress/components 28.13.1-next.082ed6819.0 → 29.0.1-next.a9f418477.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/CHANGELOG.md +51 -2
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/angle-picker-control/index.js +1 -1
  4. package/build/angle-picker-control/index.js.map +1 -1
  5. package/build/animation/index.js +0 -6
  6. package/build/animation/index.js.map +1 -1
  7. package/build/autocomplete/index.js +0 -1
  8. package/build/autocomplete/index.js.map +1 -1
  9. package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
  10. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  11. package/build/border-control/border-control/component.js +2 -0
  12. package/build/border-control/border-control/component.js.map +1 -1
  13. package/build/box-control/all-input-control.js +1 -0
  14. package/build/box-control/all-input-control.js.map +1 -1
  15. package/build/box-control/axial-input-controls.js +1 -0
  16. package/build/box-control/axial-input-controls.js.map +1 -1
  17. package/build/box-control/index.js +22 -15
  18. package/build/box-control/index.js.map +1 -1
  19. package/build/box-control/input-controls.js +1 -0
  20. package/build/box-control/input-controls.js.map +1 -1
  21. package/build/box-control/types.js.map +1 -1
  22. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  23. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  24. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  25. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  26. package/build/clipboard-button/index.js +5 -3
  27. package/build/clipboard-button/index.js.map +1 -1
  28. package/build/color-palette/index.native.js +0 -1
  29. package/build/color-palette/index.native.js.map +1 -1
  30. package/build/color-picker/input-with-slider.js +2 -2
  31. package/build/color-picker/input-with-slider.js.map +1 -1
  32. package/build/composite/item.js +0 -9
  33. package/build/composite/item.js.map +1 -1
  34. package/build/context/context-connect.js +0 -1
  35. package/build/context/context-connect.js.map +1 -1
  36. package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  37. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  38. package/build/custom-gradient-picker/index.js +2 -0
  39. package/build/custom-gradient-picker/index.js.map +1 -1
  40. package/build/custom-gradient-picker/types.js.map +1 -1
  41. package/build/custom-select-control/index.js +8 -0
  42. package/build/custom-select-control/index.js.map +1 -1
  43. package/build/custom-select-control/types.js.map +1 -1
  44. package/build/drop-zone/index.js +19 -13
  45. package/build/drop-zone/index.js.map +1 -1
  46. package/build/drop-zone/types.js.map +1 -1
  47. package/build/dropdown-menu/index.js +1 -0
  48. package/build/dropdown-menu/index.js.map +1 -1
  49. package/build/duotone-picker/color-list-picker/index.js +9 -14
  50. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  51. package/build/external-link/index.js +0 -1
  52. package/build/external-link/index.js.map +1 -1
  53. package/build/font-size-picker/font-size-picker-select.js +1 -0
  54. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  55. package/build/font-size-picker/index.js +1 -0
  56. package/build/font-size-picker/index.js.map +1 -1
  57. package/build/form-file-upload/index.js +11 -1
  58. package/build/form-file-upload/index.js.map +1 -1
  59. package/build/form-file-upload/types.js.map +1 -1
  60. package/build/form-token-field/index.js +6 -1
  61. package/build/form-token-field/index.js.map +1 -1
  62. package/build/gradient-picker/index.js +2 -0
  63. package/build/gradient-picker/index.js.map +1 -1
  64. package/build/gradient-picker/types.js.map +1 -1
  65. package/build/icon/index.js +9 -0
  66. package/build/icon/index.js.map +1 -1
  67. package/build/index.js +0 -6
  68. package/build/index.js.map +1 -1
  69. package/build/menu/checkbox-item.js +5 -9
  70. package/build/menu/checkbox-item.js.map +1 -1
  71. package/build/menu/group-label.js +4 -1
  72. package/build/menu/group-label.js.map +1 -1
  73. package/build/menu/group.js +4 -1
  74. package/build/menu/group.js.map +1 -1
  75. package/build/menu/item-help-text.js +5 -0
  76. package/build/menu/item-help-text.js.map +1 -1
  77. package/build/menu/item-label.js +5 -0
  78. package/build/menu/item-label.js.map +1 -1
  79. package/build/menu/item.js +4 -8
  80. package/build/menu/item.js.map +1 -1
  81. package/build/menu/radio-item.js +5 -9
  82. package/build/menu/radio-item.js.map +1 -1
  83. package/build/menu/separator.js +5 -2
  84. package/build/menu/separator.js.map +1 -1
  85. package/build/modal/aria-helper.js +0 -1
  86. package/build/modal/aria-helper.js.map +1 -1
  87. package/build/modal/index.js +0 -1
  88. package/build/modal/index.js.map +1 -1
  89. package/build/number-control/index.js +8 -0
  90. package/build/number-control/index.js.map +1 -1
  91. package/build/number-control/types.js.map +1 -1
  92. package/build/range-control/index.js +2 -1
  93. package/build/range-control/index.js.map +1 -1
  94. package/build/range-control/mark.js +0 -1
  95. package/build/range-control/mark.js.map +1 -1
  96. package/build/range-control/styles/range-control-styles.js +33 -45
  97. package/build/range-control/styles/range-control-styles.js.map +1 -1
  98. package/build/resizable-box/index.js +9 -1
  99. package/build/resizable-box/index.js.map +1 -1
  100. package/build/slot-fill/bubbles-virtually/fill.js +8 -12
  101. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  102. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  103. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  104. package/build/slot-fill/bubbles-virtually/slot.js +4 -10
  105. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  106. package/build/slot-fill/types.js.map +1 -1
  107. package/build/style-provider/index.js +0 -1
  108. package/build/style-provider/index.js.map +1 -1
  109. package/build/tabs/tab.js +0 -17
  110. package/build/tabs/tab.js.map +1 -1
  111. package/build/toolbar/toolbar-button/index.js +2 -0
  112. package/build/toolbar/toolbar-button/index.js.map +1 -1
  113. package/build/tools-panel/tools-panel/component.js +2 -0
  114. package/build/tools-panel/tools-panel/component.js.map +1 -1
  115. package/build/tree-grid/cell.js +4 -1
  116. package/build/tree-grid/cell.js.map +1 -1
  117. package/build/tree-grid/types.js.map +1 -1
  118. package/build/unit-control/index.js +10 -1
  119. package/build/unit-control/index.js.map +1 -1
  120. package/build/unit-control/types.js.map +1 -1
  121. package/build-module/angle-picker-control/index.js +1 -1
  122. package/build-module/angle-picker-control/index.js.map +1 -1
  123. package/build-module/animation/index.js +1 -1
  124. package/build-module/animation/index.js.map +1 -1
  125. package/build-module/autocomplete/index.js +0 -1
  126. package/build-module/autocomplete/index.js.map +1 -1
  127. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -1
  128. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  129. package/build-module/border-control/border-control/component.js +2 -0
  130. package/build-module/border-control/border-control/component.js.map +1 -1
  131. package/build-module/box-control/all-input-control.js +1 -0
  132. package/build-module/box-control/all-input-control.js.map +1 -1
  133. package/build-module/box-control/axial-input-controls.js +1 -0
  134. package/build-module/box-control/axial-input-controls.js.map +1 -1
  135. package/build-module/box-control/index.js +22 -15
  136. package/build-module/box-control/index.js.map +1 -1
  137. package/build-module/box-control/input-controls.js +1 -0
  138. package/build-module/box-control/input-controls.js.map +1 -1
  139. package/build-module/box-control/types.js.map +1 -1
  140. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  141. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  142. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  143. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  144. package/build-module/clipboard-button/index.js +5 -3
  145. package/build-module/clipboard-button/index.js.map +1 -1
  146. package/build-module/color-palette/index.native.js +0 -1
  147. package/build-module/color-palette/index.native.js.map +1 -1
  148. package/build-module/color-picker/input-with-slider.js +2 -2
  149. package/build-module/color-picker/input-with-slider.js.map +1 -1
  150. package/build-module/composite/item.js +0 -9
  151. package/build-module/composite/item.js.map +1 -1
  152. package/build-module/context/context-connect.js +0 -1
  153. package/build-module/context/context-connect.js.map +1 -1
  154. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  155. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  156. package/build-module/custom-gradient-picker/index.js +2 -0
  157. package/build-module/custom-gradient-picker/index.js.map +1 -1
  158. package/build-module/custom-gradient-picker/types.js.map +1 -1
  159. package/build-module/custom-select-control/index.js +8 -0
  160. package/build-module/custom-select-control/index.js.map +1 -1
  161. package/build-module/custom-select-control/types.js.map +1 -1
  162. package/build-module/drop-zone/index.js +19 -13
  163. package/build-module/drop-zone/index.js.map +1 -1
  164. package/build-module/drop-zone/types.js.map +1 -1
  165. package/build-module/dropdown-menu/index.js +1 -0
  166. package/build-module/dropdown-menu/index.js.map +1 -1
  167. package/build-module/duotone-picker/color-list-picker/index.js +10 -15
  168. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  169. package/build-module/external-link/index.js +0 -1
  170. package/build-module/external-link/index.js.map +1 -1
  171. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  172. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  173. package/build-module/font-size-picker/index.js +1 -0
  174. package/build-module/font-size-picker/index.js.map +1 -1
  175. package/build-module/form-file-upload/index.js +13 -2
  176. package/build-module/form-file-upload/index.js.map +1 -1
  177. package/build-module/form-file-upload/types.js.map +1 -1
  178. package/build-module/form-token-field/index.js +6 -1
  179. package/build-module/form-token-field/index.js.map +1 -1
  180. package/build-module/gradient-picker/index.js +2 -0
  181. package/build-module/gradient-picker/index.js.map +1 -1
  182. package/build-module/gradient-picker/types.js.map +1 -1
  183. package/build-module/icon/index.js +9 -0
  184. package/build-module/icon/index.js.map +1 -1
  185. package/build-module/index.js +1 -1
  186. package/build-module/index.js.map +1 -1
  187. package/build-module/menu/checkbox-item.js +5 -9
  188. package/build-module/menu/checkbox-item.js.map +1 -1
  189. package/build-module/menu/group-label.js +4 -1
  190. package/build-module/menu/group-label.js.map +1 -1
  191. package/build-module/menu/group.js +4 -1
  192. package/build-module/menu/group.js.map +1 -1
  193. package/build-module/menu/item-help-text.js +6 -1
  194. package/build-module/menu/item-help-text.js.map +1 -1
  195. package/build-module/menu/item-label.js +6 -1
  196. package/build-module/menu/item-label.js.map +1 -1
  197. package/build-module/menu/item.js +4 -8
  198. package/build-module/menu/item.js.map +1 -1
  199. package/build-module/menu/radio-item.js +5 -9
  200. package/build-module/menu/radio-item.js.map +1 -1
  201. package/build-module/menu/separator.js +5 -2
  202. package/build-module/menu/separator.js.map +1 -1
  203. package/build-module/modal/aria-helper.js +0 -1
  204. package/build-module/modal/aria-helper.js.map +1 -1
  205. package/build-module/modal/index.js +0 -1
  206. package/build-module/modal/index.js.map +1 -1
  207. package/build-module/number-control/index.js +8 -0
  208. package/build-module/number-control/index.js.map +1 -1
  209. package/build-module/number-control/types.js.map +1 -1
  210. package/build-module/range-control/index.js +2 -1
  211. package/build-module/range-control/index.js.map +1 -1
  212. package/build-module/range-control/mark.js +0 -1
  213. package/build-module/range-control/mark.js.map +1 -1
  214. package/build-module/range-control/styles/range-control-styles.js +33 -45
  215. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  216. package/build-module/resizable-box/index.js +9 -1
  217. package/build-module/resizable-box/index.js.map +1 -1
  218. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
  219. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  220. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  221. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  222. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
  223. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  224. package/build-module/slot-fill/types.js.map +1 -1
  225. package/build-module/style-provider/index.js +0 -1
  226. package/build-module/style-provider/index.js.map +1 -1
  227. package/build-module/tabs/tab.js +0 -15
  228. package/build-module/tabs/tab.js.map +1 -1
  229. package/build-module/toolbar/toolbar-button/index.js +2 -0
  230. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  231. package/build-module/tools-panel/tools-panel/component.js +2 -0
  232. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  233. package/build-module/tree-grid/cell.js +4 -1
  234. package/build-module/tree-grid/cell.js.map +1 -1
  235. package/build-module/tree-grid/types.js.map +1 -1
  236. package/build-module/unit-control/index.js +10 -1
  237. package/build-module/unit-control/index.js.map +1 -1
  238. package/build-module/unit-control/types.js.map +1 -1
  239. package/build-style/style-rtl.css +15 -11
  240. package/build-style/style.css +15 -11
  241. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  242. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  243. package/build-types/animation/index.d.ts +1 -1
  244. package/build-types/animation/index.d.ts.map +1 -1
  245. package/build-types/base-control/hooks.d.ts +4 -4
  246. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  247. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  248. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  249. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  250. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  251. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  252. package/build-types/border-control/border-control/hook.d.ts +83 -83
  253. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  254. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  255. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  256. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  257. package/build-types/box-control/index.d.ts +14 -13
  258. package/build-types/box-control/index.d.ts.map +1 -1
  259. package/build-types/box-control/input-controls.d.ts.map +1 -1
  260. package/build-types/box-control/stories/index.story.d.ts +852 -816
  261. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  262. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  263. package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
  264. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  265. package/build-types/box-control/types.d.ts +16 -2
  266. package/build-types/box-control/types.d.ts.map +1 -1
  267. package/build-types/card/card/hook.d.ts +83 -83
  268. package/build-types/card/card-body/hook.d.ts +83 -83
  269. package/build-types/card/card-divider/hook.d.ts +84 -84
  270. package/build-types/card/card-footer/hook.d.ts +83 -83
  271. package/build-types/card/card-header/hook.d.ts +83 -83
  272. package/build-types/card/card-media/hook.d.ts +83 -83
  273. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  274. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  275. package/build-types/clipboard-button/index.d.ts.map +1 -1
  276. package/build-types/color-picker/styles.d.ts +3 -2
  277. package/build-types/color-picker/styles.d.ts.map +1 -1
  278. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  279. package/build-types/composite/index.d.ts.map +1 -1
  280. package/build-types/composite/item.d.ts.map +1 -1
  281. package/build-types/context/constants.d.ts.map +1 -1
  282. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  283. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  284. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  285. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  286. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  287. package/build-types/custom-gradient-picker/types.d.ts +6 -0
  288. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  289. package/build-types/custom-select-control/index.d.ts.map +1 -1
  290. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  291. package/build-types/custom-select-control/types.d.ts +7 -0
  292. package/build-types/custom-select-control/types.d.ts.map +1 -1
  293. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  294. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  295. package/build-types/date-time/date/styles.d.ts.map +1 -1
  296. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  297. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  298. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  299. package/build-types/date-time/time/styles.d.ts +8 -4
  300. package/build-types/date-time/time/styles.d.ts.map +1 -1
  301. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/drop-zone/index.d.ts +1 -1
  303. package/build-types/drop-zone/index.d.ts.map +1 -1
  304. package/build-types/drop-zone/types.d.ts +5 -0
  305. package/build-types/drop-zone/types.d.ts.map +1 -1
  306. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  307. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  308. package/build-types/elevation/hook.d.ts +83 -83
  309. package/build-types/flex/flex/hook.d.ts +83 -83
  310. package/build-types/flex/flex-block/hook.d.ts +83 -83
  311. package/build-types/flex/flex-item/hook.d.ts +83 -83
  312. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  313. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
  314. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  315. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  316. package/build-types/font-size-picker/index.d.ts.map +1 -1
  317. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  318. package/build-types/form-file-upload/index.d.ts +2 -1
  319. package/build-types/form-file-upload/index.d.ts.map +1 -1
  320. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  321. package/build-types/form-file-upload/types.d.ts +10 -8
  322. package/build-types/form-file-upload/types.d.ts.map +1 -1
  323. package/build-types/form-token-field/index.d.ts.map +1 -1
  324. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  325. package/build-types/gradient-picker/index.d.ts +1 -1
  326. package/build-types/gradient-picker/index.d.ts.map +1 -1
  327. package/build-types/gradient-picker/types.d.ts +6 -0
  328. package/build-types/gradient-picker/types.d.ts.map +1 -1
  329. package/build-types/grid/hook.d.ts +83 -83
  330. package/build-types/h-stack/hook.d.ts +83 -83
  331. package/build-types/heading/hook.d.ts +82 -82
  332. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  333. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  334. package/build-types/icon/index.d.ts +23 -7
  335. package/build-types/icon/index.d.ts.map +1 -1
  336. package/build-types/icon/stories/index.story.d.ts +7 -1
  337. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  338. package/build-types/index.d.ts +1 -1
  339. package/build-types/index.d.ts.map +1 -1
  340. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  341. package/build-types/item-group/item/hook.d.ts +83 -83
  342. package/build-types/item-group/item-group/hook.d.ts +83 -83
  343. package/build-types/lock-unlock.d.ts +2 -2
  344. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  345. package/build-types/menu/group-label.d.ts.map +1 -1
  346. package/build-types/menu/group.d.ts.map +1 -1
  347. package/build-types/menu/index.d.ts.map +1 -1
  348. package/build-types/menu/item-help-text.d.ts.map +1 -1
  349. package/build-types/menu/item-label.d.ts.map +1 -1
  350. package/build-types/menu/item.d.ts.map +1 -1
  351. package/build-types/menu/radio-item.d.ts.map +1 -1
  352. package/build-types/menu/separator.d.ts.map +1 -1
  353. package/build-types/menu/styles.d.ts.map +1 -1
  354. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  355. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  356. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  357. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  358. package/build-types/number-control/index.d.ts +2 -1
  359. package/build-types/number-control/index.d.ts.map +1 -1
  360. package/build-types/number-control/stories/index.story.d.ts +2 -1
  361. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  362. package/build-types/number-control/types.d.ts +7 -0
  363. package/build-types/number-control/types.d.ts.map +1 -1
  364. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  365. package/build-types/progress-bar/styles.d.ts.map +1 -1
  366. package/build-types/range-control/index.d.ts +1 -1
  367. package/build-types/range-control/index.d.ts.map +1 -1
  368. package/build-types/range-control/mark.d.ts.map +1 -1
  369. package/build-types/range-control/styles/range-control-styles.d.ts +4 -3
  370. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  371. package/build-types/resizable-box/index.d.ts.map +1 -1
  372. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  373. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  374. package/build-types/scrollable/hook.d.ts +83 -83
  375. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  376. package/build-types/select-control/index.d.ts.map +1 -1
  377. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  378. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  379. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  380. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  381. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  382. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  383. package/build-types/slot-fill/types.d.ts +4 -3
  384. package/build-types/slot-fill/types.d.ts.map +1 -1
  385. package/build-types/spacer/hook.d.ts +83 -83
  386. package/build-types/spinner/styles.d.ts.map +1 -1
  387. package/build-types/surface/hook.d.ts +83 -83
  388. package/build-types/tabs/tab.d.ts +3 -0
  389. package/build-types/tabs/tab.d.ts.map +1 -1
  390. package/build-types/text/hook.d.ts +83 -83
  391. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  392. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  393. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  394. package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
  395. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  396. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  397. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  398. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  399. package/build-types/tree-grid/cell.d.ts.map +1 -1
  400. package/build-types/tree-grid/types.d.ts +1 -1
  401. package/build-types/tree-grid/types.d.ts.map +1 -1
  402. package/build-types/truncate/hook.d.ts +83 -83
  403. package/build-types/unit-control/index.d.ts +3 -2
  404. package/build-types/unit-control/index.d.ts.map +1 -1
  405. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  406. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
  407. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  408. package/build-types/unit-control/types.d.ts +7 -0
  409. package/build-types/unit-control/types.d.ts.map +1 -1
  410. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  411. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  412. package/build-types/utils/rtl.d.ts +1 -1
  413. package/build-types/utils/rtl.d.ts.map +1 -1
  414. package/build-types/v-stack/hook.d.ts +83 -83
  415. package/build-types/z-stack/styles.d.ts.map +1 -1
  416. package/package.json +20 -20
  417. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  418. package/src/angle-picker-control/index.tsx +1 -1
  419. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  420. package/src/animation/index.tsx +0 -1
  421. package/src/base-control/stories/index.story.tsx +1 -1
  422. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
  423. package/src/border-box-control/stories/index.story.tsx +1 -1
  424. package/src/border-control/border-control/component.tsx +2 -0
  425. package/src/border-control/stories/index.story.tsx +1 -1
  426. package/src/box-control/README.md +80 -60
  427. package/src/box-control/all-input-control.tsx +1 -0
  428. package/src/box-control/axial-input-controls.tsx +1 -0
  429. package/src/box-control/docs-manifest.json +5 -0
  430. package/src/box-control/index.tsx +23 -15
  431. package/src/box-control/input-controls.tsx +1 -0
  432. package/src/box-control/stories/index.story.tsx +2 -1
  433. package/src/box-control/test/index.tsx +33 -26
  434. package/src/box-control/types.ts +71 -54
  435. package/src/button-group/stories/index.story.tsx +1 -1
  436. package/src/card/stories/index.story.tsx +2 -2
  437. package/src/checkbox-control/stories/index.story.tsx +1 -1
  438. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  439. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  440. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  441. package/src/circular-option-picker/style.scss +2 -2
  442. package/src/clipboard-button/index.tsx +5 -3
  443. package/src/color-palette/stories/index.story.tsx +3 -3
  444. package/src/color-picker/input-with-slider.tsx +1 -1
  445. package/src/color-picker/stories/index.story.tsx +2 -2
  446. package/src/combobox-control/stories/index.story.tsx +1 -1
  447. package/src/composite/item.tsx +1 -19
  448. package/src/composite/stories/index.story.tsx +3 -3
  449. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  450. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  451. package/src/custom-gradient-picker/index.tsx +2 -0
  452. package/src/custom-gradient-picker/style.scss +1 -1
  453. package/src/custom-gradient-picker/types.ts +6 -0
  454. package/src/custom-select-control/README.md +2 -0
  455. package/src/custom-select-control/index.tsx +9 -0
  456. package/src/custom-select-control/stories/index.story.tsx +3 -2
  457. package/src/custom-select-control/test/index.tsx +13 -9
  458. package/src/custom-select-control/types.ts +7 -0
  459. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  460. package/src/date-time/stories/date-time.story.tsx +4 -1
  461. package/src/date-time/stories/date.story.tsx +4 -1
  462. package/src/date-time/stories/time.story.tsx +4 -1
  463. package/src/dimension-control/stories/index.story.tsx +1 -1
  464. package/src/disabled/stories/index.story.tsx +3 -3
  465. package/src/divider/stories/index.story.tsx +1 -1
  466. package/src/draggable/stories/index.story.tsx +2 -2
  467. package/src/drop-zone/index.tsx +21 -24
  468. package/src/drop-zone/types.ts +5 -0
  469. package/src/dropdown/stories/index.story.tsx +7 -7
  470. package/src/dropdown-menu/index.tsx +4 -1
  471. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  472. package/src/dropdown-menu/style.scss +1 -1
  473. package/src/duotone-picker/color-list-picker/index.tsx +8 -8
  474. package/src/duotone-picker/color-list-picker/style.scss +0 -6
  475. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  476. package/src/flex/stories/index.story.tsx +1 -1
  477. package/src/font-size-picker/font-size-picker-select.tsx +1 -0
  478. package/src/font-size-picker/index.tsx +1 -0
  479. package/src/font-size-picker/stories/index.story.tsx +1 -1
  480. package/src/form-file-upload/README.md +58 -48
  481. package/src/form-file-upload/docs-manifest.json +5 -0
  482. package/src/form-file-upload/index.tsx +12 -1
  483. package/src/form-file-upload/stories/index.story.tsx +4 -3
  484. package/src/form-file-upload/test/index.tsx +5 -1
  485. package/src/form-file-upload/types.ts +10 -8
  486. package/src/form-token-field/README.md +1 -0
  487. package/src/form-token-field/index.tsx +7 -0
  488. package/src/form-token-field/stories/index.story.tsx +4 -2
  489. package/src/form-token-field/test/index.tsx +5 -1
  490. package/src/gradient-picker/README.md +8 -0
  491. package/src/gradient-picker/index.tsx +2 -0
  492. package/src/gradient-picker/stories/index.story.tsx +1 -1
  493. package/src/gradient-picker/types.ts +6 -0
  494. package/src/grid/stories/index.story.tsx +1 -1
  495. package/src/h-stack/stories/index.story.tsx +2 -2
  496. package/src/icon/README.md +22 -65
  497. package/src/icon/docs-manifest.json +5 -0
  498. package/src/icon/index.tsx +28 -13
  499. package/src/icon/stories/index.story.tsx +50 -8
  500. package/src/index.ts +1 -5
  501. package/src/input-control/stories/index.story.tsx +4 -4
  502. package/src/item-group/stories/index.story.tsx +2 -2
  503. package/src/menu/checkbox-item.tsx +9 -7
  504. package/src/menu/group-label.tsx +8 -1
  505. package/src/menu/group.tsx +8 -1
  506. package/src/menu/item-help-text.tsx +10 -1
  507. package/src/menu/item-label.tsx +10 -1
  508. package/src/menu/item.tsx +8 -6
  509. package/src/menu/radio-item.tsx +9 -7
  510. package/src/menu/separator.tsx +9 -2
  511. package/src/menu/stories/index.story.tsx +2 -2
  512. package/src/menu-group/stories/index.story.tsx +1 -1
  513. package/src/menu-item/stories/index.story.tsx +1 -1
  514. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  515. package/src/menu-items-choice/style.scss +1 -0
  516. package/src/modal/stories/index.story.tsx +2 -2
  517. package/src/modal/test/index.tsx +2 -1
  518. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  519. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  520. package/src/navigation/stories/index.story.tsx +4 -4
  521. package/src/navigator/stories/index.story.tsx +3 -3
  522. package/src/number-control/README.md +2 -1
  523. package/src/number-control/index.tsx +9 -0
  524. package/src/number-control/stories/index.story.tsx +2 -1
  525. package/src/number-control/test/index.tsx +5 -1
  526. package/src/number-control/types.ts +7 -0
  527. package/src/panel/stories/index.story.tsx +1 -1
  528. package/src/placeholder/stories/index.story.tsx +3 -3
  529. package/src/popover/stories/index.story.tsx +11 -9
  530. package/src/query-controls/stories/index.story.tsx +6 -6
  531. package/src/radio-control/stories/index.story.tsx +1 -1
  532. package/src/radio-group/stories/index.story.tsx +3 -3
  533. package/src/range-control/index.tsx +1 -0
  534. package/src/range-control/mark.tsx +0 -1
  535. package/src/range-control/stories/index.story.tsx +7 -7
  536. package/src/range-control/styles/range-control-styles.ts +18 -19
  537. package/src/resizable-box/index.tsx +10 -0
  538. package/src/resizable-box/stories/index.story.tsx +1 -1
  539. package/src/resizable-box/style.scss +8 -0
  540. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  541. package/src/sandbox/stories/index.story.tsx +1 -1
  542. package/src/scrollable/stories/index.story.tsx +2 -1
  543. package/src/search-control/stories/index.story.tsx +1 -1
  544. package/src/select-control/stories/index.story.tsx +1 -1
  545. package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
  546. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
  547. package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
  548. package/src/slot-fill/stories/index.story.tsx +2 -2
  549. package/src/slot-fill/types.ts +4 -3
  550. package/src/snackbar/stories/index.story.tsx +4 -4
  551. package/src/snackbar/stories/list.story.tsx +2 -2
  552. package/src/surface/stories/index.story.tsx +1 -1
  553. package/src/tabs/tab.tsx +0 -18
  554. package/src/tabs/test/index.tsx +1492 -947
  555. package/src/text-control/stories/index.story.tsx +1 -1
  556. package/src/textarea-control/stories/index.story.tsx +1 -1
  557. package/src/theme/stories/index.story.tsx +1 -1
  558. package/src/toggle-control/stories/index.story.tsx +1 -1
  559. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  560. package/src/toolbar/stories/index.story.tsx +1 -1
  561. package/src/toolbar/toolbar-button/index.tsx +2 -0
  562. package/src/tools-panel/stories/index.story.tsx +15 -3
  563. package/src/tools-panel/test/index.tsx +0 -17
  564. package/src/tools-panel/tools-panel/README.md +4 -0
  565. package/src/tools-panel/tools-panel/component.tsx +2 -0
  566. package/src/tooltip/stories/index.story.tsx +1 -1
  567. package/src/tree-grid/cell.tsx +5 -1
  568. package/src/tree-grid/stories/index.story.tsx +1 -1
  569. package/src/tree-grid/types.ts +1 -1
  570. package/src/tree-select/stories/index.story.tsx +1 -1
  571. package/src/unit-control/README.md +3 -3
  572. package/src/unit-control/index.tsx +11 -1
  573. package/src/unit-control/stories/index.story.tsx +5 -4
  574. package/src/unit-control/test/index.tsx +5 -1
  575. package/src/unit-control/types.ts +7 -0
  576. package/src/view/stories/index.story.tsx +1 -1
  577. package/src/visually-hidden/stories/index.story.tsx +1 -1
  578. package/src/z-stack/stories/index.story.tsx +1 -1
  579. package/tsconfig.tsbuildinfo +1 -1
  580. package/build/menu/use-temporary-focus-visible-fix.js +0 -27
  581. package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
  582. package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
  583. package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
  584. package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
  585. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
  586. package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_numberControl","_interopRequireDefault","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","rangeHeightValue","railHeight","rangeHeight","css","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","exports","_base","default","target","label","wrapperColor","color","COLORS","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","shouldForwardProp","prop","includes","BeforeIconWrapper","rtl","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","CONFIG","radiusFull","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","markFill","isFilled","backgroundColor","Mark","markLabelFill","MarkLabel","left","transform","thumbColor","theme","accent","ThumbWrapper","radiusRound","thumbFocus","isFocused","Thumb","elevationXSmall","InputRange","tooltipShow","show","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","radiusSmall","InputNumber","NumberControl","space","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, rtl, CONFIG } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled( 'div', {\n\tshouldForwardProp: ( prop: string ) =>\n\t\t! [ 'color', '__nextHasNoMarginBottom', 'marks' ].includes( prop ),\n} )< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ CONFIG.radiusFull };\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ CONFIG.radiusFull };\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n`;\n\nconst markFill = ( { disabled, isFilled }: RangeMarkProps ) => {\n\tlet backgroundColor = isFilled ? 'currentColor' : COLORS.gray[ 300 ];\n\n\tif ( disabled ) {\n\t\tbackgroundColor = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( {\n\t\tbackgroundColor,\n\t} );\n};\n\nexport const Mark = styled.span`\n\theight: ${ thumbSize }px;\n\tleft: 0;\n\tposition: absolute;\n\ttop: 9px;\n\twidth: 1px;\n\n\t${ markFill };\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 22px;\n\twhite-space: nowrap;\n\n\t${ rtl( { left: 0 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( -50% )' },\n\t\t{ transform: 'translateX( 50% )' }\n\t) };\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: ${ CONFIG.radiusRound };\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: ${ CONFIG.radiusRound };\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: ${ CONFIG.radiusRound };\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\tbox-shadow: ${ CONFIG.elevationXSmall };\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css`\n\t\tdisplay: ${ show ? 'inline-block' : 'none' };\n\t\topacity: ${ show ? 1 : 0 };\n\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\ttransition:\n\t\t\t\topacity 120ms ease,\n\t\t\t\tdisplay 120ms ease allow-discrete;\n\t\t}\n\n\t\t@starting-style {\n\t\t\topacity: 0;\n\t\t}\n\t`;\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tcolor: white;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\n\t${ tooltipPosition };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;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EA,SAAS,EAAE;AAAkB,CAChC,CAAC,SAAAvD,OAAA,CAAAC,GAAA,CAAAC,QAAA,4oVACD;;AAED;AACA;AACO,MAAMyE,WAAW,GAAApE,OAAA,CAAAoE,WAAA,gBAAG,IAAAnE,KAAA,CAAAC,OAAA,EAAQmE,sBAAa,EAAA5E,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAQ,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,4EAM7Cf,WAAW,QAGZ,IAAA+B,UAAG,EAAE;EAAEG,UAAU,EAAE,GAAI,IAAA+C,YAAK,EAAE,CAAE,CAAC;AAAe,CAAE,CAAC,SAAA7E,OAAA,CAAAC,GAAA,CAAAC,QAAA,4oVACtD;AAEM,MAAM4E,kBAAkB,GAAAvE,OAAA,CAAAuE,kBAAA,oBAAAtE,KAAA,CAAAC,OAAA,UAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAQ,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,uEAO1Bf,WAAW,QAGZ,IAAA+B,UAAG,EAAE;EAAEG,UAAU,EAAE;AAAE,CAAE,CAAC,SAAA9B,OAAA,CAAAC,GAAA,CAAAC,QAAA,4oVAC3B","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_numberControl","_interopRequireDefault","_utils","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","rangeHeightValue","railHeight","rangeHeight","css","height","minHeight","process","env","NODE_ENV","thumbSize","deprecatedHeight","__next40pxDefaultSize","Root","exports","_base","default","target","label","wrapperColor","color","COLORS","ui","borderFocus","wrapperMargin","marks","__nextHasNoMarginBottom","marginBottom","undefined","Wrapper","shouldForwardProp","prop","includes","BeforeIconWrapper","rtl","marginRight","AfterIconWrapper","marginLeft","railBackgroundColor","disabled","railColor","background","backgroundDisabled","Rail","gray","CONFIG","radiusFull","trackBackgroundColor","trackColor","Track","MarksWrapper","name","styles","map","toString","Mark","markLabelFill","isFilled","MarkLabel","left","transform","thumbColor","theme","accent","ThumbWrapper","radiusRound","thumbFocus","isFocused","Thumb","elevationXSmall","InputRange","tooltipShow","show","_ref","_ref2","tooltipPosition","position","isBottom","Tooltip","radiusSmall","InputNumber","NumberControl","space","ActionRightWrapper"],"sources":["@wordpress/components/src/range-control/styles/range-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport NumberControl from '../../number-control';\nimport { COLORS, rtl, CONFIG } from '../../utils';\nimport { space } from '../../utils/space';\n\nimport type {\n\tRangeMarkProps,\n\tRailProps,\n\tThumbProps,\n\tTooltipProps,\n\tTrackProps,\n\tWrapperProps,\n\tRangeControlProps,\n} from '../types';\n\nconst rangeHeightValue = 30;\nconst railHeight = 4;\nconst rangeHeight = () =>\n\tcss( { height: rangeHeightValue, minHeight: rangeHeightValue } );\nconst thumbSize = 12;\n\nconst deprecatedHeight = ( {\n\t__next40pxDefaultSize,\n}: Pick< RangeControlProps, '__next40pxDefaultSize' > ) =>\n\t! __next40pxDefaultSize && css( { minHeight: rangeHeightValue } );\n\ntype RootProps = Pick< RangeControlProps, '__next40pxDefaultSize' >;\nexport const Root = styled.div< RootProps >`\n\t-webkit-tap-highlight-color: transparent;\n\talign-items: center;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tpadding: 0;\n\tposition: relative;\n\ttouch-action: none;\n\twidth: 100%;\n\tmin-height: 40px;\n\t/* TODO: remove after removing the __next40pxDefaultSize prop */\n\t${ deprecatedHeight };\n`;\n\nconst wrapperColor = ( { color = COLORS.ui.borderFocus }: WrapperProps ) =>\n\tcss( { color } );\n\nconst wrapperMargin = ( { marks, __nextHasNoMarginBottom }: WrapperProps ) => {\n\tif ( ! __nextHasNoMarginBottom ) {\n\t\treturn css( { marginBottom: marks ? 16 : undefined } );\n\t}\n\treturn '';\n};\n\nexport const Wrapper = styled( 'div', {\n\tshouldForwardProp: ( prop: string ) =>\n\t\t! [ 'color', '__nextHasNoMarginBottom', 'marks' ].includes( prop ),\n} )< WrapperProps >`\n\tdisplay: block;\n\tflex: 1;\n\tposition: relative;\n\twidth: 100%;\n\n\t${ wrapperColor };\n\t${ rangeHeight };\n\t${ wrapperMargin };\n`;\n\nexport const BeforeIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginRight: 6 } ) }\n`;\n\nexport const AfterIconWrapper = styled.span`\n\tdisplay: flex; // ensures the height isn't affected by line-height\n\tmargin-top: ${ railHeight }px;\n\n\t${ rtl( { marginLeft: 6 } ) }\n`;\n\nconst railBackgroundColor = ( { disabled, railColor }: RailProps ) => {\n\tlet background = railColor || '';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.ui.backgroundDisabled;\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Rail = styled.span`\n\tbackground-color: ${ COLORS.gray[ 300 ] };\n\tleft: 0;\n\tpointer-events: none;\n\tright: 0;\n\tdisplay: block;\n\theight: ${ railHeight }px;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\tborder-radius: ${ CONFIG.radiusFull };\n\n\t${ railBackgroundColor };\n`;\n\nconst trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {\n\tlet background = trackColor || 'currentColor';\n\n\tif ( disabled ) {\n\t\tbackground = COLORS.gray[ 400 ];\n\t}\n\n\treturn css( { background } );\n};\n\nexport const Track = styled.span`\n\tbackground-color: currentColor;\n\tborder-radius: ${ CONFIG.radiusFull };\n\theight: ${ railHeight }px;\n\tpointer-events: none;\n\tdisplay: block;\n\tposition: absolute;\n\tmargin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;\n\ttop: 0;\n\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: width ease 0.1s;\n\t}\n\n\t${ trackBackgroundColor };\n`;\n\nexport const MarksWrapper = styled.span`\n\tdisplay: block;\n\tpointer-events: none;\n\tposition: relative;\n\twidth: 100%;\n\tuser-select: none;\n\tmargin-top: 17px;\n`;\n\nexport const Mark = styled.span`\n\tposition: absolute;\n\tleft: 0;\n\ttop: -4px;\n\theight: 4px;\n\twidth: 2px;\n\ttransform: translateX( -50% );\n\tbackground-color: ${ COLORS.ui.background };\n\tz-index: 1;\n`;\n\nconst markLabelFill = ( { isFilled }: RangeMarkProps ) => {\n\treturn css( {\n\t\tcolor: isFilled ? COLORS.gray[ 700 ] : COLORS.gray[ 300 ],\n\t} );\n};\n\nexport const MarkLabel = styled.span`\n\tcolor: ${ COLORS.gray[ 300 ] };\n\tfont-size: 11px;\n\tposition: absolute;\n\ttop: 8px;\n\twhite-space: nowrap;\n\n\t${ rtl( { left: 0 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( -50% )' },\n\t\t{ transform: 'translateX( 50% )' }\n\t) };\n\n\t${ markLabelFill };\n`;\n\nconst thumbColor = ( { disabled }: ThumbProps ) =>\n\tdisabled\n\t\t? css`\n\t\t\t\tbackground-color: ${ COLORS.gray[ 400 ] };\n\t\t `\n\t\t: css`\n\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t `;\n\nexport const ThumbWrapper = styled.span`\n\talign-items: center;\n\tdisplay: flex;\n\theight: ${ thumbSize }px;\n\tjustify-content: center;\n\tmargin-top: ${ ( rangeHeightValue - thumbSize ) / 2 }px;\n\toutline: 0;\n\tpointer-events: none;\n\tposition: absolute;\n\ttop: 0;\n\tuser-select: none;\n\twidth: ${ thumbSize }px;\n\tborder-radius: ${ CONFIG.radiusRound };\n\tz-index: 3;\n\n\t@media not ( prefers-reduced-motion ) {\n\t\ttransition: left ease 0.1s;\n\t}\n\n\t${ thumbColor };\n\t${ rtl( { marginLeft: -10 } ) };\n\t${ rtl(\n\t\t{ transform: 'translateX( 4.5px )' },\n\t\t{ transform: 'translateX( -4.5px )' }\n\t) };\n`;\n\nconst thumbFocus = ( { isFocused }: ThumbProps ) => {\n\treturn isFocused\n\t\t? css`\n\t\t\t\t&::before {\n\t\t\t\t\tcontent: ' ';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tbackground-color: ${ COLORS.theme.accent };\n\t\t\t\t\topacity: 0.4;\n\t\t\t\t\tborder-radius: ${ CONFIG.radiusRound };\n\t\t\t\t\theight: ${ thumbSize + 8 }px;\n\t\t\t\t\twidth: ${ thumbSize + 8 }px;\n\t\t\t\t\ttop: -4px;\n\t\t\t\t\tleft: -4px;\n\t\t\t\t}\n\t\t `\n\t\t: '';\n};\n\nexport const Thumb = styled.span< ThumbProps >`\n\talign-items: center;\n\tborder-radius: ${ CONFIG.radiusRound };\n\theight: 100%;\n\toutline: 0;\n\tposition: absolute;\n\tuser-select: none;\n\twidth: 100%;\n\tbox-shadow: ${ CONFIG.elevationXSmall };\n\n\t${ thumbColor };\n\t${ thumbFocus };\n`;\n\nexport const InputRange = styled.input`\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tdisplay: block;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0 -${ thumbSize / 2 }px;\n\topacity: 0;\n\toutline: none;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\twidth: calc( 100% + ${ thumbSize }px );\n`;\n\nconst tooltipShow = ( { show }: TooltipProps ) => {\n\treturn css`\n\t\tdisplay: ${ show ? 'inline-block' : 'none' };\n\t\topacity: ${ show ? 1 : 0 };\n\n\t\t@media not ( prefers-reduced-motion ) {\n\t\t\ttransition:\n\t\t\t\topacity 120ms ease,\n\t\t\t\tdisplay 120ms ease allow-discrete;\n\t\t}\n\n\t\t@starting-style {\n\t\t\topacity: 0;\n\t\t}\n\t`;\n};\n\nconst tooltipPosition = ( { position }: TooltipProps ) => {\n\tconst isBottom = position === 'bottom';\n\n\tif ( isBottom ) {\n\t\treturn css`\n\t\t\tbottom: -80%;\n\t\t`;\n\t}\n\n\treturn css`\n\t\ttop: -80%;\n\t`;\n};\n\nexport const Tooltip = styled.span< TooltipProps >`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: ${ CONFIG.radiusSmall };\n\tcolor: white;\n\tfont-size: 12px;\n\tmin-width: 32px;\n\tpadding: 4px 8px;\n\tpointer-events: none;\n\tposition: absolute;\n\ttext-align: center;\n\tuser-select: none;\n\tline-height: 1.4;\n\n\t${ tooltipShow };\n\n\t${ tooltipPosition };\n\t${ rtl(\n\t\t{ transform: 'translateX(-50%)' },\n\t\t{ transform: 'translateX(50%)' }\n\t) }\n`;\n\n// @todo Refactor RangeControl with latest HStack configuration\n// @see: packages/components/src/h-stack\nexport const InputNumber = styled( NumberControl )`\n\tdisplay: inline-block;\n\tfont-size: 13px;\n\tmargin-top: 0;\n\n\tinput[type='number']& {\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: `${ space( 4 ) } !important` } ) }\n`;\n\nexport const ActionRightWrapper = styled.span`\n\tdisplay: block;\n\tmargin-top: 0;\n\n\tbutton,\n\tbutton.is-small {\n\t\tmargin-left: 0;\n\t\t${ rangeHeight };\n\t}\n\n\t${ rtl( { marginLeft: 8 } ) }\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA0C,SAAAK,iCAAA,gPAX1C;AACA;AACA,GAFA,CAMA;AACA;AACA;AAeA,MAAMC,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,WAAW,GAAGA,CAAA,kBACnB,IAAAC,UAAG,EAAE;EAAEC,MAAM,EAAEJ,gBAAgB;EAAEK,SAAS,EAAEL;AAAiB,CAAC,EAAAM,OAAA,CAAAC,GAAA,CAAAC,QAAA,gDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,8oVAAC,CAAC;AACjE,MAAMC,SAAS,GAAG,EAAE;AAE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  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reResizable.Resizable, {
67
- className: (0, _clsx.default)('components-resizable-box__container', showHandle && 'has-show-handle', className),
67
+ className: (0, _clsx.default)('components-resizable-box__container', showHandle && 'has-show-handle', className)
68
+ // Add a focusable element within the drag handle. Unfortunately,
69
+ // `re-resizable` does not make them properly focusable by default,
70
+ // causing focus to move the the block wrapper which triggers block
71
+ // drag.
72
+ ,
73
+ handleComponent: Object.fromEntries(Object.keys(HANDLE_CLASSES).map(key => [key, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
74
+ tabIndex: -1
75
+ }, key)])),
68
76
  handleClasses: HANDLE_CLASSES,
69
77
  handleStyles: HANDLE_STYLES,
70
78
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_clsx","_interopRequireDefault","_reResizable","_resizeTooltip","_jsxRuntime","HANDLE_CLASS_NAME","SIDE_HANDLE_CLASS_NAME","CORNER_HANDLE_CLASS_NAME","HANDLE_CLASSES","top","clsx","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","HANDLE_STYLES_OVERRIDES","width","undefined","height","HANDLE_STYLES","UnforwardedResizableBox","className","children","showHandle","__experimentalShowTooltip","showTooltip","__experimentalTooltipProps","tooltipProps","props","ref","jsxs","Resizable","handleClasses","handleStyles","jsx","default","ResizableBox","exports","forwardRef","_default"],"sources":["@wordpress/components/src/resizable-box/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { Resizable } from 're-resizable';\nimport type { ResizableProps } from 're-resizable';\nimport type { ReactNode, ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ResizeTooltip from './resize-tooltip';\n\nconst HANDLE_CLASS_NAME = 'components-resizable-box__handle';\nconst SIDE_HANDLE_CLASS_NAME = 'components-resizable-box__side-handle';\nconst CORNER_HANDLE_CLASS_NAME = 'components-resizable-box__corner-handle';\n\nconst HANDLE_CLASSES = {\n\ttop: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top'\n\t),\n\tright: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottom: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom'\n\t),\n\tleft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-left'\n\t),\n\ttopLeft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top',\n\t\t'components-resizable-box__handle-left'\n\t),\n\ttopRight: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top',\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottomRight: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom',\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottomLeft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom',\n\t\t'components-resizable-box__handle-left'\n\t),\n};\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDES = {\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\nconst HANDLE_STYLES = {\n\ttop: HANDLE_STYLES_OVERRIDES,\n\tright: HANDLE_STYLES_OVERRIDES,\n\tbottom: HANDLE_STYLES_OVERRIDES,\n\tleft: HANDLE_STYLES_OVERRIDES,\n\ttopLeft: HANDLE_STYLES_OVERRIDES,\n\ttopRight: HANDLE_STYLES_OVERRIDES,\n\tbottomRight: HANDLE_STYLES_OVERRIDES,\n\tbottomLeft: HANDLE_STYLES_OVERRIDES,\n};\n\ntype ResizableBoxProps = ResizableProps & {\n\tchildren: ReactNode;\n\tshowHandle?: boolean;\n\t__experimentalShowTooltip?: boolean;\n\t__experimentalTooltipProps?: Parameters< typeof ResizeTooltip >[ 0 ];\n};\n\nfunction UnforwardedResizableBox(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tshowHandle = true,\n\t\t__experimentalShowTooltip: showTooltip = false,\n\t\t__experimentalTooltipProps: tooltipProps = {},\n\t\t...props\n\t}: ResizableBoxProps,\n\tref: ForwardedRef< Resizable >\n): JSX.Element {\n\treturn (\n\t\t<Resizable\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-resizable-box__container',\n\t\t\t\tshowHandle && 'has-show-handle',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\thandleClasses={ HANDLE_CLASSES }\n\t\t\thandleStyles={ HANDLE_STYLES }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t\t{ showTooltip && <ResizeTooltip { ...tooltipProps } /> }\n\t\t</Resizable>\n\t);\n}\n\nexport const ResizableBox = forwardRef( UnforwardedResizableBox );\n\nexport default ResizableBox;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA6C,IAAAK,WAAA,GAAAL,OAAA;AAhB7C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMM,iBAAiB,GAAG,kCAAkC;AAC5D,MAAMC,sBAAsB,GAAG,uCAAuC;AACtE,MAAMC,wBAAwB,GAAG,yCAAyC;AAE1E,MAAMC,c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UAAU,GAAG,IAAI;EACjBC,yBAAyB,EAAEC,WAAW,GAAG,KAAK;EAC9CC,0BAA0B,EAAEC,YAAY,GAAG,CAAC,CAAC;EAC7C,GAAGC;AACe,CAAC,EACpBC,GAA8B,EAChB;EACd,oBACC,IAAA5B,WAAA,CAAA6B,IAAA,EAAC/B,YAAA,CAAAgC,SAAS;IACTV,SAAS,EAAG,IAAAd,aAAI,EACf,qCAAqC,EACrCgB,UAAU,IAAI,iBAAiB,EAC/BF,SACD,CAAG;IACHW,aAAa,EAAG3B,cAAgB;IAChC4B,YAAY,EAAGd,aAAe;IAC9BU,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IAAAN,QAAA,GAERA,QAAQ,EACRG,WAAW,iBAAI,IAAAxB,WAAA,CAAAiC,GAAA,EAAClC,cAAA,CAAAmC,OAAa;MAAA,GAAMR;IAAY,CAAI,CAAC;EAAA,CAC5C,CAAC;AAEd;AAEO,MAAMS,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAElB,uBAAwB,CAAC;AAAC,IAAAmB,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEnDC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_clsx","_interopRequireDefault","_reResizable","_resizeTooltip","_jsxRuntime","HANDLE_CLASS_NAME","SIDE_HANDLE_CLASS_NAME","CORNER_HANDLE_CLASS_NAME","HANDLE_CLASSES","top","clsx","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","HANDLE_STYLES_OVERRIDES","width","undefined","height","HANDLE_STYLES","UnforwardedResizableBox","className","children","showHandle","__experimentalShowTooltip","showTooltip","__experimentalTooltipProps","tooltipProps","props","ref","jsxs","Resizable","handleComponent","Object","fromEntries","keys","map","key","jsx","tabIndex","handleClasses","handleStyles","default","ResizableBox","exports","forwardRef","_default"],"sources":["@wordpress/components/src/resizable-box/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport { Resizable } from 're-resizable';\nimport type { ResizableProps } from 're-resizable';\nimport type { ReactNode, ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ResizeTooltip from './resize-tooltip';\n\nconst HANDLE_CLASS_NAME = 'components-resizable-box__handle';\nconst SIDE_HANDLE_CLASS_NAME = 'components-resizable-box__side-handle';\nconst CORNER_HANDLE_CLASS_NAME = 'components-resizable-box__corner-handle';\n\nconst HANDLE_CLASSES = {\n\ttop: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top'\n\t),\n\tright: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottom: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom'\n\t),\n\tleft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tSIDE_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-left'\n\t),\n\ttopLeft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top',\n\t\t'components-resizable-box__handle-left'\n\t),\n\ttopRight: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-top',\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottomRight: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom',\n\t\t'components-resizable-box__handle-right'\n\t),\n\tbottomLeft: clsx(\n\t\tHANDLE_CLASS_NAME,\n\t\tCORNER_HANDLE_CLASS_NAME,\n\t\t'components-resizable-box__handle-bottom',\n\t\t'components-resizable-box__handle-left'\n\t),\n};\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDES = {\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\nconst HANDLE_STYLES = {\n\ttop: HANDLE_STYLES_OVERRIDES,\n\tright: HANDLE_STYLES_OVERRIDES,\n\tbottom: HANDLE_STYLES_OVERRIDES,\n\tleft: HANDLE_STYLES_OVERRIDES,\n\ttopLeft: HANDLE_STYLES_OVERRIDES,\n\ttopRight: HANDLE_STYLES_OVERRIDES,\n\tbottomRight: HANDLE_STYLES_OVERRIDES,\n\tbottomLeft: HANDLE_STYLES_OVERRIDES,\n};\n\ntype ResizableBoxProps = ResizableProps & {\n\tchildren: ReactNode;\n\tshowHandle?: boolean;\n\t__experimentalShowTooltip?: boolean;\n\t__experimentalTooltipProps?: Parameters< typeof ResizeTooltip >[ 0 ];\n};\n\nfunction UnforwardedResizableBox(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tshowHandle = true,\n\t\t__experimentalShowTooltip: showTooltip = false,\n\t\t__experimentalTooltipProps: tooltipProps = {},\n\t\t...props\n\t}: ResizableBoxProps,\n\tref: ForwardedRef< Resizable >\n): JSX.Element {\n\treturn (\n\t\t<Resizable\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-resizable-box__container',\n\t\t\t\tshowHandle && 'has-show-handle',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t// Add a focusable element within the drag handle. Unfortunately,\n\t\t\t// `re-resizable` does not make them properly focusable by default,\n\t\t\t// causing focus to move the the block wrapper which triggers block\n\t\t\t// drag.\n\t\t\thandleComponent={ Object.fromEntries(\n\t\t\t\tObject.keys( HANDLE_CLASSES ).map( ( key ) => [\n\t\t\t\t\tkey,\n\t\t\t\t\t<div key={ key } tabIndex={ -1 } />,\n\t\t\t\t] )\n\t\t\t) }\n\t\t\thandleClasses={ HANDLE_CLASSES }\n\t\t\thandleStyles={ HANDLE_STYLES }\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ children }\n\t\t\t{ showTooltip && <ResizeTooltip { ...tooltipProps } /> }\n\t\t</Resizable>\n\t);\n}\n\nexport const ResizableBox = forwardRef( UnforwardedResizableBox );\n\nexport default ResizableBox;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAOA,IAAAI,cAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA6C,IAAAK,WAAA,GAAAL,OAAA;AAhB7C;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMM,iBAAiB,GAAG,kCAAkC;AAC5D,MAAMC,sBAAsB,GAAG,uCAAuC;AACtE,MAAMC,wBAAwB,GAAG,yCAAyC;AAE1E,MAAMC,cAAc,GAAG;EACtBC,GAAG,EAAE,IAAAC,aAAI,EACRL,iBAAiB,EACjBC,sBAAsB,EACtB,sCACD,CAAC;EACDK,KAAK,EAAE,IAAAD,aAAI,EACVL,iBAAiB,EACjBC,sBAAsB,EACtB,wCACD,CAAC;EACDM,MAAM,EAAE,IAAAF,aAAI,EACXL,iBAAiB,EACjBC,sBAAsB,EACtB,yCACD,CAAC;EACDO,IAAI,EAAE,IAAAH,aAAI,EACTL,iBAAiB,EACjBC,sBAAsB,EACtB,uCACD,CAAC;EACDQ,OAAO,EAAE,IAAAJ,aAAI,EACZL,iBAAiB,EACjBE,wBAAwB,EACxB,sCAAsC,EACtC,uCACD,CAAC;EACDQ,QAAQ,EAAE,IAAAL,aAAI,EACbL,iBAAiB,EACjBE,wBAAwB,EACxB,sCAAsC,EACtC,wCACD,CAAC;EACDS,WAAW,EAAE,IAAAN,aAAI,EAChBL,iBAAiB,EACjBE,wBAAwB,EACxB,yCAAyC,EACzC,wCACD,CAAC;EACDU,UAAU,EAAE,IAAAP,aAAI,EACfL,iBAAi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ND,KAAK;IAAAN,QAAA,GAERA,QAAQ,EACRG,WAAW,iBAAI,IAAAxB,WAAA,CAAAqC,GAAA,EAACtC,cAAA,CAAA0C,OAAa;MAAA,GAAMf;IAAY,CAAI,CAAC;EAAA,CAC5C,CAAC;AAEd;AAEO,MAAMgB,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAEzB,uBAAwB,CAAC;AAAC,IAAA0B,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEnDC,YAAY","ignoreList":[]}
@@ -25,19 +25,15 @@ function Fill({
25
25
  var _slot$fillProps;
26
26
  const registry = (0, _element.useContext)(_slotFillContext.default);
27
27
  const slot = (0, _compose.useObservableValue)(registry.slots, name);
28
- const [, rerender] = (0, _element.useReducer)(() => [], []);
29
- const ref = (0, _element.useRef)({
30
- rerender
31
- });
28
+ const instanceRef = (0, _element.useRef)({});
29
+
30
+ // We register fills so we can keep track of their existence.
31
+ // Slots can use the `useSlotFills` hook to know if there're already fills
32
+ // registered so they can choose to render themselves or not.
32
33
  (0, _element.useEffect)(() => {
33
- // We register fills so we can keep track of their existence.
34
- // Some Slot implementations need to know if there're already fills
35
- // registered so they can choose to render themselves or not.
36
- const refValue = ref.current;
37
- registry.registerFill(name, refValue);
38
- return () => {
39
- registry.unregisterFill(name, refValue);
40
- };
34
+ const instance = instanceRef.current;
35
+ registry.registerFill(name, instance);
36
+ return () => registry.unregisterFill(name, instance);
41
37
  }, [registry, name]);
42
38
  if (!slot || !slot.ref.current) {
43
39
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_element","_slotFillContext","_interopRequireDefault","_styleProvider","_jsxRuntime","Fill","name","children","_slot$fillProps","registry","useContext","SlotFillContext","slot","useObservableValue","slots","rerender","useReducer","ref","useRef","useEffect","refValue","current","registerFill","unregisterFill","wrappedChildren","jsx","default","document","ownerDocument","fillProps","createPortal"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/fill.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useObservableValue } from '@wordpress/compose';\nimport {\n\tuseContext,\n\tuseReducer,\n\tuseRef,\n\tuseEffect,\n\tcreatePortal,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport StyleProvider from '../../style-provider';\nimport type { FillComponentProps } from '../types';\n\nexport default function Fill( { name, children }: FillComponentProps ) {\n\tconst registry = useContext( SlotFillContext );\n\tconst slot = useObservableValue( registry.slots, name );\n\tconst [ , rerender ] = useReducer( () => [], [] );\n\tconst ref = useRef( { rerender } );\n\n\tuseEffect( () => {\n\t\t// We register fills so we can keep track of their existence.\n\t\t// Some Slot implementations need to know if there're already fills\n\t\t// registered so they can choose to render themselves or not.\n\t\tconst refValue = ref.current;\n\t\tregistry.registerFill( name, refValue );\n\t\treturn () => {\n\t\t\tregistry.unregisterFill( name, refValue );\n\t\t};\n\t}, [ registry, name ] );\n\n\tif ( ! slot || ! slot.ref.current ) {\n\t\treturn null;\n\t}\n\n\t// When using a `Fill`, the `children` will be rendered in the document of the\n\t// `Slot`. This means that we need to wrap the `children` in a `StyleProvider`\n\t// to make sure we're referencing the right document/iframe (instead of the\n\t// context of the `Fill`'s parent).\n\tconst wrappedChildren = (\n\t\t<StyleProvider document={ slot.ref.current.ownerDocument }>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( slot.fillProps ?? {} )\n\t\t\t\t: children }\n\t\t</StyleProvider>\n\t);\n\n\treturn createPortal( wrappedChildren, slot.ref.current );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAWA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,cAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAiD,IAAAK,WAAA,GAAAL,OAAA;AAhBjD;AACA;AACA;;AAUA;AACA;AACA;;AAKe,SAASM,IAAIA,CAAE;EAAEC,IAAI;E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illContext","_interopRequireDefault","_styleProvider","_jsxRuntime","Fill","name","children","_slot$fillProps","registry","useContext","SlotFillContext","slot","useObservableValue","slots","instanceRef","useRef","useEffect","instance","current","registerFill","unregisterFill","ref","wrappedChildren","jsx","default","document","ownerDocument","fillProps","createPortal"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/fill.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useObservableValue } from '@wordpress/compose';\nimport {\n\tuseContext,\n\tuseRef,\n\tuseEffect,\n\tcreatePortal,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport StyleProvider from '../../style-provider';\nimport type { FillComponentProps } from '../types';\n\nexport default function Fill( { name, children }: FillComponentProps ) {\n\tconst registry = useContext( SlotFillContext );\n\tconst slot = useObservableValue( registry.slots, name );\n\tconst instanceRef = useRef( {} );\n\n\t// We register fills so we can keep track of their existence.\n\t// Slots can use the `useSlotFills` hook to know if there're already fills\n\t// registered so they can choose to render themselves or not.\n\tuseEffect( () => {\n\t\tconst instance = instanceRef.current;\n\t\tregistry.registerFill( name, instance );\n\t\treturn () => registry.unregisterFill( name, instance );\n\t}, [ registry, name ] );\n\n\tif ( ! slot || ! slot.ref.current ) {\n\t\treturn null;\n\t}\n\n\t// When using a `Fill`, the `children` will be rendered in the document of the\n\t// `Slot`. This means that we need to wrap the `children` in a `StyleProvider`\n\t// to make sure we're referencing the right document/iframe (instead of the\n\t// context of the `Fill`'s parent).\n\tconst wrappedChildren = (\n\t\t<StyleProvider document={ slot.ref.current.ownerDocument }>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( slot.fillProps ?? {} )\n\t\t\t\t: children }\n\t\t</StyleProvider>\n\t);\n\n\treturn createPortal( wrappedChildren, slot.ref.current );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAUA,IAAAE,gBAAA,GAAAC,sBAAA,C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ACzD","ignoreList":[]}
@@ -22,11 +22,9 @@ function createSlotRegistry() {
22
22
  const slots = (0, _compose.observableMap)();
23
23
  const fills = (0, _compose.observableMap)();
24
24
  const registerSlot = (name, ref, fillProps) => {
25
- const slot = slots.get(name);
26
25
  slots.set(name, {
27
- ...slot,
28
- ref: ref || slot?.ref,
29
- fillProps: fillProps || slot?.fillProps || {}
26
+ ref,
27
+ fillProps
30
28
  });
31
29
  };
32
30
  const unregisterSlot = (name, ref) => {
@@ -53,12 +51,10 @@ function createSlotRegistry() {
53
51
  if ((0, _isShallowEqual.default)(slot.fillProps, fillProps)) {
54
52
  return;
55
53
  }
56
- slot.fillProps = fillProps;
57
- const slotFills = fills.get(name);
58
- if (slotFills) {
59
- // Force update fills.
60
- slotFills.forEach(fill => fill.rerender());
61
- }
54
+ slots.set(name, {
55
+ ref,
56
+ fillProps
57
+ });
62
58
  };
63
59
  const registerFill = (name, ref) => {
64
60
  fills.set(name, [...(fills.get(name) || []), ref]);
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_compose","_slotFillContext","_jsxRuntime","createSlotRegistry","slots","observableMap","fills","registerSlot","name","ref","fillProps","slot","get","set","unregisterSlot","delete","updateSlot","isShallowEqual","slotFills","forEach","fill","rerender","registerFill","unregisterFill","fillsForName","filter","fillRef","SlotFillProvider","children","registry","useState","jsx","default","Provider","value"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport { observableMap } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport type {\n\tSlotFillProviderProps,\n\tSlotFillBubblesVirtuallyContext,\n} from '../types';\n\nfunction createSlotRegistry(): SlotFillBubblesVirtuallyContext {\n\tconst slots: SlotFillBubblesVirtuallyContext[ 'slots' ] = observableMap();\n\tconst fills: SlotFillBubblesVirtuallyContext[ 'fills' ] = observableMap();\n\n\tconst registerSlot: SlotFillBubblesVirtuallyContext[ 'registerSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\n\t\tslots.set( name, {\n\t\t\t...slot,\n\t\t\tref: ref || slot?.ref,\n\t\t\tfillProps: fillProps || slot?.fillProps || {},\n\t\t} );\n\t};\n\n\tconst unregisterSlot: SlotFillBubblesVirtuallyContext[ 'unregisterSlot' ] =\n\t\t( name, ref ) => {\n\t\t\tconst slot = slots.get( name );\n\t\t\tif ( ! slot ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure we're not unregistering a slot registered by another element\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412\n\t\t\tif ( slot.ref !== ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tslots.delete( name );\n\t\t};\n\n\tconst updateSlot: SlotFillBubblesVirtuallyContext[ 'updateSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\t\tif ( ! slot ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( slot.ref !== ref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isShallowEqual( slot.fillProps, fillProps ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tslot.fillProps = fillProps;\n\t\tconst slotFills = fills.get( name );\n\t\tif ( slotFills ) {\n\t\t\t// Force update fills.\n\t\t\tslotFills.forEach( ( fill ) => fill.rerender() );\n\t\t}\n\t};\n\n\tconst registerFill: SlotFillBubblesVirtuallyContext[ 'registerFill' ] = (\n\t\tname,\n\t\tref\n\t) => {\n\t\tfills.set( name, [ ...( fills.get( name ) || [] ), ref ] );\n\t};\n\n\tconst unregisterFill: SlotFillBubblesVirtuallyContext[ 'unregisterFill' ] =\n\t\t( name, ref ) => {\n\t\t\tconst fillsForName = fills.get( name );\n\t\t\tif ( ! fillsForName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfills.set(\n\t\t\t\tname,\n\t\t\t\tfillsForName.filter( ( fillRef ) => fillRef !== ref )\n\t\t\t);\n\t\t};\n\n\treturn {\n\t\tslots,\n\t\tfills,\n\t\tregisterSlot,\n\t\tupdateSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t};\n}\n\nexport default function SlotFillProvider( {\n\tchildren,\n}: SlotFillProviderProps ) {\n\tconst [ registry ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.Provider value={ registry }>\n\t\t\t{ children }\n\t\t</SlotFillContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AAVlD;AACA;AACA;;AAKA;AACA;AACA;;AAOA,SAASM,kBAAkBA,CAAA,EAAoC;EAC9D,MAAMC,KAAiD,GAAG,IAAAC,sBAAa,EAAC,CAAC;EACzE,MAAMC,KAAiD,GAAG,IAAAD,sBAAa,EAAC,CAAC;EAEzE,MAAME,YAA+D,GAAGA,CACvEC,IAAI,EACJC,GAAG,EACHC,SAAS,KACL;IACJ,MAAMC,IAAI,GAAGP,KAAK,CAACQ,GAAG,CAAEJ,IAAK,CAAC;IAE9BJ,KAAK,CAACS,GAAG,CAAEL,IAAI,EAAE;MAChB,GAAGG,IAAI;MACPF,GAAG,EAAEA,GAAG,IAAIE,IAAI,EAAEF,GAAG;MACrBC,SAAS,EAAEA,SAAS,IAAIC,IAAI,EAAED,SAAS,IAAI,CAAC;IAC7C,CAAE,CAAC;EACJ,CAAC;EAED,MAAMI,cAAmE,GACxEA,CAAEN,IAAI,EAAEC,GAAG,KAAM;IAChB,M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M,CAAIC,OAAO,IAAMA,OAAO,KAAKjB,GAAI,CACrD,CAAC;EACF,CAAC;EAEF,OAAO;IACNL,KAAK;IACLE,KAAK;IACLC,YAAY;IACZS,UAAU;IACVF,cAAc;IACdQ,YAAY;IACZC;EACD,CAAC;AACF;AAEe,SAASI,gBAAgBA,CAAE;EACzCC;AACsB,CAAC,EAAG;EAC1B,MAAM,CAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAE3B,kBAAmB,CAAC;EACnD,oBACC,IAAAD,WAAA,CAAA6B,GAAA,EAAC9B,gBAAA,CAAA+B,OAAe,CAACC,QAAQ;IAACC,KAAK,EAAGL,QAAU;IAAAD,QAAA,EACzCA;EAAQ,CACe,CAAC;AAE7B","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_isShallowEqual","_interopRequireDefault","_compose","_slotFillContext","_jsxRuntime","createSlotRegistry","slots","observableMap","fills","registerSlot","name","ref","fillProps","set","unregisterSlot","slot","get","delete","updateSlot","isShallowEqual","registerFill","unregisterFill","fillsForName","filter","fillRef","SlotFillProvider","children","registry","useState","jsx","default","Provider","value"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport { observableMap } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SlotFillContext from './slot-fill-context';\nimport type {\n\tSlotFillProviderProps,\n\tSlotFillBubblesVirtuallyContext,\n} from '../types';\n\nfunction createSlotRegistry(): SlotFillBubblesVirtuallyContext {\n\tconst slots: SlotFillBubblesVirtuallyContext[ 'slots' ] = observableMap();\n\tconst fills: SlotFillBubblesVirtuallyContext[ 'fills' ] = observableMap();\n\n\tconst registerSlot: SlotFillBubblesVirtuallyContext[ 'registerSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tslots.set( name, { ref, fillProps } );\n\t};\n\n\tconst unregisterSlot: SlotFillBubblesVirtuallyContext[ 'unregisterSlot' ] =\n\t\t( name, ref ) => {\n\t\t\tconst slot = slots.get( name );\n\t\t\tif ( ! slot ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Make sure we're not unregistering a slot registered by another element\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412\n\t\t\tif ( slot.ref !== ref ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tslots.delete( name );\n\t\t};\n\n\tconst updateSlot: SlotFillBubblesVirtuallyContext[ 'updateSlot' ] = (\n\t\tname,\n\t\tref,\n\t\tfillProps\n\t) => {\n\t\tconst slot = slots.get( name );\n\t\tif ( ! slot ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( slot.ref !== ref ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isShallowEqual( slot.fillProps, fillProps ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tslots.set( name, { ref, fillProps } );\n\t};\n\n\tconst registerFill: SlotFillBubblesVirtuallyContext[ 'registerFill' ] = (\n\t\tname,\n\t\tref\n\t) => {\n\t\tfills.set( name, [ ...( fills.get( name ) || [] ), ref ] );\n\t};\n\n\tconst unregisterFill: SlotFillBubblesVirtuallyContext[ 'unregisterFill' ] =\n\t\t( name, ref ) => {\n\t\t\tconst fillsForName = fills.get( name );\n\t\t\tif ( ! fillsForName ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfills.set(\n\t\t\t\tname,\n\t\t\t\tfillsForName.filter( ( fillRef ) => fillRef !== ref )\n\t\t\t);\n\t\t};\n\n\treturn {\n\t\tslots,\n\t\tfills,\n\t\tregisterSlot,\n\t\tupdateSlot,\n\t\tunregisterSlot,\n\t\tregisterFill,\n\t\tunregisterFill,\n\t};\n}\n\nexport default function SlotFillProvider( {\n\tchildren,\n}: SlotFillProviderProps ) {\n\tconst [ registry ] = useState( createSlotRegistry );\n\treturn (\n\t\t<SlotFillContext.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IAEAN,KAAK,CAACO,GAAG,CAAEH,IAAI,EAAE;MAAEC,GAAG;MAAEC;IAAU,CAAE,CAAC;EACtC,CAAC;EAED,MAAMQ,YAA+D,GAAGA,CACvEV,IAAI,EACJC,GAAG,KACC;IACJH,KAAK,CAACK,GAAG,CAAEH,IAAI,EAAE,CAAE,IAAKF,KAAK,CAACQ,GAAG,CAAEN,IAAK,CAAC,IAAI,EAAE,CAAE,EAAEC,GAAG,CAAG,CAAC;EAC3D,CAAC;EAED,MAAMU,cAAmE,GACxEA,CAAEX,IAAI,EAAEC,GAAG,KAAM;IAChB,MAAMW,YAAY,GAAGd,KAAK,CAACQ,GAAG,CAAEN,IAAK,CAAC;IACtC,IAAK,CAAEY,YAAY,EAAG;MACrB;IACD;IAEAd,KAAK,CAACK,GAAG,CACRH,IAAI,EACJY,YAAY,CAACC,MAAM,CAAIC,OAAO,IAAMA,OAAO,KAAKb,GAAI,CACrD,CAAC;EACF,CAAC;EAEF,OAAO;IACNL,KAAK;IACLE,KAAK;IACLC,YAAY;IACZS,UAAU;IACVJ,cAAc;IACdM,YAAY;IACZC;EACD,CAAC;AACF;AAEe,SAASI,gBAAgBA,CAAE;EACzCC;AACsB,CAAC,EAAG;EAC1B,MAAM,CAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAEvB,kBAAmB,CAAC;EACnD,oBACC,IAAAD,WAAA,CAAAyB,GAAA,EAAC1B,gBAAA,CAAA2B,OAAe,CAACC,QAAQ;IAACC,KAAK,EAAGL,QAAU;IAAAD,QAAA,EACzCA;EAAQ,CACe,CAAC;AAE7B","ignoreList":[]}
@@ -32,11 +32,7 @@ function Slot(props, forwardedRef) {
32
32
  children,
33
33
  ...restProps
34
34
  } = props;
35
- const {
36
- registerSlot,
37
- unregisterSlot,
38
- ...registry
39
- } = (0, _element.useContext)(_slotFillContext.default);
35
+ const registry = (0, _element.useContext)(_slotFillContext.default);
40
36
  const ref = (0, _element.useRef)(null);
41
37
 
42
38
  // We don't want to unregister and register the slot whenever
@@ -48,11 +44,9 @@ function Slot(props, forwardedRef) {
48
44
  fillPropsRef.current = fillProps;
49
45
  }, [fillProps]);
50
46
  (0, _element.useLayoutEffect)(() => {
51
- registerSlot(name, ref, fillPropsRef.current);
52
- return () => {
53
- unregisterSlot(name, ref);
54
- };
55
- }, [registerSlot, unregisterSlot, name]);
47
+ registry.registerSlot(name, ref, fillPropsRef.current);
48
+ return () => registry.unregisterSlot(name, ref);
49
+ }, [registry, name]);
56
50
  (0, _element.useLayoutEffect)(() => {
57
51
  registry.updateSlot(name, ref, fillPropsRef.current);
58
52
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_compose","_view","_slotFillContext","_interopRequireDefault","_jsxRuntime","Slot","props","forwardedRef","name","fillProps","as","children","restProps","registerSlot","unregisterSlot","registry","useContext","SlotFillContext","ref","useRef","fillPropsRef","useLayoutEffect","current","updateSlot","jsx","View","useMergeRefs","_default","exports","default","forwardRef"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tuseContext,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport SlotFillContext from './slot-fill-context';\nimport type { WordPressComponentProps } from '../../context';\nimport type { SlotComponentProps } from '../types';\n\nfunction Slot(\n\tprops: WordPressComponentProps<\n\t\tOmit< SlotComponentProps, 'bubblesVirtually' >,\n\t\t'div'\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tname,\n\t\tfillProps = {},\n\t\tas,\n\t\t// `children` is not allowed. However, if it is passed,\n\t\t// it will be displayed as is, so remove `children`.\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst { registerSlot, unregisterSlot, ...registry } =\n\t\tuseContext( SlotFillContext );\n\n\tconst ref = useRef< HTMLElement >( null );\n\n\t// We don't want to unregister and register the slot whenever\n\t// `fillProps` change, which would cause the fill to be re-mounted. Instead,\n\t// we can just update the slot (see hook below).\n\t// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973\n\tconst fillPropsRef = useRef( fillProps );\n\tuseLayoutEffect( () => {\n\t\tfillPropsRef.current = fillProps;\n\t}, [ fillProps ] );\n\n\tuseLayoutEffect( () => {\n\t\tregisterSlot( name, ref, fillPropsRef.current );\n\t\treturn () => {\n\t\t\tunregisterSlot( name, ref );\n\t\t};\n\t}, [ registerSlot, unregisterSlot, name ] );\n\n\tuseLayoutEffect( () => {\n\t\tregistry.updateSlot( name, ref, fillPropsRef.current );\n\t} );\n\n\treturn (\n\t\t<View\n\t\t\tas={ as }\n\t\t\tref={ useMergeRefs( [ forwardedRef, ref ] ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( Slot );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AApBlD;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA,SAASM,IAAIA,CACZC,KAGC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,IAAI;IACJC,SAAS,GAAG,CAAC,CAAC;IACdC,EAAE;IACF;IACA;IACAC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGN,KAAK;EAET,MAAM;IAAEO,YAAY;IAAEC,cAAc;IAAE,GAAGC;EAAS,CAAC,GAClD,IAAAC,mBAAU,EAAEC,wBAAgB,CAAC;EAE9B,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAiB,IAAK,CAAC;;EAEzC;EACA;EACA;EACA;EACA,MAAMC,YAAY,GAAG,IAAAD,eAAM,EAAEV,SAAU,CAAC;EACxC,IAAAY,wBAAe,EAAE,MAAM;IACtBD,YAAY,CAACE,OAAO,GAAGb,SAAS;EACjC,CAAC,EAAE,CAAEA,SAAS,CAAG,CAAC;EAElB,IAAAY,wBAAe,EAAE,MAAM;IACtBR,YAAY,CAAEL,IAAI,EAAEU,GAAG,EAAEE,YAAY,CAACE,OAAQ,CAAC;IAC/C,OAAO,MAAM;MACZR,cAAc,CAAEN,IAAI,EAAEU,GAAI,CAAC;IAC5B,CAAC;EACF,CAAC,EAAE,CAAEL,YAAY,EAAEC,cAAc,EAAEN,IAAI,CAAG,CAAC;EAE3C,IAAAa,wBAAe,EAAE,MAAM;IACtBN,QAAQ,CAACQ,UAAU,CAAEf,IAAI,EAAEU,GAAG,EAAEE,YAAY,CAACE,OAAQ,CAAC;EACvD,CAAE,CAAC;EAEH,oBACC,IAAAlB,WAAA,CAAAoB,GAAA,EAACvB,KAAA,CAAAwB,IAAI;IACJf,EAAE,EAAGA,EAAI;IACTQ,GAAG,EAAG,IAAAQ,qBAAY,EAAE,CAAEnB,YAAY,EAAEW,GAAG,CAAG,CAAG;IAAA,GACxCN;EAAS,CACd,CAAC;AAEJ;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAEzB,IAAK,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_compose","_view","_slotFillContext","_interopRequireDefault","_jsxRuntime","Slot","props","forwardedRef","name","fillProps","as","children","restProps","registry","useContext","SlotFillContext","ref","useRef","fillPropsRef","useLayoutEffect","current","registerSlot","unregisterSlot","updateSlot","jsx","View","useMergeRefs","_default","exports","default","forwardRef"],"sources":["@wordpress/components/src/slot-fill/bubbles-virtually/slot.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tuseContext,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport SlotFillContext from './slot-fill-context';\nimport type { WordPressComponentProps } from '../../context';\nimport type { SlotComponentProps } from '../types';\n\nfunction Slot(\n\tprops: WordPressComponentProps<\n\t\tOmit< SlotComponentProps, 'bubblesVirtually' >,\n\t\t'div'\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tname,\n\t\tfillProps = {},\n\t\tas,\n\t\t// `children` is not allowed. However, if it is passed,\n\t\t// it will be displayed as is, so remove `children`.\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst registry = useContext( SlotFillContext );\n\n\tconst ref = useRef< HTMLElement >( null );\n\n\t// We don't want to unregister and register the slot whenever\n\t// `fillProps` change, which would cause the fill to be re-mounted. Instead,\n\t// we can just update the slot (see hook below).\n\t// For more context, see https://github.com/WordPress/gutenberg/pull/44403#discussion_r994415973\n\tconst fillPropsRef = useRef( fillProps );\n\tuseLayoutEffect( () => {\n\t\tfillPropsRef.current = fillProps;\n\t}, [ fillProps ] );\n\n\tuseLayoutEffect( () => {\n\t\tregistry.registerSlot( name, ref, fillPropsRef.current );\n\t\treturn () => registry.unregisterSlot( name, ref );\n\t}, [ registry, name ] );\n\n\tuseLayoutEffect( () => {\n\t\tregistry.updateSlot( name, ref, fillPropsRef.current );\n\t} );\n\n\treturn (\n\t\t<View\n\t\t\tas={ as }\n\t\t\tref={ useMergeRefs( [ forwardedRef, ref ] ) }\n\t\t\t{ ...restProps }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( Slot );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAkD,IAAAK,WAAA,GAAAL,OAAA;AApBlD;AACA;AAC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@@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { ObservableMap } from '@wordpress/compose';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: never;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: string;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: React.CSSProperties;\n\t } )\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually?: false;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: never;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: never;\n\t } );\n\nexport type FillComponentProps = {\n\t/**\n\t * The name of the slot to fill into.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * Children elements or render function.\n\t */\n\tchildren?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );\n};\n\nexport type SlotFillProviderProps = {\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n\n\t/**\n\t * Whether to pass slots to the parent provider if existent.\n\t */\n\tpassthrough?: boolean;\n};\n\nexport type SlotRef = RefObject< HTMLElement >;\nexport type Rerenderable = { rerender: () => void };\n\nexport type SlotFillBubblesVirtuallyContext = {\n\tslots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;\n\tfills: ObservableMap< SlotKey, Rerenderable[] >;\n\tregisterSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tunregisterSlot: ( name: SlotKey, ref: SlotRef ) => void;\n\tupdateSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tregisterFill: ( name: SlotKey, ref: Rerenderable ) => void;\n\tunregisterFill: ( name: SlotKey, ref: Rerenderable ) => void;\n\n\t/**\n\t * This helps the provider know if it's using the default context value or not.\n\t */\n\tisDefault?: boolean;\n};\n\nexport type BaseSlotFillContext = {\n\tregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tunregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tgetSlot: ( name: SlotKey ) => Rerenderable | undefined;\n\tgetFills: (\n\t\tname: SlotKey,\n\t\tslotInstance: Rerenderable\n\t) => FillComponentProps[];\n\tsubscribe: ( listener: () => void ) => () => void;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/slot-fill/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode, RefObject } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { ObservableMap } from '@wordpress/compose';\n\nexport type DistributiveOmit< T, K extends keyof any > = T extends any\n\t? Omit< T, K >\n\t: never;\n\nexport type SlotKey = string | symbol;\n\nexport type FillProps = Record< string, any >;\n\ntype SlotPropBase = {\n\t/**\n\t * Slot name.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * props to pass from `Slot` to `Fill`.\n\t *\n\t * @default {}\n\t */\n\tfillProps?: FillProps;\n};\n\nexport type SlotComponentProps =\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually: true;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: never;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: string;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: React.CSSProperties;\n\t } )\n\t| ( SlotPropBase & {\n\t\t\t/**\n\t\t\t * By default, events will bubble to their parents on the DOM hierarchy (native event bubbling).\n\t\t\t * If set to true, events will bubble to their virtual parent in the React elements hierarchy instead,\n\t\t\t * also accept an optional `className`, `id`, etc. to add to the slot container.\n\t\t\t */\n\t\t\tbubblesVirtually?: false;\n\n\t\t\t/**\n\t\t\t * A function that returns nodes to be rendered.\n\t\t\t * Supported only when `bubblesVirtually` is `false`.\n\t\t\t */\n\t\t\tchildren?: ( fills: ReactNode ) => ReactNode;\n\n\t\t\t/**\n\t\t\t * Additional className for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tclassName?: never;\n\n\t\t\t/**\n\t\t\t * Additional styles for the `Slot` component.\n\t\t\t * Supported only when `bubblesVirtually` is `true`.\n\t\t\t */\n\t\t\tstyle?: never;\n\t } );\n\nexport type FillComponentProps = {\n\t/**\n\t * The name of the slot to fill into.\n\t */\n\tname: SlotKey;\n\n\t/**\n\t * Children elements or render function.\n\t */\n\tchildren?: ReactNode | ( ( fillProps: FillProps ) => ReactNode );\n};\n\nexport type SlotFillProviderProps = {\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n\n\t/**\n\t * Whether to pass slots to the parent provider if existent.\n\t */\n\tpassthrough?: boolean;\n};\n\nexport type SlotRef = RefObject< HTMLElement >;\nexport type Rerenderable = { rerender: () => void };\nexport type FillInstance = {};\n\nexport type SlotFillBubblesVirtuallyContext = {\n\tslots: ObservableMap< SlotKey, { ref: SlotRef; fillProps: FillProps } >;\n\tfills: ObservableMap< SlotKey, FillInstance[] >;\n\tregisterSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tunregisterSlot: ( name: SlotKey, ref: SlotRef ) => void;\n\tupdateSlot: ( name: SlotKey, ref: SlotRef, fillProps: FillProps ) => void;\n\tregisterFill: ( name: SlotKey, instance: FillInstance ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillInstance ) => void;\n\n\t/**\n\t * This helps the provider know if it's using the default context value or not.\n\t */\n\tisDefault?: boolean;\n};\n\nexport type BaseSlotFillContext = {\n\tregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tunregisterSlot: ( name: SlotKey, slot: Rerenderable ) => void;\n\tregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tunregisterFill: ( name: SlotKey, instance: FillComponentProps ) => void;\n\tgetSlot: ( name: SlotKey ) => Rerenderable | undefined;\n\tgetFills: (\n\t\tname: SlotKey,\n\t\tslotInstance: Rerenderable\n\t) => FillComponentProps[];\n\tsubscribe: ( listener: () => void ) => () => void;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_cache","_interopRequireDefault","uuid","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","uuidCache","Set","containerCacheMap","memoizedCreateCacheWithContainer","container","key","v4","replace","add","cache","createCache","StyleProvider","props","children","document","head","jsx","CacheProvider","value","_default","exports"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA6B,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,CAAA;AAAA,SAAAH,wBAAAG,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,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,C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B,OAAO,IAAI;EACZ;EAEA,MAAML,KAAK,GAAGN,gCAAgC,CAAEW,QAAQ,CAACC,IAAK,CAAC;EAE/D,oBAAO,IAAApC,WAAA,CAAAqC,GAAA,EAAC3C,MAAA,CAAA4C,aAAa;IAACC,KAAK,EAAGT,KAAO;IAAAI,QAAA,EAAGA;EAAQ,CAAiB,CAAC;AACnE;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAlC,OAAA,GAEcyB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_cache","_interopRequireDefault","uuid","_interopRequireWildcard","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","uuidCache","Set","containerCacheMap","memoizedCreateCacheWithContainer","container","key","v4","replace","add","cache","createCache","StyleProvider","props","children","document","head","jsx","CacheProvider","value","_default","exports"],"sources":["@wordpress/components/src/style-provider/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\nimport * as uuid from 'uuid';\n\n/**\n * Internal dependencies\n */\nimport type { StyleProviderProps } from './types';\n\nconst uuidCache = new Set();\n// Use a weak map so that when the container is detached it's automatically\n// dereferenced to avoid memory leak.\nconst containerCacheMap = new WeakMap();\n\nconst memoizedCreateCacheWithContainer = ( container: HTMLElement ) => {\n\tif ( containerCacheMap.has( container ) ) {\n\t\treturn containerCacheMap.get( container );\n\t}\n\n\t// Emotion only accepts alphabetical and hyphenated keys so we just\n\t// strip the numbers from the UUID. It _should_ be fine.\n\tlet key = uuid.v4().replace( /[0-9]/g, '' );\n\twhile ( uuidCache.has( key ) ) {\n\t\tkey = uuid.v4().replace( /[0-9]/g, '' );\n\t}\n\tuuidCache.add( key );\n\n\tconst cache = createCache( { container, key } );\n\tcontainerCacheMap.set( container, cache );\n\treturn cache;\n};\n\nexport function StyleProvider( props: StyleProviderProps ) {\n\tconst { children, document } = props;\n\n\tif ( ! document ) {\n\t\treturn null;\n\t}\n\n\tconst cache = memoizedCreateCacheWithContainer( document.head );\n\n\treturn <CacheProvider value={ cache }>{ children }</CacheProvider>;\n}\n\nexport default StyleProvider;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAA6B,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,CAAA;AAAA,SAAAH,wBAAAG,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,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT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A,CAAAqC,GAAA,EAAC3C,MAAA,CAAA4C,aAAa;IAACC,KAAK,EAAGT,KAAO;IAAAI,QAAA,EAAGA;EAAQ,CAAiB,CAAC;AACnE;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAlC,OAAA,GAEcyB,aAAa","ignoreList":[]}
package/build/tabs/tab.js CHANGED
@@ -5,19 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.Tab = void 0;
8
- var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
9
8
  var _element = require("@wordpress/element");
10
9
  var _warning = _interopRequireDefault(require("@wordpress/warning"));
11
10
  var _context = require("./context");
12
11
  var _styles = require("./styles");
13
12
  var _icons = require("@wordpress/icons");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
- 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); }
16
- 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; }
17
- /**
18
- * External dependencies
19
- */
20
-
21
14
  /**
22
15
  * WordPress dependencies
23
16
  */
@@ -38,15 +31,6 @@ const Tab = exports.Tab = (0, _element.forwardRef)(function Tab({
38
31
  store,
39
32
  instanceId
40
33
  } = (_useTabsContext = (0, _context.useTabsContext)()) !== null && _useTabsContext !== void 0 ? _useTabsContext : {};
41
-
42
- // If the active item is not connected, the tablist may end up in a state
43
- // where none of the tabs are tabbable. In this case, we force all tabs to
44
- // be tabbable, so that as soon as an item received focus, it becomes active
45
- // and Tablist goes back to working as expected.
46
- // eslint-disable-next-line @wordpress/no-unused-vars-before-return
47
- const tabbable = Ariakit.useStoreState(store, state => {
48
- return state?.activeId !== null && !store?.item(state?.activeId)?.element?.isConnected;
49
- });
50
34
  if (!store) {
51
35
  globalThis.SCRIPT_DEBUG === true ? (0, _warning.default)('`Tabs.Tab` must be wrapped in a `Tabs` component.') : void 0;
52
36
  return null;
@@ -58,7 +42,6 @@ const Tab = exports.Tab = (0, _element.forwardRef)(function Tab({
58
42
  id: instancedTabId,
59
43
  disabled: disabled,
60
44
  render: render,
61
- tabbable: tabbable,
62
45
  ...otherProps,
63
46
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.TabChildren, {
64
47
  children: children
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_warning","_interopRequireDefault","_context","_styles","_icons","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Tab","exports","forwardRef","children","tabId","disabled","render","otherProps","ref","_useTabsContext","store","instanceId","useTabsContext","tabbable","useStoreState","state","activeId","item","element","isConnected","globalThis","SCRIPT_DEBUG","warning","instancedTabId","jsxs","id","jsx","TabChildren","TabChevron","icon","chevronRight"],"sources":["@wordpress/components/src/tabs/tab.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\n\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabProps } from './types';\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport {\n\tTab as StyledTab,\n\tTabChildren as StyledTabChildren,\n\tTabChevron as StyledTabChevron,\n} from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport { chevronRight } from '@wordpress/icons';\n\nexport const Tab = forwardRef<\n\tHTMLButtonElement,\n\tOmit< WordPressComponentProps< TabProps, 'button', false >, 'id' >\n>( function Tab( { children, tabId, disabled, render, ...otherProps }, ref ) {\n\tconst { store, instanceId } = useTabsContext() ?? {};\n\n\t// If the active item is not connected, the tablist may end up in a state\n\t// where none of the tabs are tabbable. In this case, we force all tabs to\n\t// be tabbable, so that as soon as an item received focus, it becomes active\n\t// and Tablist goes back to working as expected.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst tabbable = Ariakit.useStoreState( store, ( state ) => {\n\t\treturn (\n\t\t\tstate?.activeId !== null &&\n\t\t\t! store?.item( state?.activeId )?.element?.isConnected\n\t\t);\n\t} );\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.Tab` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\tconst instancedTabId = `${ instanceId }-${ tabId }`;\n\n\treturn (\n\t\t<StyledTab\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\tid={ instancedTabId }\n\t\t\tdisabled={ disabled }\n\t\t\trender={ render }\n\t\t\ttabbable={ tabbable }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t<StyledTabChildren>{ children }</StyledTabChildren>\n\t\t\t<StyledTabChevron icon={ chevronRight } />\n\t\t</StyledTab>\n\t);\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAMA,IAAAM,MAAA,GAAAN,OAAA;AAAgD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,C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GAAG,IAAAG,uBAAc,EAAC,CAAC,cAAAH,eAAA,cAAAA,eAAA,GAAI,CAAC,CAAC;;EAEpD;EACA;EACA;EACA;EACA;EACA,MAAMI,QAAQ,GAAG3C,OAAO,CAAC4C,aAAa,CAAEJ,KAAK,EAAIK,KAAK,IAAM;IAC3D,OACCA,KAAK,EAAEC,QAAQ,KAAK,IAAI,IACxB,CAAEN,KAAK,EAAEO,IAAI,CAAEF,KAAK,EAAEC,QAAS,CAAC,EAAEE,OAAO,EAAEC,WAAW;EAExD,CAAE,CAAC;EAEH,IAAK,CAAET,KAAK,EAAG;IACdU,UAAA,CAAAC,YAAA,gBAAAC,gBAAO,EAAE,mDAAoD,CAAC;IAC9D,OAAO,IAAI;EACZ;EAEA,MAAMC,cAAc,GAAG,GAAIZ,UAAU,IAAMP,KAAK,EAAG;EAEnD,oBACC,IAAAzB,WAAA,CAAA6C,IAAA,EAAC/C,OAAA,CAAAuB,GAAS;IACTQ,GAAG,EAAGA,GAAK;IACXE,KAAK,EAAGA,KAAO;IACfe,EAAE,EAAGF,cAAgB;IACrBlB,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IACjBO,QAAQ,EAAGA,QAAU;IAAA,GAChBN,UAAU;IAAAJ,QAAA,gBAEf,IAAAxB,WAAA,CAAA+C,GAAA,EAACjD,OAAA,CAAAkD,WAAiB;MAAAxB,QAAA,EAAGA;IAAQ,CAAqB,CAAC,eACnD,IAAAxB,WAAA,CAAA+C,GAAA,EAACjD,OAAA,CAAAmD,UAAgB;MAACC,IAAI,EAAGC;IAAc,CAAE,CAAC;EAAA,CAChC,CAAC;AAEd,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_warning","_interopRequireDefault","_context","_styles","_icons","_jsxRuntime","Tab","exports","forwardRef","children","tabId","disabled","render","otherProps","ref","_useTabsContext","store","instanceId","useTabsContext","globalThis","SCRIPT_DEBUG","warning","instancedTabId","jsxs","id","jsx","TabChildren","TabChevron","icon","chevronRight"],"sources":["@wordpress/components/src/tabs/tab.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { TabProps } from './types';\nimport warning from '@wordpress/warning';\nimport { useTabsContext } from './context';\nimport {\n\tTab as StyledTab,\n\tTabChildren as StyledTabChildren,\n\tTabChevron as StyledTabChevron,\n} from './styles';\nimport type { WordPressComponentProps } from '../context';\nimport { chevronRight } from '@wordpress/icons';\n\nexport const Tab = forwardRef<\n\tHTMLButtonElement,\n\tOmit< WordPressComponentProps< TabProps, 'button', false >, 'id' >\n>( function Tab( { children, tabId, disabled, render, ...otherProps }, ref ) {\n\tconst { store, instanceId } = useTabsContext() ?? {};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.Tab` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\tconst instancedTabId = `${ instanceId }-${ tabId }`;\n\n\treturn (\n\t\t<StyledTab\n\t\t\tref={ ref }\n\t\t\tstore={ store }\n\t\t\tid={ instancedTabId }\n\t\t\tdisabled={ disabled }\n\t\t\trender={ render }\n\t\t\t{ ...otherProps }\n\t\t>\n\t\t\t<StyledTabChildren>{ children }</StyledTabChildren>\n\t\t\t<StyledTabChevron icon={ chevronRight } />\n\t\t</StyledTab>\n\t);\n} );\n"],"mappings":";;;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AAAgD,IAAAM,WAAA,GAAAN,OAAA;AAlBhD;AACA;AACA;;AAIA;AACA;AACA;;AAYO,MAAMO,GAAG,GAAAC,OAAA,CAAAD,GAAA,GAAG,IAAAE,mBAAU,EAG1B,SAASF,GAAGA,CAAE;EAAEG,QAAQ;EAAEC,KAAK;EAAEC,QAAQ;EAAEC,MAAM;EAAE,GAAGC;AAAW,CAAC,EAAEC,GAAG,EAAG;EAAA,IAAAC,eAAA;EAC5E,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,IAAAF,eAAA,GAAG,IAAAG,uBAAc,EAAC,CAAC,cAAAH,eAAA,cAAAA,eAAA,GAAI,CAAC,CAAC;EAEpD,IAAK,CAAEC,KAAK,EAAG;IACdG,UAAA,CAAAC,YAAA,gBAAAC,gBAAO,EAAE,mDAAoD,CAAC;IAC9D,OAAO,IAAI;EACZ;EAEA,MAAMC,cAAc,GAAG,GAAIL,UAAU,IAAMP,KAAK,EAAG;EAEnD,oBACC,IAAAL,WAAA,CAAAkB,IAAA,EAACpB,OAAA,CAAAG,GAAS;IACTQ,GAAG,EAAGA,GAAK;IACXE,KAAK,EAAGA,KAAO;IACfQ,EAAE,EAAGF,cAAgB;IACrBX,QAAQ,EAAGA,QAAU;IACrBC,MAAM,EAAGA,MAAQ;IAAA,GACZC,UAAU;IAAAJ,QAAA,gBAEf,IAAAJ,WAAA,CAAAoB,GAAA,EAACtB,OAAA,CAAAuB,WAAiB;MAAAjB,QAAA,EAAGA;IAAQ,CAAqB,CAAC,eACnD,IAAAJ,WAAA,CAAAoB,GAAA,EAACtB,OAAA,CAAAwB,UAAgB;MAACC,IAAI,EAAGC;IAAc,CAAE,CAAC;EAAA,CAChC,CAAC;AAEd,CAAE,CAAC","ignoreList":[]}
@@ -50,6 +50,7 @@ function UnforwardedToolbarButton(props, ref) {
50
50
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
51
51
  ref: ref,
52
52
  icon: restProps.icon,
53
+ size: "compact",
53
54
  label: title,
54
55
  shortcut: restProps.shortcut,
55
56
  "data-subscript": restProps.subscript,
@@ -80,6 +81,7 @@ function UnforwardedToolbarButton(props, ref) {
80
81
  ...restProps,
81
82
  ref: ref,
82
83
  children: toolbarItemProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
84
+ size: "compact",
83
85
  label: title,
84
86
  isPressed: isActive,
85
87
  ...toolbarItemProps,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_button","_toolbarItem","_toolbarContext","_toolbarButtonContainer","_jsxRuntime","useDeprecatedProps","isDisabled","otherProps","disabled","UnforwardedToolbarButton","props","ref","children","className","containerClassName","extraProps","isActive","title","restProps","accessibleToolbarState","useContext","ToolbarContext","jsx","default","icon","label","shortcut","subscript","onClick","event","stopPropagation","clsx","isPressed","accessibleWhenDisabled","toolbarItemProps","ToolbarButton","exports","forwardRef","_default"],"sources":["@wordpress/components/src/toolbar/toolbar-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, MouseEvent as ReactMouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarButtonContainer from './toolbar-button-container';\nimport type { ToolbarButtonOverriddenProps, ToolbarButtonProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction useDeprecatedProps( {\n\tisDisabled,\n\t...otherProps\n}: React.ComponentProps< typeof ToolbarButton > ) {\n\treturn {\n\t\tdisabled: isDisabled,\n\t\t...otherProps,\n\t};\n}\n\nfunction UnforwardedToolbarButton(\n\tprops: Omit<\n\t\tWordPressComponentProps< ToolbarButtonProps, typeof Button, false >,\n\t\t'accessibleWhenDisabled' // By default, ToolbarButton will be focusable when disabled.\n\t> &\n\t\tToolbarButtonOverriddenProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\textraProps,\n\t\tisActive,\n\t\ttitle,\n\t\t...restProps\n\t} = useDeprecatedProps( props );\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarButtonContainer className={ containerClassName }>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ restProps.icon }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tshortcut={ restProps.shortcut }\n\t\t\t\t\tdata-subscript={ restProps.subscript }\n\t\t\t\t\tonClick={ (\n\t\t\t\t\t\tevent: ReactMouseEvent<\n\t\t\t\t\t\t\tHTMLButtonElement & HTMLAnchorElement,\n\t\t\t\t\t\t\tMouseEvent\n\t\t\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t// TODO: Possible bug; maybe use onClick instead of restProps.onClick.\n\t\t\t\t\t\tif ( restProps.onClick ) {\n\t\t\t\t\t\t\trestProps.onClick( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-toolbar__control',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdata-toolbar-item\n\t\t\t\t\t{ ...extraProps }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t</ToolbarButtonContainer>\n\t\t);\n\t}\n\n\t// ToobarItem will pass all props to the render prop child, which will pass\n\t// all props to Button. This means that ToolbarButton has the same API as\n\t// Button.\n\treturn (\n\t\t<ToolbarItem\n\t\t\tclassName={ clsx( 'components-toolbar-button', className ) }\n\t\t\t{ ...extraProps }\n\t\t\t{ ...restProps }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t{ ...toolbarItemProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\n/**\n * ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar\n * or ToolbarGroup when used to create general interfaces.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { edit } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n *\t\t<Toolbar label=\"Options\">\n *\t\t\t<ToolbarButton\n *\t\t\t\ticon={ edit }\n *\t\t\t\tlabel=\"Edit\"\n *\t\t\t\tonClick={ () => alert( 'Editing' ) }\n *\t\t\t/>\n *\t\t</Toolbar>\n * );\n * }\n * ```\n */\nexport const ToolbarButton = forwardRef( UnforwardedToolbarButton );\nexport default ToolbarButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAgE,IAAAM,WAAA,GAAAN,OAAA;AAjBhE;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAQA,SAASO,kBAAkBA,CAAE;EAC5BC,UAAU;EACV,GAAGC;AAC0C,CAAC,EAAG;EACjD,OAAO;IACNC,QAAQ,EAAEF,UAAU;IACpB,GAAGC;EACJ,CAAC;AACF;AAEA,SAASE,wBAAwBA,CAChCC,KAI6B,EAC7BC,GAAwB,EACvB;EACD,MAAM;IACLC,QAAQ;IACRC,SAAS;IACTC,kBAAkB;IAClBC,UAAU;IACVC,QAAQ;IACRC,KAAK;IACL,GAAGC;EACJ,CAAC,GAAGb,kBAAkB,CAAEK,KAAM,CAAC;EAC/B,MAAMS,sBAAsB,GAAG,IAAAC,mBAAU,EAAEC,uBAAe,CAAC;EAE3D,IAAK,CA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMuB,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAE5B,wBAAyB,CAAC;AAAC,IAAA6B,QAAA,GAAAF,OAAA,CAAAb,OAAA,GACrDY,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_button","_toolbarItem","_toolbarContext","_toolbarButtonContainer","_jsxRuntime","useDeprecatedProps","isDisabled","otherProps","disabled","UnforwardedToolbarButton","props","ref","children","className","containerClassName","extraProps","isActive","title","restProps","accessibleToolbarState","useContext","ToolbarContext","jsx","default","icon","size","label","shortcut","subscript","onClick","event","stopPropagation","clsx","isPressed","accessibleWhenDisabled","toolbarItemProps","ToolbarButton","exports","forwardRef","_default"],"sources":["@wordpress/components/src/toolbar/toolbar-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, MouseEvent as ReactMouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarButtonContainer from './toolbar-button-container';\nimport type { ToolbarButtonOverriddenProps, ToolbarButtonProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction useDeprecatedProps( {\n\tisDisabled,\n\t...otherProps\n}: React.ComponentProps< typeof ToolbarButton > ) {\n\treturn {\n\t\tdisabled: isDisabled,\n\t\t...otherProps,\n\t};\n}\n\nfunction UnforwardedToolbarButton(\n\tprops: Omit<\n\t\tWordPressComponentProps< ToolbarButtonProps, typeof Button, false >,\n\t\t'accessibleWhenDisabled' // By default, ToolbarButton will be focusable when disabled.\n\t> &\n\t\tToolbarButtonOverriddenProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\textraProps,\n\t\tisActive,\n\t\ttitle,\n\t\t...restProps\n\t} = useDeprecatedProps( props );\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarButtonContainer className={ containerClassName }>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ restProps.icon }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tshortcut={ restProps.shortcut }\n\t\t\t\t\tdata-subscript={ restProps.subscript }\n\t\t\t\t\tonClick={ (\n\t\t\t\t\t\tevent: ReactMouseEvent<\n\t\t\t\t\t\t\tHTMLButtonElement & HTMLAnchorElement,\n\t\t\t\t\t\t\tMouseEvent\n\t\t\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t// TODO: Possible bug; maybe use onClick instead of restProps.onClick.\n\t\t\t\t\t\tif ( restProps.onClick ) {\n\t\t\t\t\t\t\trestProps.onClick( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-toolbar__control',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdata-toolbar-item\n\t\t\t\t\t{ ...extraProps }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t</ToolbarButtonContainer>\n\t\t);\n\t}\n\n\t// ToobarItem will pass all props to the render prop child, which will pass\n\t// all props to Button. This means that ToolbarButton has the same API as\n\t// Button.\n\treturn (\n\t\t<ToolbarItem\n\t\t\tclassName={ clsx( 'components-toolbar-button', className ) }\n\t\t\t{ ...extraProps }\n\t\t\t{ ...restProps }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t{ ...toolbarItemProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\n/**\n * ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar\n * or ToolbarGroup when used to create general interfaces.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { edit } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n *\t\t<Toolbar label=\"Options\">\n *\t\t\t<ToolbarButton\n *\t\t\t\ticon={ edit }\n *\t\t\t\tlabel=\"Edit\"\n *\t\t\t\tonClick={ () => alert( 'Editing' ) }\n *\t\t\t/>\n *\t\t</Toolbar>\n * );\n * }\n * ```\n */\nexport const ToolbarButton = forwardRef( UnforwardedToolbarButton );\nexport default ToolbarButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AAAgE,IAAAM,WAAA,GAAAN,OAAA;AAjBhE;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAQA,SAASO,kBAAkBA,CAAE;EAC5BC,UAAU;EACV,GAAGC;AAC0C,CAAC,EAAG;EACjD,OAAO;IACNC,QAAQ,EAAEF,UAAU;IACpB,GAAGC;EACJ,CAAC;AACF;AAEA,SAASE,wBAAwBA,CAChCC,KAI6B,EAC7BC,GAAwB,EACvB;EACD,MAAM;IACL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B,IAAA/B,WAAA,CAAAkB,GAAA,EAACtB,OAAA,CAAAuB,OAAM;MACNE,IAAI,EAAC,SAAS;MACdC,KAAK,EAAGT,KAAO;MACfgB,SAAS,EAAGjB,QAAU;MAAA,GACjBmB,gBAAgB;MAAAvB,QAAA,EAEnBA;IAAQ,CACH;EACR,CACW,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMwB,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,mBAAU,EAAE7B,wBAAyB,CAAC;AAAC,IAAA8B,QAAA,GAAAF,OAAA,CAAAd,OAAA,GACrDa,aAAa","ignoreList":[]}
@@ -77,6 +77,7 @@ const UnconnectedToolsPanel = (props, forwardedRef) => {
77
77
  * onDeselect={ () => setHeight() }
78
78
  * >
79
79
  * <UnitControl
80
+ * __next40pxDefaultSize
80
81
  * label={ __( 'Height' ) }
81
82
  * onChange={ setHeight }
82
83
  * value={ height }
@@ -88,6 +89,7 @@ const UnconnectedToolsPanel = (props, forwardedRef) => {
88
89
  * onDeselect={ () => setWidth() }
89
90
  * >
90
91
  * <UnitControl
92
+ * __next40pxDefaultSize
91
93
  * label={ __( 'Width' ) }
92
94
  * onChange={ setWidth }
93
95
  * value={ width }
@@ -1 +1 @@
1
- {"version":3,"names":["_toolsPanelHeader","_interopRequireDefault","require","_context","_hook","_grid","_context2","_jsxRuntime","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","dropdownMenuProps","toolsPanelProps","useToolsPanel","jsx","Grid","columns","ref","jsxs","ToolsPanelContext","Provider","value","default","resetAll","ToolsPanel","exports","contextConnect","_default"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\tdropdownMenuProps,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import {\n * __experimentalToolsPanel as ToolsPanel,\n * __experimentalToolsPanelItem as ToolsPanelItem,\n * __experimentalUnitControl as UnitControl\n * } from '@wordpress/components';\n *\n * function Example() {\n * const [ height, setHeight ] = useState();\n * const [ width, setWidth ] = useState();\n *\n * const resetAll = () => {\n * setHeight();\n * setWidth();\n * }\n *\n * return (\n * <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n * <ToolsPanelItem\n * hasValue={ () => !! height }\n * label={ __( 'Height' ) }\n * onDeselect={ () => setHeight() }\n * >\n * <UnitControl\n * label={ __( 'Height' ) }\n * onChange={ setHeight }\n * value={ height }\n * />\n * </ToolsPanelItem>\n * <ToolsPanelItem\n * hasValue={ () => !! width }\n * label={ __( 'Width' ) }\n * onDeselect={ () => setWidth() }\n * >\n * <UnitControl\n * label={ __( 'Width' ) }\n * onChange={ setWidth }\n * value={ width }\n * />\n * </ToolsPanelItem>\n * </ToolsPanel>\n * );\n * }\n * ```\n */\nexport const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );\n\nexport default ToolsPanel;\n"],"mappings":";;;;;;;AAQA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAA+C,IAAAK,WAAA,GAAAL,OAAA;AAb/C;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAMM,qBAAqB,GAAGA,CAC7BC,KAAwD,EACxDC,YAAiC,KAC7B;EACJ,MAAM;IACLC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,YAAY;IACZC,iBAAiB;IACjB,GAAGC;EACJ,CAAC,GAAG,IAAAC,mBAAa,EAAEV,KAAM,CAAC;EAE1B,oBACC,IAAAF,WAAA,CAAAa,GAAA,EAACf,KAAA,CAAAgB,IAAI;IAAA,GAAMH,eAAe;IAAGI,OAAO,EAAG,CAAG;IAACC,GAAG,EAAGb,YAAc;IAAAC,QAAA,eAC9D,IAAAJ,WAAA,CAAAiB,IAAA,EAACrB,QAAA,CAAAsB,iBAAiB,CAACC,QAAQ;MAACC,KAAK,EAAGd,YAAc;MAAAF,QAAA,gBACjD,IAAAJ,WAAA,CAAAa,GAAA,EAACpB,iBAAA,CAAA4B,OAAgB;QAChBhB,KAAK,EAAGA,KAAO;QACfiB,QAAQ,EAAGf,aAAe;QAC1BC,UAAU,EAAGA,UAAY;QACzBC,YAAY,EAAGA,YAAc;QAC7BC,iBAAiB,EAAGA;MAAmB,CACvC,CAAC,EACAN,QAAQ;IAAA,CACiB;EAAC,CACxB,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMmB,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,wBAAc,EAAExB,qBAAqB,EAAE,YAAa,CAAC;AAAC,IAAAyB,QAAA,GAAAF,OAAA,CAAAH,OAAA,GAEjEE,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_toolsPanelHeader","_interopRequireDefault","require","_context","_hook","_grid","_context2","_jsxRuntime","UnconnectedToolsPanel","props","forwardedRef","children","label","panelContext","resetAllItems","toggleItem","headingLevel","dropdownMenuProps","toolsPanelProps","useToolsPanel","jsx","Grid","columns","ref","jsxs","ToolsPanelContext","Provider","value","default","resetAll","ToolsPanel","exports","contextConnect","_default"],"sources":["@wordpress/components/src/tools-panel/tools-panel/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolsPanelHeader from '../tools-panel-header';\nimport { ToolsPanelContext } from '../context';\nimport { useToolsPanel } from './hook';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport type { ToolsPanelProps } from '../types';\n\nconst UnconnectedToolsPanel = (\n\tprops: WordPressComponentProps< ToolsPanelProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tchildren,\n\t\tlabel,\n\t\tpanelContext,\n\t\tresetAllItems,\n\t\ttoggleItem,\n\t\theadingLevel,\n\t\tdropdownMenuProps,\n\t\t...toolsPanelProps\n\t} = useToolsPanel( props );\n\n\treturn (\n\t\t<Grid { ...toolsPanelProps } columns={ 2 } ref={ forwardedRef }>\n\t\t\t<ToolsPanelContext.Provider value={ panelContext }>\n\t\t\t\t<ToolsPanelHeader\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tresetAll={ resetAllItems }\n\t\t\t\t\ttoggleItem={ toggleItem }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</ToolsPanelContext.Provider>\n\t\t</Grid>\n\t);\n};\n\n/**\n * The `ToolsPanel` is a container component that displays its children preceded\n * by a header. The header includes a dropdown menu which is automatically\n * generated from the panel's inner `ToolsPanelItems`.\n *\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import {\n * __experimentalToolsPanel as ToolsPanel,\n * __experimentalToolsPanelItem as ToolsPanelItem,\n * __experimentalUnitControl as UnitControl\n * } from '@wordpress/components';\n *\n * function Example() {\n * const [ height, setHeight ] = useState();\n * const [ width, setWidth ] = useState();\n *\n * const resetAll = () => {\n * setHeight();\n * setWidth();\n * }\n *\n * return (\n * <ToolsPanel label={ __( 'Dimensions' ) } resetAll={ resetAll }>\n * <ToolsPanelItem\n * hasValue={ () => !! height }\n * label={ __( 'Height' ) }\n * onDeselect={ () => setHeight() }\n * >\n * <UnitControl\n * __next40pxDefaultSize\n * label={ __( 'Height' ) }\n * onChange={ setHeight }\n * value={ height }\n * />\n * </ToolsPanelItem>\n * <ToolsPanelItem\n * hasValue={ () => !! width }\n * label={ __( 'Width' ) }\n * onDeselect={ () => setWidth() }\n * >\n * <UnitControl\n * __next40pxDefaultSize\n * label={ __( 'Width' ) }\n * onChange={ setWidth }\n * value={ width }\n * />\n * </ToolsPanelItem>\n * </ToolsPanel>\n * );\n * }\n * ```\n */\nexport const ToolsPanel = contextConnect( UnconnectedToolsPanel, 'ToolsPanel' );\n\nexport default ToolsPanel;\n"],"mappings":";;;;;;;AAQA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAA+C,IAAAK,WAAA,GAAAL,OAAA;AAb/C;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAMM,qBAAqB,GAAGA,CAC7BC,KAAwD,EACxDC,YAAiC,KAC7B;EACJ,MAAM;IACLC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,YAAY;IACZC,iBAAiB;IACjB,GAAGC;EACJ,CAAC,GAAG,IAAAC,mBAAa,EAAEV,KAAM,CAAC;EAE1B,oBACC,IAAAF,WAAA,CAAAa,GAAA,EAACf,KAAA,CAAAgB,IAAI;IAAA,GAAMH,eAAe;IAAGI,OAAO,EAAG,CAAG;IAACC,GAAG,EAAGb,YAAc;IAAAC,QAAA,eAC9D,IAAAJ,WAAA,CAAAiB,IAAA,EAACrB,QAAA,CAAAsB,iBAAiB,CAACC,QAAQ;MAACC,KAAK,EAAGd,YAAc;MAAAF,QAAA,gBACjD,IAAAJ,WAAA,CAAAa,GAAA,EAACpB,iBAAA,CAAA4B,OAAgB;QAChBhB,KAAK,EAAGA,KAAO;QACfiB,QAAQ,EAAGf,aAAe;QAC1BC,UAAU,EAAGA,UAAY;QACzBC,YAAY,EAAGA,YAAc;QAC7BC,iBAAiB,EAAGA;MAAmB,CACvC,CAAC,EACAN,QAAQ;IAAA,CACiB;EAAC,CACxB,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMmB,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,wBAAc,EAAExB,qBAAqB,EAAE,YAAa,CAAC;AAAC,IAAAyB,QAAA,GAAAF,OAAA,CAAAH,OAAA,GAEjEE,UAAU","ignoreList":[]}
@@ -25,7 +25,10 @@ function UnforwardedTreeGridCell({
25
25
  ...props,
26
26
  role: "gridcell",
27
27
  children: withoutGridItem ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
28
- children: children
28
+ children: typeof children === 'function' ? children({
29
+ ...props,
30
+ ref
31
+ }) : children
29
32
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_item.default, {
30
33
  ref: ref,
31
34
  children: children
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_item","_interopRequireDefault","_jsxRuntime","UnforwardedTreeGridCell","children","withoutGridItem","props","ref","jsx","role","Fragment","default","TreeGridCell","exports","forwardRef","_default"],"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TreeGridItem from './item';\nimport type { WordPressComponentProps } from '../context';\nimport type { TreeGridCellProps } from './types';\n\nfunction UnforwardedTreeGridCell(\n\t{\n\t\tchildren,\n\t\twithoutGridItem = false,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridCellProps, 'td', false >,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<td { ...props } role=\"gridcell\">\n\t\t\t{ withoutGridItem ? (\n\t\t\t\t<>{ children }</>\n\t\t\t) : (\n\t\t\t\t<TreeGridItem ref={ ref }>{ children }</TreeGridItem>\n\t\t\t) }\n\t\t</td>\n\t);\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef( UnforwardedTreeGridCell );\n\nexport default TreeGridCell;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAkC,IAAAG,WAAA,GAAAH,OAAA;AARlC;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASI,uBAAuBA,CAC/B;EACCC,QAAQ;EACRC,eAAe,GAAG,KAAK;EACvB,GAAGC;AACuD,CAAC,EAC5DC,GAA8B,EAC7B;EACD,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAA,GAASF,KAAK;IAAGG,IAAI,EAAC,UAAU;IAAAL,QAAA,EAC7BC,eAAe,gBAChB,IAAAH,WAAA,CAAAM,GAAA,EAAAN,WAAA,CAAAQ,QAAA;MAAAN,QAAA,EAAIA;IAAQ,CAAI,CAAC,gBAEjB,IAAAF,WAAA,CAAAM,GAAA,EAACR,KAAA,CAAAW,OAAY;MAACJ,GAAG,EAAGA,GAAK;MAAAH,QAAA,EAAGA;IAAQ,CAAgB;EACpD,CACE,CAAC;AAEP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAEX,uBAAwB,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEnDC,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_item","_interopRequireDefault","_jsxRuntime","UnforwardedTreeGridCell","children","withoutGridItem","props","ref","jsx","role","Fragment","default","TreeGridCell","exports","forwardRef","_default"],"sources":["@wordpress/components/src/tree-grid/cell.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TreeGridItem from './item';\nimport type { WordPressComponentProps } from '../context';\nimport type { TreeGridCellProps } from './types';\n\nfunction UnforwardedTreeGridCell(\n\t{\n\t\tchildren,\n\t\twithoutGridItem = false,\n\t\t...props\n\t}: WordPressComponentProps< TreeGridCellProps, 'td', false >,\n\tref: React.ForwardedRef< any >\n) {\n\treturn (\n\t\t<td { ...props } role=\"gridcell\">\n\t\t\t{ withoutGridItem ? (\n\t\t\t\t<>\n\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t? children( { ...props, ref } )\n\t\t\t\t\t\t: children }\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<TreeGridItem ref={ ref }>{ children }</TreeGridItem>\n\t\t\t) }\n\t\t</td>\n\t);\n}\n\n/**\n * `TreeGridCell` is used to create a tree hierarchy.\n * It is not a visually styled component, but instead helps with adding\n * keyboard navigation and roving tab index behaviors to tree grid structures.\n *\n * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html}\n */\nexport const TreeGridCell = forwardRef( UnforwardedTreeGridCell );\n\nexport default TreeGridCell;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAkC,IAAAG,WAAA,GAAAH,OAAA;AARlC;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASI,uBAAuBA,CAC/B;EACCC,QAAQ;EACRC,eAAe,GAAG,KAAK;EACvB,GAAGC;AACuD,CAAC,EAC5DC,GAA8B,EAC7B;EACD,oBACC,IAAAL,WAAA,CAAAM,GAAA;IAAA,GAASF,KAAK;IAAGG,IAAI,EAAC,UAAU;IAAAL,QAAA,EAC7BC,eAAe,gBAChB,IAAAH,WAAA,CAAAM,GAAA,EAAAN,WAAA,CAAAQ,QAAA;MAAAN,QAAA,EACG,OAAOA,QAAQ,KAAK,UAAU,GAC7BA,QAAQ,CAAE;QAAE,GAAGE,KAAK;QAAEC;MAAI,CAAE,CAAC,GAC7BH;IAAQ,CACV,CAAC,gBAEH,IAAAF,WAAA,CAAAM,GAAA,EAACR,KAAA,CAAAW,OAAY;MAACJ,GAAG,EAAGA,GAAK;MAAAH,QAAA,EAAGA;IAAQ,CAAgB;EACpD,CACE,CAAC;AAEP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMQ,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAEX,uBAAwB,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEnDC,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/tree-grid/types.ts"],"sourcesContent":["export type TreeGridRowProps = {\n\t/**\n\t * The children to be rendered in the row.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * An integer value designating the level in the hierarchical tree structure.\n\t * Counting starts at 1. A value of `1` indicates the root level of the structure.\n\t */\n\tlevel: NonNullable< React.AriaAttributes[ 'aria-level' ] >;\n\t/**\n\t * An integer value that represents the position in the set.\n\t * A set is the count of elements at a specific level. Counting starts at 1.\n\t */\n\tpositionInSet: NonNullable< React.AriaAttributes[ 'aria-posinset' ] >;\n\t/**\n\t * An integer value that represents the total number of items in the set,\n\t * at this specific level of the hierarchy.\n\t */\n\tsetSize: NonNullable< React.AriaAttributes[ 'aria-setsize' ] >;\n\t/**\n\t * An optional value that designates whether a row is expanded or collapsed.\n\t * Currently this value only sets the correct aria-expanded property on a row,\n\t * it has no other built-in behavior.\n\t *\n\t * If there is a need to implement `aria-expanded` elsewhere in the row, cell,\n\t * or element within a cell, you may pass `isExpanded={ undefined }`.\n\t * In order for keyboard navigation to continue working, add the\n\t * `data-expanded` attribute with either `true`/`false`. This allows the\n\t * `TreeGrid` component to still manage keyboard interactions while allowing\n\t * the `aria-expanded` attribute to be placed elsewhere.\n\t */\n\tisExpanded?: boolean;\n};\n\ntype RovingTabIndexItemPassThruProps = {\n\tref: React.ForwardedRef< any >;\n\ttabIndex?: number;\n\tonFocus: React.FocusEventHandler< any >;\n\t[ key: string ]: any;\n};\n\nexport type RovingTabIndexItemProps = {\n\t/**\n\t * A render function that receives the props necessary to make it participate in the\n\t * roving tabindex. Any extra props will also be passed through to this function.\n\t *\n\t * Props passed as an argument to the render prop must be passed to the child\n\t * focusable component/element within the cell. If a component is used, it must\n\t * correctly handle the `onFocus`, `tabIndex`, and `ref` props, passing these to the\n\t * element it renders. These props are used to handle the roving tabindex functionality\n\t * of the tree grid.\n\t *\n\t * ```jsx\n\t * <TreeGridCell>\n\t * \t{ ( props ) => (\n\t * \t\t<Button onClick={ doSomething } { ...props }>\n\t * \t\t\tDo something\n\t * \t\t</Button>\n\t * \t) }\n\t * </TreeGridCell>\n\t * ```\n\t */\n\tchildren?: ( props: RovingTabIndexItemPassThruProps ) => JSX.Element;\n\t/**\n\t * If `children` is not a function, this component will be used instead.\n\t */\n\tas?: React.ComponentType< RovingTabIndexItemPassThruProps >;\n\t[ key: string ]: any;\n};\n\nexport type TreeGridCellProps =\n\t| ( {\n\t\t\t/**\n\t\t\t * Render `children` without wrapping it in a `TreeGridItem` component.\n\t\t\t * This means that `children` will not participate in the roving tabindex.\n\t\t\t *\n\t\t\t * @default false\n\t\t\t */\n\t\t\twithoutGridItem?: false;\n\t } & NonNullable< Pick< RovingTabIndexItemProps, 'children' > > )\n\t| {\n\t\t\tchildren: React.ReactNode;\n\t\t\twithoutGridItem: true;\n\t };\n\nexport type TreeGridProps = {\n\t/**\n\t * Label to use for the element with the `application` role.\n\t */\n\tapplicationAriaLabel?: string;\n\t/**\n\t * The children to be rendered in the tree grid.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * Callback to fire when row is expanded.\n\t *\n\t * @default noop\n\t */\n\tonExpandRow?: ( row: HTMLElement ) => void;\n\t/**\n\t * Callback to fire when row is collapsed.\n\t *\n\t * @default noop\n\t */\n\tonCollapseRow?: ( row: HTMLElement ) => void;\n\t/**\n\t * Callback that fires when focus is shifted from one row to another via\n\t * the Up and Down keys. Callback is also fired on Home and End keys which\n\t * move focus from the beginning row to the end row.\n\t *\n\t * The callback is passed the event, the start row element that the focus was on\n\t * originally, and the destination row element after the focus has moved.\n\t *\n\t * @default noop\n\t */\n\tonFocusRow?: (\n\t\tevent: React.KeyboardEvent< HTMLTableElement >,\n\t\tstartRow: HTMLElement,\n\t\tdestinationRow: HTMLElement\n\t) => void;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/tree-grid/types.ts"],"sourcesContent":["export type TreeGridRowProps = {\n\t/**\n\t * The children to be rendered in the row.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * An integer value designating the level in the hierarchical tree structure.\n\t * Counting starts at 1. A value of `1` indicates the root level of the structure.\n\t */\n\tlevel: NonNullable< React.AriaAttributes[ 'aria-level' ] >;\n\t/**\n\t * An integer value that represents the position in the set.\n\t * A set is the count of elements at a specific level. Counting starts at 1.\n\t */\n\tpositionInSet: NonNullable< React.AriaAttributes[ 'aria-posinset' ] >;\n\t/**\n\t * An integer value that represents the total number of items in the set,\n\t * at this specific level of the hierarchy.\n\t */\n\tsetSize: NonNullable< React.AriaAttributes[ 'aria-setsize' ] >;\n\t/**\n\t * An optional value that designates whether a row is expanded or collapsed.\n\t * Currently this value only sets the correct aria-expanded property on a row,\n\t * it has no other built-in behavior.\n\t *\n\t * If there is a need to implement `aria-expanded` elsewhere in the row, cell,\n\t * or element within a cell, you may pass `isExpanded={ undefined }`.\n\t * In order for keyboard navigation to continue working, add the\n\t * `data-expanded` attribute with either `true`/`false`. This allows the\n\t * `TreeGrid` component to still manage keyboard interactions while allowing\n\t * the `aria-expanded` attribute to be placed elsewhere.\n\t */\n\tisExpanded?: boolean;\n};\n\ntype RovingTabIndexItemPassThruProps = {\n\tref: React.ForwardedRef< any >;\n\ttabIndex?: number;\n\tonFocus?: React.FocusEventHandler< any >;\n\t[ key: string ]: any;\n};\n\nexport type RovingTabIndexItemProps = {\n\t/**\n\t * A render function that receives the props necessary to make it participate in the\n\t * roving tabindex. Any extra props will also be passed through to this function.\n\t *\n\t * Props passed as an argument to the render prop must be passed to the child\n\t * focusable component/element within the cell. If a component is used, it must\n\t * correctly handle the `onFocus`, `tabIndex`, and `ref` props, passing these to the\n\t * element it renders. These props are used to handle the roving tabindex functionality\n\t * of the tree grid.\n\t *\n\t * ```jsx\n\t * <TreeGridCell>\n\t * \t{ ( props ) => (\n\t * \t\t<Button onClick={ doSomething } { ...props }>\n\t * \t\t\tDo something\n\t * \t\t</Button>\n\t * \t) }\n\t * </TreeGridCell>\n\t * ```\n\t */\n\tchildren?: ( props: RovingTabIndexItemPassThruProps ) => JSX.Element;\n\t/**\n\t * If `children` is not a function, this component will be used instead.\n\t */\n\tas?: React.ComponentType< RovingTabIndexItemPassThruProps >;\n\t[ key: string ]: any;\n};\n\nexport type TreeGridCellProps =\n\t| ( {\n\t\t\t/**\n\t\t\t * Render `children` without wrapping it in a `TreeGridItem` component.\n\t\t\t * This means that `children` will not participate in the roving tabindex.\n\t\t\t *\n\t\t\t * @default false\n\t\t\t */\n\t\t\twithoutGridItem?: false;\n\t } & NonNullable< Pick< RovingTabIndexItemProps, 'children' > > )\n\t| {\n\t\t\tchildren: React.ReactNode;\n\t\t\twithoutGridItem: true;\n\t };\n\nexport type TreeGridProps = {\n\t/**\n\t * Label to use for the element with the `application` role.\n\t */\n\tapplicationAriaLabel?: string;\n\t/**\n\t * The children to be rendered in the tree grid.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * Callback to fire when row is expanded.\n\t *\n\t * @default noop\n\t */\n\tonExpandRow?: ( row: HTMLElement ) => void;\n\t/**\n\t * Callback to fire when row is collapsed.\n\t *\n\t * @default noop\n\t */\n\tonCollapseRow?: ( row: HTMLElement ) => void;\n\t/**\n\t * Callback that fires when focus is shifted from one row to another via\n\t * the Up and Down keys. Callback is also fired on Home and End keys which\n\t * move focus from the beginning row to the end row.\n\t *\n\t * The callback is passed the event, the start row element that the focus was on\n\t * originally, and the destination row element after the focus has moved.\n\t *\n\t * @default noop\n\t */\n\tonFocusRow?: (\n\t\tevent: React.KeyboardEvent< HTMLTableElement >,\n\t\tstartRow: HTMLElement,\n\t\tdestinationRow: HTMLElement\n\t) => void;\n};\n"],"mappings":"","ignoreList":[]}