@wordpress/components 21.3.0 → 22.0.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 (612) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/build/angle-picker-control/index.js +1 -1
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/autocomplete/autocompleter-ui.js +28 -2
  5. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  6. package/build/border-box-control/border-box-control/component.js +63 -15
  7. package/build/border-box-control/border-box-control/component.js.map +1 -1
  8. package/build/border-box-control/border-box-control/hook.js +7 -3
  9. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  10. package/build/border-box-control/border-box-control-linked-button/hook.js +3 -3
  11. package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  12. package/build/border-box-control/border-box-control-split-controls/component.js +3 -3
  13. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  14. package/build/border-box-control/border-box-control-split-controls/hook.js +8 -11
  15. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  16. package/build/border-box-control/border-box-control-visualizer/hook.js +3 -7
  17. package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  18. package/build/border-box-control/styles.js +34 -34
  19. package/build/border-box-control/styles.js.map +1 -1
  20. package/build/border-control/border-control/component.js +5 -4
  21. package/build/border-control/border-control/component.js.map +1 -1
  22. package/build/border-control/border-control/hook.js +12 -5
  23. package/build/border-control/border-control/hook.js.map +1 -1
  24. package/build/border-control/border-control-dropdown/hook.js +5 -5
  25. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  26. package/build/border-control/styles.js +19 -34
  27. package/build/border-control/styles.js.map +1 -1
  28. package/build/box-control/index.js +6 -2
  29. package/build/box-control/index.js.map +1 -1
  30. package/build/circular-option-picker/index.js +14 -14
  31. package/build/circular-option-picker/index.js.map +1 -1
  32. package/build/color-palette/index.js +83 -30
  33. package/build/color-palette/index.js.map +1 -1
  34. package/build/color-palette/styles.js +3 -3
  35. package/build/color-palette/styles.js.map +1 -1
  36. package/build/color-palette/types.js +6 -0
  37. package/build/color-palette/types.js.map +1 -0
  38. package/build/color-picker/input-with-slider.js +1 -1
  39. package/build/color-picker/input-with-slider.js.map +1 -1
  40. package/build/custom-gradient-picker/gradient-bar/index.js +1 -3
  41. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  42. package/build/custom-select-control/index.js +8 -4
  43. package/build/custom-select-control/index.js.map +1 -1
  44. package/build/date-time/date-time/index.js +2 -0
  45. package/build/date-time/date-time/index.js.map +1 -1
  46. package/build/date-time/time/index.js +4 -4
  47. package/build/date-time/time/index.js.map +1 -1
  48. package/build/disabled/index.js +8 -1
  49. package/build/disabled/index.js.map +1 -1
  50. package/build/external-link/index.js +13 -2
  51. package/build/external-link/index.js.map +1 -1
  52. package/build/focusable-iframe/index.js +0 -1
  53. package/build/focusable-iframe/index.js.map +1 -1
  54. package/build/font-size-picker/index.js +61 -48
  55. package/build/font-size-picker/index.js.map +1 -1
  56. package/build/font-size-picker/utils.js +0 -21
  57. package/build/font-size-picker/utils.js.map +1 -1
  58. package/build/form-file-upload/index.js.map +1 -1
  59. package/build/higher-order/with-filters/index.js +1 -7
  60. package/build/higher-order/with-filters/index.js.map +1 -1
  61. package/build/index.js +7 -1
  62. package/build/index.js.map +1 -1
  63. package/build/input-control/index.js +2 -0
  64. package/build/input-control/index.js.map +1 -1
  65. package/build/input-control/input-base.js +1 -1
  66. package/build/input-control/input-base.js.map +1 -1
  67. package/build/input-control/styles/input-control-styles.js +21 -21
  68. package/build/input-control/styles/input-control-styles.js.map +1 -1
  69. package/build/isolated-event-container/index.js +5 -9
  70. package/build/isolated-event-container/index.js.map +1 -1
  71. package/build/item-group/styles.js +10 -10
  72. package/build/item-group/styles.js.map +1 -1
  73. package/build/navigator/navigator-screen/component.js +20 -14
  74. package/build/navigator/navigator-screen/component.js.map +1 -1
  75. package/build/number-control/index.js +82 -22
  76. package/build/number-control/index.js.map +1 -1
  77. package/build/number-control/styles/number-control-styles.js +36 -6
  78. package/build/number-control/styles/number-control-styles.js.map +1 -1
  79. package/build/popover/index.js +15 -29
  80. package/build/popover/index.js.map +1 -1
  81. package/build/radio-group/index.js +7 -1
  82. package/build/radio-group/index.js.map +1 -1
  83. package/build/{radio → radio-group/radio}/index.js +7 -1
  84. package/build/radio-group/radio/index.js.map +1 -0
  85. package/build/{radio-context → radio-group/radio-context}/index.js +0 -0
  86. package/build/radio-group/radio-context/index.js.map +1 -0
  87. package/build/slot-fill/bubbles-virtually/fill.js +9 -5
  88. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  89. package/build/slot-fill/bubbles-virtually/slot.js +13 -8
  90. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  91. package/build/slot-fill/bubbles-virtually/use-slot.js +15 -9
  92. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  93. package/build/slot-fill/fill.js +12 -4
  94. package/build/slot-fill/fill.js.map +1 -1
  95. package/build/slot-fill/use-slot.js +3 -1
  96. package/build/slot-fill/use-slot.js.map +1 -1
  97. package/build/snackbar/index.js +1 -1
  98. package/build/snackbar/index.js.map +1 -1
  99. package/build/tab-panel/index.js +2 -6
  100. package/build/tab-panel/index.js.map +1 -1
  101. package/build/text-control/index.js +0 -2
  102. package/build/text-control/index.js.map +1 -1
  103. package/build/toggle-control/index.js +15 -3
  104. package/build/toggle-control/index.js.map +1 -1
  105. package/build/toggle-group-control/toggle-group-control/as-button-group.js +90 -0
  106. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
  107. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +90 -0
  108. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
  109. package/build/toggle-group-control/toggle-group-control/component.js +21 -50
  110. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  111. package/build/toggle-group-control/toggle-group-control/styles.js +8 -8
  112. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  113. package/build/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
  114. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  115. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +23 -23
  116. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  117. package/build/toolbar-dropdown-menu/index.js +1 -1
  118. package/build/toolbar-dropdown-menu/index.js.map +1 -1
  119. package/build/ui/context/context-system-provider.js +9 -22
  120. package/build/ui/context/context-system-provider.js.map +1 -1
  121. package/build/unit-control/index.js +7 -9
  122. package/build/unit-control/index.js.map +1 -1
  123. package/build/unit-control/styles/unit-control-styles.js +15 -25
  124. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  125. package/build/utils/config-values.js +0 -1
  126. package/build/utils/config-values.js.map +1 -1
  127. package/build/utils/hooks/use-update-effect.js +5 -1
  128. package/build/utils/hooks/use-update-effect.js.map +1 -1
  129. package/build-module/angle-picker-control/index.js +1 -1
  130. package/build-module/angle-picker-control/index.js.map +1 -1
  131. package/build-module/autocomplete/autocompleter-ui.js +29 -3
  132. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  133. package/build-module/border-box-control/border-box-control/component.js +61 -13
  134. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  135. package/build-module/border-box-control/border-box-control/hook.js +7 -3
  136. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  137. package/build-module/border-box-control/border-box-control-linked-button/hook.js +3 -3
  138. package/build-module/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  139. package/build-module/border-box-control/border-box-control-split-controls/component.js +3 -3
  140. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  141. package/build-module/border-box-control/border-box-control-split-controls/hook.js +9 -10
  142. package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  143. package/build-module/border-box-control/border-box-control-visualizer/hook.js +4 -6
  144. package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  145. package/build-module/border-box-control/styles.js +26 -28
  146. package/build-module/border-box-control/styles.js.map +1 -1
  147. package/build-module/border-control/border-control/component.js +5 -4
  148. package/build-module/border-control/border-control/component.js.map +1 -1
  149. package/build-module/border-control/border-control/hook.js +12 -5
  150. package/build-module/border-control/border-control/hook.js.map +1 -1
  151. package/build-module/border-control/border-control-dropdown/hook.js +5 -5
  152. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  153. package/build-module/border-control/styles.js +20 -36
  154. package/build-module/border-control/styles.js.map +1 -1
  155. package/build-module/box-control/index.js +6 -2
  156. package/build-module/box-control/index.js.map +1 -1
  157. package/build-module/circular-option-picker/index.js +14 -14
  158. package/build-module/circular-option-picker/index.js.map +1 -1
  159. package/build-module/color-palette/index.js +81 -28
  160. package/build-module/color-palette/index.js.map +1 -1
  161. package/build-module/color-palette/styles.js +3 -3
  162. package/build-module/color-palette/styles.js.map +1 -1
  163. package/build-module/color-palette/types.js +2 -0
  164. package/build-module/color-palette/types.js.map +1 -0
  165. package/build-module/color-picker/input-with-slider.js +1 -1
  166. package/build-module/color-picker/input-with-slider.js.map +1 -1
  167. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  168. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  169. package/build-module/custom-select-control/index.js +8 -4
  170. package/build-module/custom-select-control/index.js.map +1 -1
  171. package/build-module/date-time/date-time/index.js +2 -0
  172. package/build-module/date-time/date-time/index.js.map +1 -1
  173. package/build-module/date-time/time/index.js +4 -4
  174. package/build-module/date-time/time/index.js.map +1 -1
  175. package/build-module/disabled/index.js +8 -1
  176. package/build-module/disabled/index.js.map +1 -1
  177. package/build-module/external-link/index.js +13 -2
  178. package/build-module/external-link/index.js.map +1 -1
  179. package/build-module/focusable-iframe/index.js +0 -1
  180. package/build-module/focusable-iframe/index.js.map +1 -1
  181. package/build-module/font-size-picker/index.js +65 -50
  182. package/build-module/font-size-picker/index.js.map +1 -1
  183. package/build-module/font-size-picker/utils.js +0 -19
  184. package/build-module/font-size-picker/utils.js.map +1 -1
  185. package/build-module/form-file-upload/index.js.map +1 -1
  186. package/build-module/higher-order/with-filters/index.js +1 -6
  187. package/build-module/higher-order/with-filters/index.js.map +1 -1
  188. package/build-module/index.js +2 -2
  189. package/build-module/index.js.map +1 -1
  190. package/build-module/input-control/index.js +2 -0
  191. package/build-module/input-control/index.js.map +1 -1
  192. package/build-module/input-control/input-base.js +1 -1
  193. package/build-module/input-control/input-base.js.map +1 -1
  194. package/build-module/input-control/styles/input-control-styles.js +21 -21
  195. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  196. package/build-module/isolated-event-container/index.js +7 -9
  197. package/build-module/isolated-event-container/index.js.map +1 -1
  198. package/build-module/item-group/styles.js +10 -10
  199. package/build-module/item-group/styles.js.map +1 -1
  200. package/build-module/navigator/navigator-screen/component.js +20 -4
  201. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  202. package/build-module/number-control/index.js +81 -26
  203. package/build-module/number-control/index.js.map +1 -1
  204. package/build-module/number-control/styles/number-control-styles.js +30 -4
  205. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  206. package/build-module/popover/index.js +15 -29
  207. package/build-module/popover/index.js.map +1 -1
  208. package/build-module/radio-group/index.js +6 -1
  209. package/build-module/radio-group/index.js.map +1 -1
  210. package/build-module/{radio → radio-group/radio}/index.js +6 -1
  211. package/build-module/radio-group/radio/index.js.map +1 -0
  212. package/build-module/{radio-context → radio-group/radio-context}/index.js +0 -0
  213. package/build-module/radio-group/radio-context/index.js.map +1 -0
  214. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -5
  215. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  216. package/build-module/slot-fill/bubbles-virtually/slot.js +13 -8
  217. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  218. package/build-module/slot-fill/bubbles-virtually/use-slot.js +15 -9
  219. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  220. package/build-module/slot-fill/fill.js +12 -4
  221. package/build-module/slot-fill/fill.js.map +1 -1
  222. package/build-module/slot-fill/use-slot.js +3 -1
  223. package/build-module/slot-fill/use-slot.js.map +1 -1
  224. package/build-module/snackbar/index.js +1 -1
  225. package/build-module/snackbar/index.js.map +1 -1
  226. package/build-module/tab-panel/index.js +2 -6
  227. package/build-module/tab-panel/index.js.map +1 -1
  228. package/build-module/text-control/index.js +0 -2
  229. package/build-module/text-control/index.js.map +1 -1
  230. package/build-module/toggle-control/index.js +15 -3
  231. package/build-module/toggle-control/index.js.map +1 -1
  232. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js +76 -0
  233. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -0
  234. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +75 -0
  235. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -0
  236. package/build-module/toggle-group-control/toggle-group-control/component.js +19 -49
  237. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  238. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -6
  239. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  240. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +39 -17
  241. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  242. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +21 -18
  243. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  244. package/build-module/toolbar-dropdown-menu/index.js +1 -1
  245. package/build-module/toolbar-dropdown-menu/index.js.map +1 -1
  246. package/build-module/ui/context/context-system-provider.js +6 -20
  247. package/build-module/ui/context/context-system-provider.js.map +1 -1
  248. package/build-module/unit-control/index.js +8 -10
  249. package/build-module/unit-control/index.js.map +1 -1
  250. package/build-module/unit-control/styles/unit-control-styles.js +8 -24
  251. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  252. package/build-module/utils/config-values.js +0 -1
  253. package/build-module/utils/config-values.js.map +1 -1
  254. package/build-module/utils/hooks/use-update-effect.js +5 -1
  255. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  256. package/build-style/style-rtl.css +21 -41
  257. package/build-style/style.css +19 -39
  258. package/build-types/base-field/hook.d.ts +11 -11
  259. package/build-types/border-box-control/border-box-control/component.d.ts +53 -4
  260. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  261. package/build-types/border-box-control/border-box-control/hook.d.ts +13 -12
  262. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  263. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +12 -12
  264. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  265. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +1 -1
  266. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  267. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +12 -12
  268. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  269. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +12 -12
  270. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  271. package/build-types/border-box-control/stories/index.d.ts +17 -0
  272. package/build-types/border-box-control/stories/index.d.ts.map +1 -0
  273. package/build-types/border-box-control/styles.d.ts +7 -6
  274. package/build-types/border-box-control/styles.d.ts.map +1 -1
  275. package/build-types/border-box-control/types.d.ts +12 -16
  276. package/build-types/border-box-control/types.d.ts.map +1 -1
  277. package/build-types/border-control/border-control/component.d.ts +1 -1
  278. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  279. package/build-types/border-control/border-control/hook.d.ts +13 -13
  280. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  281. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -1
  282. package/build-types/border-control/border-control-dropdown/hook.d.ts +11 -11
  283. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  284. package/build-types/border-control/border-control-style-picker/hook.d.ts +11 -11
  285. package/build-types/border-control/stories/index.d.ts +6 -6
  286. package/build-types/border-control/stories/index.d.ts.map +1 -1
  287. package/build-types/border-control/styles.d.ts +3 -3
  288. package/build-types/border-control/styles.d.ts.map +1 -1
  289. package/build-types/border-control/types.d.ts +7 -9
  290. package/build-types/border-control/types.d.ts.map +1 -1
  291. package/build-types/card/card/hook.d.ts +12 -12
  292. package/build-types/card/card-body/hook.d.ts +12 -12
  293. package/build-types/card/card-divider/hook.d.ts +13 -13
  294. package/build-types/card/card-footer/hook.d.ts +12 -12
  295. package/build-types/card/card-header/hook.d.ts +12 -12
  296. package/build-types/card/card-media/hook.d.ts +12 -12
  297. package/build-types/card/stories/index.d.ts.map +1 -1
  298. package/build-types/circular-option-picker/index.d.ts +4 -24
  299. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  300. package/build-types/color-palette/index.d.ts +33 -18
  301. package/build-types/color-palette/index.d.ts.map +1 -1
  302. package/build-types/color-palette/stories/index.d.ts +21 -0
  303. package/build-types/color-palette/stories/index.d.ts.map +1 -0
  304. package/build-types/color-palette/styles.d.ts +3 -2
  305. package/build-types/color-palette/styles.d.ts.map +1 -1
  306. package/build-types/color-palette/test/index.d.ts +2 -0
  307. package/build-types/color-palette/test/index.d.ts.map +1 -0
  308. package/build-types/color-palette/types.d.ts +86 -0
  309. package/build-types/color-palette/types.d.ts.map +1 -0
  310. package/build-types/color-picker/styles.d.ts +5 -4
  311. package/build-types/color-picker/styles.d.ts.map +1 -1
  312. package/build-types/confirm-dialog/component.d.ts +4 -4
  313. package/build-types/custom-select-control/index.d.ts +1 -12
  314. package/build-types/custom-select-control/index.d.ts.map +1 -1
  315. package/build-types/custom-select-control/styles.d.ts +3 -1
  316. package/build-types/custom-select-control/styles.d.ts.map +1 -1
  317. package/build-types/date-time/date/styles.d.ts +3 -3
  318. package/build-types/date-time/date-time/index.d.ts +2 -0
  319. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  320. package/build-types/date-time/date-time/styles.d.ts +3 -3
  321. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  322. package/build-types/date-time/time/styles.d.ts +8 -4
  323. package/build-types/date-time/time/styles.d.ts.map +1 -1
  324. package/build-types/disabled/index.d.ts +8 -1
  325. package/build-types/disabled/index.d.ts.map +1 -1
  326. package/build-types/elevation/hook.d.ts +12 -12
  327. package/build-types/external-link/index.d.ts.map +1 -1
  328. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  329. package/build-types/external-link/test/index.d.ts +2 -0
  330. package/build-types/external-link/test/index.d.ts.map +1 -0
  331. package/build-types/flex/flex/hook.d.ts +12 -12
  332. package/build-types/flex/flex-block/hook.d.ts +12 -12
  333. package/build-types/flex/flex-item/hook.d.ts +12 -12
  334. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -2
  335. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +3 -3
  336. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  337. package/build-types/font-size-picker/index.d.ts.map +1 -1
  338. package/build-types/font-size-picker/types.d.ts +1 -1
  339. package/build-types/font-size-picker/utils.d.ts +0 -8
  340. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  341. package/build-types/form-file-upload/index.d.ts.map +1 -1
  342. package/build-types/form-file-upload/types.d.ts +5 -4
  343. package/build-types/form-file-upload/types.d.ts.map +1 -1
  344. package/build-types/grid/hook.d.ts +12 -12
  345. package/build-types/h-stack/component.d.ts +1 -1
  346. package/build-types/h-stack/hook.d.ts +12 -12
  347. package/build-types/heading/hook.d.ts +12 -12
  348. package/build-types/input-control/index.d.ts +1 -1
  349. package/build-types/input-control/index.d.ts.map +1 -1
  350. package/build-types/input-control/input-base.d.ts +5 -2
  351. package/build-types/input-control/input-base.d.ts.map +1 -1
  352. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  353. package/build-types/input-control/types.d.ts +3 -8
  354. package/build-types/input-control/types.d.ts.map +1 -1
  355. package/build-types/input-control/utils.d.ts +1 -1
  356. package/build-types/isolated-event-container/index.d.ts +3 -2
  357. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  358. package/build-types/item-group/item/hook.d.ts +13 -13
  359. package/build-types/item-group/item-group/hook.d.ts +13 -13
  360. package/build-types/navigator/navigator-back-button/hook.d.ts +13 -13
  361. package/build-types/navigator/navigator-button/hook.d.ts +13 -13
  362. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  363. package/build-types/number-control/index.d.ts +2 -4
  364. package/build-types/number-control/index.d.ts.map +1 -1
  365. package/build-types/number-control/styles/number-control-styles.d.ts +5 -0
  366. package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
  367. package/build-types/number-control/types.d.ts +12 -0
  368. package/build-types/number-control/types.d.ts.map +1 -1
  369. package/build-types/popover/index.d.ts +1 -1
  370. package/build-types/popover/index.d.ts.map +1 -1
  371. package/build-types/popover/stories/e2e/index.d.ts +1 -1
  372. package/build-types/popover/stories/index.d.ts +2 -0
  373. package/build-types/popover/stories/index.d.ts.map +1 -1
  374. package/build-types/popover/types.d.ts +18 -14
  375. package/build-types/popover/types.d.ts.map +1 -1
  376. package/build-types/radio-group/index.d.ts +10 -0
  377. package/build-types/radio-group/index.d.ts.map +1 -0
  378. package/build-types/radio-group/radio/index.d.ts +7 -0
  379. package/build-types/radio-group/radio/index.d.ts.map +1 -0
  380. package/build-types/{radio-context → radio-group/radio-context}/index.d.ts +0 -0
  381. package/build-types/radio-group/radio-context/index.d.ts.map +1 -0
  382. package/build-types/range-control/index.d.ts +1 -1
  383. package/build-types/range-control/styles/range-control-styles.d.ts +2 -1
  384. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  385. package/build-types/resizable-box/index.d.ts +1 -1
  386. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  387. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  388. package/build-types/scrollable/hook.d.ts +12 -12
  389. package/build-types/search-control/index.d.ts +2 -2
  390. package/build-types/search-control/stories/index.d.ts +4 -4
  391. package/build-types/select-control/stories/index.d.ts.map +1 -1
  392. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  393. package/build-types/slot-fill/fill.d.ts.map +1 -1
  394. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  395. package/build-types/spacer/hook.d.ts +12 -12
  396. package/build-types/spinner/index.d.ts +1 -1
  397. package/build-types/surface/hook.d.ts +12 -12
  398. package/build-types/tab-panel/index.d.ts.map +1 -1
  399. package/build-types/text/hook.d.ts +12 -12
  400. package/build-types/text-control/index.d.ts +2 -4
  401. package/build-types/text-control/index.d.ts.map +1 -1
  402. package/build-types/text-control/stories/index.d.ts.map +1 -1
  403. package/build-types/toggle-control/index.d.ts.map +1 -1
  404. package/build-types/toggle-control/types.d.ts +2 -1
  405. package/build-types/toggle-control/types.d.ts.map +1 -1
  406. package/build-types/toggle-group-control/stories/index.d.ts +2 -2
  407. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
  408. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +6 -0
  409. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -0
  410. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +6 -0
  411. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -0
  412. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -2
  413. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  414. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +2 -2
  415. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  416. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  417. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -7
  418. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  419. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  420. package/build-types/toggle-group-control/types.d.ts +19 -14
  421. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  422. package/build-types/tools-panel/tools-panel/hook.d.ts +12 -12
  423. package/build-types/tools-panel/tools-panel-header/hook.d.ts +12 -12
  424. package/build-types/tools-panel/tools-panel-item/hook.d.ts +12 -12
  425. package/build-types/truncate/hook.d.ts +12 -12
  426. package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
  427. package/build-types/ui/control-group/hook.d.ts +12 -12
  428. package/build-types/ui/control-label/component.d.ts +1 -1
  429. package/build-types/ui/control-label/hook.d.ts +12 -12
  430. package/build-types/ui/form-group/form-group.d.ts +4 -4
  431. package/build-types/ui/form-group/use-form-group.d.ts +28 -28
  432. package/build-types/unit-control/index.d.ts +2 -2
  433. package/build-types/unit-control/index.d.ts.map +1 -1
  434. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -5
  435. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  436. package/build-types/unit-control/types.d.ts +3 -3
  437. package/build-types/unit-control/types.d.ts.map +1 -1
  438. package/build-types/utils/config-values.d.ts +0 -1
  439. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  440. package/build-types/utils/types.d.ts +0 -14
  441. package/build-types/utils/types.d.ts.map +1 -1
  442. package/build-types/v-stack/component.d.ts +2 -2
  443. package/build-types/v-stack/hook.d.ts +12 -12
  444. package/build-types/v-stack/stories/index.d.ts +2 -2
  445. package/package.json +17 -17
  446. package/src/angle-picker-control/index.js +1 -1
  447. package/src/angle-picker-control/stories/index.js +3 -0
  448. package/src/autocomplete/autocompleter-ui.js +29 -2
  449. package/src/autocomplete/test/index.js +89 -0
  450. package/src/border-box-control/border-box-control/README.md +8 -0
  451. package/src/border-box-control/border-box-control/component.tsx +64 -13
  452. package/src/border-box-control/border-box-control/hook.ts +7 -2
  453. package/src/border-box-control/border-box-control-linked-button/hook.ts +3 -6
  454. package/src/border-box-control/border-box-control-split-controls/component.tsx +3 -6
  455. package/src/border-box-control/border-box-control-split-controls/hook.ts +11 -14
  456. package/src/border-box-control/border-box-control-visualizer/hook.ts +4 -7
  457. package/src/border-box-control/stories/index.tsx +90 -0
  458. package/src/border-box-control/styles.ts +28 -22
  459. package/src/border-box-control/test/index.js +287 -122
  460. package/src/border-box-control/types.ts +12 -16
  461. package/src/border-control/border-control/README.md +8 -0
  462. package/src/border-control/border-control/component.tsx +4 -3
  463. package/src/border-control/border-control/hook.ts +10 -6
  464. package/src/border-control/border-control-dropdown/hook.ts +5 -7
  465. package/src/border-control/stories/index.tsx +12 -14
  466. package/src/border-control/styles.ts +20 -23
  467. package/src/border-control/test/index.js +139 -96
  468. package/src/border-control/types.ts +7 -9
  469. package/src/box-control/README.md +14 -0
  470. package/src/box-control/index.js +4 -0
  471. package/src/box-control/stories/index.js +8 -27
  472. package/src/button/README.md +2 -15
  473. package/src/button/stories/index.js +109 -178
  474. package/src/button/style.scss +17 -54
  475. package/src/card/stories/index.tsx +27 -31
  476. package/src/card/test/__snapshots__/index.tsx.snap +36 -35
  477. package/src/card/test/index.tsx +2 -6
  478. package/src/circular-option-picker/index.js +14 -20
  479. package/src/color-palette/README.md +51 -49
  480. package/src/color-palette/{index.js → index.tsx} +132 -51
  481. package/src/color-palette/stories/{index.js → index.tsx} +38 -27
  482. package/src/color-palette/style.scss +2 -2
  483. package/src/color-palette/{styles.js → styles.ts} +0 -0
  484. package/src/color-palette/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  485. package/src/color-palette/test/{index.js → index.tsx} +1 -1
  486. package/src/color-palette/types.ts +93 -0
  487. package/src/color-picker/input-with-slider.tsx +1 -1
  488. package/src/custom-gradient-picker/gradient-bar/index.js +1 -3
  489. package/src/custom-select-control/README.md +14 -0
  490. package/src/custom-select-control/index.js +22 -15
  491. package/src/date-time/date-time/index.tsx +2 -0
  492. package/src/date-time/stories/date-time.tsx +4 -0
  493. package/src/date-time/time/index.tsx +4 -4
  494. package/src/dimension-control/test/__snapshots__/index.test.js.snap +4 -0
  495. package/src/disabled/README.md +2 -0
  496. package/src/disabled/index.tsx +8 -1
  497. package/src/disabled/test/index.tsx +0 -5
  498. package/src/external-link/index.tsx +14 -6
  499. package/src/external-link/test/index.tsx +106 -0
  500. package/src/focusable-iframe/index.js +0 -1
  501. package/src/font-size-picker/README.md +3 -3
  502. package/src/font-size-picker/index.tsx +152 -142
  503. package/src/font-size-picker/test/index.tsx +447 -174
  504. package/src/font-size-picker/test/utils.ts +1 -45
  505. package/src/font-size-picker/types.ts +1 -1
  506. package/src/font-size-picker/utils.ts +0 -22
  507. package/src/form-file-upload/README.md +1 -3
  508. package/src/form-file-upload/index.tsx +1 -0
  509. package/src/form-file-upload/types.ts +5 -4
  510. package/src/form-toggle/test/__snapshots__/index.tsx.snap +15 -13
  511. package/src/form-toggle/test/index.tsx +1 -1
  512. package/src/h-stack/test/__snapshots__/index.tsx.snap +36 -30
  513. package/src/h-stack/test/index.tsx +3 -3
  514. package/src/higher-order/with-filters/index.js +4 -9
  515. package/src/index.js +2 -1
  516. package/src/input-control/index.tsx +2 -0
  517. package/src/input-control/input-base.tsx +3 -3
  518. package/src/input-control/styles/input-control-styles.tsx +1 -0
  519. package/src/input-control/types.ts +4 -11
  520. package/src/isolated-event-container/index.tsx +32 -0
  521. package/src/item-group/styles.ts +1 -1
  522. package/src/item-group/test/__snapshots__/index.js.snap +90 -85
  523. package/src/item-group/test/index.js +7 -17
  524. package/src/navigator/navigator-screen/component.tsx +20 -3
  525. package/src/number-control/README.md +9 -4
  526. package/src/number-control/index.tsx +100 -33
  527. package/src/number-control/styles/number-control-styles.js +26 -1
  528. package/src/number-control/test/index.js +50 -0
  529. package/src/number-control/types.ts +12 -0
  530. package/src/popover/README.md +12 -7
  531. package/src/popover/index.tsx +20 -30
  532. package/src/popover/stories/index.tsx +29 -1
  533. package/src/popover/style.scss +9 -0
  534. package/src/popover/types.ts +18 -15
  535. package/src/radio-group/README.md +4 -0
  536. package/src/radio-group/index.js +6 -1
  537. package/src/{radio → radio-group/radio}/index.js +6 -1
  538. package/src/{radio-context → radio-group/radio-context}/index.js +0 -0
  539. package/src/radio-group/stories/index.js +11 -2
  540. package/src/sandbox/test/index.js +2 -2
  541. package/src/select-control/stories/index.tsx +9 -4
  542. package/src/slot-fill/bubbles-virtually/fill.js +5 -5
  543. package/src/slot-fill/bubbles-virtually/slot.js +10 -8
  544. package/src/slot-fill/bubbles-virtually/use-slot.js +15 -9
  545. package/src/slot-fill/fill.js +12 -2
  546. package/src/slot-fill/use-slot.js +3 -0
  547. package/src/snackbar/index.js +1 -1
  548. package/src/surface/test/__snapshots__/index.tsx.snap +58 -46
  549. package/src/surface/test/index.tsx +6 -16
  550. package/src/tab-panel/index.tsx +2 -3
  551. package/src/tab-panel/test/index.tsx +78 -1
  552. package/src/text/test/__snapshots__/index.tsx.snap +19 -15
  553. package/src/text/test/index.tsx +2 -2
  554. package/src/text-control/index.tsx +0 -2
  555. package/src/text-control/stories/index.tsx +5 -6
  556. package/src/toggle-control/README.md +6 -4
  557. package/src/toggle-control/index.tsx +13 -2
  558. package/src/toggle-control/types.ts +2 -4
  559. package/src/toggle-group-control/stories/index.tsx +4 -4
  560. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +219 -160
  561. package/src/toggle-group-control/test/index.tsx +129 -2
  562. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +103 -0
  563. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +99 -0
  564. package/src/toggle-group-control/toggle-group-control/component.tsx +29 -74
  565. package/src/toggle-group-control/toggle-group-control/styles.ts +12 -10
  566. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +49 -25
  567. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +39 -19
  568. package/src/toggle-group-control/types.ts +75 -63
  569. package/src/toolbar-dropdown-menu/index.js +1 -1
  570. package/src/tools-panel/stories/index.js +0 -1
  571. package/src/tools-panel/stories/tools-panel-with-item-group-slot.js +0 -1
  572. package/src/tree-grid/test/__snapshots__/cell.js.snap +20 -18
  573. package/src/tree-grid/test/__snapshots__/roving-tab-index.js.snap +3 -1
  574. package/src/tree-grid/test/__snapshots__/row.js.snap +33 -29
  575. package/src/tree-grid/test/cell.js +1 -1
  576. package/src/tree-grid/test/roving-tab-index.js +1 -1
  577. package/src/tree-grid/test/row.js +2 -2
  578. package/src/ui/context/context-system-provider.js +5 -18
  579. package/src/ui/context/test/__snapshots__/context-system-provider.js.snap +23 -17
  580. package/src/ui/context/test/context-system-provider.js +3 -3
  581. package/src/ui/control-group/test/__snapshots__/index.js.snap +18 -16
  582. package/src/ui/control-group/test/index.js +1 -1
  583. package/src/ui/control-label/test/__snapshots__/index.js.snap +27 -21
  584. package/src/ui/control-label/test/index.js +3 -3
  585. package/src/ui/form-group/test/__snapshots__/index.js.snap +34 -30
  586. package/src/ui/form-group/test/index.js +2 -2
  587. package/src/ui/shortcut/test/__snapshots__/index.js.snap +1 -1
  588. package/src/ui/shortcut/test/index.js +1 -1
  589. package/src/ui/spinner/test/__snapshots__/index.js.snap +75 -73
  590. package/src/ui/spinner/test/index.js +3 -7
  591. package/src/unit-control/index.tsx +29 -30
  592. package/src/unit-control/styles/unit-control-styles.ts +6 -12
  593. package/src/unit-control/test/utils.ts +43 -0
  594. package/src/unit-control/types.ts +5 -6
  595. package/src/utils/config-values.js +0 -1
  596. package/src/utils/hooks/use-update-effect.js +5 -1
  597. package/src/utils/types.ts +0 -15
  598. package/src/v-stack/test/__snapshots__/index.tsx.snap +36 -30
  599. package/src/v-stack/test/index.tsx +3 -3
  600. package/src/view/test/__snapshots__/index.js.snap +34 -24
  601. package/src/view/test/index.js +5 -5
  602. package/tsconfig.json +0 -2
  603. package/tsconfig.tsbuildinfo +1 -1
  604. package/build/radio/index.js.map +0 -1
  605. package/build/radio-context/index.js.map +0 -1
  606. package/build-module/radio/index.js.map +0 -1
  607. package/build-module/radio-context/index.js.map +0 -1
  608. package/build-types/radio-context/index.d.ts.map +0 -1
  609. package/src/border-box-control/stories/index.js +0 -106
  610. package/src/form-file-upload/stories/index.js +0 -51
  611. package/src/isolated-event-container/index.js +0 -28
  612. package/src/radio/stories/index.js +0 -20
