@wordpress/components 28.11.0 → 28.13.1-next.082ed6819.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 (514) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/build/autocomplete/autocompleter-ui.js +1 -0
  3. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  4. package/build/border-box-control/border-box-control/component.js +1 -0
  5. package/build/border-box-control/border-box-control/component.js.map +1 -1
  6. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  7. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  8. package/build/border-control/border-control/component.js +2 -1
  9. package/build/border-control/border-control/component.js.map +1 -1
  10. package/build/border-control/border-control/hook.js +3 -1
  11. package/build/border-control/border-control/hook.js.map +1 -1
  12. package/build/border-control/border-control-dropdown/component.js +1 -1
  13. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  14. package/build/border-control/types.js.map +1 -1
  15. package/build/box-control/all-input-control.js +1 -0
  16. package/build/box-control/all-input-control.js.map +1 -1
  17. package/build/box-control/axial-input-controls.js +1 -0
  18. package/build/box-control/axial-input-controls.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/color-palette/index.js +2 -0
  22. package/build/color-palette/index.js.map +1 -1
  23. package/build/color-picker/color-copy-button.js +6 -4
  24. package/build/color-picker/color-copy-button.js.map +1 -1
  25. package/build/color-picker/component.js +1 -0
  26. package/build/color-picker/component.js.map +1 -1
  27. package/build/color-picker/styles.js +21 -28
  28. package/build/color-picker/styles.js.map +1 -1
  29. package/build/combobox-control/index.js +17 -12
  30. package/build/combobox-control/index.js.map +1 -1
  31. package/build/composite/hover.js +1 -1
  32. package/build/composite/hover.js.map +1 -1
  33. package/build/composite/typeahead.js +1 -1
  34. package/build/composite/typeahead.js.map +1 -1
  35. package/build/dashicon/types.js.map +1 -1
  36. package/build/dimension-control/index.js +7 -0
  37. package/build/dimension-control/index.js.map +1 -1
  38. package/build/disabled/index.js +8 -1
  39. package/build/disabled/index.js.map +1 -1
  40. package/build/duotone-picker/duotone-picker.js +2 -0
  41. package/build/duotone-picker/duotone-picker.js.map +1 -1
  42. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  43. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  44. package/build/font-size-picker/index.js +7 -0
  45. package/build/font-size-picker/index.js.map +1 -1
  46. package/build/form-file-upload/index.js +7 -1
  47. package/build/form-file-upload/index.js.map +1 -1
  48. package/build/form-token-field/token.js +1 -0
  49. package/build/form-token-field/token.js.map +1 -1
  50. package/build/gradient-picker/index.js +34 -32
  51. package/build/gradient-picker/index.js.map +1 -1
  52. package/build/gradient-picker/types.js.map +1 -1
  53. package/build/guide/page-control.js +1 -0
  54. package/build/guide/page-control.js.map +1 -1
  55. package/build/menu/styles.js +16 -16
  56. package/build/menu/styles.js.map +1 -1
  57. package/build/menu-item/index.js +1 -0
  58. package/build/menu-item/index.js.map +1 -1
  59. package/build/modal/index.js +2 -2
  60. package/build/modal/index.js.map +1 -1
  61. package/build/notice/index.js +2 -0
  62. package/build/notice/index.js.map +1 -1
  63. package/build/palette-edit/index.js +5 -0
  64. package/build/palette-edit/index.js.map +1 -1
  65. package/build/panel/body.js +1 -0
  66. package/build/panel/body.js.map +1 -1
  67. package/build/popover/index.js +4 -1
  68. package/build/popover/index.js.map +1 -1
  69. package/build/private-apis.js +0 -2
  70. package/build/private-apis.js.map +1 -1
  71. package/build/radio-group/radio.js +6 -0
  72. package/build/radio-group/radio.js.map +1 -1
  73. package/build/radio-group/types.js.map +1 -1
  74. package/build/range-control/index.js +11 -0
  75. package/build/range-control/index.js.map +1 -1
  76. package/build/range-control/types.js.map +1 -1
  77. package/build/slot-fill/bubbles-virtually/fill.js +14 -31
  78. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  79. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  80. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  81. package/build/slot-fill/bubbles-virtually/slot.js +11 -9
  82. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  83. package/build/slot-fill/bubbles-virtually/use-slot.js +1 -8
  84. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  85. package/build/slot-fill/fill.js +7 -24
  86. package/build/slot-fill/fill.js.map +1 -1
  87. package/build/slot-fill/index.js +5 -10
  88. package/build/slot-fill/index.js.map +1 -1
  89. package/build/slot-fill/provider.js +2 -2
  90. package/build/slot-fill/provider.js.map +1 -1
  91. package/build/slot-fill/slot.js +37 -77
  92. package/build/slot-fill/slot.js.map +1 -1
  93. package/build/slot-fill/types.js.map +1 -1
  94. package/build/snackbar/index.js +2 -1
  95. package/build/snackbar/index.js.map +1 -1
  96. package/build/tabs/tablist.js +13 -2
  97. package/build/tabs/tablist.js.map +1 -1
  98. package/build/text-control/index.js +7 -0
  99. package/build/text-control/index.js.map +1 -1
  100. package/build/toggle-group-control/toggle-group-control/component.js +10 -1
  101. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  102. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -0
  103. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  104. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  105. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  106. package/build/toggle-group-control/types.js.map +1 -1
  107. package/build/utils/deprecated-36px-size.js +3 -2
  108. package/build/utils/deprecated-36px-size.js.map +1 -1
  109. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  110. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  111. package/build-module/border-box-control/border-box-control/component.js +1 -0
  112. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  113. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  114. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  115. package/build-module/border-control/border-control/component.js +2 -1
  116. package/build-module/border-control/border-control/component.js.map +1 -1
  117. package/build-module/border-control/border-control/hook.js +3 -1
  118. package/build-module/border-control/border-control/hook.js.map +1 -1
  119. package/build-module/border-control/border-control-dropdown/component.js +1 -1
  120. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  121. package/build-module/border-control/types.js.map +1 -1
  122. package/build-module/box-control/all-input-control.js +1 -0
  123. package/build-module/box-control/all-input-control.js.map +1 -1
  124. package/build-module/box-control/axial-input-controls.js +1 -0
  125. package/build-module/box-control/axial-input-controls.js.map +1 -1
  126. package/build-module/box-control/input-controls.js +1 -0
  127. package/build-module/box-control/input-controls.js.map +1 -1
  128. package/build-module/color-palette/index.js +2 -0
  129. package/build-module/color-palette/index.js.map +1 -1
  130. package/build-module/color-picker/color-copy-button.js +6 -4
  131. package/build-module/color-picker/color-copy-button.js.map +1 -1
  132. package/build-module/color-picker/component.js +1 -0
  133. package/build-module/color-picker/component.js.map +1 -1
  134. package/build-module/color-picker/styles.js +20 -27
  135. package/build-module/color-picker/styles.js.map +1 -1
  136. package/build-module/combobox-control/index.js +18 -13
  137. package/build-module/combobox-control/index.js.map +1 -1
  138. package/build-module/composite/hover.js +1 -1
  139. package/build-module/composite/hover.js.map +1 -1
  140. package/build-module/composite/typeahead.js +1 -1
  141. package/build-module/composite/typeahead.js.map +1 -1
  142. package/build-module/dashicon/types.js.map +1 -1
  143. package/build-module/dimension-control/index.js +7 -0
  144. package/build-module/dimension-control/index.js.map +1 -1
  145. package/build-module/disabled/index.js +8 -1
  146. package/build-module/disabled/index.js.map +1 -1
  147. package/build-module/duotone-picker/duotone-picker.js +2 -0
  148. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  149. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  150. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  151. package/build-module/font-size-picker/index.js +7 -0
  152. package/build-module/font-size-picker/index.js.map +1 -1
  153. package/build-module/form-file-upload/index.js +7 -1
  154. package/build-module/form-file-upload/index.js.map +1 -1
  155. package/build-module/form-token-field/token.js +1 -0
  156. package/build-module/form-token-field/token.js.map +1 -1
  157. package/build-module/gradient-picker/index.js +34 -32
  158. package/build-module/gradient-picker/index.js.map +1 -1
  159. package/build-module/gradient-picker/types.js.map +1 -1
  160. package/build-module/guide/page-control.js +1 -0
  161. package/build-module/guide/page-control.js.map +1 -1
  162. package/build-module/menu/styles.js +16 -16
  163. package/build-module/menu/styles.js.map +1 -1
  164. package/build-module/menu-item/index.js +1 -0
  165. package/build-module/menu-item/index.js.map +1 -1
  166. package/build-module/modal/index.js +2 -2
  167. package/build-module/modal/index.js.map +1 -1
  168. package/build-module/notice/index.js +2 -0
  169. package/build-module/notice/index.js.map +1 -1
  170. package/build-module/palette-edit/index.js +5 -0
  171. package/build-module/palette-edit/index.js.map +1 -1
  172. package/build-module/panel/body.js +1 -0
  173. package/build-module/panel/body.js.map +1 -1
  174. package/build-module/popover/index.js +4 -1
  175. package/build-module/popover/index.js.map +1 -1
  176. package/build-module/private-apis.js +0 -2
  177. package/build-module/private-apis.js.map +1 -1
  178. package/build-module/radio-group/radio.js +6 -0
  179. package/build-module/radio-group/radio.js.map +1 -1
  180. package/build-module/radio-group/types.js.map +1 -1
  181. package/build-module/range-control/index.js +11 -0
  182. package/build-module/range-control/index.js.map +1 -1
  183. package/build-module/range-control/types.js.map +1 -1
  184. package/build-module/slot-fill/bubbles-virtually/fill.js +15 -32
  185. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  186. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  187. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  188. package/build-module/slot-fill/bubbles-virtually/slot.js +11 -9
  189. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  190. package/build-module/slot-fill/bubbles-virtually/use-slot.js +2 -9
  191. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  192. package/build-module/slot-fill/fill.js +7 -24
  193. package/build-module/slot-fill/fill.js.map +1 -1
  194. package/build-module/slot-fill/index.js +5 -8
  195. package/build-module/slot-fill/index.js.map +1 -1
  196. package/build-module/slot-fill/provider.js +2 -3
  197. package/build-module/slot-fill/provider.js.map +1 -1
  198. package/build-module/slot-fill/slot.js +38 -78
  199. package/build-module/slot-fill/slot.js.map +1 -1
  200. package/build-module/slot-fill/types.js.map +1 -1
  201. package/build-module/snackbar/index.js +2 -1
  202. package/build-module/snackbar/index.js.map +1 -1
  203. package/build-module/tabs/tablist.js +13 -2
  204. package/build-module/tabs/tablist.js.map +1 -1
  205. package/build-module/text-control/index.js +7 -0
  206. package/build-module/text-control/index.js.map +1 -1
  207. package/build-module/toggle-group-control/toggle-group-control/component.js +10 -1
  208. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  209. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -0
  210. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  211. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  212. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  213. package/build-module/toggle-group-control/types.js.map +1 -1
  214. package/build-module/utils/deprecated-36px-size.js +3 -2
  215. package/build-module/utils/deprecated-36px-size.js.map +1 -1
  216. package/build-style/style-rtl.css +15 -36
  217. package/build-style/style.css +15 -36
  218. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  219. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  220. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  221. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  222. package/build-types/border-control/border-control/component.d.ts +1 -0
  223. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  224. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  225. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  226. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  227. package/build-types/border-control/stories/index.story.d.ts +10 -5
  228. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  229. package/build-types/border-control/types.d.ts +7 -0
  230. package/build-types/border-control/types.d.ts.map +1 -1
  231. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  232. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  233. package/build-types/box-control/input-controls.d.ts.map +1 -1
  234. package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
  235. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  236. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  237. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  238. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  239. package/build-types/color-palette/index.d.ts.map +1 -1
  240. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  241. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  242. package/build-types/color-picker/component.d.ts.map +1 -1
  243. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  244. package/build-types/color-picker/styles.d.ts +2 -4
  245. package/build-types/color-picker/styles.d.ts.map +1 -1
  246. package/build-types/combobox-control/index.d.ts +1 -0
  247. package/build-types/combobox-control/index.d.ts.map +1 -1
  248. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  249. package/build-types/composite/typeahead.d.ts.map +1 -1
  250. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  251. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  252. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  253. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  254. package/build-types/dashicon/types.d.ts +1 -1
  255. package/build-types/dashicon/types.d.ts.map +1 -1
  256. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  257. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  258. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  259. package/build-types/dimension-control/index.d.ts +1 -0
  260. package/build-types/dimension-control/index.d.ts.map +1 -1
  261. package/build-types/disabled/index.d.ts +8 -1
  262. package/build-types/disabled/index.d.ts.map +1 -1
  263. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  264. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  265. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  266. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  267. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  268. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  269. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  270. package/build-types/font-size-picker/index.d.ts.map +1 -1
  271. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  272. package/build-types/form-file-upload/index.d.ts.map +1 -1
  273. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  274. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  275. package/build-types/form-token-field/token.d.ts.map +1 -1
  276. package/build-types/gradient-picker/index.d.ts +32 -32
  277. package/build-types/gradient-picker/index.d.ts.map +1 -1
  278. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  279. package/build-types/gradient-picker/types.d.ts +1 -5
  280. package/build-types/gradient-picker/types.d.ts.map +1 -1
  281. package/build-types/guide/page-control.d.ts.map +1 -1
  282. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  283. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  284. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  285. package/build-types/lock-unlock.d.ts +2 -2
  286. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  287. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  288. package/build-types/menu-item/index.d.ts.map +1 -1
  289. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  290. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  291. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  292. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  293. package/build-types/notice/index.d.ts.map +1 -1
  294. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  295. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  296. package/build-types/palette-edit/index.d.ts.map +1 -1
  297. package/build-types/panel/body.d.ts.map +1 -1
  298. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  299. package/build-types/popover/index.d.ts.map +1 -1
  300. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  301. package/build-types/private-apis.d.ts.map +1 -1
  302. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  303. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  304. package/build-types/radio-group/radio.d.ts +4 -2
  305. package/build-types/radio-group/radio.d.ts.map +1 -1
  306. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  307. package/build-types/radio-group/types.d.ts +5 -1
  308. package/build-types/radio-group/types.d.ts.map +1 -1
  309. package/build-types/range-control/index.d.ts +3 -1
  310. package/build-types/range-control/index.d.ts.map +1 -1
  311. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  312. package/build-types/range-control/types.d.ts +7 -0
  313. package/build-types/range-control/types.d.ts.map +1 -1
  314. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  315. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  316. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  317. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +1 -1
  318. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  319. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  320. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  321. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  322. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  323. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +3 -7
  324. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  325. package/build-types/slot-fill/fill.d.ts.map +1 -1
  326. package/build-types/slot-fill/index.d.ts +5 -12
  327. package/build-types/slot-fill/index.d.ts.map +1 -1
  328. package/build-types/slot-fill/provider.d.ts.map +1 -1
  329. package/build-types/slot-fill/slot.d.ts +1 -1
  330. package/build-types/slot-fill/slot.d.ts.map +1 -1
  331. package/build-types/slot-fill/types.d.ts +15 -18
  332. package/build-types/slot-fill/types.d.ts.map +1 -1
  333. package/build-types/slot-fill/use-slot.d.ts +1 -1
  334. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  335. package/build-types/snackbar/index.d.ts.map +1 -1
  336. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  337. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  338. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  339. package/build-types/tabs/tablist.d.ts.map +1 -1
  340. package/build-types/text/stories/index.story.d.ts.map +1 -1
  341. package/build-types/text-control/index.d.ts +1 -0
  342. package/build-types/text-control/index.d.ts.map +1 -1
  343. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  344. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  345. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  346. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  347. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  348. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  349. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -0
  350. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  351. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -0
  352. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  353. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  354. package/build-types/toggle-group-control/types.d.ts +7 -0
  355. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  356. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  357. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  358. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  359. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  360. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  361. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  362. package/build-types/utils/deprecated-36px-size.d.ts +3 -2
  363. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  364. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  365. package/package.json +21 -21
  366. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  367. package/src/base-control/stories/index.story.tsx +2 -1
  368. package/src/border-box-control/border-box-control/component.tsx +1 -0
  369. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  370. package/src/border-control/border-control/component.tsx +1 -0
  371. package/src/border-control/border-control/hook.ts +2 -0
  372. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  373. package/src/border-control/types.ts +7 -0
  374. package/src/box-control/all-input-control.tsx +1 -0
  375. package/src/box-control/axial-input-controls.tsx +1 -0
  376. package/src/box-control/input-controls.tsx +1 -0
  377. package/src/checkbox-control/stories/index.story.tsx +2 -1
  378. package/src/circular-option-picker/stories/index.story.tsx +2 -1
  379. package/src/color-indicator/stories/index.story.tsx +2 -1
  380. package/src/color-palette/index.tsx +5 -1
  381. package/src/color-palette/stories/index.story.tsx +2 -1
  382. package/src/color-picker/color-copy-button.tsx +8 -10
  383. package/src/color-picker/component.tsx +1 -0
  384. package/src/color-picker/stories/index.story.tsx +2 -1
  385. package/src/color-picker/styles.ts +0 -13
  386. package/src/combobox-control/README.md +1 -0
  387. package/src/combobox-control/index.tsx +19 -13
  388. package/src/combobox-control/stories/index.story.tsx +3 -1
  389. package/src/combobox-control/style.scss +0 -6
  390. package/src/combobox-control/test/index.tsx +7 -1
  391. package/src/composite/hover.tsx +1 -1
  392. package/src/composite/typeahead.tsx +3 -1
  393. package/src/confirm-dialog/stories/index.story.tsx +2 -1
  394. package/src/custom-gradient-picker/stories/index.story.tsx +2 -1
  395. package/src/custom-select-control/stories/index.story.tsx +2 -1
  396. package/src/custom-select-control-v2/stories/index.story.tsx +2 -1
  397. package/src/dashicon/types.ts +0 -2
  398. package/src/date-time/stories/date-time.story.tsx +2 -1
  399. package/src/date-time/stories/date.story.tsx +2 -1
  400. package/src/date-time/stories/time.story.tsx +2 -1
  401. package/src/dimension-control/README.md +1 -0
  402. package/src/dimension-control/index.tsx +8 -0
  403. package/src/dimension-control/stories/index.story.tsx +1 -0
  404. package/src/dimension-control/test/__snapshots__/index.test.js.snap +24 -24
  405. package/src/dimension-control/test/index.test.js +7 -1
  406. package/src/disabled/README.md +9 -7
  407. package/src/disabled/index.tsx +8 -1
  408. package/src/disabled/stories/index.story.tsx +1 -0
  409. package/src/drop-zone/stories/index.story.tsx +2 -1
  410. package/src/dropdown/stories/index.story.tsx +2 -1
  411. package/src/dropdown-menu/stories/index.story.tsx +2 -1
  412. package/src/duotone-picker/duotone-picker.tsx +2 -0
  413. package/src/external-link/stories/index.story.tsx +2 -1
  414. package/src/font-size-picker/README.md +1 -0
  415. package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -0
  416. package/src/font-size-picker/index.tsx +8 -0
  417. package/src/font-size-picker/stories/index.story.tsx +1 -0
  418. package/src/font-size-picker/test/index.tsx +5 -1
  419. package/src/form-file-upload/index.tsx +13 -1
  420. package/src/form-file-upload/stories/index.story.tsx +2 -1
  421. package/src/form-token-field/stories/index.story.tsx +2 -1
  422. package/src/form-token-field/style.scss +8 -12
  423. package/src/form-token-field/token.tsx +1 -0
  424. package/src/gradient-picker/README.md +107 -69
  425. package/src/gradient-picker/docs-manifest.json +5 -0
  426. package/src/gradient-picker/index.tsx +34 -32
  427. package/src/gradient-picker/stories/index.story.tsx +2 -1
  428. package/src/gradient-picker/types.ts +3 -5
  429. package/src/guide/page-control.tsx +1 -0
  430. package/src/guide/style.scss +4 -6
  431. package/src/h-stack/stories/index.story.tsx +2 -1
  432. package/src/heading/stories/index.story.tsx +2 -1
  433. package/src/higher-order/with-constrained-tabbing/README.md +13 -3
  434. package/src/higher-order/with-focus-return/README.md +9 -2
  435. package/src/input-control/stories/index.story.tsx +2 -1
  436. package/src/menu/stories/index.story.tsx +2 -1
  437. package/src/menu/styles.ts +1 -1
  438. package/src/menu-group/stories/index.story.tsx +2 -1
  439. package/src/menu-item/index.tsx +1 -0
  440. package/src/menu-item/stories/index.story.tsx +2 -1
  441. package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
  442. package/src/menu-items-choice/stories/index.story.tsx +2 -1
  443. package/src/modal/index.tsx +2 -2
  444. package/src/modal/stories/index.story.tsx +3 -2
  445. package/src/navigator/stories/index.story.tsx +2 -1
  446. package/src/notice/index.tsx +2 -0
  447. package/src/notice/stories/index.story.tsx +7 -2
  448. package/src/notice/test/__snapshots__/index.tsx.snap +4 -4
  449. package/src/number-control/stories/index.story.tsx +2 -1
  450. package/src/palette-edit/index.tsx +5 -0
  451. package/src/panel/body.tsx +1 -0
  452. package/src/placeholder/stories/index.story.tsx +1 -0
  453. package/src/popover/index.tsx +3 -0
  454. package/src/popover/stories/index.story.tsx +2 -1
  455. package/src/private-apis.ts +0 -2
  456. package/src/progress-bar/stories/index.story.tsx +2 -1
  457. package/src/radio-control/stories/index.story.tsx +2 -1
  458. package/src/radio-group/README.md +8 -8
  459. package/src/radio-group/radio.tsx +7 -0
  460. package/src/radio-group/stories/index.story.tsx +16 -4
  461. package/src/radio-group/types.ts +6 -1
  462. package/src/range-control/README.md +4 -3
  463. package/src/range-control/index.tsx +11 -0
  464. package/src/range-control/stories/index.story.tsx +9 -1
  465. package/src/range-control/test/index.tsx +7 -1
  466. package/src/range-control/types.ts +7 -0
  467. package/src/responsive-wrapper/stories/index.story.tsx +2 -1
  468. package/src/search-control/stories/index.story.tsx +2 -1
  469. package/src/select-control/stories/index.story.tsx +2 -1
  470. package/src/slot-fill/README.md +26 -15
  471. package/src/slot-fill/bubbles-virtually/fill.tsx +18 -28
  472. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +26 -16
  473. package/src/slot-fill/bubbles-virtually/slot.tsx +13 -9
  474. package/src/slot-fill/bubbles-virtually/use-slot.ts +3 -26
  475. package/src/slot-fill/fill.ts +7 -22
  476. package/src/slot-fill/index.tsx +5 -7
  477. package/src/slot-fill/provider.tsx +8 -17
  478. package/src/slot-fill/slot.tsx +48 -85
  479. package/src/slot-fill/types.ts +14 -51
  480. package/src/snackbar/index.tsx +2 -1
  481. package/src/snackbar/stories/index.story.tsx +2 -1
  482. package/src/snackbar/stories/list.story.tsx +2 -1
  483. package/src/snackbar/style.scss +7 -16
  484. package/src/spinner/stories/index.story.tsx +2 -1
  485. package/src/tabs/tablist.tsx +13 -2
  486. package/src/text/stories/index.story.tsx +2 -1
  487. package/src/text-control/README.md +1 -0
  488. package/src/text-control/index.tsx +8 -0
  489. package/src/text-control/stories/index.story.tsx +3 -1
  490. package/src/text-control/test/text-control.tsx +7 -1
  491. package/src/text-highlight/stories/index.story.tsx +2 -1
  492. package/src/textarea-control/stories/index.story.tsx +2 -1
  493. package/src/tip/stories/index.story.tsx +2 -1
  494. package/src/toggle-control/stories/index.story.tsx +2 -1
  495. package/src/toggle-group-control/stories/index.story.tsx +3 -1
  496. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -12
  497. package/src/toggle-group-control/test/index.tsx +7 -1
  498. package/src/toggle-group-control/toggle-group-control/README.md +2 -1
  499. package/src/toggle-group-control/toggle-group-control/component.tsx +11 -1
  500. package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
  501. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
  502. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  503. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  504. package/src/toggle-group-control/types.ts +7 -0
  505. package/src/tools-panel/stories/index.story.tsx +3 -0
  506. package/src/tooltip/stories/index.story.tsx +2 -1
  507. package/src/tree-grid/stories/index.story.tsx +2 -1
  508. package/src/tree-select/stories/index.story.tsx +2 -1
  509. package/src/truncate/stories/index.story.tsx +2 -1
  510. package/src/unit-control/stories/index.story.tsx +2 -1
  511. package/src/utils/deprecated-36px-size.ts +8 -2
  512. package/src/v-stack/stories/index.story.tsx +2 -1
  513. package/src/visually-hidden/stories/index.story.tsx +1 -1
  514. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_a11y","_element","_i18n","_warning","_button","_jsxRuntime","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","useRef","useLayoutEffect","timeoutHandle","setTimeout","clearTimeout","classes","clsx","length","globalThis","SCRIPT_DEBUG","warning","snackbarContentClassnames","jsx","undefined","tabIndex","role","onKeyPress","__","jsxs","map","label","url","index","default","href","variant","Snackbar","exports","forwardRef","_default"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t&#x2715;\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA+B,IAAAM,WAAA,GAAAN,OAAA;AAvB/B;AACA;AACA;;AAIA;AACA;AACA;;AAYA;AACA;AACA;;AAMA,MAAMO,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACxBC,OAAyC,EACzCC,UAAwD,EACvD;EACD,MAAMC,aAAa,GAClB,OAAOF,OAAO,KA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B,QAAA,GACzCG,IAAI,iBACL,IAAAd,WAAA,CAAAwC,GAAA;QAAK9B,SAAS,EAAC,2BAA2B;QAAAC,QAAA,EAAGG;MAAI,CAAO,CACxD,EACCH,QAAQ,EACRC,OAAO,CAACmC,GAAG,CAAE,CAAE;QAAEC,KAAK;QAAEvB,OAAO;QAAEwB;MAAI,CAAC,EAAEC,KAAK,KAAM;QACpD,oBACC,IAAAlD,WAAA,CAAAwC,GAAA,EAACzC,OAAA,CAAAoD,OAAM;UAENC,IAAI,EAAGH,GAAK;UACZI,OAAO,EAAC,UAAU;UAClB5B,OAAO,EACNL,KAAsC,IAClCI,aAAa,CAAEJ,KAAK,EAAEK,OAAQ,CAAG;UACtCf,SAAS,EAAC,6BAA6B;UAAAC,QAAA,EAErCqC;QAAK,GARDE,KASC,CAAC;MAEX,CAAE,CAAC,EACDnC,eAAe,iBAChB,IAAAf,WAAA,CAAAwC,GAAA;QACCG,IAAI,EAAC,QAAQ;QACb,cAAa,IAAAE,QAAE,EAAE,qBAAsB,CAAG;QAC1CH,QAAQ,EAAG,CAAG;QACdhC,SAAS,EAAC,qCAAqC;QAC/Ce,OAAO,EAAGN,SAAW;QACrByB,UAAU,EAAGzB,SAAW;QAAAR,QAAA,EACxB;MAED,CAAM,CACN;IAAA,CACG;EAAC,CACF,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM2C,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,mBAAU,EAAE/C,mBAAoB,CAAC;AAAC,IAAAgD,QAAA,GAAAF,OAAA,CAAAJ,OAAA,GAE3CG,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_a11y","_element","_i18n","_warning","_button","_jsxRuntime","NOTICE_TIMEOUT","useSpokenMessage","message","politeness","spokenMessage","renderToString","useEffect","speak","UnforwardedSnackbar","className","children","actions","onRemove","icon","explicitDismiss","onDismiss","listRef","ref","dismissMe","event","preventDefault","current","focus","onActionClick","onClick","stopPropagation","callbacksRef","useRef","useLayoutEffect","timeoutHandle","setTimeout","clearTimeout","classes","clsx","length","globalThis","SCRIPT_DEBUG","warning","snackbarContentClassnames","jsx","undefined","tabIndex","role","onKeyPress","__","jsxs","map","label","url","index","default","__next40pxDefaultSize","href","variant","Snackbar","exports","forwardRef","_default"],"sources":["@wordpress/components/src/snackbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { speak } from '@wordpress/a11y';\nimport {\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tforwardRef,\n\trenderToString,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport type { SnackbarProps } from './types';\nimport type { NoticeAction } from '../notice/types';\nimport type { WordPressComponentProps } from '../context';\n\nconst NOTICE_TIMEOUT = 10000;\n\n/**\n * Custom hook which announces the message with the given politeness, if a\n * valid message is provided.\n *\n * @param message Message to announce.\n * @param politeness Politeness to announce.\n */\nfunction useSpokenMessage(\n\tmessage: SnackbarProps[ 'spokenMessage' ],\n\tpoliteness: NonNullable< SnackbarProps[ 'politeness' ] >\n) {\n\tconst spokenMessage =\n\t\ttypeof message === 'string' ? message : renderToString( message );\n\n\tuseEffect( () => {\n\t\tif ( spokenMessage ) {\n\t\t\tspeak( spokenMessage, politeness );\n\t\t}\n\t}, [ spokenMessage, politeness ] );\n}\n\nfunction UnforwardedSnackbar(\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\tspokenMessage = children,\n\t\tpoliteness = 'polite',\n\t\tactions = [],\n\t\tonRemove,\n\t\ticon = null,\n\t\texplicitDismiss = false,\n\t\t// onDismiss is a callback executed when the snackbar is dismissed.\n\t\t// It is distinct from onRemove, which _looks_ like a callback but is\n\t\t// actually the function to call to remove the snackbar from the UI.\n\t\tonDismiss,\n\t\tlistRef,\n\t}: WordPressComponentProps< SnackbarProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tfunction dismissMe( event: KeyboardEvent | MouseEvent ) {\n\t\tif ( event && event.preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\t// Prevent focus loss by moving it to the list element.\n\t\tlistRef?.current?.focus();\n\n\t\tonDismiss?.();\n\t\tonRemove?.();\n\t}\n\n\tfunction onActionClick(\n\t\tevent: MouseEvent< HTMLButtonElement >,\n\t\tonClick: NoticeAction[ 'onClick' ]\n\t) {\n\t\tevent.stopPropagation();\n\n\t\tonRemove?.();\n\n\t\tif ( onClick ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\tuseSpokenMessage( spokenMessage, politeness );\n\n\t// The `onDismiss/onRemove` can have unstable references,\n\t// trigger side-effect cleanup, and reset timers.\n\tconst callbacksRef = useRef( { onDismiss, onRemove } );\n\tuseLayoutEffect( () => {\n\t\tcallbacksRef.current = { onDismiss, onRemove };\n\t} );\n\n\tuseEffect( () => {\n\t\t// Only set up the timeout dismiss if we're not explicitly dismissing.\n\t\tconst timeoutHandle = setTimeout( () => {\n\t\t\tif ( ! explicitDismiss ) {\n\t\t\t\tcallbacksRef.current.onDismiss?.();\n\t\t\t\tcallbacksRef.current.onRemove?.();\n\t\t\t}\n\t\t}, NOTICE_TIMEOUT );\n\n\t\treturn () => clearTimeout( timeoutHandle );\n\t}, [ explicitDismiss ] );\n\n\tconst classes = clsx( className, 'components-snackbar', {\n\t\t'components-snackbar-explicit-dismiss': !! explicitDismiss,\n\t} );\n\tif ( actions && actions.length > 1 ) {\n\t\t// We need to inform developers that snackbar only accepts 1 action.\n\t\twarning(\n\t\t\t'Snackbar can only have one action. Use Notice if your message requires many actions.'\n\t\t);\n\t\t// return first element only while keeping it inside an array\n\t\tactions = [ actions[ 0 ] ];\n\t}\n\n\tconst snackbarContentClassnames = clsx( 'components-snackbar__content', {\n\t\t'components-snackbar__content-with-icon': !! icon,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ classes }\n\t\t\tonClick={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\ttabIndex={ 0 }\n\t\t\trole={ ! explicitDismiss ? 'button' : undefined }\n\t\t\tonKeyPress={ ! explicitDismiss ? dismissMe : undefined }\n\t\t\taria-label={\n\t\t\t\t! explicitDismiss ? __( 'Dismiss this notice' ) : undefined\n\t\t\t}\n\t\t\tdata-testid=\"snackbar\"\n\t\t>\n\t\t\t<div className={ snackbarContentClassnames }>\n\t\t\t\t{ icon && (\n\t\t\t\t\t<div className=\"components-snackbar__icon\">{ icon }</div>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t\t{ actions.map( ( { label, onClick, url }, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\thref={ url }\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\tevent: MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t) => onActionClick( event, onClick ) }\n\t\t\t\t\t\t\tclassName=\"components-snackbar__action\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t\t{ explicitDismiss && (\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label={ __( 'Dismiss this notice' ) }\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\tclassName=\"components-snackbar__dismiss-button\"\n\t\t\t\t\t\tonClick={ dismissMe }\n\t\t\t\t\t\tonKeyPress={ dismissMe }\n\t\t\t\t\t>\n\t\t\t\t\t\t&#x2715;\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * A Snackbar displays a succinct message that is cleared out after a small delay.\n *\n * It can also offer the user options, like viewing a published post.\n * But these options should also be available elsewhere in the UI.\n *\n * ```jsx\n * const MySnackbarNotice = () => (\n * <Snackbar>Post published successfully.</Snackbar>\n * );\n * ```\n */\nexport const Snackbar = forwardRef( UnforwardedSnackbar );\n\nexport default Snackbar;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AAKA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA+B,IAAAM,WAAA,GAAAN,OAAA;AAvB/B;AACA;AACA;;AAIA;AACA;AACA;;AAYA;AACA;AACA;;AAMA,MAAMO,cAAc,GAAG,KAAK;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACxBC,OAAyC,EACzCC,UAAwD,EACvD;EACD,MAAMC,aAAa,GAClB,OAAOF,OAAO,KAAK,QAAQ,GAAGA,OAAO,GAAG,IAAAG,uBAAc,EAAEH,OAAQ,CAAC;EAElE,IAAAI,kBAAS,EAAE,MAAM;IAChB,IAAKF,aAAa,EAAG;MACpB,IAAAG,WAAK,EAAEH,aAAa,EAAED,UAAW,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,aAAa,EAAED,UAAU,CAAG,CAAC;AACnC;AAEA,SAASK,mBAAmBA,CAC3B;EACCC,SAAS;EACTC,QAAQ;EACRN,aAAa,GAAGM,QAAQ;EACxBP,UAAU,GAAG,QAAQ;EACrBQ,OAAO,GAAG,EAAE;EACZC,QAAQ;EACRC,IAAI,GAAG,IAAI;EACXC,eAAe,GAAG,KAAK;EACvB;EACA;EACA;EACAC,SAAS;EACT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AC,6BAA6B;UAAAC,QAAA,EAErCqC;QAAK,GARDE,KASC,CAAC;MAEX,CAAE,CAAC,EACDnC,eAAe,iBAChB,IAAAf,WAAA,CAAAwC,GAAA;QACCG,IAAI,EAAC,QAAQ;QACb,cAAa,IAAAE,QAAE,EAAE,qBAAsB,CAAG;QAC1CH,QAAQ,EAAG,CAAG;QACdhC,SAAS,EAAC,qCAAqC;QAC/Ce,OAAO,EAAGN,SAAW;QACrByB,UAAU,EAAGzB,SAAW;QAAAR,QAAA,EACxB;MAED,CAAM,CACN;IAAA,CACG;EAAC,CACF,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM4C,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAG,IAAAE,mBAAU,EAAEhD,mBAAoB,CAAC;AAAC,IAAAiD,QAAA,GAAAF,OAAA,CAAAL,OAAA,GAE3CI,QAAQ","ignoreList":[]}
