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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/CHANGELOG.md +51 -2
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/angle-picker-control/index.js +1 -1
  4. package/build/angle-picker-control/index.js.map +1 -1
  5. package/build/animation/index.js +0 -6
  6. package/build/animation/index.js.map +1 -1
  7. package/build/autocomplete/index.js +0 -1
  8. package/build/autocomplete/index.js.map +1 -1
  9. package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
  10. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  11. package/build/border-control/border-control/component.js +2 -0
  12. package/build/border-control/border-control/component.js.map +1 -1
  13. package/build/box-control/all-input-control.js +1 -0
  14. package/build/box-control/all-input-control.js.map +1 -1
  15. package/build/box-control/axial-input-controls.js +1 -0
  16. package/build/box-control/axial-input-controls.js.map +1 -1
  17. package/build/box-control/index.js +22 -15
  18. package/build/box-control/index.js.map +1 -1
  19. package/build/box-control/input-controls.js +1 -0
  20. package/build/box-control/input-controls.js.map +1 -1
  21. package/build/box-control/types.js.map +1 -1
  22. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  23. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  24. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  25. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  26. package/build/clipboard-button/index.js +5 -3
  27. package/build/clipboard-button/index.js.map +1 -1
  28. package/build/color-palette/index.native.js +0 -1
  29. package/build/color-palette/index.native.js.map +1 -1
  30. package/build/color-picker/input-with-slider.js +2 -2
  31. package/build/color-picker/input-with-slider.js.map +1 -1
  32. package/build/composite/item.js +0 -9
  33. package/build/composite/item.js.map +1 -1
  34. package/build/context/context-connect.js +0 -1
  35. package/build/context/context-connect.js.map +1 -1
  36. package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  37. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  38. package/build/custom-gradient-picker/index.js +2 -0
  39. package/build/custom-gradient-picker/index.js.map +1 -1
  40. package/build/custom-gradient-picker/types.js.map +1 -1
  41. package/build/custom-select-control/index.js +8 -0
  42. package/build/custom-select-control/index.js.map +1 -1
  43. package/build/custom-select-control/types.js.map +1 -1
  44. package/build/drop-zone/index.js +19 -13
  45. package/build/drop-zone/index.js.map +1 -1
  46. package/build/drop-zone/types.js.map +1 -1
  47. package/build/dropdown-menu/index.js +1 -0
  48. package/build/dropdown-menu/index.js.map +1 -1
  49. package/build/duotone-picker/color-list-picker/index.js +9 -14
  50. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  51. package/build/external-link/index.js +0 -1
  52. package/build/external-link/index.js.map +1 -1
  53. package/build/font-size-picker/font-size-picker-select.js +1 -0
  54. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  55. package/build/font-size-picker/index.js +1 -0
  56. package/build/font-size-picker/index.js.map +1 -1
  57. package/build/form-file-upload/index.js +11 -1
  58. package/build/form-file-upload/index.js.map +1 -1
  59. package/build/form-file-upload/types.js.map +1 -1
  60. package/build/form-token-field/index.js +6 -1
  61. package/build/form-token-field/index.js.map +1 -1
  62. package/build/gradient-picker/index.js +2 -0
  63. package/build/gradient-picker/index.js.map +1 -1
  64. package/build/gradient-picker/types.js.map +1 -1
  65. package/build/icon/index.js +9 -0
  66. package/build/icon/index.js.map +1 -1
  67. package/build/index.js +0 -6
  68. package/build/index.js.map +1 -1
  69. package/build/menu/checkbox-item.js +5 -9
  70. package/build/menu/checkbox-item.js.map +1 -1
  71. package/build/menu/group-label.js +4 -1
  72. package/build/menu/group-label.js.map +1 -1
  73. package/build/menu/group.js +4 -1
  74. package/build/menu/group.js.map +1 -1
  75. package/build/menu/item-help-text.js +5 -0
  76. package/build/menu/item-help-text.js.map +1 -1
  77. package/build/menu/item-label.js +5 -0
  78. package/build/menu/item-label.js.map +1 -1
  79. package/build/menu/item.js +4 -8
  80. package/build/menu/item.js.map +1 -1
  81. package/build/menu/radio-item.js +5 -9
  82. package/build/menu/radio-item.js.map +1 -1
  83. package/build/menu/separator.js +5 -2
  84. package/build/menu/separator.js.map +1 -1
  85. package/build/modal/aria-helper.js +0 -1
  86. package/build/modal/aria-helper.js.map +1 -1
  87. package/build/modal/index.js +0 -1
  88. package/build/modal/index.js.map +1 -1
  89. package/build/number-control/index.js +8 -0
  90. package/build/number-control/index.js.map +1 -1
  91. package/build/number-control/types.js.map +1 -1
  92. package/build/range-control/index.js +2 -1
  93. package/build/range-control/index.js.map +1 -1
  94. package/build/range-control/mark.js +0 -1
  95. package/build/range-control/mark.js.map +1 -1
  96. package/build/range-control/styles/range-control-styles.js +33 -45
  97. package/build/range-control/styles/range-control-styles.js.map +1 -1
  98. package/build/resizable-box/index.js +9 -1
  99. package/build/resizable-box/index.js.map +1 -1
  100. package/build/slot-fill/bubbles-virtually/fill.js +8 -12
  101. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  102. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  103. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  104. package/build/slot-fill/bubbles-virtually/slot.js +4 -10
  105. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  106. package/build/slot-fill/types.js.map +1 -1
  107. package/build/style-provider/index.js +0 -1
  108. package/build/style-provider/index.js.map +1 -1
  109. package/build/tabs/tab.js +0 -17
  110. package/build/tabs/tab.js.map +1 -1
  111. package/build/toolbar/toolbar-button/index.js +2 -0
  112. package/build/toolbar/toolbar-button/index.js.map +1 -1
  113. package/build/tools-panel/tools-panel/component.js +2 -0
  114. package/build/tools-panel/tools-panel/component.js.map +1 -1
  115. package/build/tree-grid/cell.js +4 -1
  116. package/build/tree-grid/cell.js.map +1 -1
  117. package/build/tree-grid/types.js.map +1 -1
  118. package/build/unit-control/index.js +10 -1
  119. package/build/unit-control/index.js.map +1 -1
  120. package/build/unit-control/types.js.map +1 -1
  121. package/build-module/angle-picker-control/index.js +1 -1
  122. package/build-module/angle-picker-control/index.js.map +1 -1
  123. package/build-module/animation/index.js +1 -1
  124. package/build-module/animation/index.js.map +1 -1
  125. package/build-module/autocomplete/index.js +0 -1
  126. package/build-module/autocomplete/index.js.map +1 -1
  127. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -1
  128. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  129. package/build-module/border-control/border-control/component.js +2 -0
  130. package/build-module/border-control/border-control/component.js.map +1 -1
  131. package/build-module/box-control/all-input-control.js +1 -0
  132. package/build-module/box-control/all-input-control.js.map +1 -1
  133. package/build-module/box-control/axial-input-controls.js +1 -0
  134. package/build-module/box-control/axial-input-controls.js.map +1 -1
  135. package/build-module/box-control/index.js +22 -15
  136. package/build-module/box-control/index.js.map +1 -1
  137. package/build-module/box-control/input-controls.js +1 -0
  138. package/build-module/box-control/input-controls.js.map +1 -1
  139. package/build-module/box-control/types.js.map +1 -1
  140. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  141. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  142. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  143. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  144. package/build-module/clipboard-button/index.js +5 -3
  145. package/build-module/clipboard-button/index.js.map +1 -1
  146. package/build-module/color-palette/index.native.js +0 -1
  147. package/build-module/color-palette/index.native.js.map +1 -1
  148. package/build-module/color-picker/input-with-slider.js +2 -2
  149. package/build-module/color-picker/input-with-slider.js.map +1 -1
  150. package/build-module/composite/item.js +0 -9
  151. package/build-module/composite/item.js.map +1 -1
  152. package/build-module/context/context-connect.js +0 -1
  153. package/build-module/context/context-connect.js.map +1 -1
  154. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  155. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  156. package/build-module/custom-gradient-picker/index.js +2 -0
  157. package/build-module/custom-gradient-picker/index.js.map +1 -1
  158. package/build-module/custom-gradient-picker/types.js.map +1 -1
  159. package/build-module/custom-select-control/index.js +8 -0
  160. package/build-module/custom-select-control/index.js.map +1 -1
  161. package/build-module/custom-select-control/types.js.map +1 -1
  162. package/build-module/drop-zone/index.js +19 -13
  163. package/build-module/drop-zone/index.js.map +1 -1
  164. package/build-module/drop-zone/types.js.map +1 -1
  165. package/build-module/dropdown-menu/index.js +1 -0
  166. package/build-module/dropdown-menu/index.js.map +1 -1
  167. package/build-module/duotone-picker/color-list-picker/index.js +10 -15
  168. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  169. package/build-module/external-link/index.js +0 -1
  170. package/build-module/external-link/index.js.map +1 -1
  171. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  172. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  173. package/build-module/font-size-picker/index.js +1 -0
  174. package/build-module/font-size-picker/index.js.map +1 -1
  175. package/build-module/form-file-upload/index.js +13 -2
  176. package/build-module/form-file-upload/index.js.map +1 -1
  177. package/build-module/form-file-upload/types.js.map +1 -1
  178. package/build-module/form-token-field/index.js +6 -1
  179. package/build-module/form-token-field/index.js.map +1 -1
  180. package/build-module/gradient-picker/index.js +2 -0
  181. package/build-module/gradient-picker/index.js.map +1 -1
  182. package/build-module/gradient-picker/types.js.map +1 -1
  183. package/build-module/icon/index.js +9 -0
  184. package/build-module/icon/index.js.map +1 -1
  185. package/build-module/index.js +1 -1
  186. package/build-module/index.js.map +1 -1
  187. package/build-module/menu/checkbox-item.js +5 -9
  188. package/build-module/menu/checkbox-item.js.map +1 -1
  189. package/build-module/menu/group-label.js +4 -1
  190. package/build-module/menu/group-label.js.map +1 -1
  191. package/build-module/menu/group.js +4 -1
  192. package/build-module/menu/group.js.map +1 -1
  193. package/build-module/menu/item-help-text.js +6 -1
  194. package/build-module/menu/item-help-text.js.map +1 -1
  195. package/build-module/menu/item-label.js +6 -1
  196. package/build-module/menu/item-label.js.map +1 -1
  197. package/build-module/menu/item.js +4 -8
  198. package/build-module/menu/item.js.map +1 -1
  199. package/build-module/menu/radio-item.js +5 -9
  200. package/build-module/menu/radio-item.js.map +1 -1
  201. package/build-module/menu/separator.js +5 -2
  202. package/build-module/menu/separator.js.map +1 -1
  203. package/build-module/modal/aria-helper.js +0 -1
  204. package/build-module/modal/aria-helper.js.map +1 -1
  205. package/build-module/modal/index.js +0 -1
  206. package/build-module/modal/index.js.map +1 -1
  207. package/build-module/number-control/index.js +8 -0
  208. package/build-module/number-control/index.js.map +1 -1
  209. package/build-module/number-control/types.js.map +1 -1
  210. package/build-module/range-control/index.js +2 -1
  211. package/build-module/range-control/index.js.map +1 -1
  212. package/build-module/range-control/mark.js +0 -1
  213. package/build-module/range-control/mark.js.map +1 -1
  214. package/build-module/range-control/styles/range-control-styles.js +33 -45
  215. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  216. package/build-module/resizable-box/index.js +9 -1
  217. package/build-module/resizable-box/index.js.map +1 -1
  218. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
  219. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  220. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +6 -10
  221. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  222. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
  223. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  224. package/build-module/slot-fill/types.js.map +1 -1
  225. package/build-module/style-provider/index.js +0 -1
  226. package/build-module/style-provider/index.js.map +1 -1
  227. package/build-module/tabs/tab.js +0 -15
  228. package/build-module/tabs/tab.js.map +1 -1
  229. package/build-module/toolbar/toolbar-button/index.js +2 -0
  230. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  231. package/build-module/tools-panel/tools-panel/component.js +2 -0
  232. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  233. package/build-module/tree-grid/cell.js +4 -1
  234. package/build-module/tree-grid/cell.js.map +1 -1
  235. package/build-module/tree-grid/types.js.map +1 -1
  236. package/build-module/unit-control/index.js +10 -1
  237. package/build-module/unit-control/index.js.map +1 -1
  238. package/build-module/unit-control/types.js.map +1 -1
  239. package/build-style/style-rtl.css +15 -11
  240. package/build-style/style.css +15 -11
  241. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  242. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  243. package/build-types/animation/index.d.ts +1 -1
  244. package/build-types/animation/index.d.ts.map +1 -1
  245. package/build-types/base-control/hooks.d.ts +4 -4
  246. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  247. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  248. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  249. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  250. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  251. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  252. package/build-types/border-control/border-control/hook.d.ts +83 -83
  253. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  254. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  255. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  256. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  257. package/build-types/box-control/index.d.ts +14 -13
  258. package/build-types/box-control/index.d.ts.map +1 -1
  259. package/build-types/box-control/input-controls.d.ts.map +1 -1
  260. package/build-types/box-control/stories/index.story.d.ts +852 -816
  261. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  262. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  263. package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
  264. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  265. package/build-types/box-control/types.d.ts +16 -2
  266. package/build-types/box-control/types.d.ts.map +1 -1
  267. package/build-types/card/card/hook.d.ts +83 -83
  268. package/build-types/card/card-body/hook.d.ts +83 -83
  269. package/build-types/card/card-divider/hook.d.ts +84 -84
  270. package/build-types/card/card-footer/hook.d.ts +83 -83
  271. package/build-types/card/card-header/hook.d.ts +83 -83
  272. package/build-types/card/card-media/hook.d.ts +83 -83
  273. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  274. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  275. package/build-types/clipboard-button/index.d.ts.map +1 -1
  276. package/build-types/color-picker/styles.d.ts +3 -2
  277. package/build-types/color-picker/styles.d.ts.map +1 -1
  278. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  279. package/build-types/composite/index.d.ts.map +1 -1
  280. package/build-types/composite/item.d.ts.map +1 -1
  281. package/build-types/context/constants.d.ts.map +1 -1
  282. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  283. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  284. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  285. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  286. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  287. package/build-types/custom-gradient-picker/types.d.ts +6 -0
  288. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  289. package/build-types/custom-select-control/index.d.ts.map +1 -1
  290. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  291. package/build-types/custom-select-control/types.d.ts +7 -0
  292. package/build-types/custom-select-control/types.d.ts.map +1 -1
  293. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  294. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  295. package/build-types/date-time/date/styles.d.ts.map +1 -1
  296. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  297. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  298. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  299. package/build-types/date-time/time/styles.d.ts +8 -4
  300. package/build-types/date-time/time/styles.d.ts.map +1 -1
  301. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/drop-zone/index.d.ts +1 -1
  303. package/build-types/drop-zone/index.d.ts.map +1 -1
  304. package/build-types/drop-zone/types.d.ts +5 -0
  305. package/build-types/drop-zone/types.d.ts.map +1 -1
  306. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  307. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  308. package/build-types/elevation/hook.d.ts +83 -83
  309. package/build-types/flex/flex/hook.d.ts +83 -83
  310. package/build-types/flex/flex-block/hook.d.ts +83 -83
  311. package/build-types/flex/flex-item/hook.d.ts +83 -83
  312. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  313. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
  314. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  315. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  316. package/build-types/font-size-picker/index.d.ts.map +1 -1
  317. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  318. package/build-types/form-file-upload/index.d.ts +2 -1
  319. package/build-types/form-file-upload/index.d.ts.map +1 -1
  320. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  321. package/build-types/form-file-upload/types.d.ts +10 -8
  322. package/build-types/form-file-upload/types.d.ts.map +1 -1
  323. package/build-types/form-token-field/index.d.ts.map +1 -1
  324. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  325. package/build-types/gradient-picker/index.d.ts +1 -1
  326. package/build-types/gradient-picker/index.d.ts.map +1 -1
  327. package/build-types/gradient-picker/types.d.ts +6 -0
  328. package/build-types/gradient-picker/types.d.ts.map +1 -1
  329. package/build-types/grid/hook.d.ts +83 -83
  330. package/build-types/h-stack/hook.d.ts +83 -83
  331. package/build-types/heading/hook.d.ts +82 -82
  332. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  333. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  334. package/build-types/icon/index.d.ts +23 -7
  335. package/build-types/icon/index.d.ts.map +1 -1
  336. package/build-types/icon/stories/index.story.d.ts +7 -1
  337. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  338. package/build-types/index.d.ts +1 -1
  339. package/build-types/index.d.ts.map +1 -1
  340. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  341. package/build-types/item-group/item/hook.d.ts +83 -83
  342. package/build-types/item-group/item-group/hook.d.ts +83 -83
  343. package/build-types/lock-unlock.d.ts +2 -2
  344. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  345. package/build-types/menu/group-label.d.ts.map +1 -1
  346. package/build-types/menu/group.d.ts.map +1 -1
  347. package/build-types/menu/index.d.ts.map +1 -1
  348. package/build-types/menu/item-help-text.d.ts.map +1 -1
  349. package/build-types/menu/item-label.d.ts.map +1 -1
  350. package/build-types/menu/item.d.ts.map +1 -1
  351. package/build-types/menu/radio-item.d.ts.map +1 -1
  352. package/build-types/menu/separator.d.ts.map +1 -1
  353. package/build-types/menu/styles.d.ts.map +1 -1
  354. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  355. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  356. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  357. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  358. package/build-types/number-control/index.d.ts +2 -1
  359. package/build-types/number-control/index.d.ts.map +1 -1
  360. package/build-types/number-control/stories/index.story.d.ts +2 -1
  361. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  362. package/build-types/number-control/types.d.ts +7 -0
  363. package/build-types/number-control/types.d.ts.map +1 -1
  364. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  365. package/build-types/progress-bar/styles.d.ts.map +1 -1
  366. package/build-types/range-control/index.d.ts +1 -1
  367. package/build-types/range-control/index.d.ts.map +1 -1
  368. package/build-types/range-control/mark.d.ts.map +1 -1
  369. package/build-types/range-control/styles/range-control-styles.d.ts +4 -3
  370. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  371. package/build-types/resizable-box/index.d.ts.map +1 -1
  372. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  373. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  374. package/build-types/scrollable/hook.d.ts +83 -83
  375. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  376. package/build-types/select-control/index.d.ts.map +1 -1
  377. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  378. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  379. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  380. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  381. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  382. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  383. package/build-types/slot-fill/types.d.ts +4 -3
  384. package/build-types/slot-fill/types.d.ts.map +1 -1
  385. package/build-types/spacer/hook.d.ts +83 -83
  386. package/build-types/spinner/styles.d.ts.map +1 -1
  387. package/build-types/surface/hook.d.ts +83 -83
  388. package/build-types/tabs/tab.d.ts +3 -0
  389. package/build-types/tabs/tab.d.ts.map +1 -1
  390. package/build-types/text/hook.d.ts +83 -83
  391. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  392. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  393. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  394. package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
  395. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  396. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  397. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  398. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  399. package/build-types/tree-grid/cell.d.ts.map +1 -1
  400. package/build-types/tree-grid/types.d.ts +1 -1
  401. package/build-types/tree-grid/types.d.ts.map +1 -1
  402. package/build-types/truncate/hook.d.ts +83 -83
  403. package/build-types/unit-control/index.d.ts +3 -2
  404. package/build-types/unit-control/index.d.ts.map +1 -1
  405. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  406. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
  407. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  408. package/build-types/unit-control/types.d.ts +7 -0
  409. package/build-types/unit-control/types.d.ts.map +1 -1
  410. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  411. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  412. package/build-types/utils/rtl.d.ts +1 -1
  413. package/build-types/utils/rtl.d.ts.map +1 -1
  414. package/build-types/v-stack/hook.d.ts +83 -83
  415. package/build-types/z-stack/styles.d.ts.map +1 -1
  416. package/package.json +20 -20
  417. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  418. package/src/angle-picker-control/index.tsx +1 -1
  419. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  420. package/src/animation/index.tsx +0 -1
  421. package/src/base-control/stories/index.story.tsx +1 -1
  422. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
  423. package/src/border-box-control/stories/index.story.tsx +1 -1
  424. package/src/border-control/border-control/component.tsx +2 -0
  425. package/src/border-control/stories/index.story.tsx +1 -1
  426. package/src/box-control/README.md +80 -60
  427. package/src/box-control/all-input-control.tsx +1 -0
  428. package/src/box-control/axial-input-controls.tsx +1 -0
  429. package/src/box-control/docs-manifest.json +5 -0
  430. package/src/box-control/index.tsx +23 -15
  431. package/src/box-control/input-controls.tsx +1 -0
  432. package/src/box-control/stories/index.story.tsx +2 -1
  433. package/src/box-control/test/index.tsx +33 -26
  434. package/src/box-control/types.ts +71 -54
  435. package/src/button-group/stories/index.story.tsx +1 -1
  436. package/src/card/stories/index.story.tsx +2 -2
  437. package/src/checkbox-control/stories/index.story.tsx +1 -1
  438. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  439. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  440. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  441. package/src/circular-option-picker/style.scss +2 -2
  442. package/src/clipboard-button/index.tsx +5 -3
  443. package/src/color-palette/stories/index.story.tsx +3 -3
  444. package/src/color-picker/input-with-slider.tsx +1 -1
  445. package/src/color-picker/stories/index.story.tsx +2 -2
  446. package/src/combobox-control/stories/index.story.tsx +1 -1
  447. package/src/composite/item.tsx +1 -19
  448. package/src/composite/stories/index.story.tsx +3 -3
  449. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  450. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  451. package/src/custom-gradient-picker/index.tsx +2 -0
  452. package/src/custom-gradient-picker/style.scss +1 -1
  453. package/src/custom-gradient-picker/types.ts +6 -0
  454. package/src/custom-select-control/README.md +2 -0
  455. package/src/custom-select-control/index.tsx +9 -0
  456. package/src/custom-select-control/stories/index.story.tsx +3 -2
  457. package/src/custom-select-control/test/index.tsx +13 -9
  458. package/src/custom-select-control/types.ts +7 -0
  459. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  460. package/src/date-time/stories/date-time.story.tsx +4 -1
  461. package/src/date-time/stories/date.story.tsx +4 -1
  462. package/src/date-time/stories/time.story.tsx +4 -1
  463. package/src/dimension-control/stories/index.story.tsx +1 -1
  464. package/src/disabled/stories/index.story.tsx +3 -3
  465. package/src/divider/stories/index.story.tsx +1 -1
  466. package/src/draggable/stories/index.story.tsx +2 -2
  467. package/src/drop-zone/index.tsx +21 -24
  468. package/src/drop-zone/types.ts +5 -0
  469. package/src/dropdown/stories/index.story.tsx +7 -7
  470. package/src/dropdown-menu/index.tsx +4 -1
  471. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  472. package/src/dropdown-menu/style.scss +1 -1
  473. package/src/duotone-picker/color-list-picker/index.tsx +8 -8
  474. package/src/duotone-picker/color-list-picker/style.scss +0 -6
  475. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  476. package/src/flex/stories/index.story.tsx +1 -1
  477. package/src/font-size-picker/font-size-picker-select.tsx +1 -0
  478. package/src/font-size-picker/index.tsx +1 -0
  479. package/src/font-size-picker/stories/index.story.tsx +1 -1
  480. package/src/form-file-upload/README.md +58 -48
  481. package/src/form-file-upload/docs-manifest.json +5 -0
  482. package/src/form-file-upload/index.tsx +12 -1
  483. package/src/form-file-upload/stories/index.story.tsx +4 -3
  484. package/src/form-file-upload/test/index.tsx +5 -1
  485. package/src/form-file-upload/types.ts +10 -8
  486. package/src/form-token-field/README.md +1 -0
  487. package/src/form-token-field/index.tsx +7 -0
  488. package/src/form-token-field/stories/index.story.tsx +4 -2
  489. package/src/form-token-field/test/index.tsx +5 -1
  490. package/src/gradient-picker/README.md +8 -0
  491. package/src/gradient-picker/index.tsx +2 -0
  492. package/src/gradient-picker/stories/index.story.tsx +1 -1
  493. package/src/gradient-picker/types.ts +6 -0
  494. package/src/grid/stories/index.story.tsx +1 -1
  495. package/src/h-stack/stories/index.story.tsx +2 -2
  496. package/src/icon/README.md +22 -65
  497. package/src/icon/docs-manifest.json +5 -0
  498. package/src/icon/index.tsx +28 -13
  499. package/src/icon/stories/index.story.tsx +50 -8
  500. package/src/index.ts +1 -5
  501. package/src/input-control/stories/index.story.tsx +4 -4
  502. package/src/item-group/stories/index.story.tsx +2 -2
  503. package/src/menu/checkbox-item.tsx +9 -7
  504. package/src/menu/group-label.tsx +8 -1
  505. package/src/menu/group.tsx +8 -1
  506. package/src/menu/item-help-text.tsx +10 -1
  507. package/src/menu/item-label.tsx +10 -1
  508. package/src/menu/item.tsx +8 -6
  509. package/src/menu/radio-item.tsx +9 -7
  510. package/src/menu/separator.tsx +9 -2
  511. package/src/menu/stories/index.story.tsx +2 -2
  512. package/src/menu-group/stories/index.story.tsx +1 -1
  513. package/src/menu-item/stories/index.story.tsx +1 -1
  514. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  515. package/src/menu-items-choice/style.scss +1 -0
  516. package/src/modal/stories/index.story.tsx +2 -2
  517. package/src/modal/test/index.tsx +2 -1
  518. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  519. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  520. package/src/navigation/stories/index.story.tsx +4 -4
  521. package/src/navigator/stories/index.story.tsx +3 -3
  522. package/src/number-control/README.md +2 -1
  523. package/src/number-control/index.tsx +9 -0
  524. package/src/number-control/stories/index.story.tsx +2 -1
  525. package/src/number-control/test/index.tsx +5 -1
  526. package/src/number-control/types.ts +7 -0
  527. package/src/panel/stories/index.story.tsx +1 -1
  528. package/src/placeholder/stories/index.story.tsx +3 -3
  529. package/src/popover/stories/index.story.tsx +11 -9
  530. package/src/query-controls/stories/index.story.tsx +6 -6
  531. package/src/radio-control/stories/index.story.tsx +1 -1
  532. package/src/radio-group/stories/index.story.tsx +3 -3
  533. package/src/range-control/index.tsx +1 -0
  534. package/src/range-control/mark.tsx +0 -1
  535. package/src/range-control/stories/index.story.tsx +7 -7
  536. package/src/range-control/styles/range-control-styles.ts +18 -19
  537. package/src/resizable-box/index.tsx +10 -0
  538. package/src/resizable-box/stories/index.story.tsx +1 -1
  539. package/src/resizable-box/style.scss +8 -0
  540. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  541. package/src/sandbox/stories/index.story.tsx +1 -1
  542. package/src/scrollable/stories/index.story.tsx +2 -1
  543. package/src/search-control/stories/index.story.tsx +1 -1
  544. package/src/select-control/stories/index.story.tsx +1 -1
  545. package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
  546. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
  547. package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
  548. package/src/slot-fill/stories/index.story.tsx +2 -2
  549. package/src/slot-fill/types.ts +4 -3
  550. package/src/snackbar/stories/index.story.tsx +4 -4
  551. package/src/snackbar/stories/list.story.tsx +2 -2
  552. package/src/surface/stories/index.story.tsx +1 -1
  553. package/src/tabs/tab.tsx +0 -18
  554. package/src/tabs/test/index.tsx +1492 -947
  555. package/src/text-control/stories/index.story.tsx +1 -1
  556. package/src/textarea-control/stories/index.story.tsx +1 -1
  557. package/src/theme/stories/index.story.tsx +1 -1
  558. package/src/toggle-control/stories/index.story.tsx +1 -1
  559. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  560. package/src/toolbar/stories/index.story.tsx +1 -1
  561. package/src/toolbar/toolbar-button/index.tsx +2 -0
  562. package/src/tools-panel/stories/index.story.tsx +15 -3
  563. package/src/tools-panel/test/index.tsx +0 -17
  564. package/src/tools-panel/tools-panel/README.md +4 -0
  565. package/src/tools-panel/tools-panel/component.tsx +2 -0
  566. package/src/tooltip/stories/index.story.tsx +1 -1
  567. package/src/tree-grid/cell.tsx +5 -1
  568. package/src/tree-grid/stories/index.story.tsx +1 -1
  569. package/src/tree-grid/types.ts +1 -1
  570. package/src/tree-select/stories/index.story.tsx +1 -1
  571. package/src/unit-control/README.md +3 -3
  572. package/src/unit-control/index.tsx +11 -1
  573. package/src/unit-control/stories/index.story.tsx +5 -4
  574. package/src/unit-control/test/index.tsx +5 -1
  575. package/src/unit-control/types.ts +7 -0
  576. package/src/view/stories/index.story.tsx +1 -1
  577. package/src/visually-hidden/stories/index.story.tsx +1 -1
  578. package/src/z-stack/stories/index.story.tsx +1 -1
  579. package/tsconfig.tsbuildinfo +1 -1
  580. package/build/menu/use-temporary-focus-visible-fix.js +0 -27
  581. package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
  582. package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
  583. package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
  584. package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
  585. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
  586. package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
