@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","_compose","_element","_icons","_button","_icon","_utils","_jsxRuntime","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","useControlledState","initial","undefined","fallback","nodeRef","useRef","scrollBehavior","useReducedMotion","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","useUpdateEffect","scrollIntoView","inline","block","behavior","classes","clsx","jsxs","useMergeRefs","jsx","PanelBodyTitle","Boolean","onClick","forwardRef","default","chevronUp","chevronDown","size","PanelBody","exports","_default"],"sources":["@wordpress/components/src/panel/body.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = clsx( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAA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,EAACxC,OAAA,CAAA+C,OAAM;MACNrC,SAAS,EAAC,+BAA+B;MACzC,iBAAgBO,QAAU;MAC1BV,GAAG,EAAGA,GAAK;MAAA,GACND,KAAK;MAAAG,QAAA,gBAMV,IAAAN,WAAA,CAAAuC,GAAA;QAAM,eAAY,MAAM;QAAAjC,QAAA,eACvB,IAAAN,WAAA,CAAAuC,GAAA,EAACzC,KAAA,CAAA8C,OAAI;UACJrC,SAAS,EAAC,yBAAyB;UACnCC,IAAI,EAAGM,QAAQ,GAAG+B,gBAAS,GAAGC;QAAa,CAC3C;MAAC,CACG,CAAC,EACLlC,KAAK,EACLJ,IAAI,iBACL,IAAAR,WAAA,CAAAuC,GAAA,EAACzC,KAAA,CAAA8C,OAAI;QACJpC,IAAI,EAAGA,IAAM;QACbD,SAAS,EAAC,wBAAwB;QAClCwC,IAAI,EAAG;MAAI,CACX,CACD;IAAA,CACM;EAAC,CACN,CAAC;AAEP,CACD,CAAC;AAEM,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,IAAAL,mBAAU,EAAEzC,oBAAqB,CAAC;AAAC,IAAAgD,QAAA,GAAAD,OAAA,CAAAL,OAAA,GAE7CI,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_icons","_button","_icon","_utils","_jsxRuntime","noop","UnforwardedPanelBody","props","ref","buttonProps","children","className","icon","initialOpen","onToggle","opened","title","scrollAfterOpen","isOpened","setIsOpened","useControlledState","initial","undefined","fallback","nodeRef","useRef","scrollBehavior","useReducedMotion","handleOnToggle","event","preventDefault","next","scrollAfterOpenRef","current","useUpdateEffect","scrollIntoView","inline","block","behavior","classes","clsx","jsxs","useMergeRefs","jsx","PanelBodyTitle","Boolean","onClick","forwardRef","default","__next40pxDefaultSize","chevronUp","chevronDown","size","PanelBody","exports","_default"],"sources":["@wordpress/components/src/panel/body.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { PanelBodyProps, PanelBodyTitleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\n\nconst noop = () => {};\n\nexport function UnforwardedPanelBody(\n\tprops: PanelBodyProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbuttonProps = {},\n\t\tchildren,\n\t\tclassName,\n\t\ticon,\n\t\tinitialOpen,\n\t\tonToggle = noop,\n\t\topened,\n\t\ttitle,\n\t\tscrollAfterOpen = true,\n\t} = props;\n\tconst [ isOpened, setIsOpened ] = useControlledState< boolean | undefined >(\n\t\topened,\n\t\t{\n\t\t\tinitial: initialOpen === undefined ? true : initialOpen,\n\t\t\tfallback: false,\n\t\t}\n\t);\n\tconst nodeRef = useRef< HTMLElement >( null );\n\n\t// Defaults to 'smooth' scrolling\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\tconst scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n\n\tconst handleOnToggle = ( event: React.MouseEvent ) => {\n\t\tevent.preventDefault();\n\t\tconst next = ! isOpened;\n\t\tsetIsOpened( next );\n\t\tonToggle( next );\n\t};\n\n\t// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n\tconst scrollAfterOpenRef = useRef< boolean | undefined >();\n\tscrollAfterOpenRef.current = scrollAfterOpen;\n\t// Runs after initial render.\n\tuseUpdateEffect( () => {\n\t\tif (\n\t\t\tisOpened &&\n\t\t\tscrollAfterOpenRef.current &&\n\t\t\tnodeRef.current?.scrollIntoView\n\t\t) {\n\t\t\t/*\n\t\t\t * Scrolls the content into view when visible.\n\t\t\t * This improves the UX when there are multiple stacking <PanelBody />\n\t\t\t * components in a scrollable container.\n\t\t\t */\n\t\t\tnodeRef.current.scrollIntoView( {\n\t\t\t\tinline: 'nearest',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tbehavior: scrollBehavior,\n\t\t\t} );\n\t\t}\n\t}, [ isOpened, scrollBehavior ] );\n\n\tconst classes = clsx( 'components-panel__body', className, {\n\t\t'is-opened': isOpened,\n\t} );\n\n\treturn (\n\t\t<div className={ classes } ref={ useMergeRefs( [ nodeRef, ref ] ) }>\n\t\t\t<PanelBodyTitle\n\t\t\t\ticon={ icon }\n\t\t\t\tisOpened={ Boolean( isOpened ) }\n\t\t\t\tonClick={ handleOnToggle }\n\t\t\t\ttitle={ title }\n\t\t\t\t{ ...buttonProps }\n\t\t\t/>\n\t\t\t{ typeof children === 'function'\n\t\t\t\t? children( { opened: Boolean( isOpened ) } )\n\t\t\t\t: isOpened && children }\n\t\t</div>\n\t);\n}\n\nconst PanelBodyTitle = forwardRef(\n\t(\n\t\t{\n\t\t\tisOpened,\n\t\t\ticon,\n\t\t\ttitle,\n\t\t\t...props\n\t\t}: WordPressComponentProps< PanelBodyTitleProps, 'button' >,\n\t\tref: React.ForwardedRef< any >\n\t) => {\n\t\tif ( ! title ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<h2 className=\"components-panel__body-title\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"components-panel__body-toggle\"\n\t\t\t\t\taria-expanded={ isOpened }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\tFirefox + NVDA don't announce aria-expanded because the browser\n\t\t\t\t\trepaints the whole element, so this wrapping span hides that.\n\t\t\t\t*/ }\n\t\t\t\t\t<span aria-hidden=\"true\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-panel__arrow\"\n\t\t\t\t\t\t\ticon={ isOpened ? chevronUp : chevronDown }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ title }\n\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tclassName=\"components-panel__icon\"\n\t\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Button>\n\t\t\t</h2>\n\t\t);\n\t}\n);\n\nexport const PanelBody = forwardRef( UnforwardedPanelBody );\n\nexport default PanelBody;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA+D,IAAAO,WAAA,GAAAP,OAAA;AAnB/D;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,SAASC,oBAAoBA,CACnCC,KAAqB,EACrBC,GAAyC,EACxC;EACD,MAAM;IACLC,WAAW,GAAG,CAAC,CAAC;IAChBC,QAAQ;IACRC,SAAS;IACTC,IAAI;IACJC,WAAW;IACXC,QAAQ,GAAGT,IAAI;IACfU,MAAM;IACNC,KAAK;IACLC,eAAe,GAAG;EACnB,CAAC,GAAGV,KAAK;EACT,MAAM,CAAEW,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAC,yBAAkB,EACnDL,MAAM,EACN;IACCM,OAAO,EAAER,WAAW,KAAKS,SAAS,GAAG,IAAI,GAAGT,WAAW;IACvDU,QAAQ,EAAE;EACX,CACD,CAAC;EACD,MAAMC,OAAO,GAAG,IAAAC,eAAM,EAAiB,IAAK,CAAC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S","ignoreList":[]}
@@ -13,6 +13,7 @@ var _compose = require("@wordpress/compose");
13
13
  var _icons = require("@wordpress/icons");
14
14
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
15
15
  var _primitives = require("@wordpress/primitives");
16
+ var _i18n = require("@wordpress/i18n");
16
17
  var _button = _interopRequireDefault(require("../button"));
17
18
  var _scrollLock = _interopRequireDefault(require("../scroll-lock"));
18
19
  var _slotFill = require("../slot-fill");
@@ -296,8 +297,10 @@ const UnforwardedPopover = (props, forwardedRef) => {
296
297
  children: headerTitle
297
298
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
298
299
  className: "components-popover__close",
300
+ size: "small",
299
301
  icon: _icons.close,
300
- onClick: onClose
302
+ onClick: onClose,
303
+ label: (0, _i18n.__)('Close')
301
304
  })]