@@ -56,10 +56,21 @@ function useScrollRectIntoView(parent, rect, {
56
56
  const childRightEdge = childLeft + childWidth;
57
57
  const rightOverflow = childRightEdge + margin - parentRightEdge;
58
58
  const leftOverflow = parentScroll - (childLeft - margin);
59
+ let scrollLeft = null;
59
60
  if (leftOverflow > 0) {
60
- parent.scrollLeft = parentScroll - leftOverflow;
61
+ scrollLeft = parentScroll - leftOverflow;
61
62
  } else if (rightOverflow > 0) {
62
- parent.scrollLeft = parentScroll + rightOverflow;
63
+ scrollLeft = parentScroll + rightOverflow;
64
+ }
65
+ if (scrollLeft !== null) {
66
+ /**
67
+ * The optional chaining is used here to avoid unit test failures.
68
+ * It can be removed when JSDOM supports `Element` scroll methods.
69
+ * See: https://github.com/WordPress/gutenberg/pull/66498#issuecomment-2441146096
70
+ */
71
+ parent.scroll?.({
72
+ left: scrollLeft
73
+ });
63
74
  }
64
75
  }, [margin, parent, rect]);
65
76
  }
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_clsx","_interopRequireDefault","_warning","_element","_compose","_context","_styles","_elementRect","_useTrackOverflow","_useAnimatedOffsetRect","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DEFAULT_SCROLL_MARGIN","useScrollRectIntoView","parent","rect","margin","useLayoutEffect","scrollLeft","parentScroll","parentWidth","getBoundingClientRect","width","left","childLeft","childWidth","parentRightEdge","childRightEdge","rightOverflow","leftOverflow","TabList","exports","forwardRef","children","otherProps","ref","_useTabsContext","store","useTabsContext","selectedId","useStoreState","activeId","selectOnMove","items","setParent","useState","refs","useMergeRefs","selectedItem","item","renderedItems","selectedItemIndex","indexOf","selectedRect","useTrackElementOffsetRect","element","overflow","useTrackOverflow","first","at","last","useAnimatedOffsetRect","prefix","dataAttribute","transitionEndFilter","event","pseudoElement","roundRect","onBlur","setActiveId","globalThis","SCRIPT_DEBUG","warning","jsx","StyledTabList","render","props","_props$tabIndex","tabIndex","className","clsx"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef, useLayoutEffect, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ElementOffsetRect } from '../utils/element-rect';\nimport { useTabsContext } from './context';\nimport { StyledTabList } from './styles';\nimport { useTrackElementOffsetRect } from '../utils/element-rect';\nimport { useTrackOverflow } from './use-track-overflow';\nimport { useAnimatedOffsetRect } from '../utils/hooks/use-animated-offset-rect';\n\nconst DEFAULT_SCROLL_MARGIN = 24;\n\n/**\n * Scrolls a given parent element so that a given rect is visible.\n *\n * The scroll is updated initially and whenever the rect changes.\n */\nfunction useScrollRectIntoView(\n\tparent: HTMLElement | undefined,\n\trect: ElementOffsetRect,\n\t{ margin = DEFAULT_SCROLL_MARGIN } = {}\n) {\n\tuseLayoutEffect( () => {\n\t\tif ( ! parent || ! rect ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scrollLeft: parentScroll } = parent;\n\t\tconst parentWidth = parent.getBoundingClientRect().width;\n\t\tconst { left: childLeft, width: childWidth } = rect;\n\n\t\tconst parentRightEdge = parentScroll + parentWidth;\n\t\tconst childRightEdge = childLeft + childWidth;\n\t\tconst rightOverflow = childRightEdge + margin - parentRightEdge;\n\t\tconst leftOverflow = parentScroll - ( childLeft - margin );\n\t\tif ( leftOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll - leftOverflow;\n\t\t} else if ( rightOverflow > 0 ) {\n\t\t\tparent.scrollLeft = parentScroll + rightOverflow;\n\t\t}\n\t}, [ margin, parent, rect ] );\n}\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst { store } = useTabsContext() ?? {};\n\n\tconst selectedId = Ariakit.useStoreState( store, 'selectedId' );\n\tconst activeId = Ariakit.useStoreState( store, 'activeId' );\n\tconst selectOnMove = Ariakit.useStoreState( store, 'selectOnMove' );\n\tconst items = Ariakit.useStoreState( store, 'items' );\n\tconst [ parent, setParent ] = useState< HTMLElement >();\n\tconst refs = useMergeRefs( [ ref, setParent ] );\n\n\tconst selectedItem = store?.item( selectedId );\n\tconst renderedItems = Ariakit.useStoreState( store, 'renderedItems' );\n\n\tconst selectedItemIndex =\n\t\trenderedItems && selectedItem\n\t\t\t? renderedItems.indexOf( selectedItem )\n\t\t\t: -1;\n\t// Use selectedItemIndex as a dependency to force recalculation when the\n\t// selected item index changes (elements are swapped / added / removed).\n\tconst selectedRect = useTrackElementOffsetRect( selectedItem?.element, [\n\t\tselectedItemIndex,\n\t] );\n\n\t// Track overflow to show scroll hints.\n\tconst overflow = useTrackOverflow( parent, {\n\t\tfirst: items?.at( 0 )?.element,\n\t\tlast: items?.at( -1 )?.element,\n\t} );\n\n\t// Size, position, and animate the indicator.\n\tuseAnimatedOffsetRect( parent, selectedRect, {\n\t\tprefix: 'selected',\n\t\tdataAttribute: 'indicator-animated',\n\t\ttransitionEndFilter: ( event ) => event.pseudoElement === '::before',\n\t\troundRect: true,\n\t} );\n\n\t// Make sure selected tab is scrolled into view.\n\tuseScrollRectIntoView( parent, selectedRect );\n\n\tconst onBlur = () => {\n\t\tif ( ! selectOnMove ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When automatic tab selection is on, make sure that the active tab is up\n\t\t// to date with the selected tab when leaving the tablist. This makes sure\n\t\t// that the selected tab will receive keyboard focus when tabbing back into\n\t\t// the tablist.\n\t\tif ( selectedId !== activeId ) {\n\t\t\tstore?.setActiveId( selectedId );\n\t\t}\n\t};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyledTabList\n\t\t\tref={ refs }\n\t\t\tstore={ store }\n\t\t\trender={ ( props ) => (\n\t\t\t\t<div\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t// Fallback to -1 to prevent browsers from making the tablist\n\t\t\t\t\t// tabbable when it is a scrolling container.\n\t\t\t\t\ttabIndex={ props.tabIndex ?? -1 }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\tonBlur={ onBlur }\n\t\t\tdata-select-on-move={ selectOnMove ? 'true' : 'false' }\n\t\t\t{ ...otherProps }\n\t\t\tclassName={ clsx(\n\t\t\t\toverflow.first && 'is-overflowing-first',\n\t\t\t\toverflow.last && 'is-overflowing-last',\n\t\t\t\totherProps.className\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledTabList>\n\t);\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAA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AACE,KAAK,IAAI,sBAAsB,EACxCF,QAAQ,CAACI,IAAI,IAAI,qBAAqB,EACtC1B,UAAU,CAAC6C,SACZ,CAAG;IAAA9C,QAAA,EAEDA;EAAQ,CACI,CAAC;AAElB,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","_interopRequireWildcard","require","_clsx","_interopRequireDefault","_warning","_element","_compose","_context","_styles","_elementRect","_useTrackOverflow","_useAnimatedOffsetRect","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DEFAULT_SCROLL_MARGIN","useScrollRectIntoView","parent","rect","margin","useLayoutEffect","scrollLeft","parentScroll","parentWidth","getBoundingClientRect","width","left","childLeft","childWidth","parentRightEdge","childRightEdge","rightOverflow","leftOverflow","scroll","TabList","exports","forwardRef","children","otherProps","ref","_useTabsContext","store","useTabsContext","selectedId","useStoreState","activeId","selectOnMove","items","setParent","useState","refs","useMergeRefs","selectedItem","item","renderedItems","selectedItemIndex","indexOf","selectedRect","useTrackElementOffsetRect","element","overflow","useTrackOverflow","first","at","last","useAnimatedOffsetRect","prefix","dataAttribute","transitionEndFilter","event","pseudoElement","roundRect","onBlur","setActiveId","globalThis","SCRIPT_DEBUG","warning","jsx","StyledTabList","render","props","_props$tabIndex","tabIndex","className","clsx"],"sources":["@wordpress/components/src/tabs/tablist.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport warning from '@wordpress/warning';\nimport { forwardRef, useLayoutEffect, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { TabListProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ElementOffsetRect } from '../utils/element-rect';\nimport { useTabsContext } from './context';\nimport { StyledTabList } from './styles';\nimport { useTrackElementOffsetRect } from '../utils/element-rect';\nimport { useTrackOverflow } from './use-track-overflow';\nimport { useAnimatedOffsetRect } from '../utils/hooks/use-animated-offset-rect';\n\nconst DEFAULT_SCROLL_MARGIN = 24;\n\n/**\n * Scrolls a given parent element so that a given rect is visible.\n *\n * The scroll is updated initially and whenever the rect changes.\n */\nfunction useScrollRectIntoView(\n\tparent: HTMLElement | undefined,\n\trect: ElementOffsetRect,\n\t{ margin = DEFAULT_SCROLL_MARGIN } = {}\n) {\n\tuseLayoutEffect( () => {\n\t\tif ( ! parent || ! rect ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scrollLeft: parentScroll } = parent;\n\t\tconst parentWidth = parent.getBoundingClientRect().width;\n\t\tconst { left: childLeft, width: childWidth } = rect;\n\n\t\tconst parentRightEdge = parentScroll + parentWidth;\n\t\tconst childRightEdge = childLeft + childWidth;\n\t\tconst rightOverflow = childRightEdge + margin - parentRightEdge;\n\t\tconst leftOverflow = parentScroll - ( childLeft - margin );\n\n\t\tlet scrollLeft = null;\n\t\tif ( leftOverflow > 0 ) {\n\t\t\tscrollLeft = parentScroll - leftOverflow;\n\t\t} else if ( rightOverflow > 0 ) {\n\t\t\tscrollLeft = parentScroll + rightOverflow;\n\t\t}\n\n\t\tif ( scrollLeft !== null ) {\n\t\t\t/**\n\t\t\t * The optional chaining is used here to avoid unit test failures.\n\t\t\t * It can be removed when JSDOM supports `Element` scroll methods.\n\t\t\t * See: https://github.com/WordPress/gutenberg/pull/66498#issuecomment-2441146096\n\t\t\t */\n\t\t\tparent.scroll?.( { left: scrollLeft } );\n\t\t}\n\t}, [ margin, parent, rect ] );\n}\n\nexport const TabList = forwardRef<\n\tHTMLDivElement,\n\tWordPressComponentProps< TabListProps, 'div', false >\n>( function TabList( { children, ...otherProps }, ref ) {\n\tconst { store } = useTabsContext() ?? {};\n\n\tconst selectedId = Ariakit.useStoreState( store, 'selectedId' );\n\tconst activeId = Ariakit.useStoreState( store, 'activeId' );\n\tconst selectOnMove = Ariakit.useStoreState( store, 'selectOnMove' );\n\tconst items = Ariakit.useStoreState( store, 'items' );\n\tconst [ parent, setParent ] = useState< HTMLElement >();\n\tconst refs = useMergeRefs( [ ref, setParent ] );\n\n\tconst selectedItem = store?.item( selectedId );\n\tconst renderedItems = Ariakit.useStoreState( store, 'renderedItems' );\n\n\tconst selectedItemIndex =\n\t\trenderedItems && selectedItem\n\t\t\t? renderedItems.indexOf( selectedItem )\n\t\t\t: -1;\n\t// Use selectedItemIndex as a dependency to force recalculation when the\n\t// selected item index changes (elements are swapped / added / removed).\n\tconst selectedRect = useTrackElementOffsetRect( selectedItem?.element, [\n\t\tselectedItemIndex,\n\t] );\n\n\t// Track overflow to show scroll hints.\n\tconst overflow = useTrackOverflow( parent, {\n\t\tfirst: items?.at( 0 )?.element,\n\t\tlast: items?.at( -1 )?.element,\n\t} );\n\n\t// Size, position, and animate the indicator.\n\tuseAnimatedOffsetRect( parent, selectedRect, {\n\t\tprefix: 'selected',\n\t\tdataAttribute: 'indicator-animated',\n\t\ttransitionEndFilter: ( event ) => event.pseudoElement === '::before',\n\t\troundRect: true,\n\t} );\n\n\t// Make sure selected tab is scrolled into view.\n\tuseScrollRectIntoView( parent, selectedRect );\n\n\tconst onBlur = () => {\n\t\tif ( ! selectOnMove ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When automatic tab selection is on, make sure that the active tab is up\n\t\t// to date with the selected tab when leaving the tablist. This makes sure\n\t\t// that the selected tab will receive keyboard focus when tabbing back into\n\t\t// the tablist.\n\t\tif ( selectedId !== activeId ) {\n\t\t\tstore?.setActiveId( selectedId );\n\t\t}\n\t};\n\n\tif ( ! store ) {\n\t\twarning( '`Tabs.TabList` must be wrapped in a `Tabs` component.' );\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StyledTabList\n\t\t\tref={ refs }\n\t\t\tstore={ store }\n\t\t\trender={ ( props ) => (\n\t\t\t\t<div\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t// Fallback to -1 to prevent browsers from making the tablist\n\t\t\t\t\t// tabbable when it is a scrolling container.\n\t\t\t\t\ttabIndex={ props.tabIndex ?? -1 }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\tonBlur={ onBlur }\n\t\t\tdata-select-on-move={ selectOnMove ? 'true' : 'false' }\n\t\t\t{ ...otherProps }\n\t\t\tclassName={ clsx(\n\t\t\t\toverflow.first && 'is-overflowing-first',\n\t\t\t\toverflow.last && 'is-overflowing-last',\n\t\t\t\totherProps.className\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledTabList>\n\t);\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAQA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAV,OAAA;AAAgF,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAY,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,SAAAd,wBAAAc,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,CAA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,CAAEF,KAAK,EAAG;IACdiC,UAAA,CAAAC,YAAA,gBAAAC,gBAAO,EAAE,uDAAwD,CAAC;IAClE,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAlF,WAAA,CAAAmF,GAAA,EAACvF,OAAA,CAAAwF,aAAa;IACbvC,GAAG,EAAGW,IAAM;IACZT,KAAK,EAAGA,KAAO;IACfsC,MAAM,EAAKC,KAAK;MAAA,IAAAC,eAAA;MAAA,oBACf,IAAAvF,WAAA,CAAAmF,GAAA;QAAA,GACMG,KAAK;QACV;QACA;QACAE,QAAQ,GAAAD,eAAA,GAAGD,KAAK,CAACE,QAAQ,cAAAD,eAAA,cAAAA,eAAA,GAAI,CAAC;MAAG,CACjC,CAAC;IAAA,CACA;IACHT,MAAM,EAAGA,MAAQ;IACjB,uBAAsB1B,YAAY,GAAG,MAAM,GAAG,OAAS;IAAA,GAClDR,UAAU;IACf6C,SAAS,EAAG,IAAAC,aAAI,EACfxB,QAAQ,CAACE,KAAK,IAAI,sBAAsB,EACxCF,QAAQ,CAACI,IAAI,IAAI,qBAAqB,EACtC1B,UAAU,CAAC6C,SACZ,CAAG;IAAA9C,QAAA,EAEDA;EAAQ,CACI,CAAC;AAElB,CAAE,CAAC","ignoreList":[]}
@@ -9,6 +9,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _compose = require("@wordpress/compose");
10
10
  var _element = require("@wordpress/element");