@@ -15,6 +15,12 @@ var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
16
  var _i18n = require("@wordpress/i18n");
17
17
 
18
+ var _icons = require("@wordpress/icons");
19
+
20
+ var _compose = require("@wordpress/compose");
21
+
22
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
23
+
18
24
  var _numberControlStyles = require("./styles/number-control-styles");
19
25
 
20
26
  var inputControlActionTypes = _interopRequireWildcard(require("../input-control/reducer/actions"));
@@ -23,6 +29,10 @@ var _math = require("../utils/math");
23
29
 
24
30
  var _values = require("../utils/values");
25
31
 
32
+ var _hStack = require("../h-stack");
33
+
34
+ var _spacer = require("../spacer");
35
+
26
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
27
37
 
28
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -38,12 +48,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
38
48
  /**
39
49
  * Internal dependencies
40
50
  */
41
- function UnforwardedNumberControl(_ref, ref) {
51
+ const noop = () => {};
52
+
53
+ function UnforwardedNumberControl(_ref, forwardedRef) {
42
54
  let {
43
55
  __unstableStateReducer: stateReducerProp,
44
56
  className,
45
57
  dragDirection = 'n',
46
58
  hideHTMLArrows = false,
59
+ spinControls = 'native',
47
60
  isDragEnabled = true,
48
61
  isShiftStepEnabled = true,
49
62
  label,
@@ -54,8 +67,23 @@ function UnforwardedNumberControl(_ref, ref) {
54
67
  step = 1,
55
68
  type: typeProp = 'number',
56
69
  value: valueProp,
70
+ size = 'default',
71
+ suffix,
72
+ onChange = noop,
57
73
  ...props
58
74
  } = _ref;
75
+
76
+ if (hideHTMLArrows) {
77
+ (0, _deprecated.default)('hideHTMLArrows', {
78
+ alternative: 'spinControls="none"',
79
+ since: '6.2',
80
+ version: '6.3'
81
+ });
82
+ spinControls = 'none';
83
+ }
84
+
85
+ const inputRef = (0, _element.useRef)();
86
+ const mergedRef = (0, _compose.useMergeRefs)([inputRef, forwardedRef]);
59
87
  const isStepAny = step === 'any';
60
88
  const baseStep = isStepAny ? 1 : (0, _values.ensureNumber)(step);
61
89
  const baseValue = (0, _math.roundClamp)(0, min, max, baseStep);
@@ -67,6 +95,21 @@ function UnforwardedNumberControl(_ref, ref) {
67
95
 
68
96
  const autoComplete = typeProp === 'number' ? 'off' : undefined;
69
97
  const classes = (0, _classnames.default)('components-number-control', className);
98
+
99
+ const spinValue = (value, direction, event) => {
100
+ event === null || event === void 0 ? void 0 : event.preventDefault();
101
+ const shift = (event === null || event === void 0 ? void 0 : event.shiftKey) && isShiftStepEnabled;
102
+ const delta = shift ? (0, _values.ensureNumber)(shiftStep) * baseStep : baseStep;
103
+ let nextValue = (0, _values.isValueEmpty)(value) ? baseValue : value;
104
+
105
+ if (direction === 'up') {
106
+ nextValue = (0, _math.add)(nextValue, delta);
107
+ } else if (direction === 'down') {
108
+ nextValue = (0, _math.subtract)(nextValue, delta);
109
+ }
110
+
111
+ return constrainValue(nextValue, shift ? delta : undefined);
112
+ };
70
113
  /**
71
114
  * "Middleware" function that intercepts updates from InputControl.
72
115
  * This allows us to tap into actions to transform the (next) state for
@@ -75,6 +118,7 @@ function UnforwardedNumberControl(_ref, ref) {
75
118
  * @return The updated state to apply to InputControl
76
119
  */
77
120
 
121
+
78
122
  const numberControlStateReducer = (state, action) => {
79
123
  const nextState = { ...state
80
124
  };
@@ -89,24 +133,8 @@ function UnforwardedNumberControl(_ref, ref) {
89
133
  */
90
134
 
91
135
  if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {
92
- const enableShift = (event === null || event === void 0 ? void 0 : event.shiftKey) && isShiftStepEnabled;
93
- const incrementalValue = enableShift ? (0, _values.ensureNumber)(shiftStep) * baseStep : baseStep;
94
- let nextValue = (0, _values.isValueEmpty)(currentValue) ? baseValue : currentValue;
95
-
96
- if (event !== null && event !== void 0 && event.preventDefault) {
97
- event.preventDefault();
98
- }
99
-
100
- if (type === inputControlActionTypes.PRESS_UP) {
101
- nextValue = (0, _math.add)(nextValue, incrementalValue);
102
- }
103
-
104
- if (type === inputControlActionTypes.PRESS_DOWN) {
105
- nextValue = (0, _math.subtract)(nextValue, incrementalValue);
106
- } // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
107
-
108
-
109
- nextState.value = constrainValue(nextValue, enableShift ? incrementalValue : undefined);
136
+ // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
137
+ nextState.value = spinValue(currentValue, type === inputControlActionTypes.PRESS_UP ? 'up' : 'down', event);
110
138
  }
111
139
  /**
112
140
  * Handles drag to update events
@@ -167,18 +195,26 @@ function UnforwardedNumberControl(_ref, ref) {
167
195
  return nextState;
168
196
  };
169
197
 
198
+ const buildSpinButtonClickHandler = direction => event => onChange(String(spinValue(valueProp, direction, event)), {
199
+ // Set event.target to the <input> so that consumers can use
200
+ // e.g. event.target.validity.
201
+ event: { ...event,
202
+ target: inputRef.current
203
+ }
204
+ });
205
+
170
206
  return (0, _element.createElement)(_numberControlStyles.Input, (0, _extends2.default)({
171
207
  autoComplete: autoComplete,
172
208
  inputMode: "numeric"
173
209
  }, props, {
174
210
  className: classes,
175
211
  dragDirection: dragDirection,
176
- hideHTMLArrows: hideHTMLArrows,
212
+ hideHTMLArrows: spinControls !== 'native',
177
213
  isDragEnabled: isDragEnabled,
178
214
  label: label,
179
215
  max: max,
180
216
  min: min,
181
- ref: ref,
217
+ ref: mergedRef,
182
218
  required: required,
183
219
  step: step,
184
220
  type: typeProp // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
@@ -189,7 +225,31 @@ function UnforwardedNumberControl(_ref, ref) {
189
225
 
190
226
  const baseState = numberControlStateReducer(state, action);
191
227
  return (_stateReducerProp = stateReducerProp === null || stateReducerProp === void 0 ? void 0 : stateReducerProp(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;
192
- }
228
+ },
229
+ size: size,
230
+ suffix: spinControls === 'custom' ? (0, _element.createElement)(_element.Fragment, null, suffix, (0, _element.createElement)(_spacer.Spacer, {
231
+ marginBottom: 0,
232
+ marginRight: 2
233
+ }, (0, _element.createElement)(_hStack.HStack, {
234
+ spacing: 1
235
+ }, (0, _element.createElement)(_numberControlStyles.SpinButton, {
236
+ icon: _icons.plus,
237
+ isSmall: true,
238
+ "aria-hidden": "true",
239
+ "aria-label": (0, _i18n.__)('Increment'),
240
+ tabIndex: -1,
241
+ onClick: buildSpinButtonClickHandler('up'),
242
+ size: size
243
+ }), (0, _element.createElement)(_numberControlStyles.SpinButton, {
244
+ icon: _icons.reset,
245
+ isSmall: true,
246
+ "aria-hidden": "true",
247
+ "aria-label": (0, _i18n.__)('Decrement'),
248
+ tabIndex: -1,
249
+ onClick: buildSpinButtonClickHandler('down'),
250
+ size: size
251
+ })))) : suffix,
252
+ onChange: onChange
193
253
  }));
194
254
  }
195
255
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/number-control/index.tsx"],"names":["UnforwardedNumberControl","ref","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","props","isStepAny","baseStep","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","numberControlStateReducer","state","action","nextState","payload","event","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","enableShift","shiftKey","incrementalValue","nextValue","preventDefault","DRAG","x","y","delta","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","baseState","NumberControl"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;;;;;AAlBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AAQA,SAASA,wBAAT,OAkBCC,GAlBD,EAmBE;AAAA,MAlBD;AACCC,IAAAA,sBAAsB,EAAEC,gBADzB;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,aAAa,GAAG,IALjB;AAMCC,IAAAA,kBAAkB,GAAG,IANtB;AAOCC,IAAAA,KAPD;AAQCC,IAAAA,GAAG,GAAGC,QARP;AASCC,IAAAA,GAAG,GAAG,CAACD,QATR;AAUCE,IAAAA,QAAQ,GAAG,KAVZ;AAWCC,IAAAA,SAAS,GAAG,EAXb;AAYCC,IAAAA,IAAI,GAAG,CAZR;AAaCC,IAAAA,IAAI,EAAEC,QAAQ,GAAG,QAblB;AAcCC,IAAAA,KAAK,EAAEC,SAdR;AAeC,OAAGC;AAfJ,GAkBC;AACD,QAAMC,SAAS,GAAGN,IAAI,KAAK,KAA3B;AACA,QAAMO,QAAQ,GAAGD,SAAS,GAAG,CAAH,GAAO,0BAAcN,IAAd,CAAjC;AACA,QAAMQ,SAAS,GAAG,sBAAY,CAAZ,EAAeX,GAAf,EAAoBF,GAApB,EAAyBY,QAAzB,CAAlB;;AACA,QAAME,cAAc,GAAG,CACtBN,KADsB,E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G,CAAEY,KAAF,EAASC,MAAT,KAAqB;AAAA;;AAC7C,YAAM0B,SAAS,GAAG5B,yBAAyB,CAAEC,KAAF,EAASC,MAAT,CAA3C;AACA,kCAAO7B,gBAAP,aAAOA,gBAAP,uBAAOA,gBAAgB,CAAIuD,SAAJ,EAAe1B,MAAf,CAAvB,iEAAkD0B,SAAlD;AACA;AApBF,KADD;AAwBA;;AAEM,MAAMC,aAAa,GAAG,yBAAY3D,wBAAZ,CAAtB;;eAEQ2D,a","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Input } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { NumberControlProps } from './types';\n\nfunction UnforwardedNumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\t...props\n\t}: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tref: ForwardedRef< any >\n) {\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = classNames( 'components-number-control', className );\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\tconst enableShift =\n\t\t\t\t\t( event as KeyboardEvent | undefined )?.shiftKey &&\n\t\t\t\t\tisShiftStepEnabled;\n\n\t\t\t\tconst incrementalValue = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseStep\n\t\t\t\t\t: baseStep;\n\t\t\t\tlet nextValue = isValueEmpty( currentValue )\n\t\t\t\t\t? baseValue\n\t\t\t\t\t: currentValue;\n\n\t\t\t\tif ( event?.preventDefault ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\n\t\t\t\tif ( type === inputControlActionTypes.PRESS_UP ) {\n\t\t\t\t\tnextValue = add( nextValue, incrementalValue );\n\t\t\t\t}\n\n\t\t\t\tif ( type === inputControlActionTypes.PRESS_DOWN ) {\n\t\t\t\t\tnextValue = subtract( nextValue, incrementalValue );\n\t\t\t\t}\n\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\tnextValue,\n\t\t\t\t\tenableShift ? incrementalValue : undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\t// @ts-expect-error TODO: See if reducer actions can be typed better\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\t// @ts-expect-error TODO: See if reducer actions can be typed better\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseStep\n\t\t\t\t\t: baseStep;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ hideHTMLArrows }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ ref }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/number-control/index.tsx"],"names":["noop","UnforwardedNumberControl","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","type","typeProp","value","valueProp","size","suffix","onChange","props","alternative","since","version","inputRef","mergedRef","isStepAny","baseStep","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","numberControlStateReducer","state","action","nextState","payload","currentValue","inputControlActionTypes","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","baseState","plusIcon","resetIcon","NumberControl"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AAUA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,wBAAT,OAsBCC,YAtBD,EAuBE;AAAA,MAtBD;AACCC,IAAAA,sBAAsB,EAAEC,gBADzB;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,GAHjB;AAICC,IAAAA,cAAc,GAAG,KAJlB;AAKCC,IAAAA,YAAY,GAAG,QALhB;AAMCC,IAAAA,aAAa,GAAG,IANjB;AAOCC,IAAAA,kBAAkB,GAAG,IAPtB;AAQCC,IAAAA,KARD;AASCC,IAAAA,GAAG,GAAGC,QATP;AAUCC,IAAAA,GAAG,GAAG,CAACD,QAVR;AAWCE,IAAAA,QAAQ,GAAG,KAXZ;AAYCC,IAAAA,SAAS,GAAG,EAZb;AAaCC,IAAAA,IAAI,GAAG,CAbR;AAcCC,IAAAA,IAAI,EAAEC,QAAQ,GAAG,QAdlB;AAeCC,IAAAA,KAAK,EAAEC,SAfR;AAgBCC,IAAAA,IAAI,GAAG,SAhBR;AAiBCC,IAAAA,MAjBD;AAkBCC,IAAAA,QAAQ,GAAGxB,IAlBZ;AAmBC,OAAGyB;AAnBJ,GAsBC;;AACD,MAAKlB,cAAL,EAAsB;AACrB,6BAAY,gBAA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AAA,IAAI,EAAGpD,IArBR;AAsBC,IAAA,MAAM,EACLd,YAAY,KAAK,QAAjB,GACC,qDACGe,MADH,EAEC,4BAAC,cAAD;AAAQ,MAAA,YAAY,EAAG,CAAvB;AAA2B,MAAA,WAAW,EAAG;AAAzC,OACC,4BAAC,cAAD;AAAQ,MAAA,OAAO,EAAG;AAAlB,OACC,4BAAC,+BAAD;AACC,MAAA,IAAI,EAAGoD,WADR;AAEC,MAAA,OAAO,MAFR;AAGC,qBAAY,MAHb;AAIC,oBAAa,cAAI,WAAJ,CAJd;AAKC,MAAA,QAAQ,EAAG,CAAC,CALb;AAMC,MAAA,OAAO,EAAGL,2BAA2B,CACpC,IADoC,CANtC;AASC,MAAA,IAAI,EAAGhD;AATR,MADD,EAYC,4BAAC,+BAAD;AACC,MAAA,IAAI,EAAGsD,YADR;AAEC,MAAA,OAAO,MAFR;AAGC,qBAAY,MAHb;AAIC,oBAAa,cAAI,WAAJ,CAJd;AAKC,MAAA,QAAQ,EAAG,CAAC,CALb;AAMC,MAAA,OAAO,EAAGN,2BAA2B,CACpC,MADoC,CANtC;AASC,MAAA,IAAI,EAAGhD;AATR,MAZD,CADD,CAFD,CADD,GA+BCC,MAtDH;AAyDC,IAAA,QAAQ,EAAGC;AAzDZ,KADD;AA6DA;;AAEM,MAAMqD,aAAa,GAAG,yBAAY5E,wBAAZ,CAAtB;;eAEQ4E,a","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\nimport type { ForwardedRef, KeyboardEvent, MouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, roundClamp } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport type { WordPressComponentProps } from '../ui/context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\t{\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = 'native',\n\t\tisDragEnabled = true,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmax = Infinity,\n\t\tmin = -Infinity,\n\t\trequired = false,\n\t\tshiftStep = 10,\n\t\tstep = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t...props\n\t}: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'hideHTMLArrows', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t\tspinControls = 'none';\n\t}\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst mergedRef = useMergeRefs( [ inputRef, forwardedRef ] );\n\n\tconst isStepAny = step === 'any';\n\tconst baseStep = isStepAny ? 1 : ensureNumber( step );\n\tconst baseValue = roundClamp( 0, min, max, baseStep );\n\tconst constrainValue = (\n\t\tvalue: number | string,\n\t\tstepOverride?: number\n\t) => {\n\t\t// When step is \"any\" clamp the value, otherwise round and clamp it.\n\t\treturn isStepAny\n\t\t\t? Math.min( max, Math.max( min, ensureNumber( value ) ) )\n\t\t\t: roundClamp( value, min, max, stepOverride ?? baseStep );\n\t};\n\n\tconst autoComplete = typeProp === 'number' ? 'off' : undefined;\n\tconst classes = classNames( 'components-number-control', className );\n\n\tconst spinValue = (\n\t\tvalue: string | number | undefined,\n\t\tdirection: 'up' | 'down',\n\t\tevent: KeyboardEvent | MouseEvent | undefined\n\t) => {\n\t\tevent?.preventDefault();\n\t\tconst shift = event?.shiftKey && isShiftStepEnabled;\n\t\tconst delta = shift ? ensureNumber( shiftStep ) * baseStep : baseStep;\n\t\tlet nextValue = isValueEmpty( value ) ? baseValue : value;\n\t\tif ( direction === 'up' ) {\n\t\t\tnextValue = add( nextValue, delta );\n\t\t} else if ( direction === 'down' ) {\n\t\t\tnextValue = subtract( nextValue, delta );\n\t\t}\n\t\treturn constrainValue( nextValue, shift ? delta : undefined );\n\t};\n\n\t/**\n\t * \"Middleware\" function that intercepts updates from InputControl.\n\t * This allows us to tap into actions to transform the (next) state for\n\t * InputControl.\n\t *\n\t * @return The updated state to apply to InputControl\n\t */\n\tconst numberControlStateReducer: NumberControlProps[ '__unstableStateReducer' ] =\n\t\t( state, action ) => {\n\t\t\tconst nextState = { ...state };\n\n\t\t\tconst { type, payload } = action;\n\t\t\tconst event = payload.event;\n\t\t\tconst currentValue = nextState.value;\n\n\t\t\t/**\n\t\t\t * Handles custom UP and DOWN Keyboard events\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_UP ||\n\t\t\t\ttype === inputControlActionTypes.PRESS_DOWN\n\t\t\t) {\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = spinValue(\n\t\t\t\t\tcurrentValue,\n\t\t\t\t\ttype === inputControlActionTypes.PRESS_UP ? 'up' : 'down',\n\t\t\t\t\tevent as KeyboardEvent | undefined\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles drag to update events\n\t\t\t */\n\t\t\tif ( type === inputControlActionTypes.DRAG && isDragEnabled ) {\n\t\t\t\t// @ts-expect-error TODO: See if reducer actions can be typed better\n\t\t\t\tconst [ x, y ] = payload.delta;\n\t\t\t\t// @ts-expect-error TODO: See if reducer actions can be typed better\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseStep\n\t\t\t\t\t: baseStep;\n\n\t\t\t\tlet directionModifier;\n\t\t\t\tlet delta;\n\n\t\t\t\tswitch ( dragDirection ) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = -1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'e':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? -1 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tdelta = y;\n\t\t\t\t\t\tdirectionModifier = 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'w':\n\t\t\t\t\t\tdelta = x;\n\t\t\t\t\t\tdirectionModifier = isRTL() ? 1 : -1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( delta !== 0 ) {\n\t\t\t\t\tdelta = Math.ceil( Math.abs( delta ) ) * Math.sign( delta );\n\t\t\t\t\tconst distance = delta * modifier * directionModifier;\n\n\t\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\t\tnextState.value = constrainValue(\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t\tadd( currentValue, distance ),\n\t\t\t\t\t\tenableShift ? modifier : undefined\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles commit (ENTER key press or blur)\n\t\t\t */\n\t\t\tif (\n\t\t\t\ttype === inputControlActionTypes.PRESS_ENTER ||\n\t\t\t\ttype === inputControlActionTypes.COMMIT\n\t\t\t) {\n\t\t\t\tconst applyEmptyValue =\n\t\t\t\t\trequired === false && currentValue === '';\n\n\t\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\t\tnextState.value = applyEmptyValue\n\t\t\t\t\t? currentValue\n\t\t\t\t\t: // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n\t\t\t\t\t constrainValue( currentValue );\n\t\t\t}\n\n\t\t\treturn nextState;\n\t\t};\n\n\tconst buildSpinButtonClickHandler =\n\t\t( direction: 'up' | 'down' ) =>\n\t\t( event: MouseEvent< HTMLButtonElement > ) =>\n\t\t\tonChange( String( spinValue( valueProp, direction, event ) ), {\n\t\t\t\t// Set event.target to the <input> so that consumers can use\n\t\t\t\t// e.g. event.target.validity.\n\t\t\t\tevent: {\n\t\t\t\t\t...event,\n\t\t\t\t\ttarget: inputRef.current!,\n\t\t\t\t},\n\t\t\t} );\n\n\treturn (\n\t\t<Input\n\t\t\tautoComplete={ autoComplete }\n\t\t\tinputMode=\"numeric\"\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdragDirection={ dragDirection }\n\t\t\thideHTMLArrows={ spinControls !== 'native' }\n\t\t\tisDragEnabled={ isDragEnabled }\n\t\t\tlabel={ label }\n\t\t\tmax={ max }\n\t\t\tmin={ min }\n\t\t\tref={ mergedRef }\n\t\t\trequired={ required }\n\t\t\tstep={ step }\n\t\t\ttype={ typeProp }\n\t\t\t// @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n\t\t\tvalue={ valueProp }\n\t\t\t__unstableStateReducer={ ( state, action ) => {\n\t\t\t\tconst baseState = numberControlStateReducer( state, action );\n\t\t\t\treturn stateReducerProp?.( baseState, action ) ?? baseState;\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t\tsuffix={\n\t\t\t\tspinControls === 'custom' ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ suffix }\n\t\t\t\t\t\t<Spacer marginBottom={ 0 } marginRight={ 2 }>\n\t\t\t\t\t\t\t<HStack spacing={ 1 }>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Increment' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'up'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Decrement' ) }\n\t\t\t\t\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\t\t\t\t\tonClick={ buildSpinButtonClickHandler(\n\t\t\t\t\t\t\t\t\t\t'down'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tsuffix\n\t\t\t\t)\n\t\t\t}\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport const NumberControl = forwardRef( UnforwardedNumberControl );\n\nexport default NumberControl;\n"]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Input = void 0;
8
+ exports.SpinButton = exports.Input = void 0;
9
9
 
10
10
  var _base = _interopRequireDefault(require("@emotion/styled/base"));
11
11
 
@@ -13,6 +13,12 @@ var _react = require("@emotion/react");
13
13
 
14
14
  var _inputControl = _interopRequireDefault(require("../../input-control"));
15
15
 
16
+ var _utils = require("../../utils");
17
+
18
+ var _button = _interopRequireDefault(require("../../button"));
19
+
20
+ var _space = require("../../ui/utils/space");
21
+
16
22
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
17
23
 
18
24
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -21,7 +27,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
21
27
  } : {
22
28
  name: "jl4rev-htmlArrowStyles",
23
29
  styles: "input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;};label:htmlArrowStyles;",
24
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjVyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL251bWJlci1jb250cm9sL3N0eWxlcy9udW1iZXItY29udHJvbC1zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBAdHMtbm9jaGVja1xuLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuLyoqXG4gKiBJbnRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IElucHV0Q29udHJvbCBmcm9tICcuLi8uLi9pbnB1dC1jb250cm9sJztcblxuY29uc3QgaHRtbEFycm93U3R5bGVzID0gKCB7IGhpZGVIVE1MQXJyb3dzIH0gKSA9PiB7XG5cdGlmICggISBoaWRlSFRNTEFycm93cyApIHJldHVybiBgYDtcblxuXHRyZXR1cm4gY3NzYFxuXHRcdGlucHV0W3R5cGU9J251bWJlciddOjotd2Via2l0LW91dGVyLXNwaW4tYnV0dG9uLFxuXHRcdGlucHV0W3R5cGU9J251bWJlciddOjotd2Via2l0LWlubmVyLXNwaW4tYnV0dG9uIHtcblx0XHRcdC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZSAhaW1wb3J0YW50O1xuXHRcdFx0bWFyZ2luOiAwICFpbXBvcnRhbnQ7XG5cdFx0fVxuXG5cdFx0aW5wdXRbdHlwZT0nbnVtYmVyJ10ge1xuXHRcdFx0LW1vei1hcHBlYXJhbmNlOiB0ZXh0ZmllbGQ7XG5cdFx0fVxuXHRgO1xufTtcblxuZXhwb3J0IGNvbnN0IElucHV0ID0gc3R5bGVkKCBJbnB1dENvbnRyb2wgKWBcblx0JHsgaHRtbEFycm93U3R5bGVzIH07XG5gO1xuIl19 */",
30
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQlciLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9udW1iZXItY29udHJvbC9zdHlsZXMvbnVtYmVyLWNvbnRyb2wtc3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQHRzLW5vY2hlY2tcbi8qKlxuICogRXh0ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcblxuLyoqXG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XHRtaW4td2lkdGg6ICR7IHNwYWNlKCA1ICkgfTtcblx0XHRoZWlnaHQ6ICR7IHNwYWNlKCA1ICkgfTtcblx0YDtcbn07XG5cbmV4cG9ydCBjb25zdCBTcGluQnV0dG9uID0gc3R5bGVkKCBCdXR0b24gKWBcblx0JiYmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGhlbWUgfTtcblx0XHQkeyBzcGluQnV0dG9uU2l6ZVN0eWxlcyB9XG5cdH1cbmA7XG4iXX0= */",
25
31
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
32
  };
27
33
 
@@ -29,15 +35,39 @@ const htmlArrowStyles = _ref2 => {
29
35
  let {
30
36
  hideHTMLArrows
31
37
  } = _ref2;
32
- if (!hideHTMLArrows) return ``;
38
+
39
+ if (!hideHTMLArrows) {
40
+ return ``;
41
+ }
42
+
33
43
  return _ref;
34
44
  };
35
45
 
36
46
  const Input = ( /*#__PURE__*/0, _base.default)(_inputControl.default, process.env.NODE_ENV === "production" ? {
37
- target: "ep48uk90"
47
+ target: "ep48uk91"
38
48
  } : {
39
- target: "ep48uk90",
49
+ target: "ep48uk91",
40
50
  label: "Input"
41
- })(htmlArrowStyles, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEyQjJDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIEB0cy1ub2NoZWNrXG4vKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgSW5wdXRDb250cm9sIGZyb20gJy4uLy4uL2lucHV0LWNvbnRyb2wnO1xuXG5jb25zdCBodG1sQXJyb3dTdHlsZXMgPSAoIHsgaGlkZUhUTUxBcnJvd3MgfSApID0+IHtcblx0aWYgKCAhIGhpZGVIVE1MQXJyb3dzICkgcmV0dXJuIGBgO1xuXG5cdHJldHVybiBjc3NgXG5cdFx0aW5wdXRbdHlwZT0nbnVtYmVyJ106Oi13ZWJraXQtb3V0ZXItc3Bpbi1idXR0b24sXG5cdFx0aW5wdXRbdHlwZT0nbnVtYmVyJ106Oi13ZWJraXQtaW5uZXItc3Bpbi1idXR0b24ge1xuXHRcdFx0LXdlYmtpdC1hcHBlYXJhbmNlOiBub25lICFpbXBvcnRhbnQ7XG5cdFx0XHRtYXJnaW46IDAgIWltcG9ydGFudDtcblx0XHR9XG5cblx0XHRpbnB1dFt0eXBlPSdudW1iZXInXSB7XG5cdFx0XHQtbW96LWFwcGVhcmFuY2U6IHRleHRmaWVsZDtcblx0XHR9XG5cdGA7XG59O1xuXG5leHBvcnQgY29uc3QgSW5wdXQgPSBzdHlsZWQoIElucHV0Q29udHJvbCApYFxuXHQkeyBodG1sQXJyb3dTdHlsZXMgfTtcbmA7XG4iXX0= */"));
51
+ })(htmlArrowStyles, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmd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0ZXh0ZmllbGQ7XG5cdFx0fVxuXHRgO1xufTtcblxuZXhwb3J0IGNvbnN0IElucHV0ID0gc3R5bGVkKCBJbnB1dENvbnRyb2wgKWBcblx0JHsgaHRtbEFycm93U3R5bGVzIH07XG5gO1xuXG5jb25zdCBzcGluQnV0dG9uU2l6ZVN0eWxlcyA9ICggeyBzaXplIH0gKSA9PiB7XG5cdGlmICggc2l6ZSAhPT0gJ3NtYWxsJyApIHtcblx0XHRyZXR1cm4gYGA7XG5cdH1cblxuXHRyZXR1cm4gY3NzYFxuXHRcdHdpZHRoOiAkeyBzcGFjZSggNSApIH07XG5cdFx0bWluLXdpZHRoOiAkeyBzcGFjZSggNSApIH07XG5cdFx0aGVpZ2h0OiAkeyBzcGFjZSggNSApIH07XG5cdGA7XG59O1xuXG5leHBvcnQgY29uc3QgU3BpbkJ1dHRvbiA9IHN0eWxlZCggQnV0dG9uIClgXG5cdCYmJiYmIHtcblx0XHRjb2xvcjogJHsgQ09MT1JTLnVpLnRoZW1lIH07XG5cdFx0JHsgc3BpbkJ1dHRvblNpemVTdHlsZXMgfVxuXHR9XG5gO1xuIl19 */"));
42
52
  exports.Input = Input;
53
+
54
+ const spinButtonSizeStyles = _ref3 => {
55
+ let {
56
+ size
57
+ } = _ref3;
58
+
59
+ if (size !== 'small') {
60
+ return ``;
61
+ }
62
+
63
+ return /*#__PURE__*/(0, _react.css)("width:", (0, _space.space)(5), ";min-width:", (0, _space.space)(5), ";height:", (0, _space.space)(5), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:spinButtonSizeStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEwQ1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VsZDtcblx0XHR9XG5cdGA7XG59O1xuXG5leHBvcnQgY29uc3QgSW5wdXQgPSBzdHlsZWQoIElucHV0Q29udHJvbCApYFxuXHQkeyBodG1sQXJyb3dTdHlsZXMgfTtcbmA7XG5cbmNvbnN0IHNwaW5CdXR0b25TaXplU3R5bGVzID0gKCB7IHNpemUgfSApID0+IHtcblx0aWYgKCBzaXplICE9PSAnc21hbGwnICkge1xuXHRcdHJldHVybiBgYDtcblx0fVxuXG5cdHJldHVybiBjc3NgXG5cdFx0d2lkdGg6ICR7IHNwYWNlKCA1ICkgfTtcblx0XHRtaW4td2lkdGg6ICR7IHNwYWNlKCA1ICkgfTtcblx0XHRoZWlnaHQ6ICR7IHNwYWNlKCA1ICkgfTtcblx0YDtcbn07XG5cbmV4cG9ydCBjb25zdCBTcGluQnV0dG9uID0gc3R5bGVkKCBCdXR0b24gKWBcblx0JiYmJiYge1xuXHRcdGNvbG9yOiAkeyBDT0xPUlMudWkudGhlbWUgfTtcblx0XHQkeyBzcGluQnV0dG9uU2l6ZVN0eWxlcyB9XG5cdH1cbmA7XG4iXX0= */");
64
+ };
65
+
66
+ const SpinButton = ( /*#__PURE__*/0, _base.default)(_button.default, process.env.NODE_ENV === "production" ? {
67
+ target: "ep48uk90"
68
+ } : {
69
+ target: "ep48uk90",
70
+ label: "SpinButton"
71
+ })("&&&&&{color:", _utils.COLORS.ui.theme, ";", spinButtonSizeStyles, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5bGVzL251bWJlci1jb250cm9sLXN0eWxlcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFpRDBDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbnVtYmVyLWNvbnRyb2wvc3R5b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ENvbnRyb2wgKWBcblx0JHsgaHRtbEFycm93U3R5bGVzIH07XG5gO1xuXG5jb25zdCBzcGluQnV0dG9uU2l6ZVN0eWxlcyA9ICggeyBzaXplIH0gKSA9PiB7XG5cdGlmICggc2l6ZSAhPT0gJ3NtYWxsJyApIHtcblx0XHRyZXR1cm4gYGA7XG5cdH1cblxuXHRyZXR1cm4gY3NzYFxuXHRcdHdpZHRoOiAkeyBzcGFjZSggNSApIH07XG5cdFx0bWluLXdpZHRoOiAkeyBzcGFjZSggNSApIH07XG5cdFx0aGVpZ2h0OiAkeyBzcGFjZSggNSApIH07XG5cdGA7XG59O1xuXG5leHBvcnQgY29uc3QgU3BpbkJ1dHRvbiA9IHN0eWxlZCggQnV0dG9uIClgXG5cdCYmJiYmIHtcblx0XHRjb2xvcjogJHsgQ09MT1JTLnVpLnRoZW1lIH07XG5cdFx0JHsgc3BpbkJ1dHRvblNpemVTdHlsZXMgfVxuXHR9XG5gO1xuIl19 */"));
72
+ exports.SpinButton = SpinButton;
43
73
  //# sourceMappingURL=number-control-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/number-control/styles/number-control-styles.js"],"names":["htmlArrowStyles","hideHTMLArrows","Input","InputControl"],"mappings":";;;;;;;;;;;AAIA;;AAKA;;;;;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,SAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;AACjD,MAAK,CAAEA,cAAP,EAAwB,OAAQ,EAAR;AAExB;AAWA,CAdD;;AAgBO,MAAMC,KAAK,GAAG,iCAAQC,qBAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,CACdH,eADc,yzCAAX","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport InputControl from '../../input-control';\n\nconst htmlArrowStyles = ( { hideHTMLArrows } ) => {\n\tif ( ! hideHTMLArrows ) return ``;\n\n\treturn css`\n\t\tinput[type='number']::-webkit-outer-spin-button,\n\t\tinput[type='number']::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none !important;\n\t\t\tmargin: 0 !important;\n\t\t}\n\n\t\tinput[type='number'] {\n\t\t\t-moz-appearance: textfield;\n\t\t}\n\t`;\n};\n\nexport const Input = styled( InputControl )`\n\t${ htmlArrowStyles };\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/number-control/styles/number-control-styles.js"],"names":["htmlArrowStyles","hideHTMLArrows","Input","InputControl","spinButtonSizeStyles","size","css","SpinButton","Button","COLORS","ui","theme"],"mappings":";;;;;;;;;;;AAIA;;AAMA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,MAAMA,eAAe,GAAG,SAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;;AACjD,MAAK,CAAEA,cAAP,EAAwB;AACvB,WAAQ,EAAR;AACA;;AAED;AAWA,CAhBD;;AAkBO,MAAMC,KAAK,GAAG,iCAAQC,qBAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,CACdH,eADc,i8DAAX;;;AAIP,MAAMI,oBAAoB,GAAG,SAAgB;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;;AAC5C,MAAKA,IAAI,KAAK,OAAd,EAAwB;AACvB,WAAQ,EAAR;AACA;;AAED,0BAAOC,UAAP,YACW,kBAAO,CAAP,CADX,iBAEe,kBAAO,CAAP,CAFf,cAGY,kBAAO,CAAP,CAHZ;AAKA,CAVD;;AAYO,MAAMC,UAAU,GAAG,iCAAQC,eAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,iBAEXC,cAAOC,EAAP,CAAUC,KAFC,OAGlBP,oBAHkB,k8DAAhB","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport InputControl from '../../input-control';\nimport { COLORS } from '../../utils';\nimport Button from '../../button';\nimport { space } from '../../ui/utils/space';\n\nconst htmlArrowStyles = ( { hideHTMLArrows } ) => {\n\tif ( ! hideHTMLArrows ) {\n\t\treturn ``;\n\t}\n\n\treturn css`\n\t\tinput[type='number']::-webkit-outer-spin-button,\n\t\tinput[type='number']::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none !important;\n\t\t\tmargin: 0 !important;\n\t\t}\n\n\t\tinput[type='number'] {\n\t\t\t-moz-appearance: textfield;\n\t\t}\n\t`;\n};\n\nexport const Input = styled( InputControl )`\n\t${ htmlArrowStyles };\n`;\n\nconst spinButtonSizeStyles = ( { size } ) => {\n\tif ( size !== 'small' ) {\n\t\treturn ``;\n\t}\n\n\treturn css`\n\t\twidth: ${ space( 5 ) };\n\t\tmin-width: ${ space( 5 ) };\n\t\theight: ${ space( 5 ) };\n\t`;\n};\n\nexport const SpinButton = styled( Button )`\n\t&&&&& {\n\t\tcolor: ${ COLORS.ui.theme };\n\t\t${ spinButtonSizeStyles }\n\t}\n`;\n"]}
@@ -116,7 +116,6 @@ const UnforwardedPopover = (props, forwardedRef) => {
116
116
  children,
117
117
  className,
118
118
  noArrow = true,
119
- isAlternate,
120
119
  position,
121
120
  placement: placementProp = 'bottom-start',
122
121
  offset: offsetProp = 0,
@@ -128,29 +127,21 @@ const UnforwardedPopover = (props, forwardedRef) => {
128
127
  flip = true,
129
128
  resize = true,
130
129
  shift = false,
130
+ variant,
131
131
  // Deprecated props
132
132
  __unstableForcePosition,
133
- __unstableShift,
134
133
  anchorRef,
135
134
  anchorRect,
136
135
  getAnchorRect,
137
- range,
136
+ isAlternate,
138
137
  // Rest
139
138
  ...contentProps
140
139
  } = props;
141
-
142
- if (range) {
143
- (0, _deprecated.default)('`range` prop in wp.components.Popover', {
144
- since: '6.1',
145
- version: '6.3'
146
- });
147
- }
148
-
149
140
  let computedFlipProp = flip;
150
141
  let computedResizeProp = resize;
151
142
 
152
143
  if (__unstableForcePosition !== undefined) {
153
- (0, _deprecated.default)('`__unstableForcePosition` prop wp.components.Popover', {
144
+ (0, _deprecated.default)('`__unstableForcePosition` prop in wp.components.Popover', {
154
145
  since: '6.1',
155
146
  version: '6.3',
156
147
  alternative: '`flip={ false }` and `resize={ false }`'
@@ -161,22 +152,9 @@ const UnforwardedPopover = (props, forwardedRef) => {
161
152
  computedResizeProp = !__unstableForcePosition;
162
153
  }
163
154
 
164
- let shouldShift = shift;
165
-
166
- if (__unstableShift !== undefined) {
167
- (0, _deprecated.default)('`__unstableShift` prop in wp.components.Popover', {
168
- since: '6.1',
169
- version: '6.3',
170
- alternative: '`shift` prop`'
171
- }); // Back-compat.
172
-
173
- shouldShift = __unstableShift;
174
- }
175
-
176
155
  if (anchorRef !== undefined) {
177
156
  (0, _deprecated.default)('`anchorRef` prop in wp.components.Popover', {
178
157
  since: '6.1',
179
- version: '6.3',
180
158
  alternative: '`anchor` prop'
181
159
  });
182
160
  }
@@ -184,7 +162,6 @@ const UnforwardedPopover = (props, forwardedRef) => {
184
162
  if (anchorRect !== undefined) {
185
163
  (0, _deprecated.default)('`anchorRect` prop in wp.components.Popover', {
186
164
  since: '6.1',
187
- version: '6.3',
188
165
  alternative: '`anchor` prop'
189
166
  });
190
167
  }
@@ -192,11 +169,19 @@ const UnforwardedPopover = (props, forwardedRef) => {
192
169
  if (getAnchorRect !== undefined) {
193
170
  (0, _deprecated.default)('`getAnchorRect` prop in wp.components.Popover', {
194
171
  since: '6.1',
195
- version: '6.3',
196
172
  alternative: '`anchor` prop'
197
173
  });
198
174
  }
199
175
 
176
+ const computedVariant = isAlternate ? 'toolbar' : variant;
177
+
178
+ if (isAlternate !== undefined) {
179
+ (0, _deprecated.default)('`isAlternate` prop in wp.components.Popover', {
180
+ since: '6.2',
181
+ alternative: "`variant` prop with the `'toolbar'` value"
182
+ });
183
+ }
184
+
200
185
  const arrowRef = (0, _element.useRef)(null);
201
186
  const [fallbackReferenceElement, setFallbackReferenceElement] = (0, _element.useState)(null);
202
187
  const [referenceOwnerDocument, setReferenceOwnerDocument] = (0, _element.useState)();
@@ -259,7 +244,7 @@ const UnforwardedPopover = (props, forwardedRef) => {
259
244
  });
260
245
  }
261
246
 
262
- }) : undefined, shouldShift ? (0, _reactDom.shift)({
247
+ }) : undefined, shift ? (0, _reactDom.shift)({
263
248
  crossAxis: true,
264
249
  limiter: (0, _limitShift.limitShift)(),
265
250
  padding: 1 // Necessary to avoid flickering at the edge of the viewport.
@@ -380,7 +365,8 @@ const UnforwardedPopover = (props, forwardedRef) => {
380
365
  placement: computedPlacement,
381
366
  className: (0, _classnames.default)('components-popover', className, {
382
367
  'is-expanded': isExpanded,
383
- 'is-alternate': isAlternate
368
+ // Use the 'alternate' classname for 'toolbar' variant for back compat.
369
+ [`is-${computedVariant === 'toolbar' ? 'alternate' : computedVariant}`]: computedVariant
384
370
  })
385
371
  }, contentProps, {
386
372
  ref: mergedFloatingRef
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/popover/index.tsx"],"names":["SLOT_NAME","ArrowTriangle","AnimatedWrapper","forwardedRef","style","receivedInlineStyles","placement","shouldAnimate","props","hasAnimatedOnce","setHasAnimatedOnce","shouldReduceMotion","motionInlineStyles","otherMotionProps","onAnimationComplete","computedAnimationProps","animate","slotNameContext","undefined","UnforwardedPopover","headerTitle","onClose","children","className","noArrow","isAlternate","position","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","__unstableForcePosition","__unstableShift","anchorRef","anchorRect","getAnchorRect","range","contentProps","since","version","computedFlipProp","computedResizeProp","alternative","shouldShift","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","referenceOwnerDocument","setReferenceOwnerDocument","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","frameOffsetRef","middleware","name","fn","x","y","current","data","amount","apply","sizeProps","firstElementChild","refs","floating","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","filter","m","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","reference","referenceCallbackRef","strategy","update","computedPlacement","middlewareData","arrow","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","animationFrame","arrowCallbackRef","resultingReferenceOwnerDoc","fallbackDocument","document","resultingReferenceElement","top","bottom","startContainer","ownerDocument","defaultView","frameElement","updateFrameOffset","addEventListener","removeEventListener","mergedFloatingRef","content","left","Number","isNaN","close","split","join","isFinite","ref","Popover","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AA2BA;;;;AAvBA;;AACA;;AAYA;;AAoBA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAcA;;AAlEA;AACA;AACA;AAcA;;AAQA;AACA;AACA;;AAoBA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB,C,CAEA;AACA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,MACrB,4BAAC,eAAD;AACC,EAAA,KAAK,EAAC,4BADP;AAEC,EAAA,OAAO,EAAI,aAFZ;AAGC,EAAA,SAAS,EAAC,8BAHX;AAIC,EAAA,IAAI,EAAC;AAJN,GAMC,4BAAC,gBAAD;AACC,EAAA,SAAS,EAAC,iCADX;AAEC,EAAA,CAAC,EAAC;AAFH,EAND,EAUC,4BAAC,gBAAD;AACC,EAAA,SAAS,EAAC,qCADX;AAEC,EAAA,CAAC,EAAC,uBAFH;AAGC,EAAA,YAAY,EAAC;AAHd,EAVD,CADD;;AAmBA,MAAMC,eAAe,GAAG,yBACvB,OAOCC,YAPD,KAQK;AAAA,MAPJ;AACCC,IAAAA,KAAK,EAAEC,oBADR;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,KAHjB;AAIC,OAAGC;AAJJ,GAOI;AACJ;AACA;AACA;AACA,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,kBAAkB,GAAG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GAMG;AAhBG;AANT,KAyBC,4BAAC,aAAD,OAzBD,CArCF,CAHD;;AAuEA,MAAKsB,IAAI,CAAC2C,GAAV,EAAgB;AACfR,IAAAA,OAAO,GAAG,4BAAC,cAAD;AAAM,MAAA,IAAI,EAAGpC;AAAb,OAA0BoC,OAA1B,CAAV;AACA;;AAED,MAAKpF,SAAS,IAAIC,UAAb,IAA2BV,MAAhC,EAAyC;AACxC,WAAO6F,OAAP;AACA;;AAED,SAAO;AAAM,IAAA,GAAG,EAAGpE;AAAZ,KAAkCoE,OAAlC,CAAP;AACA,CA5YD;AA8YA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMS,OAAO,GAAG,yBAAYlH,kBAAZ,CAAhB;;;AAEP,SAASmH,WAAT,QAECF,GAFD,EAGE;AAAA,MAFD;AAAEpE,IAAAA,IAAI,GAAGhE;AAAT,GAEC;AACD,SACC,4BAAC,cAAD,CACC;AADD;AAEC,IAAA,gBAAgB,MAFjB;AAGC,IAAA,IAAI,EAAGgE,IAHR;AAIC,IAAA,SAAS,EAAC,cAJX;AAKC,IAAA,GAAG,EAAGoE;AALP,IADD;AASA,C,CAED;;;AACAC,OAAO,CAACE,IAAR,GAAe,yBAAYD,WAAZ,CAAf,C,CACA;;AACAD,OAAO,CAACG,0BAAR,GAAqCvH,eAAe,CAACwH,QAArD;eAEeJ,O","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n\tMiddleware,\n\tMiddlewareArguments,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport {\n\tmotion,\n\tuseReducedMotion,\n\tHTMLMotionProps,\n\tMotionProps,\n} 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} from '@wordpress/element';\nimport {\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\tgetFrameOffset,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceOwnerDocument,\n\tgetReferenceElement,\n} from './utils';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type {\n\tPopoverProps,\n\tAnimatedWrapperProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { limitShift as customLimitShift } from './limit-shift';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst 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 AnimatedWrapper = forwardRef(\n\t(\n\t\t{\n\t\t\tstyle: receivedInlineStyles,\n\t\t\tplacement,\n\t\t\tshouldAnimate = false,\n\t\t\t...props\n\t\t}: HTMLMotionProps< 'div' > & AnimatedWrapperProps,\n\t\tforwardedRef: ForwardedRef< any >\n\t) => {\n\t\t// When animating, animate only once (i.e. when the popover is opened), and\n\t\t// do not animate on subsequent prop changes (as it conflicts with\n\t\t// floating-ui's positioning updates).\n\t\tconst [ hasAnimatedOnce, setHasAnimatedOnce ] = useState( false );\n\t\tconst shouldReduceMotion = useReducedMotion();\n\n\t\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t\t() => placementToMotionAnimationProps( placement ),\n\t\t\t[ placement ]\n\t\t);\n\n\t\tconst onAnimationComplete = useCallback(\n\t\t\t() => setHasAnimatedOnce( true ),\n\t\t\t[]\n\t\t);\n\n\t\tconst computedAnimationProps: HTMLMotionProps< 'div' > =\n\t\t\tshouldAnimate && ! shouldReduceMotion\n\t\t\t\t? {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t\t\t...receivedInlineStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...otherMotionProps,\n\t\t\t\t\t\tonAnimationComplete,\n\t\t\t\t\t\tanimate: hasAnimatedOnce\n\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t: otherMotionProps.animate,\n\t\t\t\t }\n\t\t\t\t: {\n\t\t\t\t\t\tanimate: false,\n\t\t\t\t\t\tstyle: receivedInlineStyles,\n\t\t\t\t };\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\t{ ...computedAnimationProps }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ forwardedRef }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\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`, which is re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tisAlternate,\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\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\t__unstableShift,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\trange,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = props;\n\n\tif ( range ) {\n\t\tdeprecated( '`range` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop 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\tlet shouldShift = shift;\n\tif ( __unstableShift !== undefined ) {\n\t\tdeprecated( '`__unstableShift` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`shift` prop`',\n\t\t} );\n\n\t\t// Back-compat.\n\t\tshouldShift = __unstableShift;\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\tversion: '6.3',\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\tversion: '6.3',\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\tversion: '6.3',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\tconst [ referenceOwnerDocument, setReferenceOwnerDocument ] = useState<\n\t\tDocument | undefined\n\t>();\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\t/**\n\t * Offsets the position of the popover when the anchor is inside an iframe.\n\t *\n\t * Store the offset in a ref, due to constraints with floating-ui:\n\t * https://floating-ui.com/docs/react-dom#variables-inside-middleware-functions.\n\t */\n\tconst frameOffsetRef = useRef( getFrameOffset( referenceOwnerDocument ) );\n\n\tconst middleware = [\n\t\t// Custom middleware which adjusts the popover's position by taking into\n\t\t// account the offset of the anchor's iframe (if any) compared to the page.\n\t\t{\n\t\t\tname: 'frameOffset',\n\t\t\tfn( { x, y }: MiddlewareArguments ) {\n\t\t\t\tif ( ! frameOffsetRef.current ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tx: x + frameOffsetRef.current.x,\n\t\t\t\t\ty: y + frameOffsetRef.current.y,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t// This will be used in the customLimitShift() function.\n\t\t\t\t\t\tamount: frameOffsetRef.current,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp ? flipMiddleware() : undefined,\n\t\tcomputedResizeProp\n\t\t\t? size( {\n\t\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\t\tconst { firstElementChild } =\n\t\t\t\t\t\t\trefs.floating.current ?? {};\n\n\t\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) )\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t } )\n\t\t\t: undefined,\n\t\tshouldShift\n\t\t\t? shiftMiddleware( {\n\t\t\t\t\tcrossAxis: true,\n\t\t\t\t\tlimiter: customLimitShift(),\n\t\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t } )\n\t\t\t: undefined,\n\t\tarrow( { element: arrowRef } ),\n\t].filter(\n\t\t( m: Middleware | undefined ): m is Middleware => m !== undefined\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\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// Callback refs (not regular refs). This allows the position to be updated.\n\t\t// when either elements change.\n\t\treference: referenceCallbackRef,\n\t\tfloating,\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: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node ) => {\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\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceOwnerDoc = getReferenceOwnerDocument( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t\tfallbackDocument: document,\n\t\t} );\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\treferenceCallbackRef( resultingReferenceElement );\n\n\t\tsetReferenceOwnerDocument( resultingReferenceOwnerDoc );\n\t}, [\n\t\tanchor,\n\t\tanchorRef as Element | undefined,\n\t\t( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top,\n\t\t( anchorRef as PopoverAnchorRefTopBottom | undefined )?.bottom,\n\t\t( anchorRef as Range | undefined )?.startContainer,\n\t\t( anchorRef as PopoverAnchorRefReference )?.current,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\treferenceCallbackRef,\n\t] );\n\n\t// If the reference element is in a different ownerDocument (e.g. iFrame),\n\t// we need to manually update the floating's position as the reference's owner\n\t// document scrolls. Also update the frame offset if the view resizes.\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\t// Reference and root documents are the same.\n\t\t\treferenceOwnerDocument === document ||\n\t\t\t// Reference and floating are in the same document.\n\t\t\treferenceOwnerDocument === refs?.floating?.current?.ownerDocument ||\n\t\t\t// The reference's document has no view (i.e. window)\n\t\t\t// or frame element (ie. it's not an iframe).\n\t\t\t! referenceOwnerDocument?.defaultView?.frameElement\n\t\t) {\n\t\t\tframeOffsetRef.current = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = referenceOwnerDocument;\n\n\t\tconst updateFrameOffset = () => {\n\t\t\tframeOffsetRef.current = getFrameOffset( referenceOwnerDocument );\n\t\t\tupdate();\n\t\t};\n\t\tdefaultView.addEventListener( 'resize', updateFrameOffset );\n\n\t\tupdateFrameOffset();\n\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'resize', updateFrameOffset );\n\t\t};\n\t}, [ referenceOwnerDocument, update ] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\tfloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<AnimatedWrapper\n\t\t\tshouldAnimate={ animate && ! isExpanded }\n\t\t\tplacement={ computedPlacement }\n\t\t\tclassName={ classnames( 'components-popover', className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-alternate': isAlternate,\n\t\t\t} ) }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t\tstyle={\n\t\t\t\tisExpanded\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tposition: strategy,\n\t\t\t\t\t\t\tleft: Number.isNaN( x ) ? 0 : x ?? undefined,\n\t\t\t\t\t\t\ttop: Number.isNaN( y ) ? 0 : y ?? undefined,\n\t\t\t\t\t }\n\t\t\t}\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? `${\n\t\t\t\t\t\t\t\t\t\tarrowData.x +\n\t\t\t\t\t\t\t\t\t\t( frameOffsetRef.current?.x ?? 0 )\n\t\t\t\t\t\t\t\t }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? `${\n\t\t\t\t\t\t\t\t\t\tarrowData.y +\n\t\t\t\t\t\t\t\t\t\t( frameOffsetRef.current?.y ?? 0 )\n\t\t\t\t\t\t\t\t }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</AnimatedWrapper>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect || anchor ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\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 = forwardRef( UnforwardedPopover );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\t// @ts-expect-error Need to type `SlotFill`\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"]}
1
+ {"version":3,"sources":["@wordpress/components/src/popover/index.tsx"],"names":["SLOT_NAME","ArrowTriangle","AnimatedWrapper","forwardedRef","style","receivedInlineStyles","placement","shouldAnimate","props","hasAnimatedOnce","setHasAnimatedOnce","shouldReduceMotion","motionInlineStyles","otherMotionProps","onAnimationComplete","computedAnimationProps","animate","slotNameContext","undefined","UnforwardedPopover","headerTitle","onClose","children","className","noArrow","position","placementProp","offset","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","flip","resize","shift","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","referenceOwnerDocument","setReferenceOwnerDocument","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","frameOffsetRef","middleware","name","fn","x","y","current","data","amount","apply","sizeProps","firstElementChild","refs","floating","HTMLElement","Object","assign","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","filter","m","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","reference","referenceCallbackRef","strategy","update","computedPlacement","middlewareData","arrow","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","animationFrame","arrowCallbackRef","resultingReferenceOwnerDoc","fallbackDocument","document","resultingReferenceElement","top","bottom","startContainer","ownerDocument","defaultView","frameElement","updateFrameOffset","addEventListener","removeEventListener","mergedFloatingRef","content","left","Number","isNaN","close","split","join","isFinite","ref","Popover","PopoverSlot","Slot","__unstableSlotNameProvider","Provider"],"mappings":";;;;;;;;;AA2BA;;;;AAvBA;;AACA;;AAYA;;AAoBA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAcA;;AAlEA;AACA;AACA;AAcA;;AAQA;AACA;AACA;;AAoBA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAS,GAAG,SAAlB,C,CAEA;AACA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,MACrB,4BAAC,eAAD;AACC,EAAA,KAAK,EAAC,4BADP;AAEC,EAAA,OAAO,EAAI,aAFZ;AAGC,EAAA,SAAS,EAAC,8BAHX;AAIC,EAAA,IAAI,EAAC;AAJN,GAMC,4BAAC,gBAAD;AACC,EAAA,SAAS,EAAC,iCADX;AAEC,EAAA,CAAC,EAAC;AAFH,EAND,EAUC,4BAAC,gBAAD;AACC,EAAA,SAAS,EAAC,qCADX;AAEC,EAAA,CAAC,EAAC,uBAFH;AAGC,EAAA,YAAY,EAAC;AAHd,EAVD,CADD;;AAmBA,MAAMC,eAAe,GAAG,yBACvB,OAOCC,YAPD,KAQK;AAAA,MAPJ;AACCC,IAAAA,KAAK,EAAEC,oBADR;AAECC,IAAAA,SAFD;AAGCC,IAAAA,aAAa,GAAG,KAHjB;AAIC,OAAGC;AAJJ,GAOI;AACJ;AACA;AACA;AACA,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAMC,kBAAkB,GAAG,qCAA3B;AAEA,QAAM;AAAEP,IAAAA,KAAK,EAAEQ,kBAAT;AAA6B,OAAGC;AAAhC,MAAqD,sBAC1D,MAAM,4CAAiCP,SAAjC,CADoD,EAE1D,CAAEA,SAAF,CAF0D,CAA3D;AAKA,QAAMQ,mBAAmB,GAAG,0BAC3B,MAAMJ,kBAAkB,CAA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;AACA;;;AACO,MAAMS,OAAO,GAAG,yBAAYjH,kBAAZ,CAAhB;;;AAEP,SAASkH,WAAT,QAECF,GAFD,EAGE;AAAA,MAFD;AAAEpE,IAAAA,IAAI,GAAG/D;AAAT,GAEC;AACD,SACC,4BAAC,cAAD,CACC;AADD;AAEC,IAAA,gBAAgB,MAFjB;AAGC,IAAA,IAAI,EAAG+D,IAHR;AAIC,IAAA,SAAS,EAAC,cAJX;AAKC,IAAA,GAAG,EAAGoE;AALP,IADD;AASA,C,CAED;;;AACAC,OAAO,CAACE,IAAR,GAAe,yBAAYD,WAAZ,CAAf,C,CACA;;AACAD,OAAO,CAACG,0BAAR,GAAqCtH,eAAe,CAACuH,QAArD;eAEeJ,O","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport classnames from 'classnames';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n\tMiddleware,\n\tMiddlewareArguments,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport {\n\tmotion,\n\tuseReducedMotion,\n\tHTMLMotionProps,\n\tMotionProps,\n} 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} from '@wordpress/element';\nimport {\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\tgetFrameOffset,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceOwnerDocument,\n\tgetReferenceElement,\n} from './utils';\nimport type { WordPressComponentProps } from '../ui/context';\nimport type {\n\tPopoverProps,\n\tAnimatedWrapperProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { limitShift as customLimitShift } from './limit-shift';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nconst 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 AnimatedWrapper = forwardRef(\n\t(\n\t\t{\n\t\t\tstyle: receivedInlineStyles,\n\t\t\tplacement,\n\t\t\tshouldAnimate = false,\n\t\t\t...props\n\t\t}: HTMLMotionProps< 'div' > & AnimatedWrapperProps,\n\t\tforwardedRef: ForwardedRef< any >\n\t) => {\n\t\t// When animating, animate only once (i.e. when the popover is opened), and\n\t\t// do not animate on subsequent prop changes (as it conflicts with\n\t\t// floating-ui's positioning updates).\n\t\tconst [ hasAnimatedOnce, setHasAnimatedOnce ] = useState( false );\n\t\tconst shouldReduceMotion = useReducedMotion();\n\n\t\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t\t() => placementToMotionAnimationProps( placement ),\n\t\t\t[ placement ]\n\t\t);\n\n\t\tconst onAnimationComplete = useCallback(\n\t\t\t() => setHasAnimatedOnce( true ),\n\t\t\t[]\n\t\t);\n\n\t\tconst computedAnimationProps: HTMLMotionProps< 'div' > =\n\t\t\tshouldAnimate && ! shouldReduceMotion\n\t\t\t\t? {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t\t\t...receivedInlineStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t...otherMotionProps,\n\t\t\t\t\t\tonAnimationComplete,\n\t\t\t\t\t\tanimate: hasAnimatedOnce\n\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t: otherMotionProps.animate,\n\t\t\t\t }\n\t\t\t\t: {\n\t\t\t\t\t\tanimate: false,\n\t\t\t\t\t\tstyle: receivedInlineStyles,\n\t\t\t\t };\n\n\t\treturn (\n\t\t\t<motion.div\n\t\t\t\t{ ...computedAnimationProps }\n\t\t\t\t{ ...props }\n\t\t\t\tref={ forwardedRef }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\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`, which is re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\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\tvariant,\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} = props;\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\tconst [ referenceOwnerDocument, setReferenceOwnerDocument ] = useState<\n\t\tDocument | undefined\n\t>();\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\t/**\n\t * Offsets the position of the popover when the anchor is inside an iframe.\n\t *\n\t * Store the offset in a ref, due to constraints with floating-ui:\n\t * https://floating-ui.com/docs/react-dom#variables-inside-middleware-functions.\n\t */\n\tconst frameOffsetRef = useRef( getFrameOffset( referenceOwnerDocument ) );\n\n\tconst middleware = [\n\t\t// Custom middleware which adjusts the popover's position by taking into\n\t\t// account the offset of the anchor's iframe (if any) compared to the page.\n\t\t{\n\t\t\tname: 'frameOffset',\n\t\t\tfn( { x, y }: MiddlewareArguments ) {\n\t\t\t\tif ( ! frameOffsetRef.current ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx,\n\t\t\t\t\t\ty,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tx: x + frameOffsetRef.current.x,\n\t\t\t\t\ty: y + frameOffsetRef.current.y,\n\t\t\t\t\tdata: {\n\t\t\t\t\t\t// This will be used in the customLimitShift() function.\n\t\t\t\t\t\tamount: frameOffsetRef.current,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp ? flipMiddleware() : undefined,\n\t\tcomputedResizeProp\n\t\t\t? size( {\n\t\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\t\tconst { firstElementChild } =\n\t\t\t\t\t\t\trefs.floating.current ?? {};\n\n\t\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) )\n\t\t\t\t\t\t\treturn;\n\n\t\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t } )\n\t\t\t: undefined,\n\t\tshift\n\t\t\t? shiftMiddleware( {\n\t\t\t\t\tcrossAxis: true,\n\t\t\t\t\tlimiter: customLimitShift(),\n\t\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t } )\n\t\t\t: undefined,\n\t\tarrow( { element: arrowRef } ),\n\t].filter(\n\t\t( m: Middleware | undefined ): m is Middleware => m !== undefined\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\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// Callback refs (not regular refs). This allows the position to be updated.\n\t\t// when either elements change.\n\t\treference: referenceCallbackRef,\n\t\tfloating,\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: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\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\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceOwnerDoc = getReferenceOwnerDocument( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t\tfallbackDocument: document,\n\t\t} );\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\treferenceCallbackRef( resultingReferenceElement );\n\n\t\tsetReferenceOwnerDocument( resultingReferenceOwnerDoc );\n\t}, [\n\t\tanchor,\n\t\tanchorRef as Element | undefined,\n\t\t( anchorRef as PopoverAnchorRefTopBottom | undefined )?.top,\n\t\t( anchorRef as PopoverAnchorRefTopBottom | undefined )?.bottom,\n\t\t( anchorRef as Range | undefined )?.startContainer,\n\t\t( anchorRef as PopoverAnchorRefReference )?.current,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\treferenceCallbackRef,\n\t] );\n\n\t// If the reference element is in a different ownerDocument (e.g. iFrame),\n\t// we need to manually update the floating's position as the reference's owner\n\t// document scrolls. Also update the frame offset if the view resizes.\n\tuseLayoutEffect( () => {\n\t\tif (\n\t\t\t// Reference and root documents are the same.\n\t\t\treferenceOwnerDocument === document ||\n\t\t\t// Reference and floating are in the same document.\n\t\t\treferenceOwnerDocument === refs?.floating?.current?.ownerDocument ||\n\t\t\t// The reference's document has no view (i.e. window)\n\t\t\t// or frame element (ie. it's not an iframe).\n\t\t\t! referenceOwnerDocument?.defaultView?.frameElement\n\t\t) {\n\t\t\tframeOffsetRef.current = undefined;\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = referenceOwnerDocument;\n\n\t\tconst updateFrameOffset = () => {\n\t\t\tframeOffsetRef.current = getFrameOffset( referenceOwnerDocument );\n\t\t\tupdate();\n\t\t};\n\t\tdefaultView.addEventListener( 'resize', updateFrameOffset );\n\n\t\tupdateFrameOffset();\n\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'resize', updateFrameOffset );\n\t\t};\n\t}, [ referenceOwnerDocument, update ] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\tfloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\t// Disable reason: We care to capture the _bubbled_ events from inputs\n\t// within popover as inferring close intent.\n\n\tlet content = (\n\t\t// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<AnimatedWrapper\n\t\t\tshouldAnimate={ animate && ! isExpanded }\n\t\t\tplacement={ computedPlacement }\n\t\t\tclassName={ classnames( 'components-popover', className, {\n\t\t\t\t'is-expanded': isExpanded,\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{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t\tstyle={\n\t\t\t\tisExpanded\n\t\t\t\t\t? undefined\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tposition: strategy,\n\t\t\t\t\t\t\tleft: Number.isNaN( x ) ? 0 : x ?? undefined,\n\t\t\t\t\t\t\ttop: Number.isNaN( y ) ? 0 : y ?? undefined,\n\t\t\t\t\t }\n\t\t\t}\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? `${\n\t\t\t\t\t\t\t\t\t\tarrowData.x +\n\t\t\t\t\t\t\t\t\t\t( frameOffsetRef.current?.x ?? 0 )\n\t\t\t\t\t\t\t\t }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? `${\n\t\t\t\t\t\t\t\t\t\tarrowData.y +\n\t\t\t\t\t\t\t\t\t\t( frameOffsetRef.current?.y ?? 0 )\n\t\t\t\t\t\t\t\t }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</AnimatedWrapper>\n\t);\n\n\tif ( slot.ref ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t}\n\n\tif ( anchorRef || anchorRect || anchor ) {\n\t\treturn content;\n\t}\n\n\treturn <span ref={ anchorRefFallback }>{ content }</span>;\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 = forwardRef( UnforwardedPopover );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\t// @ts-expect-error Need to type `SlotFill`\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"]}