@@ -12,11 +12,14 @@ import * as Styled from './styles';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  export const MenuSeparator = forwardRef(function MenuSeparator(props, ref) {
14
14
  const menuContext = useContext(MenuContext);
15
+ if (!menuContext?.store) {
16
+ throw new Error('Menu.Separator can only be rendered inside a Menu component');
17
+ }
15
18
  return /*#__PURE__*/_jsx(Styled.MenuSeparator, {
16
19
  ref: ref,
17
20
  ...props,
18
- store: menuContext?.store,
19
- variant: menuContext?.variant
21
+ store: menuContext.store,
22
+ variant: menuContext.variant
20
23
  });
21
24
  });
22
25
  //# sourceMappingURL=separator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","useContext","MenuContext","Styled","jsx","_jsx","MenuSeparator","props","ref","menuContext","store","variant"],"sources":["@wordpress/components/src/menu/separator.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuSeparatorProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< MenuSeparatorProps, 'hr', false >\n>( function MenuSeparator( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\treturn (\n\t\t<Styled.MenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext?.store }\n\t\t\tvariant={ menuContext?.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,aAAa,GAAGN,UAAU,CAGpC,SAASM,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,WAAY,CAAC;EAC7C,oBACCG,IAAA,CAACF,MAAM,CAACG,aAAa;IACpBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,EAAEC,KAAO;IAC5BC,OAAO,EAAGF,WAAW,EAAEE;EAAS,CAChC,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["forwardRef","useContext","MenuContext","Styled","jsx","_jsx","MenuSeparator","props","ref","menuContext","store","Error","variant"],"sources":["@wordpress/components/src/menu/separator.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { MenuContext } from './context';\nimport type { MenuSeparatorProps } from './types';\nimport * as Styled from './styles';\n\nexport const MenuSeparator = forwardRef<\n\tHTMLHRElement,\n\tWordPressComponentProps< MenuSeparatorProps, 'hr', false >\n>( function MenuSeparator( props, ref ) {\n\tconst menuContext = useContext( MenuContext );\n\n\tif ( ! menuContext?.store ) {\n\t\tthrow new Error(\n\t\t\t'Menu.Separator can only be rendered inside a Menu component'\n\t\t);\n\t}\n\n\treturn (\n\t\t<Styled.MenuSeparator\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tstore={ menuContext.store }\n\t\t\tvariant={ menuContext.variant }\n\t\t/>\n\t);\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;;AAEA,SAASC,WAAW,QAAQ,WAAW;AAEvC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,OAAO,MAAMC,aAAa,GAAGN,UAAU,CAGpC,SAASM,aAAaA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACvC,MAAMC,WAAW,GAAGR,UAAU,CAAEC,WAAY,CAAC;EAE7C,IAAK,CAAEO,WAAW,EAAEC,KAAK,EAAG;IAC3B,MAAM,IAAIC,KAAK,CACd,6DACD,CAAC;EACF;EAEA,oBACCN,IAAA,CAACF,MAAM,CAACG,aAAa;IACpBE,GAAG,EAAGA,GAAK;IAAA,GACND,KAAK;IACVG,KAAK,EAAGD,WAAW,CAACC,KAAO;IAC3BE,OAAO,EAAGH,WAAW,CAACG;EAAS,CAC/B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