11
11
  var _baseControl = _interopRequireDefault(require("../base-control"));
12
+ var _deprecated36pxSize = require("../utils/deprecated-36px-size");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  /**
14
15
  * External dependencies
@@ -38,6 +39,11 @@ function UnforwardedTextControl(props, ref) {
38
39
  } = props;
39
40
  const id = (0, _compose.useInstanceId)(TextControl, 'inspector-text-control', idProp);
40
41
  const onChangeValue = event => onChange(event.target.value);
42
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
43
+ componentName: 'TextControl',
44
+ size: undefined,
45
+ __next40pxDefaultSize
46
+ });
41
47
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_baseControl.default, {
42
48
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
43
49
  __associatedWPComponentName: "TextControl",
@@ -74,6 +80,7 @@ function UnforwardedTextControl(props, ref) {
74
80
  * return (
75
81
  * <TextControl
76
82
  * __nextHasNoMarginBottom
83
+ * __next40pxDefaultSize
77
84
  * label="Additional CSS Class"
78
85
  * value={ className }
79
86
  * onChange={ ( value ) => setClassName( value ) }
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_baseControl","_jsxRuntime","UnforwardedTextControl","props","ref","__nextHasNoMarginBottom","__next40pxDefaultSize","label","hideLabelFromVision","value","help","id","idProp","className","onChange","type","additionalProps","useInstanceId","TextControl","onChangeValue","event","target","jsx","default","__associatedWPComponentName","children","clsx","undefined","exports","forwardRef","_default"],"sources":["@wordpress/components/src/text-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context';\nimport type { TextControlProps } from './types';\n\nfunction UnforwardedTextControl(\n\tprops: WordPressComponentProps< TextControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\t__next40pxDefaultSize = false,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tid: idProp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...additionalProps\n\t} = props;\n\tconst id = useInstanceId( TextControl, 'inspector-text-control', idProp );\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"TextControl\"\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName={ clsx( 'components-text-control__input', {\n\t\t\t\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t\t\t} ) }\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextControl components let users enter and edit text.\n *\n * ```jsx\n * import { TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextControl = () => {\n * const [ className, setClassName ] = useState( '' );\n *\n * return (\n * <TextControl\n * __nextHasNoMarginBottom\n * label=\"Additional CSS Class\"\n * value={ className }\n * onChange={ ( value ) => setClassName( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextControl = forwardRef( UnforwardedTextControl );\n\nexport default TextControl;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA0C,IAAAI,WAAA,GAAAJ,OAAA;AAf1C;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASK,sBAAsBA,CAC9BC,KAAkE,EAClEC,GAAqC,EACpC;EACD,MAAM;IACLC,uBAAuB;IACvBC,qBAAqB,GAAG,KAAK;IAC7BC,KAAK;IACLC,mBAAmB;IACnBC,KAAK;I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 {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_baseControl","_deprecated36pxSize","_jsxRuntime","UnforwardedTextControl","props","ref","__nextHasNoMarginBottom","__next40pxDefaultSize","label","hideLabelFromVision","value","help","id","idProp","className","onChange","type","additionalProps","useInstanceId","TextControl","onChangeValue","event","target","maybeWarnDeprecated36pxSize","componentName","size","undefined","jsx","default","__associatedWPComponentName","children","clsx","exports","forwardRef","_default"],"sources":["@wordpress/components/src/text-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ChangeEvent, ForwardedRef } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { WordPressComponentProps } from '../context';\nimport type { TextControlProps } from './types';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nfunction UnforwardedTextControl(\n\tprops: WordPressComponentProps< TextControlProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\t__next40pxDefaultSize = false,\n\t\tlabel,\n\t\thideLabelFromVision,\n\t\tvalue,\n\t\thelp,\n\t\tid: idProp,\n\t\tclassName,\n\t\tonChange,\n\t\ttype = 'text',\n\t\t...additionalProps\n\t} = props;\n\tconst id = useInstanceId( TextControl, 'inspector-text-control', idProp );\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.value );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'TextControl',\n\t\tsize: undefined,\n\t\t__next40pxDefaultSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"TextControl\"\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ className }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName={ clsx( 'components-text-control__input', {\n\t\t\t\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t\t\t} ) }\n\t\t\t\ttype={ type }\n\t\t\t\tid={ id }\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ onChangeValue }\n\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...additionalProps }\n\t\t\t/>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * TextControl components let users enter and edit text.\n *\n * ```jsx\n * import { TextControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTextControl = () => {\n * const [ className, setClassName ] = useState( '' );\n *\n * return (\n * <TextControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * label=\"Additional CSS Class\"\n * value={ className }\n * onChange={ ( value ) => setClassName( value ) }\n * />\n * );\n * };\n * ```\n */\nexport const TextControl = forwardRef( UnforwardedTextControl );\n\nexport default TextControl;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAGA,IAAAI,mBAAA,GAAAJ,OAAA;AAA4E,IAAAK,WAAA,GAAAL,OAAA;AAlB5E;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,SAASM,sBAAsBA,CAC9BC,KAAkE,EAClEC,GAAqC,EACpC;EACD,MAAM;IACLC,uBAAuB;IACvBC,qBAAqB,GAAG,KAAK;IAC7BC,KAAK;IACLC,mBAAmB;IACnBC,KAAK;IACLC,IAAI;IACJC,EAAE,EAAEC,MAAM;IACVC,SAAS;IACTC,QAAQ;IACRC,IAAI,GAAG,MAAM;IACb,GAAGC;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ignoreList":[]}
@@ -16,6 +16,7 @@ var _asButtonGroup = require("./as-button-group");
16
16
  var _elementRect = require("../../utils/element-rect");