302
305
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
303
306
  className: "components-popover__content",
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAWA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAKA,IAAAQ,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ACF;EAEA,IAAK2J,SAAS,EAAG;IAChB,OAAOf,OAAO;EACf;EAEA,oBACC,IAAA/J,WAAA,CAAAI,IAAA,EAAAJ,WAAA,CAAAmL,QAAA;IAAAzK,QAAA,gBACC,IAAAV,WAAA,CAAAW,GAAA;MAAMwJ,GAAG,EAAG7F;IAAmB,CAAE,CAAC,EAChCyF,OAAO;EAAA,CACR,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMqB,OAAO,GAAAlL,OAAA,CAAAkL,OAAA,GAAG,IAAAC,uBAAc,EAAE3J,kBAAkB,EAAE,SAAU,CAAC;AAEtE,SAAS4J,WAAWA,CACnB;EAAEN,IAAI,GAAG/K;AAA6B,CAAC,EACvCkK,GAAwB,EACvB;EACD,oBACC,IAAAnK,WAAA,CAAAW,GAAA,EAAChB,SAAA,CAAA4L,IAAI;IACJC,gBAAgB;IAChBR,IAAI,EAAGA,IAAM;IACbxK,SAAS,EAAC,cAAc;IACxB2J,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAiB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG3K,eAAe,CAAC4K,QAAQ;AAAC,IAAAC,QAAA,GAAA1L,OAAA,CAAAmK,OAAA,GAE/Ce,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_reactDom","_framerMotion","_element","_compose","_icons","_deprecated","_primitives","_i18n","_button","_scrollLock","_slotFill","_utils","_context","_overlayMiddlewares","_styleProvider","_jsxRuntime","SLOT_NAME","exports","ArrowTriangle","jsxs","SVG","xmlns","viewBox","className","role","children","jsx","Path","d","vectorEffect","slotNameContext","createContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","inline","variant","style","contentStyle","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","useContextSystem","computedFlipProp","computedResizeProp","deprecated","since","version","alternative","computedVariant","arrowRef","useRef","fallbackReferenceElement","setFallbackReferenceElement","useState","anchorRefFallback","useCallback","node","isMobileViewport","useViewportMatch","isExpanded","hasArrow","normalizedPlacementFromProps","positionToPlacement","middleware","overlayMiddlewares","offsetMiddleware","flipMiddleware","size","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","shiftMiddleware","crossAxis","limiter","limitShift","padding","arrow","element","slotName","useContext","slot","useSlot","onDialogClose","type","event","dialogRef","dialogProps","useDialog","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","useFloating","whileElementsMounted","referenceParam","floatingParam","updateParam","autoUpdate","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","useLayoutEffect","resultingReferenceElement","getReferenceElement","setReference","mergedFloatingRef","useMergeRefs","setFloating","left","computePopoverPosition","shouldReduceMotion","useReducedMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","useMemo","placementToMotionAnimationProps","animationProps","onAnimationComplete","isPositioned","content","motion","div","clsx","ref","tabIndex","default","icon","close","onClick","label","__","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","Fill","name","createPortal","StyleProvider","Fragment","Popover","contextConnect","PopoverSlot","Slot","bubblesVirtually","forwardRef","__unstableSlotNameProvider","Provider","_default"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children` which are re-defined in\n\t\t// `PopoverProps`, and `style` which is merged safely).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' | 'style' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\t\tstyle: contentStyle,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle: {\n\t\t\t\t\t...contentStyle,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAWA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAWA,IAAAI,QAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AAMA,IAAAa,QAAA,GAAAb,OAAA;AAOA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAf,OAAA;AAAkD,IAAAgB,WAAA,GAAAhB,OAAA;AA/DlD;AACA;AACA;;AAgBA;AACA;AACA;;AAuBA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACO,MAAMiB,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAS;;AAElC;AACA;AACA;AACA;AACA,MAAME,aAAa,GAAGA,CAAA,kBACrB,IAAAH,WAAA,CAAAI,IAAA,EAACb,WAAA,CAAAc,GAAG;EACHC,KAAK,EAAC,4BAA4B;EAClCC,OAAO,EAAC,aAAa;EACrBC,SAAS,EAAC,8BAA8B;EACxCC,IAAI,EAAC,cAAc;EAAAC,QAAA,gBAEnB,IAAAV,WAAA,CAAAW,GAAA,EAACpB,WAAA,CAAAqB,IAAI;IACJJ,SAAS,EAAC,iCAAiC;IAC3CK,C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K,SAAS,EAAC,cAAc;IACxB2J,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAmB,OAAO,CAACG,IAAI,GAAG,IAAAE,mBAAU,EAAEH,WAAY,CAAC;AACxC;AACAF,OAAO,CAACM,0BAA0B,GAAG7K,eAAe,CAAC8K,QAAQ;AAAC,IAAAC,QAAA,GAAA5L,OAAA,CAAAmK,OAAA,GAE/CiB,OAAO","ignoreList":[]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.privateApis = void 0;
8
8
  var _utils = require("./popover/utils");