3
2
  const hiddenElementsByDepth = [];
4
3
 
@@ -1 +1 @@
1
- {"version":3,"names":["LIVE_REGION_ARIA_ROLES","Set","hiddenElementsByDepth","modalize","modalElement","elements","Array","from","document","body","children","hiddenElements","push","element","elementShouldBeHidden","setAttribute","role","getAttribute","tagName","hasAttribute","has","unmodalize","pop","removeAttribute"],"sources":["@wordpress/components/src/modal/aria-helper.ts"],"sourcesContent":["const LIVE_REGION_ARIA_ROLES = new Set( [\n\t'alert',\n\t'status',\n\t'log',\n\t'marquee',\n\t'timer',\n] );\n\nconst hiddenElementsByDepth: Element[][] = [];\n\n/**\n * Hides all elements in the body element from screen-readers except\n * the provided element and elements that should not be hidden from\n * screen-readers.\n *\n * The reason we do this is because `aria-modal=\"true\"` currently is bugged\n * in Safari, and support is spotty in other browsers overall. In the future\n * we should consider removing these helper functions in favor of\n * `aria-modal=\"true\"`.\n *\n * @param modalElement The element that should not be hidden.\n */\nexport function modalize( modalElement?: HTMLDivElement ) {\n\tconst elements = Array.from( document.body.children );\n\tconst hiddenElements: Element[] = [];\n\thiddenElementsByDepth.push( hiddenElements );\n\tfor ( const element of elements ) {\n\t\tif ( element === modalElement ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( elementShouldBeHidden( element ) ) {\n\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\t\t\thiddenElements.push( element );\n\t\t}\n\t}\n}\n\n/**\n * Determines if the passed element should not be hidden from screen readers.\n *\n * @param element The element that should be checked.\n *\n * @return Whether the element should not be hidden from screen-readers.\n */\nexport function elementShouldBeHidden( element: Element ) {\n\tconst role = element.getAttribute( 'role' );\n\treturn ! (\n\t\telement.tagName === 'SCRIPT' ||\n\t\telement.hasAttribute( 'hidden' ) ||\n\t\telement.hasAttribute( 'aria-hidden' ) ||\n\t\telement.hasAttribute( 'aria-live' ) ||\n\t\t( role && LIVE_REGION_ARIA_ROLES.has( role ) )\n\t);\n}\n\n/**\n * Accessibly reveals the elements hidden by the latest modal.\n */\nexport function unmodalize() {\n\tconst hiddenElements = hiddenElementsByDepth.pop();\n\tif ( ! hiddenElements ) {\n\t\treturn;\n\t}\n\n\tfor ( const element of hiddenElements ) {\n\t\telement.removeAttribute( 'aria-hidden' );\n\t}\n}\n"],"mappings":";AAAA,MAAMA,sBAAsB,GAAG,IAAIC,GAAG,CAAE,CACvC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,CACN,CAAC;AAEH,MAAMC,qBAAkC,GAAG,EAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAEC,YAA6B,EAAG;EACzD,MAAMC,QAAQ,GAAGC,KAAK,CAACC,IAAI,CAAEC,QAAQ,CAACC,IAAI,CAACC,QAAS,CAAC;EACrD,MAAMC,cAAyB,GAAG,EAAE;EACpCT,qBAAqB,CAACU,IAAI,CAAED,cAAe,CAAC;EAC5C,KAAM,MAAME,OAAO,IAAIR,QAAQ,EAAG;IACjC,IAAKQ,OAAO,KAAKT,YAAY,EAAG;MAC/B;IACD;IAEA,IAAKU,qBAAqB,CAAED,OAAQ,CAAC,EAAG;MACvCA,OAAO,CAACE,YAAY,CAAE,aAAa,EAAE,MAAO,CAAC;MAC7CJ,cAAc,CAACC,IAAI,CAAEC,OAAQ,CAAC;IAC/B;EACD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAED,OAAgB,EAAG;EACzD,MAAMG,IAAI,GAAGH,OAAO,CAACI,YAAY,CAAE,MAAO,CAAC;EAC3C,OAAO,EACNJ,OAAO,CAACK,OAAO,KAAK,QAAQ,IAC5BL,OAAO,CAACM,YAAY,CAAE,QAAS,CAAC,IAChCN,OAAO,CAACM,YAAY,CAAE,aAAc,CAAC,IACrCN,OAAO,CAACM,YAAY,CAAE,WAAY,CAAC,IACjCH,IAAI,IAAIhB,sBAAsB,CAACoB,GAAG,CAAEJ,IAAK,CAAG,CAC9C;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASK,UAAUA,CAAA,EAAG;EAC5B,MAAMV,cAAc,GAAGT,qBAAqB,CAACoB,GAAG,CAAC,CAAC;EAClD,IAAK,CAAEX,cAAc,EAAG;IACvB;EACD;EAEA,KAAM,MAAME,OAAO,IAAIF,cAAc,EAAG;IACvCE,OAAO,CAACU,eAAe,CAAE,aAAc,CAAC;EACzC;AACD","ignoreList":[]}
1
+ {"version":3,"names":["LIVE_REGION_ARIA_ROLES","Set","hiddenElementsByDepth","modalize","modalElement","elements","Array","from","document","body","children","hiddenElements","push","element","elementShouldBeHidden","setAttribute","role","getAttribute","tagName","hasAttribute","has","unmodalize","pop","removeAttribute"],"sources":["@wordpress/components/src/modal/aria-helper.ts"],"sourcesContent":["const LIVE_REGION_ARIA_ROLES = new Set( [\n\t'alert',\n\t'status',\n\t'log',\n\t'marquee',\n\t'timer',\n] );\n\nconst hiddenElementsByDepth: Element[][] = [];\n\n/**\n * Hides all elements in the body element from screen-readers except\n * the provided element and elements that should not be hidden from\n * screen-readers.\n *\n * The reason we do this is because `aria-modal=\"true\"` currently is bugged\n * in Safari, and support is spotty in other browsers overall. In the future\n * we should consider removing these helper functions in favor of\n * `aria-modal=\"true\"`.\n *\n * @param modalElement The element that should not be hidden.\n */\nexport function modalize( modalElement?: HTMLDivElement ) {\n\tconst elements = Array.from( document.body.children );\n\tconst hiddenElements: Element[] = [];\n\thiddenElementsByDepth.push( hiddenElements );\n\tfor ( const element of elements ) {\n\t\tif ( element === modalElement ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( elementShouldBeHidden( element ) ) {\n\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\t\t\thiddenElements.push( element );\n\t\t}\n\t}\n}\n\n/**\n * Determines if the passed element should not be hidden from screen readers.\n *\n * @param element The element that should be checked.\n *\n * @return Whether the element should not be hidden from screen-readers.\n */\nexport function elementShouldBeHidden( element: Element ) {\n\tconst role = element.getAttribute( 'role' );\n\treturn ! (\n\t\telement.tagName === 'SCRIPT' ||\n\t\telement.hasAttribute( 'hidden' ) ||\n\t\telement.hasAttribute( 'aria-hidden' ) ||\n\t\telement.hasAttribute( 'aria-live' ) ||\n\t\t( role && LIVE_REGION_ARIA_ROLES.has( role ) )\n\t);\n}\n\n/**\n * Accessibly reveals the elements hidden by the latest modal.\n */\nexport function unmodalize() {\n\tconst hiddenElements = hiddenElementsByDepth.pop();\n\tif ( ! hiddenElements ) {\n\t\treturn;\n\t}\n\n\tfor ( const element of hiddenElements ) {\n\t\telement.removeAttribute( 'aria-hidden' );\n\t}\n}\n"],"mappings":"AAAA,MAAMA,sBAAsB,GAAG,IAAIC,GAAG,CAAE,CACvC,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,OAAO,CACN,CAAC;AAEH,MAAMC,qBAAkC,GAAG,EAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAEC,YAA6B,EAAG;EACzD,MAAMC,QAAQ,GAAGC,KAAK,CAACC,IAAI,CAAEC,QAAQ,CAACC,IAAI,CAACC,QAAS,CAAC;EACrD,MAAMC,cAAyB,GAAG,EAAE;EACpCT,qBAAqB,CAACU,IAAI,CAAED,cAAe,CAAC;EAC5C,KAAM,MAAME,OAAO,IAAIR,QAAQ,EAAG;IACjC,IAAKQ,OAAO,KAAKT,YAAY,EAAG;MAC/B;IACD;IAEA,IAAKU,qBAAqB,CAAED,OAAQ,CAAC,EAAG;MACvCA,OAAO,CAACE,YAAY,CAAE,aAAa,EAAE,MAAO,CAAC;MAC7CJ,cAAc,CAACC,IAAI,CAAEC,OAAQ,CAAC;IAC/B;EACD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAAED,OAAgB,EAAG;EACzD,MAAMG,IAAI,GAAGH,OAAO,CAACI,YAAY,CAAE,MAAO,CAAC;EAC3C,OAAO,EACNJ,OAAO,CAACK,OAAO,KAAK,QAAQ,IAC5BL,OAAO,CAACM,YAAY,CAAE,QAAS,CAAC,IAChCN,OAAO,CAACM,YAAY,CAAE,aAAc,CAAC,IACrCN,OAAO,CAACM,YAAY,CAAE,WAAY,CAAC,IACjCH,IAAI,IAAIhB,sBAAsB,CAACoB,GAAG,CAAEJ,IAAK,CAAG,CAC9C;AACF;;AAEA;AACA;AACA;AACA,OAAO,SAASK,UAAUA,CAAA,EAAG;EAC5B,MAAMV,cAAc,GAAGT,qBAAqB,CAACoB,GAAG,CAAC,CAAC;EAClD,IAAK,CAAEX,cAAc,EAAG;IACvB;EACD;EAEA,KAAM,MAAME,OAAO,IAAIF,cAAc,EAAG;IACvCE,OAAO,CAACU,eAAe,CAAE,aAAc,CAAC;EACzC;AACD","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","createPortal","useCallback","useEffect","useRef","useState","forwardRef","useLayoutEffect","createContext","useContext","useInstanceId","useFocusReturn","useFocusOnMount","useConstrainedTabbing","useMergeRefs","__","close","getScrollContainer","ariaHelper","Button","StyleProvider","withIgnoreIMEEvents","Spacer","useModalExitAnimation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ModalContext","Set","bodyOpenClasses","Map","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","overlayClassnameProp","className","contentLabel","onKeyDown","isFullScreen","size","headerActions","__experimentalHideHeader","ref","instanceId","Modal","headingId","focusOnMountRef","constrainedTabbingRef","focusReturnRef","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","hasScrollableContent","setHasScrollableContent","sizeClass","isContentScrollable","current","closestScrollContainer","modalize","unmodalize","onRequestCloseRef","dismissers","nestedDismissers","add","dismisser","delete","_bodyOpenClasses$get","theClass","oneMore","get","set","document","body","classList","oneLess","remove","closeModal","frameRef","frameStyle","overlayClassname","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","code","key","defaultPrevented","preventDefault","then","onContentContainerScroll","e","_e$currentTarget$scro","scrollY","currentTarget","scrollTop","pressTarget","overlayPressHandlers","onPointerDown","target","onPointerUp","button","isSameTarget","modal","tabIndex","onScroll","id","marginBottom","marginLeft","onClick","label","Provider","value"],"sources":["@wordpress/components/src/modal/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreatePortal,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseLayoutEffect,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport {\n\tuseInstanceId,\n\tuseFocusReturn,\n\tuseFocusOnMount,\n\tuseConstrainedTabbing,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { close } from '@wordpress/icons';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport * as ariaHelper from './aria-helper';\nimport Button from '../button';\nimport StyleProvider from '../style-provider';\nimport type { ModalProps } from './types';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport { Spacer } from '../spacer';\nimport { useModalExitAnimation } from './use-modal-exit-animation';\n\n// Used to track and dismiss the prior modal when another opens unless nested.\ntype Dismissers = Set<\n\tReact.RefObject< ModalProps[ 'onRequestClose' ] | undefined >\n>;\nconst ModalContext = createContext< Dismissers >( new Set() );\n\n// Used to track body class names applied while modals are open.\nconst bodyOpenClasses = new Map< string, number >();\n\nfunction UnforwardedModal(\n\tprops: ModalProps,\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbodyOpenClassName = 'modal-open',\n\t\trole = 'dialog',\n\t\ttitle = null,\n\t\tfocusOnMount = true,\n\t\tshouldCloseOnEsc = true,\n\t\tshouldCloseOnClickOutside = true,\n\t\tisDismissible = true,\n\t\t/* Accessibility. */\n\t\taria = {\n\t\t\tlabelledby: undefined,\n\t\t\tdescribedby: undefined,\n\t\t},\n\t\tonRequestClose,\n\t\ticon,\n\t\tcloseButtonLabel,\n\t\tchildren,\n\t\tstyle,\n\t\toverlayClassName: overlayClassnameProp,\n\t\tclassName,\n\t\tcontentLabel,\n\t\tonKeyDown,\n\t\tisFullScreen = false,\n\t\tsize,\n\t\theaderActions = null,\n\t\t__experimentalHideHeader = false,\n\t} = props;\n\n\tconst ref = useRef< HTMLDivElement >();\n\n\tconst instanceId = useInstanceId( Modal );\n\tconst headingId = title\n\t\t? `components-modal-header-${ instanceId }`\n\t\t: aria.labelledby;\n\n\t// The focus hook does not support 'firstContentElement' but this is a valid\n\t// value for the Modal's focusOnMount prop. The following code ensures the focus\n\t// hook will focus the first focusable node within the element to which it is applied.\n\t// When `firstContentElement` is passed as the value of the focusOnMount prop,\n\t// the focus hook is applied to the Modal's content element.\n\t// Otherwise, the focus hook is applied to the Modal's ref. This ensures that the\n\t// focus hook will focus the first element in the Modal's **content** when\n\t// `firstContentElement` is passed.\n\tconst focusOnMountRef = useFocusOnMount(\n\t\tfocusOnMount === 'firstContentElement' ? 'firstElement' : focusOnMount\n\t);\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusReturnRef = useFocusReturn();\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\tconst childrenContainerRef = useRef< HTMLDivElement >( null );\n\n\tconst [ hasScrolledContent, setHasScrolledContent ] = useState( false );\n\tconst [ hasScrollableContent, setHasScrollableContent ] = useState( false );\n\n\tlet sizeClass;\n\tif ( isFullScreen || size === 'fill' ) {\n\t\tsizeClass = 'is-full-screen';\n\t} else if ( size ) {\n\t\tsizeClass = `has-size-${ size }`;\n\t}\n\n\t// Determines whether the Modal content is scrollable and updates the state.\n\tconst isContentScrollable = useCallback( () => {\n\t\tif ( ! contentRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closestScrollContainer = getScrollContainer( contentRef.current );\n\n\t\tif ( contentRef.current === closestScrollContainer ) {\n\t\t\tsetHasScrollableContent( true );\n\t\t} else {\n\t\t\tsetHasScrollableContent( false );\n\t\t}\n\t}, [ contentRef ] );\n\n\t// Accessibly isolates/unisolates the modal.\n\tuseEffect( () => {\n\t\tariaHelper.modalize( ref.current );\n\t\treturn () => ariaHelper.unmodalize();\n\t}, [] );\n\n\t// Keeps a fresh ref for the subsequent effect.\n\tconst onRequestCloseRef = useRef< ModalProps[ 'onRequestClose' ] >();\n\tuseEffect( () => {\n\t\tonRequestCloseRef.current = onRequestClose;\n\t}, [ onRequestClose ] );\n\n\t// The list of `onRequestClose` callbacks of open (non-nested) Modals. Only\n\t// one should remain open at a time and the list enables closing prior ones.\n\tconst dismissers = useContext( ModalContext );\n\t// Used for the tracking and dismissing any nested modals.\n\tconst [ nestedDismissers ] = useState< Dismissers >( () => new Set() );\n\n\t// Updates the stack tracking open modals at this level and calls\n\t// onRequestClose for any prior and/or nested modals as applicable.\n\tuseEffect( () => {\n\t\t// add this modal instance to the dismissers set\n\t\tdismissers.add( onRequestCloseRef );\n\t\t// request that all the other modals close themselves\n\t\tfor ( const dismisser of dismissers ) {\n\t\t\tif ( dismisser !== onRequestCloseRef ) {\n\t\t\t\tdismisser.current?.();\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\t// request that all the nested modals close themselves\n\t\t\tfor ( const dismisser of nestedDismissers ) {\n\t\t\t\tdismisser.current?.();\n\t\t\t}\n\t\t\t// remove this modal instance from the dismissers set\n\t\t\tdismissers.delete( onRequestCloseRef );\n\t\t};\n\t}, [ dismissers, nestedDismissers ] );\n\n\t// Adds/removes the value of bodyOpenClassName to body element.\n\tuseEffect( () => {\n\t\tconst theClass = bodyOpenClassName;\n\t\tconst oneMore = 1 + ( bodyOpenClasses.get( theClass ) ?? 0 );\n\t\tbodyOpenClasses.set( theClass, oneMore );\n\t\tdocument.body.classList.add( bodyOpenClassName );\n\t\treturn () => {\n\t\t\tconst oneLess = bodyOpenClasses.get( theClass )! - 1;\n\t\t\tif ( oneLess === 0 ) {\n\t\t\t\tdocument.body.classList.remove( theClass );\n\t\t\t\tbodyOpenClasses.delete( theClass );\n\t\t\t} else {\n\t\t\t\tbodyOpenClasses.set( theClass, oneLess );\n\t\t\t}\n\t\t};\n\t}, [ bodyOpenClassName ] );\n\n\tconst { closeModal, frameRef, frameStyle, overlayClassname } =\n\t\tuseModalExitAnimation();\n\n\t// Calls the isContentScrollable callback when the Modal children container resizes.\n\tuseLayoutEffect( () => {\n\t\tif ( ! window.ResizeObserver || ! childrenContainerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver( isContentScrollable );\n\t\tresizeObserver.observe( childrenContainerRef.current );\n\n\t\tisContentScrollable();\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, [ isContentScrollable, childrenContainerRef ] );\n\n\tfunction handleEscapeKeyDown(\n\t\tevent: React.KeyboardEvent< HTMLDivElement >\n\t) {\n\t\tif (\n\t\t\tshouldCloseOnEsc &&\n\t\t\t( event.code === 'Escape' || event.key === 'Escape' ) &&\n\t\t\t! event.defaultPrevented\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tcloseModal().then( () => onRequestClose( event ) );\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: React.UIEvent< HTMLDivElement > ) => {\n\t\t\tconst scrollY = e?.currentTarget?.scrollTop ?? -1;\n\n\t\t\tif ( ! hasScrolledContent && scrollY > 0 ) {\n\t\t\t\tsetHasScrolledContent( true );\n\t\t\t} else if ( hasScrolledContent && scrollY <= 0 ) {\n\t\t\t\tsetHasScrolledContent( false );\n\t\t\t}\n\t\t},\n\t\t[ hasScrolledContent ]\n\t);\n\n\tlet pressTarget: EventTarget | null = null;\n\tconst overlayPressHandlers: {\n\t\tonPointerDown: React.PointerEventHandler< HTMLDivElement >;\n\t\tonPointerUp: React.PointerEventHandler< HTMLDivElement >;\n\t} = {\n\t\tonPointerDown: ( event ) => {\n\t\t\tif ( event.target === event.currentTarget ) {\n\t\t\t\tpressTarget = event.target;\n\t\t\t\t// Avoids focus changing so that focus return works as expected.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t// Closes the modal with two exceptions. 1. Opening the context menu on\n\t\t// the overlay. 2. Pressing on the overlay then dragging the pointer\n\t\t// over the modal and releasing. Due to the modal being a child of the\n\t\t// overlay, such a gesture is a `click` on the overlay and cannot be\n\t\t// excepted by a `click` handler. Thus the tactic of handling\n\t\t// `pointerup` and comparing its target to that of the `pointerdown`.\n\t\tonPointerUp: ( { target, button } ) => {\n\t\t\tconst isSameTarget = target === pressTarget;\n\t\t\tpressTarget = null;\n\t\t\tif ( button === 0 && isSameTarget ) {\n\t\t\t\tcloseModal().then( () => onRequestClose() );\n\t\t\t}\n\t\t},\n\t};\n\n\tconst modal = (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassname,\n\t\t\t\toverlayClassnameProp\n\t\t\t) }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( handleEscapeKeyDown ) }\n\t\t\t{ ...( shouldCloseOnClickOutside ? overlayPressHandlers : {} ) }\n\t\t>\n\t\t\t<StyleProvider document={ document }>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-modal__frame',\n\t\t\t\t\t\tsizeClass,\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...frameStyle,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\tframeRef,\n\t\t\t\t\t\tconstrainedTabbingRef,\n\t\t\t\t\t\tfocusReturnRef,\n\t\t\t\t\t\tfocusOnMount !== 'firstContentElement'\n\t\t\t\t\t\t\t? focusOnMountRef\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t] ) }\n\t\t\t\t\trole={ role }\n\t\t\t\t\taria-label={ contentLabel }\n\t\t\t\t\taria-labelledby={ contentLabel ? undefined : headingId }\n\t\t\t\t\taria-describedby={ aria.describedby }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx( 'components-modal__content', {\n\t\t\t\t\t\t\t'hide-header': __experimentalHideHeader,\n\t\t\t\t\t\t\t'is-scrollable': hasScrollableContent,\n\t\t\t\t\t\t\t'has-scrolled-content': hasScrolledContent,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trole=\"document\"\n\t\t\t\t\t\tonScroll={ onContentContainerScroll }\n\t\t\t\t\t\tref={ contentRef }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\thasScrollableContent\n\t\t\t\t\t\t\t\t? __( 'Scrollable section' )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={ hasScrollableContent ? 0 : undefined }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! __experimentalHideHeader && (\n\t\t\t\t\t\t\t<div className=\"components-modal__header\">\n\t\t\t\t\t\t\t\t<div className=\"components-modal__header-heading-container\">\n\t\t\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__icon-container\"\n\t\t\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t\t\t\t<h1\n\t\t\t\t\t\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__header-heading\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{ headerActions }\n\t\t\t\t\t\t\t\t{ isDismissible && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\t\t\t\t\t\tmarginLeft={ 2 }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\t\t\t\t\tevent: React.MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t\t\tcloseModal().then( () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tonRequestClose( event )\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel ||\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Close' )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\t\t\tchildrenContainerRef,\n\t\t\t\t\t\t\t\tfocusOnMount === 'firstContentElement'\n\t\t\t\t\t\t\t\t\t? focusOnMountRef\n\t\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</StyleProvider>\n\t\t</div>\n\t);\n\n\treturn createPortal(\n\t\t<ModalContext.Provider value={ nestedDismissers }>\n\t\t\t{ modal }\n\t\t</ModalContext.Provider>,\n\t\tdocument.body\n\t);\n}\n\n/**\n * Modals give users information and choices related to a task they’re trying to\n * accomplish. They can contain critical information, require decisions, or\n * involve multiple tasks.\n *\n * ```jsx\n * import { Button, Modal } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyModal = () => {\n * const [ isOpen, setOpen ] = useState( false );\n * const openModal = () => setOpen( true );\n * const closeModal = () => setOpen( false );\n *\n * return (\n * <>\n * <Button variant=\"secondary\" onClick={ openModal }>\n * Open Modal\n * </Button>\n * { isOpen && (\n * <Modal title=\"This is my modal\" onRequestClose={ closeModal }>\n * <Button variant=\"secondary\" onClick={ closeModal }>\n * My custom close button\n * </Button>\n * </Modal>\n * ) }\n * </>\n * );\n * };\n * ```\n */\nexport const Modal = forwardRef( UnforwardedModal );\n\nexport default Modal;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,aAAa,EACbC,UAAU,QACJ,oBAAoB;AAC3B,SACCC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,qBAAqB,EACrBC,YAAY,QACN,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,kBAAkB,QAAQ,gBAAgB;;AAEnD;AACA;AACA;AACA,OAAO,KAAKC,UAAU,MAAM,eAAe;AAC3C,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,aAAa,MAAM,mBAAmB;AAE7C,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,qBAAqB,QAAQ,4BAA4B;;AAElE;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAIA,MAAMC,YAAY,GAAGtB,aAAa,CAAgB,IAAIuB,GAAG,CAAC,CAAE,CAAC;;AAE7D;AACA,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAAmB,CAAC;AAEnD,SAASC,gBAAgBA,CACxBC,KAAiB,EACjBC,YAAkD,EACjD;EACD,MAAM;IACLC,iBAAiB,GAAG,YAAY;IAChCC,IAAI,GAAG,QAAQ;IACfC,KAAK,GAAG,IAAI;IACZC,YAAY,GAAG,IAAI;IACnBC,gBAAgB,GAAG,IAAI;IACvBC,yBAAyB,GAAG,IAAI;IAChCC,aAAa,GAAG,IAAI;IACpB;IACAC,IAAI,GAAG;MACNC,UAAU,EAAEC,SAAS;MACrBC,WAAW,EAAED;IACd,CAAC;IAC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AAC;QAAA,CACF;MAAC,CACF;IAAC,CACQ;EAAC,CACZ,CACL;EAED,OAAOlD,YAAY,cAClBwB,IAAA,CAACK,YAAY,CAACwG,QAAQ;IAACC,KAAK,EAAGpD,gBAAkB;IAAAhC,QAAA,EAC9C2E;EAAK,CACe,CAAC,EACxBlC,QAAQ,CAACC,IACV,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM7B,KAAK,GAAG1D,UAAU,CAAE4B,gBAAiB,CAAC;AAEnD,eAAe8B,KAAK","ignoreList":[]}
1
+ {"version":3,"names":["clsx","createPortal","useCallback","useEffect","useRef","useState","forwardRef","useLayoutEffect","createContext","useContext","useInstanceId","useFocusReturn","useFocusOnMount","useConstrainedTabbing","useMergeRefs","__","close","getScrollContainer","ariaHelper","Button","StyleProvider","withIgnoreIMEEvents","Spacer","useModalExitAnimation","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ModalContext","Set","bodyOpenClasses","Map","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","overlayClassnameProp","className","contentLabel","onKeyDown","isFullScreen","size","headerActions","__experimentalHideHeader","ref","instanceId","Modal","headingId","focusOnMountRef","constrainedTabbingRef","focusReturnRef","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","hasScrollableContent","setHasScrollableContent","sizeClass","isContentScrollable","current","closestScrollContainer","modalize","unmodalize","onRequestCloseRef","dismissers","nestedDismissers","add","dismisser","delete","_bodyOpenClasses$get","theClass","oneMore","get","set","document","body","classList","oneLess","remove","closeModal","frameRef","frameStyle","overlayClassname","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","code","key","defaultPrevented","preventDefault","then","onContentContainerScroll","e","_e$currentTarget$scro","scrollY","currentTarget","scrollTop","pressTarget","overlayPressHandlers","onPointerDown","target","onPointerUp","button","isSameTarget","modal","tabIndex","onScroll","id","marginBottom","marginLeft","onClick","label","Provider","value"],"sources":["@wordpress/components/src/modal/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcreatePortal,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseLayoutEffect,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport {\n\tuseInstanceId,\n\tuseFocusReturn,\n\tuseFocusOnMount,\n\tuseConstrainedTabbing,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { close } from '@wordpress/icons';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport * as ariaHelper from './aria-helper';\nimport Button from '../button';\nimport StyleProvider from '../style-provider';\nimport type { ModalProps } from './types';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport { Spacer } from '../spacer';\nimport { useModalExitAnimation } from './use-modal-exit-animation';\n\n// Used to track and dismiss the prior modal when another opens unless nested.\ntype Dismissers = Set<\n\tReact.RefObject< ModalProps[ 'onRequestClose' ] | undefined >\n>;\nconst ModalContext = createContext< Dismissers >( new Set() );\n\n// Used to track body class names applied while modals are open.\nconst bodyOpenClasses = new Map< string, number >();\n\nfunction UnforwardedModal(\n\tprops: ModalProps,\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst {\n\t\tbodyOpenClassName = 'modal-open',\n\t\trole = 'dialog',\n\t\ttitle = null,\n\t\tfocusOnMount = true,\n\t\tshouldCloseOnEsc = true,\n\t\tshouldCloseOnClickOutside = true,\n\t\tisDismissible = true,\n\t\t/* Accessibility. */\n\t\taria = {\n\t\t\tlabelledby: undefined,\n\t\t\tdescribedby: undefined,\n\t\t},\n\t\tonRequestClose,\n\t\ticon,\n\t\tcloseButtonLabel,\n\t\tchildren,\n\t\tstyle,\n\t\toverlayClassName: overlayClassnameProp,\n\t\tclassName,\n\t\tcontentLabel,\n\t\tonKeyDown,\n\t\tisFullScreen = false,\n\t\tsize,\n\t\theaderActions = null,\n\t\t__experimentalHideHeader = false,\n\t} = props;\n\n\tconst ref = useRef< HTMLDivElement >();\n\n\tconst instanceId = useInstanceId( Modal );\n\tconst headingId = title\n\t\t? `components-modal-header-${ instanceId }`\n\t\t: aria.labelledby;\n\n\t// The focus hook does not support 'firstContentElement' but this is a valid\n\t// value for the Modal's focusOnMount prop. The following code ensures the focus\n\t// hook will focus the first focusable node within the element to which it is applied.\n\t// When `firstContentElement` is passed as the value of the focusOnMount prop,\n\t// the focus hook is applied to the Modal's content element.\n\t// Otherwise, the focus hook is applied to the Modal's ref. This ensures that the\n\t// focus hook will focus the first element in the Modal's **content** when\n\t// `firstContentElement` is passed.\n\tconst focusOnMountRef = useFocusOnMount(\n\t\tfocusOnMount === 'firstContentElement' ? 'firstElement' : focusOnMount\n\t);\n\tconst constrainedTabbingRef = useConstrainedTabbing();\n\tconst focusReturnRef = useFocusReturn();\n\tconst contentRef = useRef< HTMLDivElement >( null );\n\tconst childrenContainerRef = useRef< HTMLDivElement >( null );\n\n\tconst [ hasScrolledContent, setHasScrolledContent ] = useState( false );\n\tconst [ hasScrollableContent, setHasScrollableContent ] = useState( false );\n\n\tlet sizeClass;\n\tif ( isFullScreen || size === 'fill' ) {\n\t\tsizeClass = 'is-full-screen';\n\t} else if ( size ) {\n\t\tsizeClass = `has-size-${ size }`;\n\t}\n\n\t// Determines whether the Modal content is scrollable and updates the state.\n\tconst isContentScrollable = useCallback( () => {\n\t\tif ( ! contentRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst closestScrollContainer = getScrollContainer( contentRef.current );\n\n\t\tif ( contentRef.current === closestScrollContainer ) {\n\t\t\tsetHasScrollableContent( true );\n\t\t} else {\n\t\t\tsetHasScrollableContent( false );\n\t\t}\n\t}, [ contentRef ] );\n\n\t// Accessibly isolates/unisolates the modal.\n\tuseEffect( () => {\n\t\tariaHelper.modalize( ref.current );\n\t\treturn () => ariaHelper.unmodalize();\n\t}, [] );\n\n\t// Keeps a fresh ref for the subsequent effect.\n\tconst onRequestCloseRef = useRef< ModalProps[ 'onRequestClose' ] >();\n\tuseEffect( () => {\n\t\tonRequestCloseRef.current = onRequestClose;\n\t}, [ onRequestClose ] );\n\n\t// The list of `onRequestClose` callbacks of open (non-nested) Modals. Only\n\t// one should remain open at a time and the list enables closing prior ones.\n\tconst dismissers = useContext( ModalContext );\n\t// Used for the tracking and dismissing any nested modals.\n\tconst [ nestedDismissers ] = useState< Dismissers >( () => new Set() );\n\n\t// Updates the stack tracking open modals at this level and calls\n\t// onRequestClose for any prior and/or nested modals as applicable.\n\tuseEffect( () => {\n\t\t// add this modal instance to the dismissers set\n\t\tdismissers.add( onRequestCloseRef );\n\t\t// request that all the other modals close themselves\n\t\tfor ( const dismisser of dismissers ) {\n\t\t\tif ( dismisser !== onRequestCloseRef ) {\n\t\t\t\tdismisser.current?.();\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\t// request that all the nested modals close themselves\n\t\t\tfor ( const dismisser of nestedDismissers ) {\n\t\t\t\tdismisser.current?.();\n\t\t\t}\n\t\t\t// remove this modal instance from the dismissers set\n\t\t\tdismissers.delete( onRequestCloseRef );\n\t\t};\n\t}, [ dismissers, nestedDismissers ] );\n\n\t// Adds/removes the value of bodyOpenClassName to body element.\n\tuseEffect( () => {\n\t\tconst theClass = bodyOpenClassName;\n\t\tconst oneMore = 1 + ( bodyOpenClasses.get( theClass ) ?? 0 );\n\t\tbodyOpenClasses.set( theClass, oneMore );\n\t\tdocument.body.classList.add( bodyOpenClassName );\n\t\treturn () => {\n\t\t\tconst oneLess = bodyOpenClasses.get( theClass )! - 1;\n\t\t\tif ( oneLess === 0 ) {\n\t\t\t\tdocument.body.classList.remove( theClass );\n\t\t\t\tbodyOpenClasses.delete( theClass );\n\t\t\t} else {\n\t\t\t\tbodyOpenClasses.set( theClass, oneLess );\n\t\t\t}\n\t\t};\n\t}, [ bodyOpenClassName ] );\n\n\tconst { closeModal, frameRef, frameStyle, overlayClassname } =\n\t\tuseModalExitAnimation();\n\n\t// Calls the isContentScrollable callback when the Modal children container resizes.\n\tuseLayoutEffect( () => {\n\t\tif ( ! window.ResizeObserver || ! childrenContainerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst resizeObserver = new ResizeObserver( isContentScrollable );\n\t\tresizeObserver.observe( childrenContainerRef.current );\n\n\t\tisContentScrollable();\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, [ isContentScrollable, childrenContainerRef ] );\n\n\tfunction handleEscapeKeyDown(\n\t\tevent: React.KeyboardEvent< HTMLDivElement >\n\t) {\n\t\tif (\n\t\t\tshouldCloseOnEsc &&\n\t\t\t( event.code === 'Escape' || event.key === 'Escape' ) &&\n\t\t\t! event.defaultPrevented\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tcloseModal().then( () => onRequestClose( event ) );\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: React.UIEvent< HTMLDivElement > ) => {\n\t\t\tconst scrollY = e?.currentTarget?.scrollTop ?? -1;\n\n\t\t\tif ( ! hasScrolledContent && scrollY > 0 ) {\n\t\t\t\tsetHasScrolledContent( true );\n\t\t\t} else if ( hasScrolledContent && scrollY <= 0 ) {\n\t\t\t\tsetHasScrolledContent( false );\n\t\t\t}\n\t\t},\n\t\t[ hasScrolledContent ]\n\t);\n\n\tlet pressTarget: EventTarget | null = null;\n\tconst overlayPressHandlers: {\n\t\tonPointerDown: React.PointerEventHandler< HTMLDivElement >;\n\t\tonPointerUp: React.PointerEventHandler< HTMLDivElement >;\n\t} = {\n\t\tonPointerDown: ( event ) => {\n\t\t\tif ( event.target === event.currentTarget ) {\n\t\t\t\tpressTarget = event.target;\n\t\t\t\t// Avoids focus changing so that focus return works as expected.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t// Closes the modal with two exceptions. 1. Opening the context menu on\n\t\t// the overlay. 2. Pressing on the overlay then dragging the pointer\n\t\t// over the modal and releasing. Due to the modal being a child of the\n\t\t// overlay, such a gesture is a `click` on the overlay and cannot be\n\t\t// excepted by a `click` handler. Thus the tactic of handling\n\t\t// `pointerup` and comparing its target to that of the `pointerdown`.\n\t\tonPointerUp: ( { target, button } ) => {\n\t\t\tconst isSameTarget = target === pressTarget;\n\t\t\tpressTarget = null;\n\t\t\tif ( button === 0 && isSameTarget ) {\n\t\t\t\tcloseModal().then( () => onRequestClose() );\n\t\t\t}\n\t\t},\n\t};\n\n\tconst modal = (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tref={ useMergeRefs( [ ref, forwardedRef ] ) }\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassname,\n\t\t\t\toverlayClassnameProp\n\t\t\t) }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( handleEscapeKeyDown ) }\n\t\t\t{ ...( shouldCloseOnClickOutside ? overlayPressHandlers : {} ) }\n\t\t>\n\t\t\t<StyleProvider document={ document }>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-modal__frame',\n\t\t\t\t\t\tsizeClass,\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...frameStyle,\n\t\t\t\t\t\t...style,\n\t\t\t\t\t} }\n\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\tframeRef,\n\t\t\t\t\t\tconstrainedTabbingRef,\n\t\t\t\t\t\tfocusReturnRef,\n\t\t\t\t\t\tfocusOnMount !== 'firstContentElement'\n\t\t\t\t\t\t\t? focusOnMountRef\n\t\t\t\t\t\t\t: null,\n\t\t\t\t\t] ) }\n\t\t\t\t\trole={ role }\n\t\t\t\t\taria-label={ contentLabel }\n\t\t\t\t\taria-labelledby={ contentLabel ? undefined : headingId }\n\t\t\t\t\taria-describedby={ aria.describedby }\n\t\t\t\t\ttabIndex={ -1 }\n\t\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx( 'components-modal__content', {\n\t\t\t\t\t\t\t'hide-header': __experimentalHideHeader,\n\t\t\t\t\t\t\t'is-scrollable': hasScrollableContent,\n\t\t\t\t\t\t\t'has-scrolled-content': hasScrolledContent,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\trole=\"document\"\n\t\t\t\t\t\tonScroll={ onContentContainerScroll }\n\t\t\t\t\t\tref={ contentRef }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\thasScrollableContent\n\t\t\t\t\t\t\t\t? __( 'Scrollable section' )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttabIndex={ hasScrollableContent ? 0 : undefined }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! __experimentalHideHeader && (\n\t\t\t\t\t\t\t<div className=\"components-modal__header\">\n\t\t\t\t\t\t\t\t<div className=\"components-modal__header-heading-container\">\n\t\t\t\t\t\t\t\t\t{ icon && (\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__icon-container\"\n\t\t\t\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ icon }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t\t\t\t<h1\n\t\t\t\t\t\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"components-modal__header-heading\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{ headerActions }\n\t\t\t\t\t\t\t\t{ isDismissible && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\t\t\t\t\tmarginBottom={ 0 }\n\t\t\t\t\t\t\t\t\t\t\tmarginLeft={ 2 }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ (\n\t\t\t\t\t\t\t\t\t\t\t\tevent: React.MouseEvent< HTMLButtonElement >\n\t\t\t\t\t\t\t\t\t\t\t) =>\n\t\t\t\t\t\t\t\t\t\t\t\tcloseModal().then( () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tonRequestClose( event )\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel ||\n\t\t\t\t\t\t\t\t\t\t\t\t__( 'Close' )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t\t\t\tchildrenContainerRef,\n\t\t\t\t\t\t\t\tfocusOnMount === 'firstContentElement'\n\t\t\t\t\t\t\t\t\t? focusOnMountRef\n\t\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t] ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</StyleProvider>\n\t\t</div>\n\t);\n\n\treturn createPortal(\n\t\t<ModalContext.Provider value={ nestedDismissers }>\n\t\t\t{ modal }\n\t\t</ModalContext.Provider>,\n\t\tdocument.body\n\t);\n}\n\n/**\n * Modals give users information and choices related to a task they’re trying to\n * accomplish. They can contain critical information, require decisions, or\n * involve multiple tasks.\n *\n * ```jsx\n * import { Button, Modal } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyModal = () => {\n * const [ isOpen, setOpen ] = useState( false );\n * const openModal = () => setOpen( true );\n * const closeModal = () => setOpen( false );\n *\n * return (\n * <>\n * <Button variant=\"secondary\" onClick={ openModal }>\n * Open Modal\n * </Button>\n * { isOpen && (\n * <Modal title=\"This is my modal\" onRequestClose={ closeModal }>\n * <Button variant=\"secondary\" onClick={ closeModal }>\n * My custom close button\n * </Button>\n * </Modal>\n * ) }\n * </>\n * );\n * };\n * ```\n */\nexport const Modal = forwardRef( UnforwardedModal );\n\nexport default Modal;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,aAAa,EACbC,UAAU,QACJ,oBAAoB;AAC3B,SACCC,aAAa,EACbC,cAAc,EACdC,eAAe,EACfC,qBAAqB,EACrBC,YAAY,QACN,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,kBAAkB,QAAQ,gBAAgB;;AAEnD;AACA;AACA;AACA,OAAO,KAAKC,UAAU,MAAM,eAAe;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stack';
22
22
  import { Spacer } from '../spacer';
23
23
  import { useCx } from '../utils';
24
24
  import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';
25
+ import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';
25
26
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
26
27
  const noop = () => {};
27
28
  function UnforwardedNumberControl(props, forwardedRef) {
@@ -45,8 +46,15 @@ function UnforwardedNumberControl(props, forwardedRef) {
45
46
  size = 'default',
46
47
  suffix,
47
48
  onChange = noop,
49
+ __shouldNotWarnDeprecated36pxSize,
48
50
  ...restProps
49
51
  } = useDeprecated36pxDefaultSizeProp(props);
52
+ maybeWarnDeprecated36pxSize({
53
+ componentName: 'NumberControl',
54
+ size,
55
+ __next40pxDefaultSize: restProps.__next40pxDefaultSize,
56
+ __shouldNotWarnDeprecated36pxSize
57
+ });
50
58
  if (hideHTMLArrows) {
51
59
  deprecated('wp.components.NumberControl hideHTMLArrows prop ', {
52
60
  alternative: 'spinControls="none"',
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useRef","forwardRef","isRTL","__","plus","plusIcon","reset","resetIcon","useMergeRefs","deprecated","Input","SpinButton","styles","inputControlActionTypes","add","subtract","roundClamp","ensureNumber","isValueEmpty","HStack","Spacer","useCx","useDeprecated36pxDefaultSizeProp","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","restProps","alternative","since","version","inputRef","mergedRef","isStepAny","baseStep","baseSpin","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","cx","spinButtonClasses","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","inputMode","ref","_stateReducerProp","baseState","children","marginBottom","marginRight","spacing","icon","onClick","NumberControl"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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, styles } 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 '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : '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\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\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 baseSpin = ensureNumber( spinFactor ) * baseStep;\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\t// Use '' + to convert to string for use in input value attribute.\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 = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\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 ) * baseSpin : baseSpin;\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\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\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\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\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\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{ ...restProps }\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\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\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/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\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/>\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,UAAU,QAAQ,oBAAoB;AACvD,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,IAAIC,QAAQ,EAAEC,KAAK,IAAIC,SAAS,QAAQ,kBAAkB;AACvE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,KAAK,EAAEC,UAAU,EAAEC,MAAM,QAAQ,gCAAgC;AAC1E,OAAO,KAAKC,uBAAuB,MAAM,kCAAkC;AAC3E,SAASC,GAAG,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,eAAe;AACzD,SAASC,YAAY,EAAEC,YAAY,QAAQ,iBAAiB;AAG5D,SAASC,MAAM,QAAQ,YAAY;AACnC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,gCAAgC,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEjF,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,wBAAwBA,CAChCC,KAAoE,EACpEC,YAAiC,EAChC;EACD,MAAM;IACLC,sBAAsB,EAAEC,gBAAgB;IACxCC,SAAS;IACTC,aAAa,GAAG,GAAG;IACnBC,cAAc,GAAG,KAAK;IACtBC,YAAY,GAAGD,cAAc,GAAG,MAAM,GAAG,QAAQ;IACjDE,aAAa,GAAG,IAAI;IACpBC,kBAAkB,GAAG,IA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B,CAAC;AAEJ;AAEA,OAAO,MAAM+D,aAAa,GAAGrH,UAAU,CAAE6B,wBAAyB,CAAC;AAEnE,eAAewF,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRef","forwardRef","isRTL","__","plus","plusIcon","reset","resetIcon","useMergeRefs","deprecated","Input","SpinButton","styles","inputControlActionTypes","add","subtract","roundClamp","ensureNumber","isValueEmpty","HStack","Spacer","useCx","useDeprecated36pxDefaultSizeProp","maybeWarnDeprecated36pxSize","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","noop","UnforwardedNumberControl","props","forwardedRef","__unstableStateReducer","stateReducerProp","className","dragDirection","hideHTMLArrows","spinControls","isDragEnabled","isShiftStepEnabled","label","max","Infinity","min","required","shiftStep","step","spinFactor","type","typeProp","value","valueProp","size","suffix","onChange","__shouldNotWarnDeprecated36pxSize","restProps","componentName","__next40pxDefaultSize","alternative","since","version","inputRef","mergedRef","isStepAny","baseStep","baseSpin","baseValue","constrainValue","stepOverride","Math","autoComplete","undefined","classes","cx","spinButtonClasses","smallSpinButtons","spinValue","direction","event","preventDefault","shift","shiftKey","delta","nextValue","numberControlStateReducer","state","action","nextState","payload","currentValue","PRESS_UP","PRESS_DOWN","DRAG","x","y","enableShift","modifier","directionModifier","ceil","abs","sign","distance","PRESS_ENTER","COMMIT","applyEmptyValue","buildSpinButtonClickHandler","String","target","current","inputMode","ref","_stateReducerProp","baseState","children","marginBottom","marginRight","spacing","icon","onClick","NumberControl"],"sources":["@wordpress/components/src/number-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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, styles } 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 '../context/wordpress-component';\nimport type { NumberControlProps } from './types';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\nfunction UnforwardedNumberControl(\n\tprops: WordPressComponentProps< NumberControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer: stateReducerProp,\n\t\tclassName,\n\t\tdragDirection = 'n',\n\t\thideHTMLArrows = false,\n\t\tspinControls = hideHTMLArrows ? 'none' : '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\tspinFactor = 1,\n\t\ttype: typeProp = 'number',\n\t\tvalue: valueProp,\n\t\tsize = 'default',\n\t\tsuffix,\n\t\tonChange = noop,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...restProps\n\t} = useDeprecated36pxDefaultSizeProp< NumberControlProps >( props );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'NumberControl',\n\t\tsize,\n\t\t__next40pxDefaultSize: restProps.__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tif ( hideHTMLArrows ) {\n\t\tdeprecated( 'wp.components.NumberControl hideHTMLArrows prop ', {\n\t\t\talternative: 'spinControls=\"none\"',\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.3',\n\t\t} );\n\t}\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 baseSpin = ensureNumber( spinFactor ) * baseStep;\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\t// Use '' + to convert to string for use in input value attribute.\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 = clsx( 'components-number-control', className );\n\tconst cx = useCx();\n\tconst spinButtonClasses = cx( size === 'small' && styles.smallSpinButtons );\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 ) * baseSpin : baseSpin;\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\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\tconst [ x, y ] = payload.delta;\n\t\t\t\tconst enableShift = payload.shiftKey && isShiftStepEnabled;\n\t\t\t\tconst modifier = enableShift\n\t\t\t\t\t? ensureNumber( shiftStep ) * baseSpin\n\t\t\t\t\t: baseSpin;\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\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\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{ ...restProps }\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\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ plusIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Increment' ) }\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/>\n\t\t\t\t\t\t\t\t<SpinButton\n\t\t\t\t\t\t\t\t\tclassName={ spinButtonClasses }\n\t\t\t\t\t\t\t\t\ticon={ resetIcon }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Decrement' ) }\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/>\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,UAA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EnE,eAAe2F,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/number-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type NumberControlProps = Omit<\n\tInputControlProps,\n\t'isDragEnabled' | 'min' | 'max' | 'required' | 'step' | 'type' | 'value'\n> & {\n\t/**\n\t * If true, the default `input` HTML arrows will be hidden.\n\t *\n\t * @deprecated\n\t * @default false\n\t */\n\thideHTMLArrows?: boolean;\n\t/**\n\t * The type of spin controls to display. These are buttons that allow the\n\t * user to quickly increment and decrement the number.\n\t *\n\t * - 'none' - Do not show spin controls.\n\t * - 'native' - Use browser's native HTML `input` controls.\n\t * - 'custom' - Use plus and minus icon buttons.\n\t *\n\t * @default 'native'\n\t */\n\tspinControls?: 'none' | 'native' | 'custom';\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default true\n\t */\n\tisDragEnabled?: InputControlProps[ 'isDragEnabled' ];\n\t/**\n\t * If true, pressing `UP` or `DOWN` along with the `SHIFT` key will increment the\n\t * value by the `shiftStep` value.\n\t *\n\t * @default true\n\t */\n\tisShiftStepEnabled?: boolean;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default Infinity\n\t */\n\tmax?: number;\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default -Infinity\n\t */\n\tmin?: number;\n\t/**\n\t * If `true` enforces a valid number within the control's min/max range.\n\t * If `false` allows an empty string as a valid value.\n\t *\n\t * @default false\n\t */\n\trequired?: InputControlProps[ 'required' ];\n\t/**\n\t * Amount to increment by when the `SHIFT` key is held down. This shift value is\n\t * a multiplier to the `step` value. For example, if the `step` value is `5`,\n\t * and `shiftStep` is `10`, each jump would increment/decrement by `50`.\n\t *\n\t * @default 10\n\t */\n\tshiftStep?: number;\n\t/**\n\t * Amount by which the `value` is changed when incrementing/decrementing.\n\t * It is also a factor in validation as `value` must be a multiple of `step`\n\t * (offset by `min`, if specified) to be valid. Accepts the special string value `any`\n\t * that voids the validation constraint and causes stepping actions to increment/decrement by `1`.\n\t *\n\t * @default 1\n\t */\n\tstep?: InputControlProps[ 'step' ];\n\t/**\n\t * Optional multiplication factor in spin changes. i.e. A spin changes\n\t * by `spinFactor * step` (if `step` is \"any\", 1 is used instead).\n\t *\n\t * @default 1\n\t */\n\tspinFactor?: number;\n\t/**\n\t * The `type` attribute of the `input` element.\n\t *\n\t * @default 'number'\n\t */\n\ttype?: InputControlProps[ 'type' ];\n\t/**\n\t * The value of the input.\n\t */\n\tvalue?: number | string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/number-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { InputControlProps } from '../input-control/types';\n\nexport type NumberControlProps = Omit<\n\tInputControlProps,\n\t'isDragEnabled' | 'min' | 'max' | 'required' | 'step' | 'type' | 'value'\n> & {\n\t/**\n\t * If true, the default `input` HTML arrows will be hidden.\n\t *\n\t * @deprecated\n\t * @default false\n\t */\n\thideHTMLArrows?: boolean;\n\t/**\n\t * The type of spin controls to display. These are buttons that allow the\n\t * user to quickly increment and decrement the number.\n\t *\n\t * - 'none' - Do not show spin controls.\n\t * - 'native' - Use browser's native HTML `input` controls.\n\t * - 'custom' - Use plus and minus icon buttons.\n\t *\n\t * @default 'native'\n\t */\n\tspinControls?: 'none' | 'native' | 'custom';\n\t/**\n\t * If true, enables mouse drag gestures.\n\t *\n\t * @default true\n\t */\n\tisDragEnabled?: InputControlProps[ 'isDragEnabled' ];\n\t/**\n\t * If true, pressing `UP` or `DOWN` along with the `SHIFT` key will increment the\n\t * value by the `shiftStep` value.\n\t *\n\t * @default true\n\t */\n\tisShiftStepEnabled?: boolean;\n\t/**\n\t * The maximum `value` allowed.\n\t *\n\t * @default Infinity\n\t */\n\tmax?: number;\n\t/**\n\t * The minimum `value` allowed.\n\t *\n\t * @default -Infinity\n\t */\n\tmin?: number;\n\t/**\n\t * If `true` enforces a valid number within the control's min/max range.\n\t * If `false` allows an empty string as a valid value.\n\t *\n\t * @default false\n\t */\n\trequired?: InputControlProps[ 'required' ];\n\t/**\n\t * Amount to increment by when the `SHIFT` key is held down. This shift value is\n\t * a multiplier to the `step` value. For example, if the `step` value is `5`,\n\t * and `shiftStep` is `10`, each jump would increment/decrement by `50`.\n\t *\n\t * @default 10\n\t */\n\tshiftStep?: number;\n\t/**\n\t * Amount by which the `value` is changed when incrementing/decrementing.\n\t * It is also a factor in validation as `value` must be a multiple of `step`\n\t * (offset by `min`, if specified) to be valid. Accepts the special string value `any`\n\t * that voids the validation constraint and causes stepping actions to increment/decrement by `1`.\n\t *\n\t * @default 1\n\t */\n\tstep?: InputControlProps[ 'step' ];\n\t/**\n\t * Optional multiplication factor in spin changes. i.e. A spin changes\n\t * by `spinFactor * step` (if `step` is \"any\", 1 is used instead).\n\t *\n\t * @default 1\n\t */\n\tspinFactor?: number;\n\t/**\n\t * The `type` attribute of the `input` element.\n\t *\n\t * @default 'number'\n\t */\n\ttype?: InputControlProps[ 'type' ];\n\t/**\n\t * The value of the input.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * Do not throw a warning for the deprecated 36px default size.\n\t * For internal components of other components that already throw the warning.\n\t *\n\t * @ignore\n\t */\n\t__shouldNotWarnDeprecated36pxSize?: boolean;\n};\n"],"mappings":"","ignoreList":[]}
@@ -278,7 +278,8 @@ function UnforwardedRangeControl(props, forwardedRef) {
278
278
  step: step
279
279
  // @ts-expect-error TODO: Investigate if the `null` value is necessary
280
280
  ,
281
- value: inputSliderValue
281
+ value: inputSliderValue,
282
+ __shouldNotWarnDeprecated36pxSize: true
282
283
  }), allowReset && /*#__PURE__*/_jsx(ActionRightWrapper, {
283
284
  children: /*#__PURE__*/_jsx(Button, {
284
285
  className: "components-range-control__reset"
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","isRTL","useRef","useState","forwardRef","useInstanceId","useMergeRefs","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","space","maybeWarnDeprecated36pxSize","jsx","_jsx","jsxs","_jsxs","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","__shouldNotWarnDeprecated36pxSize","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","componentName","size","__associatedWPComponentName","children","icon","ref","style","width","tooltipPosition","show","inputMode","__unstableInputWidth","accessibleWhenDisabled","variant","onClick","RangeControl"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\t// Add default size deprecation warning.\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'RangeControl',\n\t\t__next40pxDefaultSize,\n\t\tsize: undefined,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={50}\n * label=\"Opacity\"\n * max={100}\n * min={0}\n * onChange={() => {}}\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;;AAEhE;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BC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDiG,OAAO,EAAC,WAAW;UACnBZ,IAAI,EAAC,OAAO;UACZa,OAAO,EAAGrB,aAAe;UAAAU,QAAA,EAEvB1H,EAAE,CAAE,OAAQ;QAAC,CACR;MAAC,CACU,CACpB;IAAA,CACI;EAAC,CACK,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsI,YAAY,GAAGlI,UAAU,CAAEmC,uBAAwB,CAAC;AAEjE,eAAe+F,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","useRef","useState","forwardRef","useInstanceId","useMergeRefs","BaseControl","Button","Icon","COLORS","floatClamp","useControlledRangeValue","clamp","InputRange","RangeRail","SimpleTooltip","ActionRightWrapper","AfterIconWrapper","BeforeIconWrapper","InputNumber","Root","Track","ThumbWrapper","Thumb","Wrapper","space","maybeWarnDeprecated36pxSize","jsx","_jsx","jsxs","_jsxs","noop","computeResetValue","resetFallbackValue","initialPosition","undefined","Number","isNaN","UnforwardedRangeControl","props","forwardedRef","__nextHasNoMarginBottom","afterIcon","allowReset","beforeIcon","className","color","colorProp","theme","accent","currentInput","disabled","help","hideLabelFromVision","isShiftStepEnabled","label","marks","max","min","onBlur","onChange","onFocus","onMouseLeave","onMouseMove","railColor","renderTooltipContent","v","__next40pxDefaultSize","shiftStep","showTooltip","showTooltipProp","step","trackColor","value","valueProp","withInputField","__shouldNotWarnDeprecated36pxSize","otherProps","setValue","initial","isResetPendent","hasTooltip","hasInputField","setShowTooltip","isFocused","setIsFocused","inputRef","isCurrentlyFocused","current","matches","isThumbFocused","isValueReset","currentValue","inputSliderValue","rangeFillValue","fillValue","fillValueOffset","classes","wrapperClasses","id","describedBy","enableTooltip","isFinite","handleOnRangeChange","event","nextValue","parseFloat","target","handleOnChange","next","handleOnInputNumberBlur","handleOnReset","resetValue","handleShowTooltip","handleHideTooltip","handleOnBlur","handleOnFocus","offsetStyle","componentName","size","__associatedWPComponentName","children","icon","ref","style","width","tooltipPosition","show","inputMode","__unstableInputWidth","accessibleWhenDisabled","variant","onClick","RangeControl"],"sources":["@wordpress/components/src/range-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, FocusEvent, ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useRef, useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { COLORS } from '../utils';\nimport { floatClamp, useControlledRangeValue } from './utils';\nimport { clamp } from '../utils/math';\nimport InputRange from './input-range';\nimport RangeRail from './rail';\nimport SimpleTooltip from './tooltip';\nimport {\n\tActionRightWrapper,\n\tAfterIconWrapper,\n\tBeforeIconWrapper,\n\tInputNumber,\n\tRoot,\n\tTrack,\n\tThumbWrapper,\n\tThumb,\n\tWrapper,\n} from './styles/range-control-styles';\n\nimport type { RangeControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport { space } from '../utils/space';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\nconst noop = () => {};\n\n/**\n * Computes the value that `RangeControl` should reset to when pressing\n * the reset button.\n */\nfunction computeResetValue( {\n\tresetFallbackValue,\n\tinitialPosition,\n}: Pick< RangeControlProps, 'resetFallbackValue' | 'initialPosition' > ) {\n\tif ( resetFallbackValue !== undefined ) {\n\t\treturn ! Number.isNaN( resetFallbackValue ) ? resetFallbackValue : null;\n\t}\n\n\tif ( initialPosition !== undefined ) {\n\t\treturn ! Number.isNaN( initialPosition ) ? initialPosition : null;\n\t}\n\n\treturn null;\n}\n\nfunction UnforwardedRangeControl(\n\tprops: WordPressComponentProps< RangeControlProps, 'input', false >,\n\tforwardedRef: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tafterIcon,\n\t\tallowReset = false,\n\t\tbeforeIcon,\n\t\tclassName,\n\t\tcolor: colorProp = COLORS.theme.accent,\n\t\tcurrentInput,\n\t\tdisabled = false,\n\t\thelp,\n\t\thideLabelFromVision = false,\n\t\tinitialPosition,\n\t\tisShiftStepEnabled = true,\n\t\tlabel,\n\t\tmarks = false,\n\t\tmax = 100,\n\t\tmin = 0,\n\t\tonBlur = noop,\n\t\tonChange = noop,\n\t\tonFocus = noop,\n\t\tonMouseLeave = noop,\n\t\tonMouseMove = noop,\n\t\trailColor,\n\t\trenderTooltipContent = ( v ) => v,\n\t\tresetFallbackValue,\n\t\t__next40pxDefaultSize = false,\n\t\tshiftStep = 10,\n\t\tshowTooltip: showTooltipProp,\n\t\tstep = 1,\n\t\ttrackColor,\n\t\tvalue: valueProp,\n\t\twithInputField = true,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = props;\n\n\tconst [ value, setValue ] = useControlledRangeValue( {\n\t\tmin,\n\t\tmax,\n\t\tvalue: valueProp ?? null,\n\t\tinitial: initialPosition,\n\t} );\n\tconst isResetPendent = useRef( false );\n\n\tlet hasTooltip = showTooltipProp;\n\tlet hasInputField = withInputField;\n\n\tif ( step === 'any' ) {\n\t\t// The tooltip and number input field are hidden when the step is \"any\"\n\t\t// because the decimals get too lengthy to fit well.\n\t\thasTooltip = false;\n\t\thasInputField = false;\n\t}\n\n\tconst [ showTooltip, setShowTooltip ] = useState( hasTooltip );\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\n\tconst inputRef = useRef< HTMLInputElement >();\n\tconst isCurrentlyFocused = inputRef.current?.matches( ':focus' );\n\tconst isThumbFocused = ! disabled && isFocused;\n\n\tconst isValueReset = value === null;\n\tconst currentValue = value !== undefined ? value : currentInput;\n\n\tconst inputSliderValue = isValueReset ? '' : currentValue;\n\tconst rangeFillValue = isValueReset ? ( max - min ) / 2 + min : value;\n\n\tconst fillValue = isValueReset\n\t\t? 50\n\t\t: ( ( value - min ) / ( max - min ) ) * 100;\n\tconst fillValueOffset = `${ clamp( fillValue, 0, 100 ) }%`;\n\n\tconst classes = clsx( 'components-range-control', className );\n\n\tconst wrapperClasses = clsx(\n\t\t'components-range-control__wrapper',\n\t\t!! marks && 'is-marked'\n\t);\n\n\tconst id = useInstanceId(\n\t\tUnforwardedRangeControl,\n\t\t'inspector-range-control'\n\t);\n\tconst describedBy = !! help ? `${ id }__help` : undefined;\n\tconst enableTooltip = hasTooltip !== false && Number.isFinite( value );\n\n\tconst handleOnRangeChange = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tconst nextValue = parseFloat( event.target.value );\n\t\tsetValue( nextValue );\n\t\tonChange( nextValue );\n\t};\n\n\tconst handleOnChange = ( next?: string ) => {\n\t\t// @ts-expect-error TODO: Investigate if it's problematic for setValue() to\n\t\t// potentially receive a NaN when next is undefined.\n\t\tlet nextValue = parseFloat( next );\n\t\tsetValue( nextValue );\n\n\t\t/*\n\t\t * Calls onChange only when nextValue is numeric\n\t\t * otherwise may queue a reset for the blur event.\n\t\t */\n\t\tif ( ! isNaN( nextValue ) ) {\n\t\t\tif ( nextValue < min || nextValue > max ) {\n\t\t\t\tnextValue = floatClamp( nextValue, min, max ) as number;\n\t\t\t}\n\n\t\t\tonChange( nextValue );\n\t\t\tisResetPendent.current = false;\n\t\t} else if ( allowReset ) {\n\t\t\tisResetPendent.current = true;\n\t\t}\n\t};\n\n\tconst handleOnInputNumberBlur = () => {\n\t\tif ( isResetPendent.current ) {\n\t\t\thandleOnReset();\n\t\t\tisResetPendent.current = false;\n\t\t}\n\t};\n\n\tconst handleOnReset = () => {\n\t\t// Reset to `resetFallbackValue` if defined, otherwise set internal value\n\t\t// to `null` — which, if propagated to the `value` prop, will cause\n\t\t// the value to be reset to the `initialPosition` prop if defined.\n\t\tconst resetValue = Number.isNaN( resetFallbackValue )\n\t\t\t? null\n\t\t\t: resetFallbackValue ?? null;\n\n\t\tsetValue( resetValue );\n\n\t\t/**\n\t\t * Previously, this callback would always receive undefined as\n\t\t * an argument. This behavior is unexpected, specifically\n\t\t * when resetFallbackValue is defined.\n\t\t *\n\t\t * The value of undefined is not ideal. Passing it through\n\t\t * to internal <input /> elements would change it from a\n\t\t * controlled component to an uncontrolled component.\n\t\t *\n\t\t * For now, to minimize unexpected regressions, we're going to\n\t\t * preserve the undefined callback argument, except when a\n\t\t * resetFallbackValue is defined.\n\t\t */\n\t\tonChange( resetValue ?? undefined );\n\t};\n\n\tconst handleShowTooltip = () => setShowTooltip( true );\n\tconst handleHideTooltip = () => setShowTooltip( false );\n\n\tconst handleOnBlur = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonBlur( event );\n\t\tsetIsFocused( false );\n\t\thandleHideTooltip();\n\t};\n\n\tconst handleOnFocus = ( event: FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event );\n\t\tsetIsFocused( true );\n\t\thandleShowTooltip();\n\t};\n\n\tconst offsetStyle = {\n\t\t[ isRTL() ? 'right' : 'left' ]: fillValueOffset,\n\t};\n\n\t// Add default size deprecation warning.\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'RangeControl',\n\t\t__next40pxDefaultSize,\n\t\tsize: undefined,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t__associatedWPComponentName=\"RangeControl\"\n\t\t\tclassName={ classes }\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\tid={ `${ id }` }\n\t\t\thelp={ help }\n\t\t>\n\t\t\t<Root\n\t\t\t\tclassName=\"components-range-control__root\"\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t>\n\t\t\t\t{ beforeIcon && (\n\t\t\t\t\t<BeforeIconWrapper>\n\t\t\t\t\t\t<Icon icon={ beforeIcon } />\n\t\t\t\t\t</BeforeIconWrapper>\n\t\t\t\t) }\n\t\t\t\t<Wrapper\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t\tclassName={ wrapperClasses }\n\t\t\t\t\tcolor={ colorProp }\n\t\t\t\t\tmarks={ !! marks }\n\t\t\t\t>\n\t\t\t\t\t<InputRange\n\t\t\t\t\t\t{ ...otherProps }\n\t\t\t\t\t\tclassName=\"components-range-control__slider\"\n\t\t\t\t\t\tdescribedBy={ describedBy }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tid={ `${ id }` }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnBlur }\n\t\t\t\t\t\tonChange={ handleOnRangeChange }\n\t\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\t\tonMouseMove={ onMouseMove }\n\t\t\t\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\t\t\t\tref={ useMergeRefs( [ inputRef, forwardedRef ] ) }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ inputSliderValue ?? undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<RangeRail\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tmarks={ marks }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\trailColor={ railColor }\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\tvalue={ rangeFillValue }\n\t\t\t\t\t/>\n\t\t\t\t\t<Track\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\tclassName=\"components-range-control__track\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tstyle={ { width: fillValueOffset } }\n\t\t\t\t\t\ttrackColor={ trackColor }\n\t\t\t\t\t/>\n\t\t\t\t\t<ThumbWrapper\n\t\t\t\t\t\tclassName=\"components-range-control__thumb-wrapper\"\n\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thumb\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\tisFocused={ isThumbFocused }\n\t\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ThumbWrapper>\n\t\t\t\t\t{ enableTooltip && (\n\t\t\t\t\t\t<SimpleTooltip\n\t\t\t\t\t\t\tclassName=\"components-range-control__tooltip\"\n\t\t\t\t\t\t\tinputRef={ inputRef }\n\t\t\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\t\t\trenderTooltipContent={ renderTooltipContent }\n\t\t\t\t\t\t\tshow={ isCurrentlyFocused || showTooltip }\n\t\t\t\t\t\t\tstyle={ offsetStyle }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Wrapper>\n\t\t\t\t{ afterIcon && (\n\t\t\t\t\t<AfterIconWrapper>\n\t\t\t\t\t\t<Icon icon={ afterIcon } />\n\t\t\t\t\t</AfterIconWrapper>\n\t\t\t\t) }\n\t\t\t\t{ hasInputField && (\n\t\t\t\t\t<InputNumber\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tclassName=\"components-range-control__number\"\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\tinputMode=\"decimal\"\n\t\t\t\t\t\tisShiftStepEnabled={ isShiftStepEnabled }\n\t\t\t\t\t\tmax={ max }\n\t\t\t\t\t\tmin={ min }\n\t\t\t\t\t\tonBlur={ handleOnInputNumberBlur }\n\t\t\t\t\t\tonChange={ handleOnChange }\n\t\t\t\t\t\tshiftStep={ shiftStep }\n\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t? '__unstable-large'\n\t\t\t\t\t\t\t\t: 'default'\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableInputWidth={\n\t\t\t\t\t\t\t__next40pxDefaultSize ? space( 20 ) : space( 16 )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t// @ts-expect-error TODO: Investigate if the `null` value is necessary\n\t\t\t\t\t\tvalue={ inputSliderValue }\n\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<ActionRightWrapper>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"components-range-control__reset\"\n\t\t\t\t\t\t\t// If the RangeControl itself is disabled, the reset button shouldn't be in the tab sequence.\n\t\t\t\t\t\t\taccessibleWhenDisabled={ ! disabled }\n\t\t\t\t\t\t\t// The reset button should be disabled if RangeControl itself is disabled,\n\t\t\t\t\t\t\t// or if the current `value` is equal to the value that would be currently\n\t\t\t\t\t\t\t// assigned when clicking the button.\n\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\tdisabled ||\n\t\t\t\t\t\t\t\tvalue ===\n\t\t\t\t\t\t\t\t\tcomputeResetValue( {\n\t\t\t\t\t\t\t\t\t\tresetFallbackValue,\n\t\t\t\t\t\t\t\t\t\tinitialPosition,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</ActionRightWrapper>\n\t\t\t\t) }\n\t\t\t</Root>\n\t\t</BaseControl>\n\t);\n}\n\n/**\n * RangeControls are used to make selections from a range of incremental values.\n *\n * ```jsx\n * import { RangeControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyRangeControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <RangeControl\n * __nextHasNoMarginBottom\n * __next40pxDefaultSize\n * help=\"Please select how transparent you would like this.\"\n * initialPosition={50}\n * label=\"Opacity\"\n * max={100}\n * min={0}\n * onChange={() => {}}\n * />\n * );\n * };\n * ```\n */\nexport const RangeControl = forwardRef( UnforwardedRangeControl );\n\nexport default RangeControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;;AAEhE;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,UAAU,EAAEC,uBAAuB,QAAQ,SAAS;AAC7D,SAASC,KAAK,QAAQ,eAAe;AACrC,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,SAAS,MAAM,QAAQ;AAC9B,OAAOC,aAAa,MAAM,WAAW;AACrC,SACCC,kBAAkB,EAClBC,gBAAgB,EAChBC,iBAAiB,EACjBC,WAAW,EACXC,IAAI,EACJC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,OAAO,QACD,+BAA+B;AAItC,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,2BAA2B,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE5E,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAE;E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A,GAAK;QACXC,MAAM,EAAGmD,uBAAyB;QAClClD,QAAQ,EAAGgD,cAAgB;QAC3BxC,SAAS,EAAGA,SAAW;QACvBmD,IAAI,EACHpD,qBAAqB,GAClB,kBAAkB,GAClB,SACH;QACD8D,oBAAoB,EACnB9D,qBAAqB,GAAG1C,KAAK,CAAE,EAAG,CAAC,GAAGA,KAAK,CAAE,EAAG,CAChD;QACD8C,IAAI,EAAGA;QACP;QAAA;QACAE,KAAK,EAAGoB,gBAAkB;QAC1BjB,iCAAiC;MAAA,CACjC,CACD,EACCjC,UAAU,iBACXf,IAAA,CAACZ,kBAAkB;QAAAyG,QAAA,eAClB7F,IAAA,CAACrB,MAAM;UACNsC,SAAS,EAAC;UACV;UAAA;UACAqF,sBAAsB,EAAG,CAAE/E;UAC3B;UACA;UACA;UAAA;UACAA,QAAQ,EACPA,QAAQ,IACRsB,KAAK,KACJzC,iBAAiB,CAAE;YAClBC,kBAAkB;YAClBC;UACD,CAAE,CACH;UACDiG,OAAO,EAAC,WAAW;UACnBZ,IAAI,EAAC,OAAO;UACZa,OAAO,EAAGrB,aAAe;UAAAU,QAAA,EAEvB1H,EAAE,CAAE,OAAQ;QAAC,CACR;MAAC,CACU,CACpB;IAAA,CACI;EAAC,CACK,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMsI,YAAY,GAAGlI,UAAU,CAAEmC,uBAAwB,CAAC;AAEjE,eAAe+F,YAAY","ignoreList":[]}
@@ -23,7 +23,6 @@ export default function RangeMark(props) {
23
23
  ...otherProps,
24
24
  "aria-hidden": "true",
25
25
  className: classes,
26
- isFilled: isFilled,
27
26
  style: style
28
27
  }), label && /*#__PURE__*/_jsx(MarkLabel, {
29
28
  "aria-hidden": "true",
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Mark","MarkLabel","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RangeMark","props","className","isFilled","label","style","otherProps","classes","labelClasses","children"],"sources":["@wordpress/components/src/range-control/mark.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { Mark, MarkLabel } from './styles/range-control-styles';\n\nimport type { RangeMarkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function RangeMark(\n\tprops: WordPressComponentProps< RangeMarkProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisFilled = false,\n\t\tlabel,\n\t\tstyle = {},\n\t\t...otherProps\n\t} = props;\n\n\tconst classes = clsx(\n\t\t'components-range-control__mark',\n\t\tisFilled && 'is-filled',\n\t\tclassName\n\t);\n\tconst labelClasses = clsx(\n\t\t'components-range-control__mark-label',\n\t\tisFilled && 'is-filled'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Mark\n\t\t\t\t{ ...otherProps }\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={ classes }\n\t\t\t\tisFilled={ isFilled }\n\t\t\t\tstyle={ style }\n\t\t\t/>\n\t\t\t{ label && (\n\t\t\t\t<MarkLabel\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={ labelClasses }\n\t\t\t\t\tisFilled={ isFilled }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</MarkLabel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,IAAI,EAAEC,SAAS,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAKhE,eAAe,SAASC,SAASA,CAChCC,KAAwD,EACvD;EACD,MAAM;IACLC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,KAAK;IACLC,KAAK,GAAG,CAAC,CAAC;IACV,GAAGC;EACJ,CAAC,GAAGL,KAAK;EAET,MAAMM,OAAO,GAAGhB,IAAI,CACnB,gCAAgC,EAChCY,QAAQ,IAAI,WAAW,EACvBD,SACD,CAAC;EACD,MAAMM,YAAY,GAAGjB,IAAI,CACxB,sCAAsC,EACtCY,QAAQ,IAAI,WACb,CAAC;EAED,oBACCJ,KAAA,CAAAF,SAAA;IAAAY,QAAA,gBACCd,IAAA,CAACH,IAAI;MAAA,GACCc,UAAU;MACf,eAAY,MAAM;MAClBJ,SAAS,EAAGK,OAAS;MACrBJ,QAAQ,EAAGA,QAAU;MACrBE,KAAK,EAAGA;IAAO,CACf,CAAC,EACAD,KAAK,iBACNT,IAAA,CAACF,SAAS;MACT,eAAY,MAAM;MAClBS,SAAS,EAAGM,YAAc;MAC1BL,QAAQ,EAAGA,QAAU;MACrBE,KAAK,EAAGA,KAAO;MAAAI,QAAA,EAEbL;IAAK,CACG,CACX;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Mark","MarkLabel","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RangeMark","props","className","isFilled","label","style","otherProps","classes","labelClasses","children"],"sources":["@wordpress/components/src/range-control/mark.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { Mark, MarkLabel } from './styles/range-control-styles';\n\nimport type { RangeMarkProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport default function RangeMark(\n\tprops: WordPressComponentProps< RangeMarkProps, 'span' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisFilled = false,\n\t\tlabel,\n\t\tstyle = {},\n\t\t...otherProps\n\t} = props;\n\n\tconst classes = clsx(\n\t\t'components-range-control__mark',\n\t\tisFilled && 'is-filled',\n\t\tclassName\n\t);\n\tconst labelClasses = clsx(\n\t\t'components-range-control__mark-label',\n\t\tisFilled && 'is-filled'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Mark\n\t\t\t\t{ ...otherProps }\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={ classes }\n\t\t\t\tstyle={ style }\n\t\t\t/>\n\t\t\t{ label && (\n\t\t\t\t<MarkLabel\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tclassName={ labelClasses }\n\t\t\t\t\tisFilled={ isFilled }\n\t\t\t\t\tstyle={ style }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</MarkLabel>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,IAAI,EAAEC,SAAS,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAKhE,eAAe,SAASC,SAASA,CAChCC,KAAwD,EACvD;EACD,MAAM;IACLC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,KAAK;IACLC,KAAK,GAAG,CAAC,CAAC;IACV,GAAGC;EACJ,CAAC,GAAGL,KAAK;EAET,MAAMM,OAAO,GAAGhB,IAAI,CACnB,gCAAgC,EAChCY,QAAQ,IAAI,WAAW,EACvBD,SACD,CAAC;EACD,MAAMM,YAAY,GAAGjB,IAAI,CACxB,sCAAsC,EACtCY,QAAQ,IAAI,WACb,CAAC;EAED,oBACCJ,KAAA,CAAAF,SAAA;IAAAY,QAAA,gBACCd,IAAA,CAACH,IAAI;MAAA,GACCc,UAAU;MACf,eAAY,MAAM;MAClBJ,SAAS,EAAGK,OAAS;MACrBF,KAAK,EAAGA;IAAO,CACf,CAAC,EACAD,KAAK,iBACNT,IAAA,CAACF,SAAS;MACT,eAAY,MAAM;MAClBS,SAAS,EAAGM,YAAc;MAC1BL,QAAQ,EAAGA,QAAU;MACrBE,KAAK,EAAGA,KAAO;MAAAI,QAAA,EAEbL;IAAK,CACG,CACX;EAAA,CACA,CAAC;AAEL","ignoreList":[]}