17
17
  var _compose = require("@wordpress/compose");
18
18
  var _useAnimatedOffsetRect = require("../../utils/hooks/use-animated-offset-rect");
19
+ var _deprecated36pxSize = require("../../utils/deprecated-36px-size");
19
20
  var _jsxRuntime = require("react/jsx-runtime");
20
21
  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); }
21
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -35,6 +36,7 @@ function UnconnectedToggleGroupControl(props, forwardedRef) {
35
36
  const {
36
37
  __nextHasNoMarginBottom = false,
37
38
  __next40pxDefaultSize = false,
39
+ __shouldNotWarnDeprecated36pxSize,
38
40
  className,
39
41
  isAdaptiveWidth = false,
40
42
  isBlock = false,
@@ -52,7 +54,7 @@ function UnconnectedToggleGroupControl(props, forwardedRef) {
52
54
  const [selectedElement, setSelectedElement] = (0, _element.useState)();
53
55
  const [controlElement, setControlElement] = (0, _element.useState)();
54
56
  const refs = (0, _compose.useMergeRefs)([setControlElement, forwardedRef]);
55
- const selectedRect = (0, _elementRect.useTrackElementOffsetRect)(value ? selectedElement : undefined);
57
+ const selectedRect = (0, _elementRect.useTrackElementOffsetRect)(value || value === 0 ? selectedElement : undefined);
56
58
  (0, _useAnimatedOffsetRect.useAnimatedOffsetRect)(controlElement, selectedRect, {
57
59
  prefix: 'selected',
58
60
  dataAttribute: 'indicator-animated',
@@ -66,6 +68,12 @@ function UnconnectedToggleGroupControl(props, forwardedRef) {
66
68
  size: normalizedSize
67
69
  }), isBlock && styles.block, className), [className, cx, isBlock, isDeselectable, normalizedSize]);
68
70
  const MainControl = isDeselectable ? _asButtonGroup.ToggleGroupControlAsButtonGroup : _asRadioGroup.ToggleGroupControlAsRadioGroup;
71
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
72
+ componentName: 'ToggleGroupControl',
73
+ size,
74
+ __next40pxDefaultSize,
75
+ __shouldNotWarnDeprecated36pxSize
76
+ });
69
77
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_baseControl.default, {
70
78
  help: help,
71
79
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
@@ -115,6 +123,7 @@ function UnconnectedToggleGroupControl(props, forwardedRef) {
115
123
  * value="vertical"
116
124
  * isBlock
117
125
  * __nextHasNoMarginBottom
126
+ * __next40pxDefaultSize
118
127
  * >
119
128
  * <ToggleGroupControlOption value="horizontal" label="Horizontal" />
120
129
  * <ToggleGroupControlOption value="vertical" label="Vertical" />
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_context","_hooks","_baseControl","_interopRequireDefault","_styles","_interopRequireWildcard","styles","_asRadioGroup","_asButtonGroup","_elementRect","_compose","_useAnimatedOffsetRect","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedToggleGroupControl","props","forwardedRef","__nextHasNoMarginBottom","__next40pxDefaultSize","className","isAdaptiveWidth","isBlock","isDeselectable","label","hideLabelFromVision","help","onChange","size","value","children","otherProps","useContextSystem","normalizedSize","selectedElement","setSelectedElement","useState","controlElement","setControlElement","refs","useMergeRefs","selectedRect","useTrackElementOffsetRect","undefined","useAnimatedOffsetRect","prefix","dataAttribute","transitionEndFilter","event","pseudoElement","roundRect","cx","useCx","classes","useMemo","toggleGroupControl","block","MainControl","ToggleGroupControlAsButtonGroup","ToggleGroupControlAsRadioGroup","jsxs","__associatedWPComponentName","jsx","VisualLabelWrapper","VisualLabel","ref","ToggleGroupControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks';\nimport BaseControl from '../../base-control';\nimport type { ToggleGroupControlProps } from '../types';\nimport { VisualLabelWrapper } from './styles';\nimport * as styles from './styles';\nimport { ToggleGroupControlAsRadioGroup } from './as-radio-group';\nimport { ToggleGroupControlAsButtonGroup } from './as-button-group';\nimport { useTrackElementOffsetRect } from '../../utils/element-rect';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { useAnimatedOffsetRect } from '../../utils/hooks/use-animated-offset-rect';\n\nfunction UnconnectedToggleGroupControl(\n\tprops: WordPressComponentProps< ToggleGroupControlProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__next40pxDefaultSize = false,\n\t\tclassName,\n\t\tisAdaptiveWidth = false,\n\t\tisBlock = false,\n\t\tisDeselectable = false,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\tchildren,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ToggleGroupControl' );\n\n\tconst normalizedSize =\n\t\t__next40pxDefaultSize && size === 'default' ? '__unstable-large' : size;\n\n\tconst [ selectedElement, setSelectedElement ] = useState< HTMLElement >();\n\tconst [ controlElement, setControlElement ] = useState< HTMLElement >();\n\tconst refs = useMergeRefs( [ setControlElement, forwardedRef ] );\n\tconst selectedRect = useTrackElementOffsetRect(\n\t\tvalue ? selectedElement : undefined\n\t);\n\tuseAnimatedOffsetRect( controlElement, selectedRect, {\n\t\tprefix: 'selected',\n\t\tdataAttribute: 'indicator-animated',\n\t\ttransitionEndFilter: ( event ) => event.pseudoElement === '::before',\n\t\troundRect: true,\n\t} );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tstyles.toggleGroupControl( {\n\t\t\t\t\tisBlock,\n\t\t\t\t\tisDeselectable,\n\t\t\t\t\tsize: normalizedSize,\n\t\t\t\t} ),\n\t\t\t\tisBlock && styles.block,\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx, isBlock, isDeselectable, normalizedSize ]\n\t);\n\n\tconst MainControl = isDeselectable\n\t\t? ToggleGroupControlAsButtonGroup\n\t\t: ToggleGroupControlAsRadioGroup;\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"ToggleGroupControl\"\n\t\t>\n\t\t\t{ ! hideLabelFromVision && (\n\t\t\t\t<VisualLabelWrapper>\n\t\t\t\t\t<BaseControl.VisualLabel>{ label }</BaseControl.VisualLabel>\n\t\t\t\t</VisualLabelWrapper>\n\t\t\t) }\n\t\t\t<MainControl\n\t\t\t\t{ ...otherProps }\n\t\t\t\tsetSelectedElement={ setSelectedElement }\n\t\t\t\tclassName={ classes }\n\t\t\t\tisAdaptiveWidth={ isAdaptiveWidth }\n\t\t\t\tlabel={ label }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tref={ refs }\n\t\t\t\tsize={ normalizedSize }\n\t\t\t\tvalue={ value }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</MainControl>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `ToggleGroupControl` is a form component that lets users choose options\n * represented in horizontal segments. To render options for this control use\n * `ToggleGroupControlOption` component.\n *\n * This component is intended for selecting a single persistent value from a set of options,\n * similar to a how a radio button group would work. If you simply want a toggle to switch between views,\n * use a `TabPanel` instead.\n *\n * Only use this control when you know for sure the labels of items inside won't\n * wrap. For items with longer labels, you can consider a `SelectControl` or a\n * `CustomSelectControl` component instead.\n *\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl\n * label=\"my label\"\n * value=\"vertical\"\n * isBlock\n * __nextHasNoMarginBottom\n * >\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControl = contextConnect(\n\tUnconnectedToggleGroupControl,\n\t'ToggleGroupControl'\n);\n\nexport default ToggleGroupControl;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAC,uBAAA,CAAAN,OAAA;AAA8C,IAAAO,MAAA,GAAAF,OAAA;AAE9C,IAAAG,aAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA;AAAmF,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,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,SAAAT,wBA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AW;IACXyB,IAAI,EAAGA,IAAM;IACbR,uBAAuB,EAAGA,uBAAyB;IACnD2C,2BAA2B,EAAC,oBAAoB;IAAA/B,QAAA,GAE9C,CAAEL,mBAAmB,iBACtB,IAAA/B,WAAA,CAAAoE,GAAA,EAAC5E,OAAA,CAAA6E,kBAAkB;MAAAjC,QAAA,eAClB,IAAApC,WAAA,CAAAoE,GAAA,EAAC9E,YAAA,CAAAiB,OAAW,CAAC+D,WAAW;QAAAlC,QAAA,EAAGN;MAAK,CAA2B;IAAC,CACzC,CACpB,eACD,IAAA9B,WAAA,CAAAoE,GAAA,EAACL,WAAW;MAAA,GACN1B,UAAU;MACfI,kBAAkB,EAAGA,kBAAoB;MACzCf,SAAS,EAAGiC,OAAS;MACrBhC,eAAe,EAAGA,eAAiB;MACnCG,KAAK,EAAGA,KAAO;MACfG,QAAQ,EAAGA,QAAU;MACrBsC,GAAG,EAAG1B,IAAM;MACZX,IAAI,EAAGK,cAAgB;MACvBJ,KAAK,EAAGA,KAAO;MAAAC,QAAA,EAEbA;IAAQ,CACE,CAAC;EAAA,CACF,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMoC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,uBAAc,EAC/CrD,6BAA6B,EAC7B,oBACD,CAAC;AAAC,IAAAsD,QAAA,GAAAF,OAAA,CAAAlE,OAAA,GAEaiE,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_context","_hooks","_baseControl","_interopRequireDefault","_styles","_interopRequireWildcard","styles","_asRadioGroup","_asButtonGroup","_elementRect","_compose","_useAnimatedOffsetRect","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedToggleGroupControl","props","forwardedRef","__nextHasNoMarginBottom","__next40pxDefaultSize","__shouldNotWarnDeprecated36pxSize","className","isAdaptiveWidth","isBlock","isDeselectable","label","hideLabelFromVision","help","onChange","size","value","children","otherProps","useContextSystem","normalizedSize","selectedElement","setSelectedElement","useState","controlElement","setControlElement","refs","useMergeRefs","selectedRect","useTrackElementOffsetRect","undefined","useAnimatedOffsetRect","prefix","dataAttribute","transitionEndFilter","event","pseudoElement","roundRect","cx","useCx","classes","useMemo","toggleGroupControl","block","MainControl","ToggleGroupControlAsButtonGroup","ToggleGroupControlAsRadioGroup","maybeWarnDeprecated36pxSize","componentName","jsxs","__associatedWPComponentName","jsx","VisualLabelWrapper","VisualLabel","ref","ToggleGroupControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks';\nimport BaseControl from '../../base-control';\nimport type { ToggleGroupControlProps } from '../types';\nimport { VisualLabelWrapper } from './styles';\nimport * as styles from './styles';\nimport { ToggleGroupControlAsRadioGroup } from './as-radio-group';\nimport { ToggleGroupControlAsButtonGroup } from './as-button-group';\nimport { useTrackElementOffsetRect } from '../../utils/element-rect';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { useAnimatedOffsetRect } from '../../utils/hooks/use-animated-offset-rect';\nimport { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';\n\nfunction UnconnectedToggleGroupControl(\n\tprops: WordPressComponentProps< ToggleGroupControlProps, 'div', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\t__next40pxDefaultSize = false,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\tclassName,\n\t\tisAdaptiveWidth = false,\n\t\tisBlock = false,\n\t\tisDeselectable = false,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tvalue,\n\t\tchildren,\n\t\t...otherProps\n\t} = useContextSystem( props, 'ToggleGroupControl' );\n\n\tconst normalizedSize =\n\t\t__next40pxDefaultSize && size === 'default' ? '__unstable-large' : size;\n\n\tconst [ selectedElement, setSelectedElement ] = useState< HTMLElement >();\n\tconst [ controlElement, setControlElement ] = useState< HTMLElement >();\n\tconst refs = useMergeRefs( [ setControlElement, forwardedRef ] );\n\tconst selectedRect = useTrackElementOffsetRect(\n\t\tvalue || value === 0 ? selectedElement : undefined\n\t);\n\tuseAnimatedOffsetRect( controlElement, selectedRect, {\n\t\tprefix: 'selected',\n\t\tdataAttribute: 'indicator-animated',\n\t\ttransitionEndFilter: ( event ) => event.pseudoElement === '::before',\n\t\troundRect: true,\n\t} );\n\n\tconst cx = useCx();\n\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tstyles.toggleGroupControl( {\n\t\t\t\t\tisBlock,\n\t\t\t\t\tisDeselectable,\n\t\t\t\t\tsize: normalizedSize,\n\t\t\t\t} ),\n\t\t\t\tisBlock && styles.block,\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx, isBlock, isDeselectable, normalizedSize ]\n\t);\n\n\tconst MainControl = isDeselectable\n\t\t? ToggleGroupControlAsButtonGroup\n\t\t: ToggleGroupControlAsRadioGroup;\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'ToggleGroupControl',\n\t\tsize,\n\t\t__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\thelp={ help }\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"ToggleGroupControl\"\n\t\t>\n\t\t\t{ ! hideLabelFromVision && (\n\t\t\t\t<VisualLabelWrapper>\n\t\t\t\t\t<BaseControl.VisualLabel>{ label }</BaseControl.VisualLabel>\n\t\t\t\t</VisualLabelWrapper>\n\t\t\t) }\n\t\t\t<MainControl\n\t\t\t\t{ ...otherProps }\n\t\t\t\tsetSelectedElement={ setSelectedElement }\n\t\t\t\tclassName={ classes }\n\t\t\t\tisAdaptiveWidth={ isAdaptiveWidth }\n\t\t\t\tlabel={ label }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tref={ refs }\n\t\t\t\tsize={ normalizedSize }\n\t\t\t\tvalue={ value }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</MainControl>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * `ToggleGroupControl` is a form component that lets users choose options\n * represented in horizontal segments. To render options for this control use\n * `ToggleGroupControlOption` component.\n *\n * This component is intended for selecting a single persistent value from a set of options,\n * similar to a how a radio button group would work. If you simply want a toggle to switch between views,\n * use a `TabPanel` instead.\n *\n * Only use this control when you know for sure the labels of items inside won't\n * wrap. For items with longer labels, you can consider a `SelectControl` or a\n * `CustomSelectControl` component instead.\n *\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl\n * label=\"my label\"\n * value=\"vertical\"\n * isBlock\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * >\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControl = contextConnect(\n\tUnconnectedToggleGroupControl,\n\t'ToggleGroupControl'\n);\n\nexport default ToggleGroupControl;\n"],"mappings":";;;;;;;AAQ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zCf,SAAS,EAAGiC,OAAS;MACrBhC,eAAe,EAAGA,eAAiB;MACnCG,KAAK,EAAGA,KAAO;MACfG,QAAQ,EAAGA,QAAU;MACrBwC,GAAG,EAAG5B,IAAM;MACZX,IAAI,EAAGK,cAAgB;MACvBJ,KAAK,EAAGA,KAAO;MAAAC,QAAA,EAEbA;IAAQ,CACE,CAAC;EAAA,CACF,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMsC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,uBAAc,EAC/CxD,6BAA6B,EAC7B,oBACD,CAAC;AAAC,IAAAyD,QAAA,GAAAF,OAAA,CAAArE,OAAA,GAEaoE,kBAAkB","ignoreList":[]}
@@ -50,6 +50,7 @@ function UnforwardedToggleGroupControlOption(props, ref) {
50
50
  * value="vertical"
51
51
  * isBlock
52
52
  * __nextHasNoMarginBottom
53
+ * __next40pxDefaultSize
53
54
  * >
54
55
  * <ToggleGroupControlOption value="horizontal" label="Horizontal" />
55
56
  * <ToggleGroupControlOption value="vertical" label="Vertical" />
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_toggleGroupControlOptionBase","_jsxRuntime","UnforwardedToggleGroupControlOption","props","ref","label","restProps","optionLabel","jsx","ToggleGroupControlOptionBase","children","ToggleGroupControlOption","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport type { ToggleGroupControlOptionProps } from '../types';\nimport { ToggleGroupControlOptionBase } from '../toggle-group-control-option-base';\n\nfunction UnforwardedToggleGroupControlOption(\n\tprops: WordPressComponentProps<\n\t\tToggleGroupControlOptionProps,\n\t\t'button',\n\t\tfalse\n\t>,\n\tref: ForwardedRef< any >\n) {\n\tconst { label, ...restProps } = props;\n\tconst optionLabel = restProps[ 'aria-label' ] || label;\n\treturn (\n\t\t<ToggleGroupControlOptionBase\n\t\t\t{ ...restProps }\n\t\t\taria-label={ optionLabel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ label }\n\t\t</ToggleGroupControlOptionBase>\n\t);\n}\n\n/**\n * `ToggleGroupControlOption` is a form component and is meant to be used as a\n * child of `ToggleGroupControl`.\n *\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl\n * label=\"my label\"\n * value=\"vertical\"\n * isBlock\n * __nextHasNoMarginBottom\n * >\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControlOption = forwardRef(\n\tUnforwardedToggleGroupControlOption\n);\n\nexport default ToggleGroupControlOption;\n"],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,6BAAA,GAAAD,OAAA;AAAmF,IAAAE,WAAA,GAAAF,OAAA;AAfnF;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASG,mCAAmCA,CAC3CC,KAIC,EACDC,GAAwB,EACvB;EACD,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACrC,MAAMI,WAAW,GAAGD,SAAS,CAAE,YAAY,CAAE,IAAID,KAAK;EACtD,oBACC,IAAAJ,WAAA,CAAAO,GAAA,EAACR,6BAAA,CAAAS,4BAA4B;IAAA,GACvBH,SAAS;IACd,cAAaC,WAAa;IAC1BH,GAAG,EAAGA,GAAK;IAAAM,QAAA,EAETL;EAAK,CACsB,CAAC;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,mBAAU,EACjDX,mCACD,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEaJ,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_toggleGroupControlOptionBase","_jsxRuntime","UnforwardedToggleGroupControlOption","props","ref","label","restProps","optionLabel","jsx","ToggleGroupControlOptionBase","children","ToggleGroupControlOption","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport type { ToggleGroupControlOptionProps } from '../types';\nimport { ToggleGroupControlOptionBase } from '../toggle-group-control-option-base';\n\nfunction UnforwardedToggleGroupControlOption(\n\tprops: WordPressComponentProps<\n\t\tToggleGroupControlOptionProps,\n\t\t'button',\n\t\tfalse\n\t>,\n\tref: ForwardedRef< any >\n) {\n\tconst { label, ...restProps } = props;\n\tconst optionLabel = restProps[ 'aria-label' ] || label;\n\treturn (\n\t\t<ToggleGroupControlOptionBase\n\t\t\t{ ...restProps }\n\t\t\taria-label={ optionLabel }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ label }\n\t\t</ToggleGroupControlOptionBase>\n\t);\n}\n\n/**\n * `ToggleGroupControlOption` is a form component and is meant to be used as a\n * child of `ToggleGroupControl`.\n *\n * ```jsx\n * import {\n * __experimentalToggleGroupControl as ToggleGroupControl,\n * __experimentalToggleGroupControlOption as ToggleGroupControlOption,\n * } from '@wordpress/components';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl\n * label=\"my label\"\n * value=\"vertical\"\n * isBlock\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * >\n * <ToggleGroupControlOption value=\"horizontal\" label=\"Horizontal\" />\n * <ToggleGroupControlOption value=\"vertical\" label=\"Vertical\" />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControlOption = forwardRef(\n\tUnforwardedToggleGroupControlOption\n);\n\nexport default ToggleGroupControlOption;\n"],"mappings":";;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,6BAAA,GAAAD,OAAA;AAAmF,IAAAE,WAAA,GAAAF,OAAA;AAfnF;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASG,mCAAmCA,CAC3CC,KAIC,EACDC,GAAwB,EACvB;EACD,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACrC,MAAMI,WAAW,GAAGD,SAAS,CAAE,YAAY,CAAE,IAAID,KAAK;EACtD,oBACC,IAAAJ,WAAA,CAAAO,GAAA,EAACR,6BAAA,CAAAS,4BAA4B;IAAA,GACvBH,SAAS;IACd,cAAaC,WAAa;IAC1BH,GAAG,EAAGA,GAAK;IAAAM,QAAA,EAETL;EAAK,CACsB,CAAC;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,IAAAE,mBAAU,EACjDX,mCACD,CAAC;AAAC,IAAAY,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEaJ,wBAAwB","ignoreList":[]}
@@ -53,7 +53,7 @@ function UnforwardedToggleGroupControlOptionIcon(props, ref) {
53
53
  *
54
54
  * function Example() {
55
55
  * return (
56
- * <ToggleGroupControl __nextHasNoMarginBottom>
56
+ * <ToggleGroupControl __nextHasNoMarginBottom __next40pxDefaultSize>
57
57
  * <ToggleGroupControlOptionIcon
58
58
  * value="uppercase"
59
59
  * label="Uppercase"
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_toggleGroupControlOptionBase","_icon","_interopRequireDefault","_jsxRuntime","UnforwardedToggleGroupControlOptionIcon","props","ref","icon","label","restProps","jsx","ToggleGroupControlOptionBase","isIcon","showTooltip","children","default","ToggleGroupControlOptionIcon","exports","forwardRef","_default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option-icon/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport type { ToggleGroupControlOptionIconProps } from '../types';\nimport { ToggleGroupControlOptionBase } from '../toggle-group-control-option-base';\nimport Icon from '../../icon';\n\nfunction UnforwardedToggleGroupControlOptionIcon(\n\tprops: WordPressComponentProps<\n\t\tToggleGroupControlOptionIconProps,\n\t\t'button',\n\t\tfalse\n\t>,\n\tref: ForwardedRef< any >\n) {\n\tconst { icon, label, ...restProps } = props;\n\treturn (\n\t\t<ToggleGroupControlOptionBase\n\t\t\t{ ...restProps }\n\t\t\tisIcon\n\t\t\taria-label={ label }\n\t\t\tshowTooltip\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<Icon icon={ icon } />\n\t\t</ToggleGroupControlOptionBase>\n\t);\n}\n\n/**\n * `ToggleGroupControlOptionIcon` is a form component which is meant to be used as a\n * child of `ToggleGroupControl` and displays an icon.\n *\n * ```jsx\n *\n * import {\n *\t__experimentalToggleGroupControl as ToggleGroupControl,\n *\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n * from '@wordpress/components';\n * import { formatLowercase, formatUppercase } from '@wordpress/icons';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl __nextHasNoMarginBottom>\n * <ToggleGroupControlOptionIcon\n * value=\"uppercase\"\n * label=\"Uppercase\"\n * icon={ formatUppercase }\n * />\n * <ToggleGroupControlOptionIcon\n * value=\"lowercase\"\n * label=\"Lowercase\"\n * icon={ formatLowercase }\n * />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControlOptionIcon = forwardRef(\n\tUnforwardedToggleGroupControlOptionIcon\n);\n\nexport default ToggleGroupControlOptionIcon;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8B,IAAAI,WAAA,GAAAJ,OAAA;AAhB9B;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASK,uCAAuCA,CAC/CC,KAIC,EACDC,GAAwB,EACvB;EACD,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAC3C,oBACC,IAAAF,WAAA,CAAAO,GAAA,EAACV,6BAAA,CAAAW,4BAA4B;IAAA,GACvBF,SAAS;IACdG,MAAM;IACN,cAAaJ,KAAO;IACpBK,WAAW;IACXP,GAAG,EAAGA,GAAK;IAAAQ,QAAA,eAEX,IAAAX,WAAA,CAAAO,GAAA,EAACT,KAAA,CAAAc,OAAI;MAACR,IAAI,EAAGA;IAAM,CAAE;EAAC,CACO,CAAC;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,IAAAE,mBAAU,EACrDd,uCACD,CAAC;AAAC,IAAAe,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEaC,4BAA4B","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_toggleGroupControlOptionBase","_icon","_interopRequireDefault","_jsxRuntime","UnforwardedToggleGroupControlOptionIcon","props","ref","icon","label","restProps","jsx","ToggleGroupControlOptionBase","isIcon","showTooltip","children","default","ToggleGroupControlOptionIcon","exports","forwardRef","_default"],"sources":["@wordpress/components/src/toggle-group-control/toggle-group-control-option-icon/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport type { ToggleGroupControlOptionIconProps } from '../types';\nimport { ToggleGroupControlOptionBase } from '../toggle-group-control-option-base';\nimport Icon from '../../icon';\n\nfunction UnforwardedToggleGroupControlOptionIcon(\n\tprops: WordPressComponentProps<\n\t\tToggleGroupControlOptionIconProps,\n\t\t'button',\n\t\tfalse\n\t>,\n\tref: ForwardedRef< any >\n) {\n\tconst { icon, label, ...restProps } = props;\n\treturn (\n\t\t<ToggleGroupControlOptionBase\n\t\t\t{ ...restProps }\n\t\t\tisIcon\n\t\t\taria-label={ label }\n\t\t\tshowTooltip\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<Icon icon={ icon } />\n\t\t</ToggleGroupControlOptionBase>\n\t);\n}\n\n/**\n * `ToggleGroupControlOptionIcon` is a form component which is meant to be used as a\n * child of `ToggleGroupControl` and displays an icon.\n *\n * ```jsx\n *\n * import {\n *\t__experimentalToggleGroupControl as ToggleGroupControl,\n *\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n * from '@wordpress/components';\n * import { formatLowercase, formatUppercase } from '@wordpress/icons';\n *\n * function Example() {\n * return (\n * <ToggleGroupControl __nextHasNoMarginBottom __next40pxDefaultSize>\n * <ToggleGroupControlOptionIcon\n * value=\"uppercase\"\n * label=\"Uppercase\"\n * icon={ formatUppercase }\n * />\n * <ToggleGroupControlOptionIcon\n * value=\"lowercase\"\n * label=\"Lowercase\"\n * icon={ formatLowercase }\n * />\n * </ToggleGroupControl>\n * );\n * }\n * ```\n */\nexport const ToggleGroupControlOptionIcon = forwardRef(\n\tUnforwardedToggleGroupControlOptionIcon\n);\n\nexport default ToggleGroupControlOptionIcon;\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAOA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA8B,IAAAI,WAAA,GAAAJ,OAAA;AAhB9B;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAMA,SAASK,uCAAuCA,CAC/CC,KAIC,EACDC,GAAwB,EACvB;EACD,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAC3C,oBACC,IAAAF,WAAA,CAAAO,GAAA,EAACV,6BAAA,CAAAW,4BAA4B;IAAA,GACvBF,SAAS;IACdG,MAAM;IACN,cAAaJ,KAAO;IACpBK,WAAW;IACXP,GAAG,EAAGA,GAAK;IAAAQ,QAAA,eAEX,IAAAX,WAAA,CAAAO,GAAA,EAACT,KAAA,CAAAc,OAAI;MAACR,IAAI,EAAGA;IAAM,CAAE;EAAC,CACO,CAAC;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,IAAAE,mBAAU,EACrDd,uCACD,CAAC;AAAC,IAAAe,QAAA,GAAAF,OAAA,CAAAF,OAAA,GAEaC,4BAA4B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/toggle-group-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\nimport type { TooltipProps } from '../tooltip/types';\n\nexport type ToggleGroupControlOptionBaseProps = {\n\tchildren: ReactNode;\n\t/**\n\t * Style the option as an icon option.\n\t *\n\t * @default false\n\t */\n\tisIcon?: boolean;\n\tvalue: string | number;\n\t/**\n\t * Whether to display a Tooltip for the control option. If set to `true`, the tooltip will\n\t * show the aria-label or the label prop text.\n\t *\n\t * @default false\n\t */\n\tshowTooltip?: boolean;\n};\n\nexport type ToggleGroupControlOptionIconProps = Pick<\n\tToggleGroupControlOptionBaseProps,\n\t'value'\n> & {\n\t/**\n\t * Icon displayed as the content of the option. Usually one of the icons from\n\t * the `@wordpress/icons` package, or a custom React `<svg>` icon.\n\t */\n\ticon: JSX.Element;\n\t/**\n\t * The text to accessibly label the icon option. Will also be shown in a tooltip.\n\t */\n\tlabel: string;\n};\n\nexport type ToggleGroupControlOptionProps = Pick<\n\tToggleGroupControlOptionBaseProps,\n\t'value' | 'showTooltip'\n> & {\n\t/**\n\t * Label for the option. If needed, the `aria-label` prop can be used in addition\n\t * to specify a different label for assistive technologies.\n\t */\n\tlabel: string;\n};\n\nexport type WithToolTipProps = {\n\t/**\n\t * React children\n\t */\n\tchildren: TooltipProps[ 'children' ];\n\t/**\n\t * Label for the Tooltip component.\n\t */\n\ttext?: string;\n\t/**\n\t * Whether to wrap the control option in a Tooltip component.\n\t *\n\t * @default false\n\t */\n\tshowTooltip?: boolean;\n};\n\nexport type ToggleGroupControlProps = Pick<\n\tBaseControlProps,\n\t'help' | '__nextHasNoMarginBottom'\n> & {\n\t/**\n\t * Label for the control.\n\t */\n\tlabel: string;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * Determines if segments should be rendered with equal widths.\n\t *\n\t * @default false\n\t */\n\tisAdaptiveWidth?: boolean;\n\t/**\n\t * Renders `ToggleGroupControl` as a (CSS) block element, spanning the entire width of\n\t * the available space. This is the recommended style when the options are text-based and not icons.\n\t *\n\t * @default false\n\t */\n\tisBlock?: boolean;\n\t/**\n\t * Whether an option can be deselected by clicking it again.\n\t *\n\t * @default false\n\t */\n\tisDeselectable?: boolean;\n\t/**\n\t * Callback when a segment is selected.\n\t */\n\tonChange?: ( value: string | number | undefined ) => void;\n\t/**\n\t * The selected value.\n\t */\n\tvalue?: string | number;\n\t/**\n\t * The options to render in the `ToggleGroupControl`, using either the `ToggleGroupControlOption` or\n\t * `ToggleGroupControlOptionIcon` components.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The size variant of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type ToggleGroupControlContextProps = {\n\tactiveItemIsNotFirstItem?: () => boolean;\n\tisDeselectable?: boolean;\n\tbaseId: string;\n\tisBlock: ToggleGroupControlProps[ 'isBlock' ];\n\tsize: ToggleGroupControlProps[ 'size' ];\n\tvalue: ToggleGroupControlProps[ 'value' ];\n\tsetValue: ( newValue: string | number | undefined ) => void;\n\tsetSelectedElement: ( element: HTMLElement | undefined ) => void;\n};\n\nexport type ToggleGroupControlMainControlProps = Pick<\n\tToggleGroupControlProps,\n\t'children' | 'isAdaptiveWidth' | 'label' | 'size' | 'onChange' | 'value'\n> &\n\tPick< ToggleGroupControlContextProps, 'setSelectedElement' >;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/toggle-group-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\nimport type { TooltipProps } from '../tooltip/types';\n\nexport type ToggleGroupControlOptionBaseProps = {\n\tchildren: ReactNode;\n\t/**\n\t * Style the option as an icon option.\n\t *\n\t * @default false\n\t */\n\tisIcon?: boolean;\n\tvalue: string | number;\n\t/**\n\t * Whether to display a Tooltip for the control option. If set to `true`, the tooltip will\n\t * show the aria-label or the label prop text.\n\t *\n\t * @default false\n\t */\n\tshowTooltip?: boolean;\n};\n\nexport type ToggleGroupControlOptionIconProps = Pick<\n\tToggleGroupControlOptionBaseProps,\n\t'value'\n> & {\n\t/**\n\t * Icon displayed as the content of the option. Usually one of the icons from\n\t * the `@wordpress/icons` package, or a custom React `<svg>` icon.\n\t */\n\ticon: JSX.Element;\n\t/**\n\t * The text to accessibly label the icon option. Will also be shown in a tooltip.\n\t */\n\tlabel: string;\n};\n\nexport type ToggleGroupControlOptionProps = Pick<\n\tToggleGroupControlOptionBaseProps,\n\t'value' | 'showTooltip'\n> & {\n\t/**\n\t * Label for the option. If needed, the `aria-label` prop can be used in addition\n\t * to specify a different label for assistive technologies.\n\t */\n\tlabel: string;\n};\n\nexport type WithToolTipProps = {\n\t/**\n\t * React children\n\t */\n\tchildren: TooltipProps[ 'children' ];\n\t/**\n\t * Label for the Tooltip component.\n\t */\n\ttext?: string;\n\t/**\n\t * Whether to wrap the control option in a Tooltip component.\n\t *\n\t * @default false\n\t */\n\tshowTooltip?: boolean;\n};\n\nexport type ToggleGroupControlProps = Pick<\n\tBaseControlProps,\n\t'help' | '__nextHasNoMarginBottom'\n> & {\n\t/**\n\t * Label for the control.\n\t */\n\tlabel: string;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * Determines if segments should be rendered with equal widths.\n\t *\n\t * @default false\n\t */\n\tisAdaptiveWidth?: boolean;\n\t/**\n\t * Renders `ToggleGroupControl` as a (CSS) block element, spanning the entire width of\n\t * the available space. This is the recommended style when the options are text-based and not icons.\n\t *\n\t * @default false\n\t */\n\tisBlock?: boolean;\n\t/**\n\t * Whether an option can be deselected by clicking it again.\n\t *\n\t * @default false\n\t */\n\tisDeselectable?: boolean;\n\t/**\n\t * Callback when a segment is selected.\n\t */\n\tonChange?: ( value: string | number | undefined ) => void;\n\t/**\n\t * The selected value.\n\t */\n\tvalue?: string | number;\n\t/**\n\t * The options to render in the `ToggleGroupControl`, using either the `ToggleGroupControlOption` or\n\t * `ToggleGroupControlOptionIcon` components.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The size variant of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Do not throw a warning for the deprecated 36px default size.\n\t * For internal components of other components that already throw the warning.\n\t *\n\t * @ignore\n\t */\n\t__shouldNotWarnDeprecated36pxSize?: boolean;\n};\n\nexport type ToggleGroupControlContextProps = {\n\tactiveItemIsNotFirstItem?: () => boolean;\n\tisDeselectable?: boolean;\n\tbaseId: string;\n\tisBlock: ToggleGroupControlProps[ 'isBlock' ];\n\tsize: ToggleGroupControlProps[ 'size' ];\n\tvalue: ToggleGroupControlProps[ 'value' ];\n\tsetValue: ( newValue: string | number | undefined ) => void;\n\tsetSelectedElement: ( element: HTMLElement | undefined ) => void;\n};\n\nexport type ToggleGroupControlMainControlProps = Pick<\n\tToggleGroupControlProps,\n\t'children' | 'isAdaptiveWidth' | 'label' | 'size' | 'onChange' | 'value'\n> &\n\tPick< ToggleGroupControlContextProps, 'setSelectedElement' >;\n"],"mappings":"","ignoreList":[]}
@@ -13,9 +13,10 @@ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
13
13
  function maybeWarnDeprecated36pxSize({
14
14
  componentName,
15
15
  __next40pxDefaultSize,
16
- size
16
+ size,
17
+ __shouldNotWarnDeprecated36pxSize
17
18
  }) {
18
- if (__next40pxDefaultSize || size !== 'default') {
19
+ if (__shouldNotWarnDeprecated36pxSize || __next40pxDefaultSize || size !== undefined && size !== 'default') {
19
20
  return;
20
21
  }
21
22
  (0, _deprecated.default)(`36px default size for wp.components.${componentName}`, {
@@ -1 +1 @@
1
- {"version":3,"names":["_deprecated","_interopRequireDefault","require","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","size","deprecated","since","version","hint"],"sources":["@wordpress/components/src/utils/deprecated-36px-size.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport function maybeWarnDeprecated36pxSize( {\n\tcomponentName,\n\t__next40pxDefaultSize,\n\tsize,\n}: {\n\tcomponentName: string;\n\t__next40pxDefaultSize: boolean | undefined;\n\tsize: string;\n} ) {\n\tif ( __next40pxDefaultSize || size !== 'default' ) {\n\t\treturn;\n\t}\n\n\tdeprecated( `36px default size for wp.components.${ componentName }`, {\n\t\tsince: '6.8',\n\t\tversion: '7.1',\n\t\thint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,2BAA2BA,CAAE;EAC5CC,aAAa;EACbC,qBAAqB;EACrBC;AAKD,CAAC,EAAG;EACH,IAAKD,qBAAqB,IAAIC,IAAI,KAAK,SAAS,EAAG;IAClD;EACD;EAEA,IAAAC,mBAAU,EAAE,uCAAwCH,aAAa,EAAG,EAAE;IACrEI,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,IAAI,EAAE;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","size","__shouldNotWarnDeprecated36pxSize","undefined","deprecated","since","version","hint"],"sources":["@wordpress/components/src/utils/deprecated-36px-size.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport function maybeWarnDeprecated36pxSize( {\n\tcomponentName,\n\t__next40pxDefaultSize,\n\tsize,\n\t__shouldNotWarnDeprecated36pxSize,\n}: {\n\tcomponentName: string;\n\t__next40pxDefaultSize: boolean | undefined;\n\tsize: string | undefined;\n\t__shouldNotWarnDeprecated36pxSize?: boolean;\n} ) {\n\tif (\n\t\t__shouldNotWarnDeprecated36pxSize ||\n\t\t__next40pxDefaultSize ||\n\t\t( size !== undefined && size !== 'default' )\n\t) {\n\t\treturn;\n\t}\n\n\tdeprecated( `36px default size for wp.components.${ componentName }`, {\n\t\tsince: '6.8',\n\t\tversion: '7.1',\n\t\thint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,2BAA2BA,CAAE;EAC5CC,aAAa;EACbC,qBAAqB;EACrBC,IAAI;EACJC;AAMD,CAAC,EAAG;EACH,IACCA,iCAAiC,IACjCF,qBAAqB,IACnBC,IAAI,KAAKE,SAAS,IAAIF,IAAI,KAAK,SAAW,EAC3C;IACD;EACD;EAEA,IAAAG,mBAAU,EAAE,uCAAwCL,aAAa,EAAG,EAAE;IACrEM,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,IAAI,EAAE;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -37,6 +37,7 @@ function ListBox({
37
37
  children: items.map((option, index) => /*#__PURE__*/_jsx(Button, {
38
38
  id: `components-autocomplete-item-${instanceId}-${option.key}`,
39
39
  role: "option",
40
+ __next40pxDefaultSize: true,
40
41
  "aria-selected": index === selectedIndex,
41
42
  accessibleWhenDisabled: true,
42
43
  disabled: option.isDisabled,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","accessibleWhenDisabled","disabled","isDisabled","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t}, [ handler, ref ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,MAAM,EACNC,SAAS,EACTC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,WAAW,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,yBAAyB;AACxD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,YAAY,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAazC,SAASC,OAAOA,CAAE;EACjBC,KAAK;EACLC,QAAQ;EACRC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,SAAS,GAAG;AACC,CAAC,EAAG;EACjB,oBACCZ,IAAA,CAACY,S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IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,CAAED,OAAO,EAAEF,GAAG,CAAG,CAAC;AACtB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","__next40pxDefaultSize","accessibleWhenDisabled","disabled","isDisabled","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t}, [ handler, ref ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,MAAM,EACNC,SAAS,EACTC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,WAAW,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO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AAW;QACvBC,SAAS,EAAGA,SAAW;QACvBC,SAAS,EAAGf;MAAgB,CAC5B,CAAC,EACFwC,UAAU,CAACG,OAAO,CAACM,aAAa,CAACW,IAClC,CAAC;IAAA,CACD,CAAC;EAEL;EAEA,OAAOzB,eAAe;AACvB;AAEA,SAASe,iBAAiBA,CACzBS,GAAmC,EACnCE,OAAwC,EACvC;EACD1E,SAAS,CAAE,MAAM;IAChB,MAAM2E,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEJ,GAAG,CAAChB,OAAO,IACbgB,GAAG,CAAChB,OAAO,CAACqB,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAJ,OAAO,CAAEE,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,CAAED,OAAO,EAAEF,GAAG,CAAG,CAAC;AACtB","ignoreList":[]}
@@ -95,6 +95,7 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => {
95
95
  withSlider: true,
96
96
  width: size === '__unstable-large' ? '116px' : '110px',
97
97
  __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
98
+ __shouldNotWarnDeprecated36pxSize: true,
98
99
  size: size
99
100
  }) : /*#__PURE__*/_jsx(BorderBoxControlSplitControls, {
100
101
  colors: colors,
@@ -1 +1 @@
1
- {"version":3,"names":["__","useMemo","useState","useMergeRefs","BorderBoxControlLinkedButton","BorderBoxControlSplitControls","BorderControl","StyledLabel","View","VisuallyHidden","contextConnect","useBorderBoxControl","jsx","_jsx","jsxs","_jsxs","BorderLabel","props","label","hideLabelFromVision","as","children","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","popoverAnchor","setPopoverAnchor","popoverProps","placement","offset","anchor","shift","undefined","mergedRef","ref","onChange","placeholder","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","onClick","BorderBoxControl"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,OAAOC,4BAA4B,MAAM,qCAAqC;AAC9E,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,WAAW,QAAQ,+CAA+C;AAC3E,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,cAAc,QAAQ,uBAAuB;AAEtD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,mBAAmB,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQ7C,MAAMC,WAAW,GAAKC,KAAiB,IAAM;EAC5C,MAAM;IAAEC,KAAK;IAAEC;EAAoB,CAAC,GAAGF,KAAK;EAE5C,IAAK,CAAEC,KAAK,EAAG;IACd,OAAO,IAAI;E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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMwB,gBAAgB,GAAGpD,cAAc,CAC7CY,2BAA2B,EAC3B,kBACD,CAAC;AAED,eAAewC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["__","useMemo","useState","useMergeRefs","BorderBoxControlLinkedButton","BorderBoxControlSplitControls","BorderControl","StyledLabel","View","VisuallyHidden","contextConnect","useBorderBoxControl","jsx","_jsx","jsxs","_jsxs","BorderLabel","props","label","hideLabelFromVision","as","children","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","popoverAnchor","setPopoverAnchor","popoverProps","placement","offset","anchor","shift","undefined","mergedRef","ref","onChange","placeholder","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","__shouldNotWarnDeprecated36pxSize","onClick","BorderBoxControl"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACtD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,OAAOC,4BAA4B,MAAM,qCAAqC;AAC9E,OAAOC,6BAA6B,MAAM,sCAAsC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Q,EAAGnB,aAAe;QAC1BC,gBAAgB,EAAGA,gBAAkB;QACrCC,aAAa,EAAGA,aAAe;QAC/BqB,KAAK,EAAGnB,UAAY;QACpBG,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CACD,eACDzB,IAAA,CAACT,4BAA4B;QAC5B0D,OAAO,EAAGtB,YAAc;QACxBT,QAAQ,EAAGA,QAAU;QACrBO,IAAI,EAAGA;MAAM,CACb,CAAC;IAAA,CACG,CAAC;EAAA,CACF,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,OAAO,MAAMyB,gBAAgB,GAAGrD,cAAc,CAC7CY,2BAA2B,EAC3B,kBACD,CAAC;AAED,eAAeyC,gBAAgB","ignoreList":[]}
@@ -49,7 +49,8 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => {
49
49
  enableStyle,
50
50
  isCompact: true,
51
51
  __experimentalIsRenderedInSidebar,
52
- size
52
+ size,
53
+ __shouldNotWarnDeprecated36pxSize: true
53
54
  };
54
55
  const mergedRef = useMergeRefs([setPopoverAnchor, forwardedRef]);
55
56
  return /*#__PURE__*/_jsxs(Grid, {