9
- var _slotFill = require("./slot-fill");
10
9
  var _menu = require("./menu");
11
10
  var _contextSystemProvider = require("./context/context-system-provider");
12
11
  var _theme = _interopRequireDefault(require("./theme"));
@@ -20,7 +19,6 @@ var _lockUnlock = require("./lock-unlock");
20
19
  const privateApis = exports.privateApis = {};
21
20
  (0, _lockUnlock.lock)(privateApis, {
22
21
  __experimentalPopoverLegacyPositionToPlacement: _utils.positionToPlacement,
23
- createPrivateSlotFill: _slotFill.createPrivateSlotFill,
24
22
  ComponentsContext: _contextSystemProvider.ComponentsContext,
25
23
  Tabs: _tabs.Tabs,
26
24
  Theme: _theme.default,
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_slotFill","_menu","_contextSystemProvider","_theme","_interopRequireDefault","_tabs","_strings","_lockUnlock","privateApis","exports","lock","__experimentalPopoverLegacyPositionToPlacement","createPrivateSlotFill","ComponentsContext","Tabs","Theme","Menu","kebabCase"],"sources":["@wordpress/components/src/private-apis.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';\nimport { createPrivateSlotFill } from './slot-fill';\nimport { Menu } from './menu';\nimport { ComponentsContext } from './context/context-system-provider';\nimport Theme from './theme';\nimport { Tabs } from './tabs';\nimport { kebabCase } from './utils/strings';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\t__experimentalPopoverLegacyPositionToPlacement,\n\tcreatePrivateSlotFill,\n\tComponentsContext,\n\tTabs,\n\tTheme,\n\tMenu,\n\tkebabCase,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAVA;AACA;AACA;;AAUO,MAAMS,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,CAAC,CAAC;AAC7B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBG,8CAA8C,EAA9CA,0BAA8C;EAC9CC,qBAAqB,EAArBA,+BAAqB;EACrBC,iBAAiB,EAAjBA,wCAAiB;EACjBC,IAAI,EAAJA,UAAI;EACJC,KAAK,EAALA,cAAK;EACLC,IAAI,EAAJA,UAAI;EACJC,SAAS,EAATA;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_utils","require","_menu","_contextSystemProvider","_theme","_interopRequireDefault","_tabs","_strings","_lockUnlock","privateApis","exports","lock","__experimentalPopoverLegacyPositionToPlacement","ComponentsContext","Tabs","Theme","Menu","kebabCase"],"sources":["@wordpress/components/src/private-apis.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';\nimport { Menu } from './menu';\nimport { ComponentsContext } from './context/context-system-provider';\nimport Theme from './theme';\nimport { Tabs } from './tabs';\nimport { kebabCase } from './utils/strings';\nimport { lock } from './lock-unlock';\n\nexport const privateApis = {};\nlock( privateApis, {\n\t__experimentalPopoverLegacyPositionToPlacement,\n\tComponentsContext,\n\tTabs,\n\tTheme,\n\tMenu,\n\tkebabCase,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AATA;AACA;AACA;;AASO,MAAMQ,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,CAAC,CAAC;AAC7B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBG,8CAA8C,EAA9CA,0BAA8C;EAC9CC,iBAAiB,EAAjBA,wCAAiB;EACjBC,IAAI,EAAJA,UAAI;EACJC,KAAK,EAALA,cAAK;EACLC,IAAI,EAAJA,UAAI;EACJC,SAAS,EAATA;AACD,CAAE,CAAC","ignoreList":[]}
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("@ariakit/react"));
10
10
  var Ariakit = _react;
11
11
  var _button = _interopRequireDefault(require("../button"));
12
12
  var _context = require("./context");
13
+ var _deprecated36pxSize = require("../utils/deprecated-36px-size");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -36,6 +37,11 @@ function UnforwardedRadio({
36
37
  } = (0, _element.useContext)(_context.RadioGroupContext);
37
38
  const selectedValue = (0, _react.useStoreState)(store, 'value');
38
39
  const isChecked = selectedValue !== undefined && selectedValue === value;
40
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
41
+ componentName: 'Radio',
42
+ size: undefined,
43
+ __next40pxDefaultSize: props.__next40pxDefaultSize
44
+ });
39
45
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Ariakit.Radio, {
40
46
  disabled: disabled,
41
47
  store: store,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_react","_interopRequireWildcard","Ariakit","_button","_interopRequireDefault","_context","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnforwardedRadio","value","children","props","ref","store","disabled","useContext","RadioGroupContext","selectedValue","useStoreState","isChecked","undefined","jsx","Radio","render","variant","exports","forwardRef","_default"],"sources":["@wordpress/components/src/radio-group/radio.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { RadioGroupContext } from './context';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioProps } from './types';\n\nfunction UnforwardedRadio(\n\t{\n\t\tvalue,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< RadioProps, 'button', false >,\n\tref: React.ForwardedRef< any >\n) {\n\tconst { store, disabled } = useContext( RadioGroupContext );\n\n\tconst selectedValue = useStoreState( store, 'value' );\n\tconst isChecked = selectedValue !== undefined && selectedValue === value;\n\n\treturn (\n\t\t<Ariakit.Radio\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ store }\n\t\t\tref={ ref }\n\t\t\tvalue={ value }\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ isChecked ? 'primary' : 'secondary' }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ children || value }\n\t\t</Ariakit.Radio>\n\t);\n}\n\n/**\n * @deprecated Use `RadioControl` or `ToggleGroupControl` instead.\n */\nexport const Radio = forwardRef( UnforwardedRadio );\nexport default Radio;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA0C,IAAAG,OAAA,GAAAF,MAAA;AAM1C,IAAAG,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAA8C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBA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A,CAAA/B,OAAA,GACrC4B,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_react","_interopRequireWildcard","Ariakit","_button","_interopRequireDefault","_context","_deprecated36pxSize","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnforwardedRadio","value","children","props","ref","store","disabled","useContext","RadioGroupContext","selectedValue","useStoreState","isChecked","undefined","maybeWarnDeprecated36pxSize","componentName","size","__next40pxDefaultSize","jsx","Radio","render","variant","exports","forwardRef","_default"],"sources":["@wordpress/components/src/radio-group/radio.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { useStoreState } from '@ariakit/react';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { RadioGroupContext } from './context';\nimport type { WordPressComponentProps } from '../context';\nimport type { RadioProps } from './types';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nfunction UnforwardedRadio(\n\t{\n\t\tvalue,\n\t\tchildren,\n\t\t...props\n\t}: WordPressComponentProps< RadioProps, 'button', false >,\n\tref: React.ForwardedRef< any >\n) {\n\tconst { store, disabled } = useContext( RadioGroupContext );\n\n\tconst selectedValue = useStoreState( store, 'value' );\n\tconst isChecked = selectedValue !== undefined && selectedValue === value;\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'Radio',\n\t\tsize: undefined,\n\t\t__next40pxDefaultSize: props.__next40pxDefaultSize,\n\t} );\n\n\treturn (\n\t\t<Ariakit.Radio\n\t\t\tdisabled={ disabled }\n\t\t\tstore={ store }\n\t\t\tref={ ref }\n\t\t\tvalue={ value }\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ isChecked ? 'primary' : 'secondary' }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ children || value }\n\t\t</Ariakit.Radio>\n\t);\n}\n\n/**\n * @deprecated Use `RadioControl` or `ToggleGroupControl` instead.\n */\nexport const Radio = forwardRef( UnforwardedRadio );\nexport default Radio;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA0C,IAAAG,OAAA,GAAAF,MAAA;AAM1C,IAAAG,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAGA,IAAAO,mBAAA,GAAAP,OAAA;AAA4E,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,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,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,C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AA,CAAAH,KAAA,GAAG,IAAAI,mBAAU,EAAEtB,gBAAiB,CAAC;AAAC,IAAAuB,QAAA,GAAAF,OAAA,CAAAnC,OAAA,GACrCgC,KAAK","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/radio-group/types.ts"],"sourcesContent":["export type RadioGroupProps = {\n\t/**\n\t * Accessible label for the radio group\n\t */\n\tlabel: string;\n\t/**\n\t * The `value` of the `Radio` element which should be selected.\n\t * Indicates controlled usage of the component.\n\t */\n\tchecked?: string | number;\n\t/**\n\t * The value of the radio element which is initially selected.\n\t */\n\tdefaultChecked?: string | number;\n\t/**\n\t * Whether the `RadioGroup` should be disabled.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Called when a `Radio` element has been selected.\n\t * Receives the `value` of the selected element as an argument.\n\t */\n\tonChange?: ( value: string | number | undefined ) => void;\n\t/**\n\t * The children elements, which should be a series of `Radio` components.\n\t */\n\tchildren: React.ReactNode;\n};\n\nexport type RadioProps = {\n\t/**\n\t * The actual value of the radio element.\n\t */\n\tvalue: string | number;\n\t/**\n\t * Content displayed on the Radio element. If there aren't any children, `value` is displayed.\n\t */\n\tchildren?: React.ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/radio-group/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ButtonProps } from '../button/types';\n\nexport type RadioGroupProps = {\n\t/**\n\t * Accessible label for the radio group\n\t */\n\tlabel: string;\n\t/**\n\t * The `value` of the `Radio` element which should be selected.\n\t * Indicates controlled usage of the component.\n\t */\n\tchecked?: string | number;\n\t/**\n\t * The value of the radio element which is initially selected.\n\t */\n\tdefaultChecked?: string | number;\n\t/**\n\t * Whether the `RadioGroup` should be disabled.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Called when a `Radio` element has been selected.\n\t * Receives the `value` of the selected element as an argument.\n\t */\n\tonChange?: ( value: string | number | undefined ) => void;\n\t/**\n\t * The children elements, which should be a series of `Radio` components.\n\t */\n\tchildren: React.ReactNode;\n};\n\nexport type RadioProps = Pick< ButtonProps, '__next40pxDefaultSize' > & {\n\t/**\n\t * The actual value of the radio element.\n\t */\n\tvalue: string | number;\n\t/**\n\t * Content displayed on the Radio element. If there aren't any children, `value` is displayed.\n\t */\n\tchildren?: React.ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
@@ -20,6 +20,7 @@ var _rail = _interopRequireDefault(require("./rail"));
20
20
  var _tooltip = _interopRequireDefault(require("./tooltip"));
21
21
  var _rangeControlStyles = require("./styles/range-control-styles");
22
22
  var _space = require("../utils/space");
23
+ var _deprecated36pxSize = require("../utils/deprecated-36px-size");
23
24
  var _jsxRuntime = require("react/jsx-runtime");
24
25
  /**
25
26
  * External dependencies
@@ -84,6 +85,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
84
85
  trackColor,
85
86
  value: valueProp,
86
87
  withInputField = true,
88
+ __shouldNotWarnDeprecated36pxSize,
87
89
  ...otherProps
88
90
  } = props;
89
91
  const [value, setValue] = (0, _utils2.useControlledRangeValue)({
@@ -185,6 +187,14 @@ function UnforwardedRangeControl(props, forwardedRef) {
185
187
  const offsetStyle = {
186
188
  [(0, _i18n.isRTL)() ? 'right' : 'left']: fillValueOffset
187
189
  };
190
+
191
+ // Add default size deprecation warning.
192
+ (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
193
+ componentName: 'RangeControl',
194
+ __next40pxDefaultSize,
195
+ size: undefined,
196
+ __shouldNotWarnDeprecated36pxSize
197
+ });
188
198
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_baseControl.default, {
189
199
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
190
200
  __associatedWPComponentName: "RangeControl",
@@ -314,6 +324,7 @@ function UnforwardedRangeControl(props, forwardedRef) {
314
324
  * return (
315
325
  * <RangeControl
316
326
  * __nextHasNoMarginBottom
327
+ * __next40pxDefaultSize
317
328
  * help="Please select how transparent you would like this."
318
329
  * initialPosition={50}
319
330
  * label="Opacity"
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_button","_icon","_utils","_utils2","_math","_inputRange","_rail","_tooltip","_rangeControlStyles","_space","_jsxRuntime","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","otherProps","setValue","useControlledRangeValue","initial","isResetPendent","useRef","hasTooltip","hasInputField","setShowTooltip","useState","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","clamp","classes","clsx","wrapperClasses","id","useInstanceId","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","floatClamp","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","isRTL","jsx","default","__associatedWPComponentName","children","jsxs","Root","BeforeIconWrapper","icon","Wrapper","ref","useMergeRefs","Track","style","width","ThumbWrapper","Thumb","tooltipPosition","show","AfterIconWrapper","InputNumber","inputMode","size","__unstableInputWidth","space","ActionRightWrapper","accessibleWhenDisabled","variant","onClick","__","RangeControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={50}\n * label=\"Opacity\"\n * max={100}\n * min={0}\n * onChange={() => {}}\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAA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A,CAAAgG,GAAA,EAAClG,mBAAA,CAAA0H,kBAAkB;QAAArB,QAAA,eAClB,IAAAnG,WAAA,CAAAgG,GAAA,EAAC1G,OAAA,CAAA2G,OAAM;UACNlF,SAAS,EAAC;UACV;UAAA;UACA0G,sBAAsB,EAAG,CAAEnG;UAC3B;UACA;UACA;UAAA;UACAA,QAAQ,EACPA,QAAQ,IACRsB,KAAK,KACJ1C,iBAAiB,CAAE;YAClBC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDsH,OAAO,EAAC,WAAW;UACnBL,IAAI,EAAC,OAAO;UACZM,OAAO,EAAGnC,aAAe;UAAAW,QAAA,EAEvB,IAAAyB,QAAE,EAAE,OAAQ;QAAC,CACR;MAAC,CACU,CACpB;IAAA,CACI;EAAC,CACK,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;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAEvH,uBAAwB,CAAC;AAAC,IAAAwH,QAAA,GAAAF,OAAA,CAAA7B,OAAA,GAEnD4B,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_compose","_baseControl","_button","_icon","_utils","_utils2","_math","_inputRange","_rail","_tooltip","_rangeControlStyles","_space","_deprecated36pxSize","_jsxRuntime","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","COLORS","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","__shouldNotWarnDeprecated36pxSize","otherProps","setValue","useControlledRangeValue","initial","isResetPendent","useRef","hasTooltip","hasInputField","setShowTooltip","useState","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","clamp","classes","clsx","wrapperClasses","id","useInstanceId","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","floatClamp","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","isRTL","maybeWarnDeprecated36pxSize","componentName","size","jsx","default","__associatedWPComponentName","children","jsxs","Root","BeforeIconWrapper","icon","Wrapper","ref","useMergeRefs","Track","style","width","ThumbWrapper","Thumb","tooltipPosition","show","AfterIconWrapper","InputNumber","inputMode","__unstableInputWidth","space","ActionRightWrapper","accessibleWhenDisabled","variant","onClick","__","RangeControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\t// Add default size deprecation warning.\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'RangeControl',\n\t\t__next40pxDefaultSize,\n\t\tsize: undefined,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={50}\n * label=\"Opacity\"\n * max={100}\n * min={0}\n * onChange={() => {}}\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,KAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,QAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,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EAACvG,mBAAA,CAAA8H,kBAAkB;QAAApB,QAAA,eAClB,IAAAvG,WAAA,CAAAoG,GAAA,EAAC/G,OAAA,CAAAgH,OAAM;UACNtF,SAAS,EAAC;UACV;UAAA;UACA6G,sBAAsB,EAAG,CAAEtG;UAC3B;UACA;UACA;UAAA;UACAA,QAAQ,EACPA,QAAQ,IACRsB,KAAK,KACJ1C,iBAAiB,CAAE;YAClBC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDyH,OAAO,EAAC,WAAW;UACnB1B,IAAI,EAAC,OAAO;UACZ2B,OAAO,EAAGrC,aAAe;UAAAc,QAAA,EAEvB,IAAAwB,QAAE,EAAE,OAAQ;QAAC,CACR;MAAC,CACU,CACpB;IAAA,CACI;EAAC,CACK,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;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG,IAAAE,mBAAU,EAAE1H,uBAAwB,CAAC;AAAC,IAAA2H,QAAA,GAAAF,OAAA,CAAA5B,OAAA,GAEnD2B,YAAY","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/range-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tCSSProperties,\n\tFocusEventHandler,\n\tMouseEventHandler,\n\tMutableRefObject,\n} from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\nimport type { IconType } from '../icon';\n\nexport type NumericProps = {\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default 0\n\t */\n\tmin?: number;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default 100\n\t */\n\tmax?: number;\n\t/**\n\t * The current value of the range slider.\n\t */\n\tvalue?: number;\n};\n\nexport type RangeMark = { value: number; label?: string };\n// An expanded definition of this type is used in MarkProps to improve Storybook\n// generated docs.\nexport type RangeMarks = boolean | RangeMark[];\n\nexport type MarksProps = NumericProps & {\n\t/**\n\t * Disables the `input`, preventing new values from being applied.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Renders a visual representation of `step` ticks. Custom mark indicators\n\t * can be provided by an `Array`.\n\t *\n\t * @default false\n\t */\n\tmarks?: boolean | { value: number; label?: string }[];\n\t/**\n\t * The minimum amount by which `value` changes. It is also a factor in\n\t * validation as `value` must be a multiple of `step` (offset by `min`) to\n\t * be valid. Accepts the special string value `any` that voids the\n\t * validation constraint and overrides both `withInputField` and\n\t * `showTooltip` props to `false`.\n\t *\n\t * @default 1\n\t */\n\tstep?: number | 'any';\n};\n\nexport type RangeMarkProps = {\n\tisFilled?: boolean;\n\tlabel?: string;\n\tdisabled?: boolean;\n\tkey?: string;\n\tstyle?: CSSProperties;\n};\n\nexport type ControlledRangeValue = number | '' | null;\n\nexport type RangeControlProps = Pick<\n\tBaseControlProps,\n\t'hideLabelFromVision' | 'help' | '__nextHasNoMarginBottom'\n> &\n\tMarksProps & {\n\t\t/**\n\t\t * If this property is added, an Icon component will be rendered\n\t\t * after the slider with the icon equal to afterIcon.\n\t\t *\n\t\t * For more information on `IconType` see the Icon component:\n\t\t * /packages/components/src/icon/index.tsx\n\t\t */\n\t\tafterIcon?: IconType;\n\t\t/**\n\t\t * If this property is true, a button to reset the slider is\n\t\t * rendered.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tallowReset?: boolean;\n\t\t/**\n\t\t * If this property is added, an Icon component will be rendered\n\t\t * before the slider with the icon equal to beforeIcon.\n\t\t *\n\t\t * For more information on `IconType` see the Icon component:\n\t\t * /packages/components/src/icon/index.tsx\n\t\t */\n\t\tbeforeIcon?: IconType;\n\t\t/**\n\t\t * CSS color string for the `RangeControl` wrapper.\n\t\t *\n\t\t * @default COLORS.theme.accent\n\t\t * @see /packages/components/src/utils/colors-values.js\n\t\t */\n\t\tcolor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * The current input to use as a fallback if `value` is currently\n\t\t * `undefined`.\n\t\t */\n\t\tcurrentInput?: number;\n\t\t/**\n\t\t * An icon to be shown above the slider next to its container title.\n\t\t */\n\t\ticon?: string;\n\t\t/**\n\t\t * The slider starting position, used when no `value` is passed.\n\t\t * The `initialPosition` will be clamped between the provided `min`\n\t\t * and `max` prop values.\n\t\t */\n\t\tinitialPosition?: number;\n\t\t/**\n\t\t * Passed as a prop to the `NumberControl` component and is only\n\t\t * applicable if `withInputField` is true. If true, while the number\n\t\t * input has focus, pressing `UP` or `DOWN` along with the `SHIFT` key\n\t\t * will change the value by the `shiftStep` value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tisShiftStepEnabled?: boolean;\n\t\t/**\n\t\t * If this property is added, a label will be generated using label\n\t\t * property as the content.\n\t\t */\n\t\tlabel?: string;\n\t\t/**\n\t\t * Callback for when `RangeControl` input loses focus.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonBlur?: FocusEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * A function that receives the new value. The value will be less than\n\t\t * `max` and more than `min` unless a reset (enabled by `allowReset`)\n\t\t * has occurred. In which case the value will be either that of\n\t\t * `resetFallbackValue` if it has been specified or otherwise\n\t\t * `undefined`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonChange?: ( value?: number ) => void;\n\t\t/**\n\t\t * Callback for when `RangeControl` input gains focus.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonFocus?: FocusEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * Callback for when mouse exits the `RangeControl`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonMouseLeave?: MouseEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * Callback for when mouse moves within the `RangeControl`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonMouseMove?: MouseEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * CSS color string to customize the rail element's background.\n\t\t */\n\t\trailColor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * A way to customize the rendered UI of the value.\n\t\t *\n\t\t * @default ( value ) => value\n\t\t */\n\t\trenderTooltipContent?: (\n\t\t\tvalue?: ControlledRangeValue\n\t\t) => string | number | null | undefined;\n\t\t/**\n\t\t * The value to revert to if the Reset button is clicked (enabled by\n\t\t * `allowReset`)\n\t\t */\n\t\tresetFallbackValue?: number;\n\t\t/**\n\t\t * Define if separator line under/above control row should be disabled\n\t\t * or full width. By default it is placed below excluding underline the\n\t\t * control icon.\n\t\t */\n\t\tseparatorType?: 'none' | 'fullWidth' | 'topFullWidth';\n\t\t/**\n\t\t * Passed as a prop to the `NumberControl` component and is only\n\t\t * applicable if `withInputField` and `isShiftStepEnabled` are both true\n\t\t * and while the number input has focus. Acts as a multiplier of `step`.\n\t\t *\n\t\t * @default 10\n\t\t */\n\t\tshiftStep?: number;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t\t/**\n\t\t * Forcing the Tooltip UI to show or hide. This is overridden to `false`\n\t\t * when `step` is set to the special string value `any`.\n\t\t */\n\t\tshowTooltip?: boolean;\n\t\t/**\n\t\t * CSS color string to customize the track element's background.\n\t\t */\n\t\ttrackColor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * Define if the value selection should present a stepper control or a\n\t\t * slider control in the bottom sheet on mobile. To use the stepper set\n\t\t * the type value as `stepper`. Defaults to slider if no option is\n\t\t * provided.\n\t\t */\n\t\ttype?: 'stepper';\n\t\t/**\n\t\t * Determines if the `input` number field will render next to the\n\t\t * RangeControl. This is overridden to `false` when `step` is set to the\n\t\t * special string value `any`.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\twithInputField?: boolean;\n\t};\n\nexport type RailProps = MarksProps & {\n\trailColor?: CSSProperties[ 'color' ];\n};\n\nexport type InputRangeProps = {\n\tdescribedBy?: string;\n\tlabel?: string;\n\tonMouseLeave?: MouseEventHandler< HTMLInputElement >;\n\tonMouseMove?: MouseEventHandler< HTMLInputElement >;\n\tvalue?: number | '';\n};\n\nexport type WrapperProps = Pick<\n\tBaseControlProps,\n\t'__nextHasNoMarginBottom'\n> & {\n\tcolor?: CSSProperties[ 'color' ];\n\tmarks?: RangeMarks;\n};\n\nexport type ThumbProps = {\n\tisFocused?: boolean;\n\tdisabled?: boolean;\n};\n\nexport type TooltipProps = {\n\tshow?: boolean;\n\tposition?: string;\n\tinputRef?: MutableRefObject< HTMLElement | undefined >;\n\ttooltipPosition?: string;\n\tvalue?: ControlledRangeValue;\n\trenderTooltipContent?: (\n\t\tvalue?: ControlledRangeValue\n\t) => string | number | null | undefined;\n\tzIndex?: number;\n};\n\nexport type TrackProps = {\n\tdisabled: boolean;\n\ttrackColor: CSSProperties[ 'color' ];\n};\n\nexport type UseControlledRangeValueArgs = {\n\t/**\n\t * The initial value.\n\t */\n\tinitial?: number;\n\t/**\n\t * The maximum value.\n\t */\n\tmax: number;\n\t/**\n\t * The minimum value.\n\t */\n\tmin: number;\n\t/**\n\t * The current value.\n\t */\n\tvalue: number | null;\n};\n\nexport type UseMarksArgs = NumericProps & {\n\tmarks: RangeMarks;\n\tstep: number;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/range-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tCSSProperties,\n\tFocusEventHandler,\n\tMouseEventHandler,\n\tMutableRefObject,\n} from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { BaseControlProps } from '../base-control/types';\nimport type { IconType } from '../icon';\n\nexport type NumericProps = {\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default 0\n\t */\n\tmin?: number;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default 100\n\t */\n\tmax?: number;\n\t/**\n\t * The current value of the range slider.\n\t */\n\tvalue?: number;\n};\n\nexport type RangeMark = { value: number; label?: string };\n// An expanded definition of this type is used in MarkProps to improve Storybook\n// generated docs.\nexport type RangeMarks = boolean | RangeMark[];\n\nexport type MarksProps = NumericProps & {\n\t/**\n\t * Disables the `input`, preventing new values from being applied.\n\t *\n\t * @default false\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * Renders a visual representation of `step` ticks. Custom mark indicators\n\t * can be provided by an `Array`.\n\t *\n\t * @default false\n\t */\n\tmarks?: boolean | { value: number; label?: string }[];\n\t/**\n\t * The minimum amount by which `value` changes. It is also a factor in\n\t * validation as `value` must be a multiple of `step` (offset by `min`) to\n\t * be valid. Accepts the special string value `any` that voids the\n\t * validation constraint and overrides both `withInputField` and\n\t * `showTooltip` props to `false`.\n\t *\n\t * @default 1\n\t */\n\tstep?: number | 'any';\n};\n\nexport type RangeMarkProps = {\n\tisFilled?: boolean;\n\tlabel?: string;\n\tdisabled?: boolean;\n\tkey?: string;\n\tstyle?: CSSProperties;\n};\n\nexport type ControlledRangeValue = number | '' | null;\n\nexport type RangeControlProps = Pick<\n\tBaseControlProps,\n\t'hideLabelFromVision' | 'help' | '__nextHasNoMarginBottom'\n> &\n\tMarksProps & {\n\t\t/**\n\t\t * If this property is added, an Icon component will be rendered\n\t\t * after the slider with the icon equal to afterIcon.\n\t\t *\n\t\t * For more information on `IconType` see the Icon component:\n\t\t * /packages/components/src/icon/index.tsx\n\t\t */\n\t\tafterIcon?: IconType;\n\t\t/**\n\t\t * If this property is true, a button to reset the slider is\n\t\t * rendered.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tallowReset?: boolean;\n\t\t/**\n\t\t * If this property is added, an Icon component will be rendered\n\t\t * before the slider with the icon equal to beforeIcon.\n\t\t *\n\t\t * For more information on `IconType` see the Icon component:\n\t\t * /packages/components/src/icon/index.tsx\n\t\t */\n\t\tbeforeIcon?: IconType;\n\t\t/**\n\t\t * CSS color string for the `RangeControl` wrapper.\n\t\t *\n\t\t * @default COLORS.theme.accent\n\t\t * @see /packages/components/src/utils/colors-values.js\n\t\t */\n\t\tcolor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * The current input to use as a fallback if `value` is currently\n\t\t * `undefined`.\n\t\t */\n\t\tcurrentInput?: number;\n\t\t/**\n\t\t * An icon to be shown above the slider next to its container title.\n\t\t */\n\t\ticon?: string;\n\t\t/**\n\t\t * The slider starting position, used when no `value` is passed.\n\t\t * The `initialPosition` will be clamped between the provided `min`\n\t\t * and `max` prop values.\n\t\t */\n\t\tinitialPosition?: number;\n\t\t/**\n\t\t * Passed as a prop to the `NumberControl` component and is only\n\t\t * applicable if `withInputField` is true. If true, while the number\n\t\t * input has focus, pressing `UP` or `DOWN` along with the `SHIFT` key\n\t\t * will change the value by the `shiftStep` value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tisShiftStepEnabled?: boolean;\n\t\t/**\n\t\t * If this property is added, a label will be generated using label\n\t\t * property as the content.\n\t\t */\n\t\tlabel?: string;\n\t\t/**\n\t\t * Callback for when `RangeControl` input loses focus.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonBlur?: FocusEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * A function that receives the new value. The value will be less than\n\t\t * `max` and more than `min` unless a reset (enabled by `allowReset`)\n\t\t * has occurred. In which case the value will be either that of\n\t\t * `resetFallbackValue` if it has been specified or otherwise\n\t\t * `undefined`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonChange?: ( value?: number ) => void;\n\t\t/**\n\t\t * Callback for when `RangeControl` input gains focus.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonFocus?: FocusEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * Callback for when mouse exits the `RangeControl`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonMouseLeave?: MouseEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * Callback for when mouse moves within the `RangeControl`.\n\t\t *\n\t\t * @default () => void\n\t\t */\n\t\tonMouseMove?: MouseEventHandler< HTMLInputElement >;\n\t\t/**\n\t\t * CSS color string to customize the rail element's background.\n\t\t */\n\t\trailColor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * A way to customize the rendered UI of the value.\n\t\t *\n\t\t * @default ( value ) => value\n\t\t */\n\t\trenderTooltipContent?: (\n\t\t\tvalue?: ControlledRangeValue\n\t\t) => string | number | null | undefined;\n\t\t/**\n\t\t * The value to revert to if the Reset button is clicked (enabled by\n\t\t * `allowReset`)\n\t\t */\n\t\tresetFallbackValue?: number;\n\t\t/**\n\t\t * Define if separator line under/above control row should be disabled\n\t\t * or full width. By default it is placed below excluding underline the\n\t\t * control icon.\n\t\t */\n\t\tseparatorType?: 'none' | 'fullWidth' | 'topFullWidth';\n\t\t/**\n\t\t * Passed as a prop to the `NumberControl` component and is only\n\t\t * applicable if `withInputField` and `isShiftStepEnabled` are both true\n\t\t * and while the number input has focus. Acts as a multiplier of `step`.\n\t\t *\n\t\t * @default 10\n\t\t */\n\t\tshiftStep?: number;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t\t/**\n\t\t * Forcing the Tooltip UI to show or hide. This is overridden to `false`\n\t\t * when `step` is set to the special string value `any`.\n\t\t */\n\t\tshowTooltip?: boolean;\n\t\t/**\n\t\t * CSS color string to customize the track element's background.\n\t\t */\n\t\ttrackColor?: CSSProperties[ 'color' ];\n\t\t/**\n\t\t * Define if the value selection should present a stepper control or a\n\t\t * slider control in the bottom sheet on mobile. To use the stepper set\n\t\t * the type value as `stepper`. Defaults to slider if no option is\n\t\t * provided.\n\t\t */\n\t\ttype?: 'stepper';\n\t\t/**\n\t\t * Determines if the `input` number field will render next to the\n\t\t * RangeControl. This is overridden to `false` when `step` is set to the\n\t\t * special string value `any`.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\twithInputField?: boolean;\n\t\t/**\n\t\t * Do not throw a warning for the deprecated 36px default size.\n\t\t * For internal components of other components that already throw the warning.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\t__shouldNotWarnDeprecated36pxSize?: boolean;\n\t};\n\nexport type RailProps = MarksProps & {\n\trailColor?: CSSProperties[ 'color' ];\n};\n\nexport type InputRangeProps = {\n\tdescribedBy?: string;\n\tlabel?: string;\n\tonMouseLeave?: MouseEventHandler< HTMLInputElement >;\n\tonMouseMove?: MouseEventHandler< HTMLInputElement >;\n\tvalue?: number | '';\n};\n\nexport type WrapperProps = Pick<\n\tBaseControlProps,\n\t'__nextHasNoMarginBottom'\n> & {\n\tcolor?: CSSProperties[ 'color' ];\n\tmarks?: RangeMarks;\n};\n\nexport type ThumbProps = {\n\tisFocused?: boolean;\n\tdisabled?: boolean;\n};\n\nexport type TooltipProps = {\n\tshow?: boolean;\n\tposition?: string;\n\tinputRef?: MutableRefObject< HTMLElement | undefined >;\n\ttooltipPosition?: string;\n\tvalue?: ControlledRangeValue;\n\trenderTooltipContent?: (\n\t\tvalue?: ControlledRangeValue\n\t) => string | number | null | undefined;\n\tzIndex?: number;\n};\n\nexport type TrackProps = {\n\tdisabled: boolean;\n\ttrackColor: CSSProperties[ 'color' ];\n};\n\nexport type UseControlledRangeValueArgs = {\n\t/**\n\t * The initial value.\n\t */\n\tinitial?: number;\n\t/**\n\t * The maximum value.\n\t */\n\tmax: number;\n\t/**\n\t * The minimum value.\n\t */\n\tmin: number;\n\t/**\n\t * The current value.\n\t */\n\tvalue: number | null;\n};\n\nexport type UseMarksArgs = NumericProps & {\n\tmarks: RangeMarks;\n\tstep: number;\n};\n"],"mappings":"","ignoreList":[]}
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = Fill;
8
+ var _compose = require("@wordpress/compose");
8
9
  var _element = require("@wordpress/element");
9
- var _useSlot = _interopRequireDefault(require("./use-slot"));
10
+ var _slotFillContext = _interopRequireDefault(require("./slot-fill-context"));
10
11
  var _styleProvider = _interopRequireDefault(require("../../style-provider"));
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  /**
@@ -17,33 +18,14 @@ var _jsxRuntime = require("react/jsx-runtime");
17
18
  * Internal dependencies
18
19
  */
19
20
 
20
- function useForceUpdate() {
21
- const [, setState] = (0, _element.useState)({});
22
- const mountedRef = (0, _element.useRef)(true);
23
- (0, _element.useEffect)(() => {
24
- mountedRef.current = true;
25
- return () => {
26
- mountedRef.current = false;
27
- };
28
- }, []);
29
- return () => {
30
- if (mountedRef.current) {
31
- setState({});
32
- }
33
- };
34
- }
35
- function Fill(props) {
21
+ function Fill({
22
+ name,
23
+ children
24
+ }) {
36
25
  var _slot$fillProps;
37
- const {
38
- name,
39
- children
40
- } = props;
41
- const {
42
- registerFill,
43
- unregisterFill,
44
- ...slot
45
- } = (0, _useSlot.default)(name);
46
- const rerender = useForceUpdate();
26
+ const registry = (0, _element.useContext)(_slotFillContext.default);
27
+ const slot = (0, _compose.useObservableValue)(registry.slots, name);
28
+ const [, rerender] = (0, _element.useReducer)(() => [], []);
47
29
  const ref = (0, _element.useRef)({
48
30
  rerender
49
31
  });
@@ -51,12 +33,13 @@ function Fill(props) {
51
33
  // We register fills so we can keep track of their existence.
52
34
  // Some Slot implementations need to know if there're already fills
53
35
  // registered so they can choose to render themselves or not.
54
- registerFill(ref);
36
+ const refValue = ref.current;
37
+ registry.registerFill(name, refValue);
55
38
  return () => {
56
- unregisterFill(ref);
39
+ registry.unregisterFill(name, refValue);
57
40
  };
58
- }, [registerFill, unregisterFill]);
59
- if (!slot.ref || !slot.ref.current) {
41
+ }, [registry, name]);
42
+ if (!slot || !slot.ref.current) {
60
43
  return null;
61
44
  }
62
45