@wordpress/components 25.15.1-next.79a6196f.0 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1422) hide show
  1. package/.stylelintrc.js +23 -0
  2. package/CHANGELOG.md +74 -2
  3. package/build/alignment-matrix-control/icon.js +1 -2
  4. package/build/alignment-matrix-control/icon.js.map +1 -1
  5. package/build/alignment-matrix-control/index.js +1 -2
  6. package/build/alignment-matrix-control/index.js.map +1 -1
  7. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +4 -8
  8. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  9. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +4 -8
  10. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  11. package/build/alignment-matrix-control/utils.js +3 -6
  12. package/build/alignment-matrix-control/utils.js.map +1 -1
  13. package/build/angle-picker-control/angle-circle.js +1 -2
  14. package/build/angle-picker-control/angle-circle.js.map +1 -1
  15. package/build/angle-picker-control/index.js +3 -15
  16. package/build/angle-picker-control/index.js.map +1 -1
  17. package/build/angle-picker-control/styles/angle-picker-control-styles.js +9 -27
  18. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  19. package/build/angle-picker-control/types.js.map +1 -1
  20. package/build/animate/index.js +1 -2
  21. package/build/animate/index.js.map +1 -1
  22. package/build/autocomplete/autocompleter-ui.native.js +1 -2
  23. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  24. package/build/autocomplete/background-view.android.js +1 -2
  25. package/build/autocomplete/background-view.android.js.map +1 -1
  26. package/build/autocomplete/background-view.ios.js +1 -2
  27. package/build/autocomplete/background-view.ios.js.map +1 -1
  28. package/build/base-control/index.js +2 -4
  29. package/build/base-control/index.js.map +1 -1
  30. package/build/base-control/styles/base-control-styles.js +5 -10
  31. package/build/base-control/styles/base-control-styles.js.map +1 -1
  32. package/build/border-box-control/border-box-control/component.js +2 -4
  33. package/build/border-box-control/border-box-control/component.js.map +1 -1
  34. package/build/border-box-control/border-box-control/hook.js +5 -3
  35. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  36. package/build/border-box-control/border-box-control-linked-button/component.js +1 -2
  37. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  38. package/build/border-box-control/border-box-control-linked-button/hook.js +2 -2
  39. package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  40. package/build/border-box-control/border-box-control-split-controls/component.js +1 -2
  41. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  42. package/build/border-box-control/border-box-control-split-controls/hook.js +2 -2
  43. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  44. package/build/border-box-control/border-box-control-visualizer/component.js +1 -2
  45. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  46. package/build/border-box-control/border-box-control-visualizer/hook.js +2 -2
  47. package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  48. package/build/border-box-control/styles.js +3 -6
  49. package/build/border-box-control/styles.js.map +1 -1
  50. package/build/border-box-control/types.js.map +1 -1
  51. package/build/border-control/border-control/component.js +7 -5
  52. package/build/border-control/border-control/component.js.map +1 -1
  53. package/build/border-control/border-control/hook.js +20 -17
  54. package/build/border-control/border-control/hook.js.map +1 -1
  55. package/build/border-control/border-control-dropdown/component.js +3 -3
  56. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  57. package/build/border-control/border-control-dropdown/hook.js +2 -2
  58. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  59. package/build/border-control/border-control-style-picker/component.js +21 -50
  60. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  61. package/build/border-control/styles.js +16 -35
  62. package/build/border-control/styles.js.map +1 -1
  63. package/build/border-control/types.js.map +1 -1
  64. package/build/box-control/all-input-control.js +35 -29
  65. package/build/box-control/all-input-control.js.map +1 -1
  66. package/build/box-control/axial-input-controls.js +40 -54
  67. package/build/box-control/axial-input-controls.js.map +1 -1
  68. package/build/box-control/index.js +22 -26
  69. package/build/box-control/index.js.map +1 -1
  70. package/build/box-control/input-controls.js +45 -37
  71. package/build/box-control/input-controls.js.map +1 -1
  72. package/build/box-control/styles/box-control-icon-styles.js +6 -12
  73. package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
  74. package/build/box-control/styles/box-control-styles.js +44 -112
  75. package/build/box-control/styles/box-control-styles.js.map +1 -1
  76. package/build/box-control/types.js.map +1 -1
  77. package/build/box-control/utils.js +125 -14
  78. package/build/box-control/utils.js.map +1 -1
  79. package/build/button/deprecated.js +1 -2
  80. package/build/button/deprecated.js.map +1 -1
  81. package/build/button/index.js +16 -20
  82. package/build/button/index.js.map +1 -1
  83. package/build/button/index.native.js +1 -3
  84. package/build/button/index.native.js.map +1 -1
  85. package/build/button/types.js.map +1 -1
  86. package/build/button-group/index.js +2 -4
  87. package/build/button-group/index.js.map +1 -1
  88. package/build/card/card/component.js +4 -6
  89. package/build/card/card/component.js.map +1 -1
  90. package/build/card/card/hook.js +2 -2
  91. package/build/card/card/hook.js.map +1 -1
  92. package/build/card/card-body/component.js +2 -4
  93. package/build/card/card-body/component.js.map +1 -1
  94. package/build/card/card-body/hook.js +2 -2
  95. package/build/card/card-body/hook.js.map +1 -1
  96. package/build/card/card-divider/component.js +2 -4
  97. package/build/card/card-divider/component.js.map +1 -1
  98. package/build/card/card-divider/hook.js +2 -2
  99. package/build/card/card-divider/hook.js.map +1 -1
  100. package/build/card/card-footer/component.js +2 -4
  101. package/build/card/card-footer/component.js.map +1 -1
  102. package/build/card/card-footer/hook.js +2 -2
  103. package/build/card/card-footer/hook.js.map +1 -1
  104. package/build/card/card-header/component.js +2 -4
  105. package/build/card/card-header/component.js.map +1 -1
  106. package/build/card/card-header/hook.js +2 -2
  107. package/build/card/card-header/hook.js.map +1 -1
  108. package/build/card/card-media/component.js +2 -4
  109. package/build/card/card-media/component.js.map +1 -1
  110. package/build/card/card-media/hook.js +2 -2
  111. package/build/card/card-media/hook.js.map +1 -1
  112. package/build/card/context.js +1 -2
  113. package/build/card/context.js.map +1 -1
  114. package/build/card/index.js +2 -2
  115. package/build/card/index.js.map +1 -1
  116. package/build/card/styles.js +14 -28
  117. package/build/card/styles.js.map +1 -1
  118. package/build/checkbox-control/index.js +1 -2
  119. package/build/checkbox-control/index.js.map +1 -1
  120. package/build/checkbox-control/types.js.map +1 -1
  121. package/build/circular-option-picker/circular-option-picker-context.js +1 -2
  122. package/build/circular-option-picker/circular-option-picker-context.js.map +1 -1
  123. package/build/circular-option-picker/circular-option-picker.js +1 -2
  124. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  125. package/build/circular-option-picker/index.js +1 -2
  126. package/build/circular-option-picker/index.js.map +1 -1
  127. package/build/color-control/index.native.js +1 -2
  128. package/build/color-control/index.native.js.map +1 -1
  129. package/build/color-indicator/index.js +2 -4
  130. package/build/color-indicator/index.js.map +1 -1
  131. package/build/color-indicator/index.native.js +1 -2
  132. package/build/color-indicator/index.native.js.map +1 -1
  133. package/build/color-palette/index.js +2 -4
  134. package/build/color-palette/index.js.map +1 -1
  135. package/build/color-palette/index.native.js +1 -2
  136. package/build/color-palette/index.native.js.map +1 -1
  137. package/build/color-palette/styles.js +1 -2
  138. package/build/color-palette/styles.js.map +1 -1
  139. package/build/color-picker/component.js +2 -4
  140. package/build/color-picker/component.js.map +1 -1
  141. package/build/color-picker/hsl-input.js +55 -33
  142. package/build/color-picker/hsl-input.js.map +1 -1
  143. package/build/color-picker/hsv-color-picker.native.js +1 -2
  144. package/build/color-picker/hsv-color-picker.native.js.map +1 -1
  145. package/build/color-picker/hue-picker.native.js +2 -2
  146. package/build/color-picker/hue-picker.native.js.map +1 -1
  147. package/build/color-picker/saturation-picker.native.js +2 -2
  148. package/build/color-picker/saturation-picker.native.js.map +1 -1
  149. package/build/color-picker/styles.js +8 -16
  150. package/build/color-picker/styles.js.map +1 -1
  151. package/build/combobox-control/index.js +2 -3
  152. package/build/combobox-control/index.js.map +1 -1
  153. package/build/combobox-control/styles.js +1 -2
  154. package/build/combobox-control/styles.js.map +1 -1
  155. package/build/composite/current/index.js +43 -0
  156. package/build/composite/current/index.js.map +1 -0
  157. package/build/composite/index.js +10 -24
  158. package/build/composite/index.js.map +1 -1
  159. package/build/composite/legacy/index.js +127 -0
  160. package/build/composite/legacy/index.js.map +1 -0
  161. package/build/composite/v2.js +10 -36
  162. package/build/composite/v2.js.map +1 -1
  163. package/build/confirm-dialog/component.js +6 -6
  164. package/build/confirm-dialog/component.js.map +1 -1
  165. package/build/confirm-dialog/styles.js +1 -2
  166. package/build/confirm-dialog/styles.js.map +1 -1
  167. package/build/context/constants.js +3 -6
  168. package/build/context/constants.js.map +1 -1
  169. package/build/context/context-system-provider.js +2 -4
  170. package/build/context/context-system-provider.js.map +1 -1
  171. package/build/context/get-styled-class-name-from-key.js +1 -2
  172. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  173. package/build/context/wordpress-component.js.map +1 -1
  174. package/build/custom-gradient-picker/constants.js +5 -10
  175. package/build/custom-gradient-picker/constants.js.map +1 -1
  176. package/build/custom-gradient-picker/gradient-bar/constants.js +7 -14
  177. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  178. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -2
  179. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  180. package/build/custom-gradient-picker/index.js +2 -17
  181. package/build/custom-gradient-picker/index.js.map +1 -1
  182. package/build/custom-gradient-picker/index.native.js +1 -2
  183. package/build/custom-gradient-picker/index.native.js.map +1 -1
  184. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js +2 -4
  185. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  186. package/build/custom-gradient-picker/types.js.map +1 -1
  187. package/build/custom-select-control/index.js +1 -1
  188. package/build/custom-select-control/index.js.map +1 -1
  189. package/build/custom-select-control/styles.js +1 -2
  190. package/build/custom-select-control/styles.js.map +1 -1
  191. package/build/custom-select-control-v2/index.js +9 -7
  192. package/build/custom-select-control-v2/index.js.map +1 -1
  193. package/build/custom-select-control-v2/styles.js +6 -10
  194. package/build/custom-select-control-v2/styles.js.map +1 -1
  195. package/build/dashicon/index.js +1 -2
  196. package/build/dashicon/index.js.map +1 -1
  197. package/build/dashicon/index.native.js +3 -4
  198. package/build/dashicon/index.native.js.map +1 -1
  199. package/build/date-time/constants.js +1 -2
  200. package/build/date-time/constants.js.map +1 -1
  201. package/build/date-time/date/index.js +1 -2
  202. package/build/date-time/date/index.js.map +1 -1
  203. package/build/date-time/date/styles.js +6 -12
  204. package/build/date-time/date/styles.js.map +1 -1
  205. package/build/date-time/date-time/index.js +2 -4
  206. package/build/date-time/date-time/index.js.map +1 -1
  207. package/build/date-time/date-time/styles.js +1 -2
  208. package/build/date-time/date-time/styles.js.map +1 -1
  209. package/build/date-time/index.js +1 -2
  210. package/build/date-time/index.js.map +1 -1
  211. package/build/date-time/time/index.js +1 -2
  212. package/build/date-time/time/index.js.map +1 -1
  213. package/build/date-time/time/styles.js +10 -20
  214. package/build/date-time/time/styles.js.map +1 -1
  215. package/build/date-time/time/timezone.js +2 -3
  216. package/build/date-time/time/timezone.js.map +1 -1
  217. package/build/dimension-control/index.js +3 -4
  218. package/build/dimension-control/index.js.map +1 -1
  219. package/build/dimension-control/sizes.js +1 -2
  220. package/build/dimension-control/sizes.js.map +1 -1
  221. package/build/disabled/index.js +1 -2
  222. package/build/disabled/index.js.map +1 -1
  223. package/build/disabled/index.native.js +1 -2
  224. package/build/disabled/index.native.js.map +1 -1
  225. package/build/disabled/styles/disabled-styles.js +1 -2
  226. package/build/disabled/styles/disabled-styles.js.map +1 -1
  227. package/build/disclosure/index.js +4 -6
  228. package/build/disclosure/index.js.map +1 -1
  229. package/build/divider/component.js +4 -6
  230. package/build/divider/component.js.map +1 -1
  231. package/build/divider/styles.js +1 -2
  232. package/build/divider/styles.js.map +1 -1
  233. package/build/draggable/index.js +1 -2
  234. package/build/draggable/index.js.map +1 -1
  235. package/build/draggable/index.native.js +3 -4
  236. package/build/draggable/index.native.js.map +1 -1
  237. package/build/drop-zone/index.js +1 -2
  238. package/build/drop-zone/index.js.map +1 -1
  239. package/build/dropdown/dropdown-content-wrapper.js +2 -4
  240. package/build/dropdown/dropdown-content-wrapper.js.map +1 -1
  241. package/build/dropdown/index.js +2 -4
  242. package/build/dropdown/index.js.map +1 -1
  243. package/build/dropdown/index.native.js +1 -2
  244. package/build/dropdown/index.native.js.map +1 -1
  245. package/build/dropdown/styles.js +1 -2
  246. package/build/dropdown/styles.js.map +1 -1
  247. package/build/dropdown-menu/index.js +2 -4
  248. package/build/dropdown-menu/index.js.map +1 -1
  249. package/build/dropdown-menu/index.native.js +1 -2
  250. package/build/dropdown-menu/index.native.js.map +1 -1
  251. package/build/dropdown-menu-v2/index.js +11 -20
  252. package/build/dropdown-menu-v2/index.js.map +1 -1
  253. package/build/dropdown-menu-v2/styles.js +29 -42
  254. package/build/dropdown-menu-v2/styles.js.map +1 -1
  255. package/build/duotone-picker/color-list-picker/index.js +1 -2
  256. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  257. package/build/duotone-picker/duotone-picker.js +1 -2
  258. package/build/duotone-picker/duotone-picker.js.map +1 -1
  259. package/build/duotone-picker/duotone-swatch.js +1 -2
  260. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  261. package/build/elevation/component.js +2 -4
  262. package/build/elevation/component.js.map +1 -1
  263. package/build/elevation/hook.js +2 -2
  264. package/build/elevation/hook.js.map +1 -1
  265. package/build/elevation/styles.js +1 -2
  266. package/build/elevation/styles.js.map +1 -1
  267. package/build/external-link/index.js +3 -5
  268. package/build/external-link/index.js.map +1 -1
  269. package/build/external-link/index.native.js +1 -2
  270. package/build/external-link/index.native.js.map +1 -1
  271. package/build/external-link/styles/external-link-styles.js +1 -2
  272. package/build/external-link/styles/external-link-styles.js.map +1 -1
  273. package/build/flex/context.js +1 -2
  274. package/build/flex/context.js.map +1 -1
  275. package/build/flex/flex/component.js +2 -4
  276. package/build/flex/flex/component.js.map +1 -1
  277. package/build/flex/flex/hook.js +2 -2
  278. package/build/flex/flex/hook.js.map +1 -1
  279. package/build/flex/flex-block/component.js +2 -4
  280. package/build/flex/flex-block/component.js.map +1 -1
  281. package/build/flex/flex-item/component.js +2 -4
  282. package/build/flex/flex-item/component.js.map +1 -1
  283. package/build/flex/flex-item/hook.js +2 -2
  284. package/build/flex/flex-item/hook.js.map +1 -1
  285. package/build/flex/index.js +2 -2
  286. package/build/flex/index.js.map +1 -1
  287. package/build/flex/styles.js +5 -10
  288. package/build/flex/styles.js.map +1 -1
  289. package/build/focal-point-picker/index.js +3 -4
  290. package/build/focal-point-picker/index.js.map +1 -1
  291. package/build/focal-point-picker/index.native.js +1 -3
  292. package/build/focal-point-picker/index.native.js.map +1 -1
  293. package/build/focal-point-picker/styles/focal-point-picker-style.js +37 -54
  294. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  295. package/build/focal-point-picker/styles/focal-point-style.js +12 -4
  296. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  297. package/build/focal-point-picker/tooltip/index.native.js +1 -2
  298. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  299. package/build/focal-point-picker/utils.js +1 -2
  300. package/build/focal-point-picker/utils.js.map +1 -1
  301. package/build/font-size-picker/constants.js +2 -4
  302. package/build/font-size-picker/constants.js.map +1 -1
  303. package/build/font-size-picker/font-size-picker-select.js +1 -2
  304. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  305. package/build/font-size-picker/font-size-picker-toggle-group.js +2 -4
  306. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  307. package/build/font-size-picker/index.js +6 -22
  308. package/build/font-size-picker/index.js.map +1 -1
  309. package/build/font-size-picker/index.native.js +3 -4
  310. package/build/font-size-picker/index.native.js.map +1 -1
  311. package/build/font-size-picker/styles.js +17 -29
  312. package/build/font-size-picker/styles.js.map +1 -1
  313. package/build/font-size-picker/types.js.map +1 -1
  314. package/build/footer-message-control/index.native.js +1 -2
  315. package/build/footer-message-control/index.native.js.map +1 -1
  316. package/build/form-file-upload/index.js +1 -2
  317. package/build/form-file-upload/index.js.map +1 -1
  318. package/build/form-toggle/index.js +1 -2
  319. package/build/form-toggle/index.js.map +1 -1
  320. package/build/form-token-field/index.js +2 -7
  321. package/build/form-token-field/index.js.map +1 -1
  322. package/build/form-token-field/styles.js +1 -2
  323. package/build/form-token-field/styles.js.map +1 -1
  324. package/build/form-token-field/suggestions-list.js +1 -2
  325. package/build/form-token-field/suggestions-list.js.map +1 -1
  326. package/build/form-token-field/token-input.js +2 -4
  327. package/build/form-token-field/token-input.js.map +1 -1
  328. package/build/gradient-picker/index.js +19 -43
  329. package/build/gradient-picker/index.js.map +1 -1
  330. package/build/gradient-picker/types.js.map +1 -1
  331. package/build/grid/component.js +2 -4
  332. package/build/grid/component.js.map +1 -1
  333. package/build/guide/index.js +1 -2
  334. package/build/guide/index.js.map +1 -1
  335. package/build/h-stack/component.js +2 -4
  336. package/build/h-stack/component.js.map +1 -1
  337. package/build/heading/component.js +2 -4
  338. package/build/heading/component.js.map +1 -1
  339. package/build/higher-order/navigate-regions/index.js +1 -2
  340. package/build/higher-order/navigate-regions/index.js.map +1 -1
  341. package/build/higher-order/with-constrained-tabbing/index.js +1 -2
  342. package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
  343. package/build/higher-order/with-focus-outside/index.js +1 -2
  344. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  345. package/build/higher-order/with-focus-outside/index.native.js +1 -2
  346. package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
  347. package/build/higher-order/with-focus-return/index.js +1 -2
  348. package/build/higher-order/with-focus-return/index.js.map +1 -1
  349. package/build/higher-order/with-notices/index.js +1 -2
  350. package/build/higher-order/with-notices/index.js.map +1 -1
  351. package/build/higher-order/with-spoken-messages/index.js +1 -2
  352. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  353. package/build/icon/index.js +1 -2
  354. package/build/icon/index.js.map +1 -1
  355. package/build/index.js +2 -2
  356. package/build/index.js.map +1 -1
  357. package/build/index.native.js +2 -2
  358. package/build/index.native.js.map +1 -1
  359. package/build/input-control/backdrop.js +3 -2
  360. package/build/input-control/backdrop.js.map +1 -1
  361. package/build/input-control/index.js +3 -5
  362. package/build/input-control/index.js.map +1 -1
  363. package/build/input-control/input-base.js +4 -3
  364. package/build/input-control/input-base.js.map +1 -1
  365. package/build/input-control/input-field.js +1 -2
  366. package/build/input-control/input-field.js.map +1 -1
  367. package/build/input-control/input-prefix-wrapper.js +2 -4
  368. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  369. package/build/input-control/input-suffix-wrapper.js +2 -4
  370. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  371. package/build/input-control/reducer/actions.js +11 -22
  372. package/build/input-control/reducer/actions.js.map +1 -1
  373. package/build/input-control/reducer/reducer.js +2 -2
  374. package/build/input-control/reducer/reducer.js.map +1 -1
  375. package/build/input-control/reducer/state.js +1 -2
  376. package/build/input-control/reducer/state.js.map +1 -1
  377. package/build/input-control/styles/input-control-styles.js +32 -37
  378. package/build/input-control/styles/input-control-styles.js.map +1 -1
  379. package/build/input-control/types.js.map +1 -1
  380. package/build/isolated-event-container/index.js +1 -2
  381. package/build/isolated-event-container/index.js.map +1 -1
  382. package/build/item-group/context.js +1 -2
  383. package/build/item-group/context.js.map +1 -1
  384. package/build/item-group/item/component.js +2 -4
  385. package/build/item-group/item/component.js.map +1 -1
  386. package/build/item-group/item/hook.js +2 -2
  387. package/build/item-group/item/hook.js.map +1 -1
  388. package/build/item-group/item-group/component.js +2 -4
  389. package/build/item-group/item-group/component.js.map +1 -1
  390. package/build/item-group/item-group/hook.js +2 -2
  391. package/build/item-group/item-group/hook.js.map +1 -1
  392. package/build/item-group/styles.js +13 -20
  393. package/build/item-group/styles.js.map +1 -1
  394. package/build/keyboard-shortcuts/index.js +1 -2
  395. package/build/keyboard-shortcuts/index.js.map +1 -1
  396. package/build/keyboard-shortcuts/index.native.js +1 -2
  397. package/build/keyboard-shortcuts/index.native.js.map +1 -1
  398. package/build/menu-group/index.js +1 -2
  399. package/build/menu-group/index.js.map +1 -1
  400. package/build/menu-item/index.js +2 -4
  401. package/build/menu-item/index.js.map +1 -1
  402. package/build/menu-items-choice/index.js +1 -2
  403. package/build/menu-items-choice/index.js.map +1 -1
  404. package/build/mobile/audio-player/index.native.js +1 -2
  405. package/build/mobile/audio-player/index.native.js.map +1 -1
  406. package/build/mobile/badge/index.native.js +1 -2
  407. package/build/mobile/badge/index.native.js.map +1 -1
  408. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +1 -2
  409. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  410. package/build/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js +1 -2
  411. package/build/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js.map +1 -1
  412. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +3 -4
  413. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  414. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
  415. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  416. package/build/mobile/bottom-sheet/button.native.js +1 -2
  417. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  418. package/build/mobile/bottom-sheet/cell.native.js +1 -2
  419. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  420. package/build/mobile/bottom-sheet/chevron-back.native.js +1 -2
  421. package/build/mobile/bottom-sheet/chevron-back.native.js.map +1 -1
  422. package/build/mobile/bottom-sheet/footer-message-cell.native.js +1 -2
  423. package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  424. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +1 -2
  425. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  426. package/build/mobile/bottom-sheet/index.native.js +1 -2
  427. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  428. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -2
  429. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  430. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  431. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  432. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -2
  433. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  434. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js +1 -2
  435. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  436. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  437. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  438. package/build/mobile/bottom-sheet/nav-bar/heading.native.js +1 -2
  439. package/build/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  440. package/build/mobile/bottom-sheet/nav-bar/index.native.js +1 -2
  441. package/build/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  442. package/build/mobile/bottom-sheet/range-cell.native.js +1 -2
  443. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  444. package/build/mobile/bottom-sheet/range-text-input.native.js +1 -2
  445. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  446. package/build/mobile/bottom-sheet/ripple.native.js +1 -2
  447. package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
  448. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
  449. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  450. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  451. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  452. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  453. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  454. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -2
  455. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  456. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -2
  457. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  458. package/build/mobile/bottom-sheet-text-control/index.native.js +1 -2
  459. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  460. package/build/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  461. package/build/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  462. package/build/mobile/color-settings/index.native.js +1 -2
  463. package/build/mobile/color-settings/index.native.js.map +1 -1
  464. package/build/mobile/color-settings/palette.screen.native.js +1 -2
  465. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  466. package/build/mobile/color-settings/picker-screen.native.js +1 -2
  467. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  468. package/build/mobile/color-settings/utils.native.js +1 -2
  469. package/build/mobile/color-settings/utils.native.js.map +1 -1
  470. package/build/mobile/cycle-select-control/index.native.js +1 -2
  471. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  472. package/build/mobile/dashicons/index.native.js +3 -6
  473. package/build/mobile/dashicons/index.native.js.map +1 -1
  474. package/build/mobile/focal-point-settings-panel/index.native.js +1 -2
  475. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  476. package/build/mobile/global-styles-context/index.native.js +1 -2
  477. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  478. package/build/mobile/global-styles-context/utils.native.js +1 -2
  479. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  480. package/build/mobile/gradient/index.native.js +1 -2
  481. package/build/mobile/gradient/index.native.js.map +1 -1
  482. package/build/mobile/gridicons/index.native.js +8 -16
  483. package/build/mobile/gridicons/index.native.js.map +1 -1
  484. package/build/mobile/html-text-input/index.native.js +1 -2
  485. package/build/mobile/html-text-input/index.native.js.map +1 -1
  486. package/build/mobile/image/constants.js +1 -2
  487. package/build/mobile/image/constants.js.map +1 -1
  488. package/build/mobile/image/icon-customize.native.js +1 -2
  489. package/build/mobile/image/icon-customize.native.js.map +1 -1
  490. package/build/mobile/image/icon-retry.native.js +1 -2
  491. package/build/mobile/image/icon-retry.native.js.map +1 -1
  492. package/build/mobile/image/image-editing-button.native.js +1 -2
  493. package/build/mobile/image/image-editing-button.native.js.map +1 -1
  494. package/build/mobile/image/index.native.js +81 -7
  495. package/build/mobile/image/index.native.js.map +1 -1
  496. package/build/mobile/keyboard-avoiding-view/index.android.js +2 -4
  497. package/build/mobile/keyboard-avoiding-view/index.android.js.map +1 -1
  498. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -2
  499. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  500. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -2
  501. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  502. package/build/mobile/keyboard-aware-flat-list/index.ios.js +1 -2
  503. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  504. package/build/mobile/link-picker/link-picker-screen.native.js +1 -2
  505. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  506. package/build/mobile/link-settings/index.native.js +1 -2
  507. package/build/mobile/link-settings/index.native.js.map +1 -1
  508. package/build/mobile/link-settings/link-rel.native.js +1 -2
  509. package/build/mobile/link-settings/link-rel.native.js.map +1 -1
  510. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -2
  511. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  512. package/build/mobile/link-settings/link-settings-screen.native.js +1 -2
  513. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  514. package/build/mobile/media-edit/index.native.js +3 -6
  515. package/build/mobile/media-edit/index.native.js.map +1 -1
  516. package/build/mobile/picker/index.ios.js +1 -2
  517. package/build/mobile/picker/index.ios.js.map +1 -1
  518. package/build/mobile/segmented-control/index.native.js +1 -2
  519. package/build/mobile/segmented-control/index.native.js.map +1 -1
  520. package/build/mobile/utils/alignments.native.js +3 -6
  521. package/build/mobile/utils/alignments.native.js.map +1 -1
  522. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -2
  523. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  524. package/build/modal/index.js +4 -6
  525. package/build/modal/index.js.map +1 -1
  526. package/build/navigable-container/container.js +1 -2
  527. package/build/navigable-container/container.js.map +1 -1
  528. package/build/navigable-container/menu.js +2 -4
  529. package/build/navigable-container/menu.js.map +1 -1
  530. package/build/navigable-container/tabbable.js +2 -4
  531. package/build/navigable-container/tabbable.js.map +1 -1
  532. package/build/navigation/back-button/index.js +2 -4
  533. package/build/navigation/back-button/index.js.map +1 -1
  534. package/build/navigation/constants.js +2 -4
  535. package/build/navigation/constants.js.map +1 -1
  536. package/build/navigation/context.js +1 -2
  537. package/build/navigation/context.js.map +1 -1
  538. package/build/navigation/group/context.js +1 -2
  539. package/build/navigation/group/context.js.map +1 -1
  540. package/build/navigation/group/index.js +1 -2
  541. package/build/navigation/group/index.js.map +1 -1
  542. package/build/navigation/index.js +1 -2
  543. package/build/navigation/index.js.map +1 -1
  544. package/build/navigation/item/index.js +1 -2
  545. package/build/navigation/item/index.js.map +1 -1
  546. package/build/navigation/menu/context.js +1 -2
  547. package/build/navigation/menu/context.js.map +1 -1
  548. package/build/navigation/menu/index.js +1 -2
  549. package/build/navigation/menu/index.js.map +1 -1
  550. package/build/navigation/menu/menu-title-search.js +5 -8
  551. package/build/navigation/menu/menu-title-search.js.map +1 -1
  552. package/build/navigation/styles/navigation-styles.js +34 -47
  553. package/build/navigation/styles/navigation-styles.js.map +1 -1
  554. package/build/navigator/context.js +1 -2
  555. package/build/navigator/context.js.map +1 -1
  556. package/build/navigator/navigator-back-button/component.js +2 -4
  557. package/build/navigator/navigator-back-button/component.js.map +1 -1
  558. package/build/navigator/navigator-button/component.js +2 -4
  559. package/build/navigator/navigator-button/component.js.map +1 -1
  560. package/build/navigator/navigator-provider/component.js +4 -6
  561. package/build/navigator/navigator-provider/component.js.map +1 -1
  562. package/build/navigator/navigator-screen/component.js +4 -6
  563. package/build/navigator/navigator-screen/component.js.map +1 -1
  564. package/build/navigator/navigator-to-parent-button/component.js +2 -4
  565. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  566. package/build/navigator/styles.js +1 -2
  567. package/build/navigator/styles.js.map +1 -1
  568. package/build/navigator/use-navigator.js +1 -2
  569. package/build/navigator/use-navigator.js.map +1 -1
  570. package/build/notice/index.js +1 -2
  571. package/build/notice/index.js.map +1 -1
  572. package/build/notice/index.native.js +1 -2
  573. package/build/notice/index.native.js.map +1 -1
  574. package/build/notice/list.js +1 -2
  575. package/build/notice/list.js.map +1 -1
  576. package/build/notice/list.native.js +1 -2
  577. package/build/notice/list.native.js.map +1 -1
  578. package/build/number-control/index.js +5 -7
  579. package/build/number-control/index.js.map +1 -1
  580. package/build/number-control/styles/number-control-styles.js +3 -6
  581. package/build/number-control/styles/number-control-styles.js.map +1 -1
  582. package/build/palette-edit/index.js +11 -17
  583. package/build/palette-edit/index.js.map +1 -1
  584. package/build/palette-edit/styles.js +50 -51
  585. package/build/palette-edit/styles.js.map +1 -1
  586. package/build/panel/actions.native.js +1 -2
  587. package/build/panel/actions.native.js.map +1 -1
  588. package/build/panel/body.js +2 -4
  589. package/build/panel/body.js.map +1 -1
  590. package/build/panel/body.native.js +1 -2
  591. package/build/panel/body.native.js.map +1 -1
  592. package/build/panel/bottom-separator-cover.native.js +1 -2
  593. package/build/panel/bottom-separator-cover.native.js.map +1 -1
  594. package/build/panel/header.js +1 -2
  595. package/build/panel/header.js.map +1 -1
  596. package/build/panel/index.js +2 -4
  597. package/build/panel/index.js.map +1 -1
  598. package/build/panel/row.js +2 -4
  599. package/build/panel/row.js.map +1 -1
  600. package/build/placeholder/index.js +1 -2
  601. package/build/placeholder/index.js.map +1 -1
  602. package/build/popover/index.js +5 -6
  603. package/build/popover/index.js.map +1 -1
  604. package/build/popover/types.js.map +1 -1
  605. package/build/private-apis.js +1 -2
  606. package/build/private-apis.js.map +1 -1
  607. package/build/private-apis.native.js +1 -2
  608. package/build/private-apis.native.js.map +1 -1
  609. package/build/progress-bar/index.js +4 -6
  610. package/build/progress-bar/index.js.map +1 -1
  611. package/build/progress-bar/styles.js +4 -8
  612. package/build/progress-bar/styles.js.map +1 -1
  613. package/build/query-controls/index.js +5 -6
  614. package/build/query-controls/index.js.map +1 -1
  615. package/build/query-controls/index.native.js +4 -5
  616. package/build/query-controls/index.native.js.map +1 -1
  617. package/build/radio-control/index.js +1 -2
  618. package/build/radio-control/index.js.map +1 -1
  619. package/build/radio-control/index.native.js +1 -2
  620. package/build/radio-control/index.native.js.map +1 -1
  621. package/build/radio-group/context.js +1 -2
  622. package/build/radio-group/context.js.map +1 -1
  623. package/build/radio-group/index.js +4 -6
  624. package/build/radio-group/index.js.map +1 -1
  625. package/build/radio-group/radio.js +4 -6
  626. package/build/radio-group/radio.js.map +1 -1
  627. package/build/range-control/index.js +2 -4
  628. package/build/range-control/index.js.map +1 -1
  629. package/build/range-control/index.native.js +1 -2
  630. package/build/range-control/index.native.js.map +1 -1
  631. package/build/range-control/input-range.js +1 -2
  632. package/build/range-control/input-range.js.map +1 -1
  633. package/build/range-control/styles/range-control-styles.js +15 -30
  634. package/build/range-control/styles/range-control-styles.js.map +1 -1
  635. package/build/resizable-box/index.js +2 -4
  636. package/build/resizable-box/index.js.map +1 -1
  637. package/build/resizable-box/index.native.js +1 -2
  638. package/build/resizable-box/index.native.js.map +1 -1
  639. package/build/resizable-box/resize-tooltip/index.js +1 -2
  640. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  641. package/build/resizable-box/resize-tooltip/label.js +1 -2
  642. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  643. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +9 -12
  644. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  645. package/build/resizable-box/resize-tooltip/utils.js +1 -2
  646. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  647. package/build/responsive-wrapper/index.js +1 -2
  648. package/build/responsive-wrapper/index.js.map +1 -1
  649. package/build/sandbox/index.js +1 -2
  650. package/build/sandbox/index.js.map +1 -1
  651. package/build/sandbox/index.native.js +1 -2
  652. package/build/sandbox/index.native.js.map +1 -1
  653. package/build/scroll-lock/index.js +1 -2
  654. package/build/scroll-lock/index.js.map +1 -1
  655. package/build/scrollable/component.js +2 -4
  656. package/build/scrollable/component.js.map +1 -1
  657. package/build/scrollable/hook.js +2 -2
  658. package/build/scrollable/hook.js.map +1 -1
  659. package/build/scrollable/styles.js +7 -14
  660. package/build/scrollable/styles.js.map +1 -1
  661. package/build/search-control/index.js +68 -60
  662. package/build/search-control/index.js.map +1 -1
  663. package/build/search-control/index.native.js +1 -2
  664. package/build/search-control/index.native.js.map +1 -1
  665. package/build/search-control/styles.js +37 -0
  666. package/build/search-control/styles.js.map +1 -0
  667. package/build/search-control/types.js.map +1 -1
  668. package/build/select-control/chevron-down.js +1 -2
  669. package/build/select-control/chevron-down.js.map +1 -1
  670. package/build/select-control/index.js +3 -5
  671. package/build/select-control/index.js.map +1 -1
  672. package/build/select-control/index.native.js +2 -4
  673. package/build/select-control/index.native.js.map +1 -1
  674. package/build/select-control/styles/select-control-styles.js +4 -8
  675. package/build/select-control/styles/select-control-styles.js.map +1 -1
  676. package/build/shortcut/index.js +1 -2
  677. package/build/shortcut/index.js.map +1 -1
  678. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -2
  679. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  680. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  681. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  682. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  683. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  684. package/build/slot-fill/context.js +2 -4
  685. package/build/slot-fill/context.js.map +1 -1
  686. package/build/slot-fill/index.js +1 -2
  687. package/build/slot-fill/index.js.map +1 -1
  688. package/build/slot-fill/provider.js +1 -2
  689. package/build/slot-fill/provider.js.map +1 -1
  690. package/build/slot-fill/slot.js +1 -2
  691. package/build/slot-fill/slot.js.map +1 -1
  692. package/build/slot-fill/use-slot.js +1 -2
  693. package/build/slot-fill/use-slot.js.map +1 -1
  694. package/build/snackbar/index.js +19 -9
  695. package/build/snackbar/index.js.map +1 -1
  696. package/build/snackbar/list.js +1 -2
  697. package/build/snackbar/list.js.map +1 -1
  698. package/build/spacer/component.js +2 -4
  699. package/build/spacer/component.js.map +1 -1
  700. package/build/spinner/index.js +2 -4
  701. package/build/spinner/index.js.map +1 -1
  702. package/build/spinner/styles.js +3 -6
  703. package/build/spinner/styles.js.map +1 -1
  704. package/build/style-provider/index.js +3 -4
  705. package/build/style-provider/index.js.map +1 -1
  706. package/build/surface/component.js +2 -4
  707. package/build/surface/component.js.map +1 -1
  708. package/build/surface/hook.js +2 -2
  709. package/build/surface/hook.js.map +1 -1
  710. package/build/surface/styles.js +5 -10
  711. package/build/surface/styles.js.map +1 -1
  712. package/build/tab-panel/index.js +4 -6
  713. package/build/tab-panel/index.js.map +1 -1
  714. package/build/tabs/context.js +1 -2
  715. package/build/tabs/context.js.map +1 -1
  716. package/build/tabs/index.js +23 -20
  717. package/build/tabs/index.js.map +1 -1
  718. package/build/tabs/styles.js +5 -8
  719. package/build/tabs/styles.js.map +1 -1
  720. package/build/tabs/tab.js +1 -2
  721. package/build/tabs/tab.js.map +1 -1
  722. package/build/tabs/tablist.js +25 -4
  723. package/build/tabs/tablist.js.map +1 -1
  724. package/build/tabs/tabpanel.js +1 -2
  725. package/build/tabs/tabpanel.js.map +1 -1
  726. package/build/text/component.js +2 -4
  727. package/build/text/component.js.map +1 -1
  728. package/build/text/hook.js +2 -2
  729. package/build/text/hook.js.map +1 -1
  730. package/build/text/index.native.js +1 -2
  731. package/build/text/index.native.js.map +1 -1
  732. package/build/text/styles/emotion-css.native.js +1 -2
  733. package/build/text/styles/emotion-css.native.js.map +1 -1
  734. package/build/text/styles/font-family.native.js +1 -2
  735. package/build/text/styles/font-family.native.js.map +1 -1
  736. package/build/text/styles.js +7 -14
  737. package/build/text/styles.js.map +1 -1
  738. package/build/text-control/index.js +2 -4
  739. package/build/text-control/index.js.map +1 -1
  740. package/build/text-control/index.native.js +1 -2
  741. package/build/text-control/index.native.js.map +1 -1
  742. package/build/text-highlight/index.js +1 -2
  743. package/build/text-highlight/index.js.map +1 -1
  744. package/build/textarea-control/index.js +2 -4
  745. package/build/textarea-control/index.js.map +1 -1
  746. package/build/textarea-control/index.native.js +1 -2
  747. package/build/textarea-control/index.native.js.map +1 -1
  748. package/build/textarea-control/styles/textarea-control-styles.js +1 -2
  749. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  750. package/build/theme/index.js +1 -2
  751. package/build/theme/index.js.map +1 -1
  752. package/build/theme/styles.js +12 -8
  753. package/build/theme/styles.js.map +1 -1
  754. package/build/tip/index.js +1 -2
  755. package/build/tip/index.js.map +1 -1
  756. package/build/toggle-control/index.js +1 -2
  757. package/build/toggle-control/index.js.map +1 -1
  758. package/build/toggle-control/index.native.js +1 -2
  759. package/build/toggle-control/index.native.js.map +1 -1
  760. package/build/toggle-group-control/context.js +1 -2
  761. package/build/toggle-group-control/context.js.map +1 -1
  762. package/build/toggle-group-control/toggle-group-control/as-button-group.js +1 -2
  763. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  764. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -4
  765. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  766. package/build/toggle-group-control/toggle-group-control/component.js +7 -8
  767. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  768. package/build/toggle-group-control/toggle-group-control/styles.js +2 -4
  769. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  770. package/build/toggle-group-control/toggle-group-control/utils.js +7 -1
  771. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  772. package/build/toggle-group-control/toggle-group-control-option/component.js +2 -4
  773. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  774. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -4
  775. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  776. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +4 -8
  777. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  778. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +2 -4
  779. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  780. package/build/toolbar/toolbar/index.js +2 -4
  781. package/build/toolbar/toolbar/index.js.map +1 -1
  782. package/build/toolbar/toolbar/toolbar-container.js +4 -6
  783. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  784. package/build/toolbar/toolbar/toolbar-container.native.js +1 -2
  785. package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  786. package/build/toolbar/toolbar-button/index.js +2 -4
  787. package/build/toolbar/toolbar-button/index.js.map +1 -1
  788. package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -2
  789. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  790. package/build/toolbar/toolbar-context/index.js +1 -2
  791. package/build/toolbar/toolbar-context/index.js.map +1 -1
  792. package/build/toolbar/toolbar-dropdown-menu/index.js +1 -2
  793. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  794. package/build/toolbar/toolbar-group/index.js +1 -2
  795. package/build/toolbar/toolbar-group/index.js.map +1 -1
  796. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -2
  797. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  798. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +1 -2
  799. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  800. package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -2
  801. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  802. package/build/toolbar/toolbar-group/toolbar-group-container.native.js +1 -2
  803. package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  804. package/build/toolbar/toolbar-item/index.js +3 -4
  805. package/build/toolbar/toolbar-item/index.js.map +1 -1
  806. package/build/toolbar/toolbar-item/index.native.js +1 -2
  807. package/build/toolbar/toolbar-item/index.native.js.map +1 -1
  808. package/build/tools-panel/context.js +1 -2
  809. package/build/tools-panel/context.js.map +1 -1
  810. package/build/tools-panel/styles.js +8 -16
  811. package/build/tools-panel/styles.js.map +1 -1
  812. package/build/tools-panel/tools-panel/component.js +2 -4
  813. package/build/tools-panel/tools-panel/component.js.map +1 -1
  814. package/build/tools-panel/tools-panel/hook.js +2 -2
  815. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  816. package/build/tools-panel/tools-panel-header/component.js +1 -2
  817. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  818. package/build/tools-panel/tools-panel-header/hook.js +2 -2
  819. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  820. package/build/tools-panel/tools-panel-item/component.js +2 -4
  821. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  822. package/build/tools-panel/tools-panel-item/hook.js +2 -2
  823. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  824. package/build/tooltip/index.js +19 -19
  825. package/build/tooltip/index.js.map +1 -1
  826. package/build/tooltip/index.native.js +1 -2
  827. package/build/tooltip/index.native.js.map +1 -1
  828. package/build/tooltip/types.js.map +1 -1
  829. package/build/tree-grid/cell.js +2 -4
  830. package/build/tree-grid/cell.js.map +1 -1
  831. package/build/tree-grid/index.js +2 -4
  832. package/build/tree-grid/index.js.map +1 -1
  833. package/build/tree-grid/item.js +2 -4
  834. package/build/tree-grid/item.js.map +1 -1
  835. package/build/tree-grid/roving-tab-index-context.js +1 -2
  836. package/build/tree-grid/roving-tab-index-context.js.map +1 -1
  837. package/build/tree-grid/roving-tab-index-item.js +2 -4
  838. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  839. package/build/tree-grid/row.js +2 -4
  840. package/build/tree-grid/row.js.map +1 -1
  841. package/build/tree-select/index.js +2 -3
  842. package/build/tree-select/index.js.map +1 -1
  843. package/build/truncate/component.js +2 -4
  844. package/build/truncate/component.js.map +1 -1
  845. package/build/truncate/hook.js +2 -2
  846. package/build/truncate/hook.js.map +1 -1
  847. package/build/truncate/styles.js +1 -2
  848. package/build/truncate/styles.js.map +1 -1
  849. package/build/truncate/utils.js +3 -6
  850. package/build/truncate/utils.js.map +1 -1
  851. package/build/unit-control/index.js +3 -5
  852. package/build/unit-control/index.js.map +1 -1
  853. package/build/unit-control/index.native.js +1 -2
  854. package/build/unit-control/index.native.js.map +1 -1
  855. package/build/unit-control/styles/unit-control-styles.js +3 -6
  856. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  857. package/build/unit-control/unit-select-control.js +1 -2
  858. package/build/unit-control/unit-select-control.js.map +1 -1
  859. package/build/unit-control/utils.js +3 -6
  860. package/build/unit-control/utils.js.map +1 -1
  861. package/build/utils/base-label.js +1 -2
  862. package/build/utils/base-label.js.map +1 -1
  863. package/build/utils/box-sizing.js +1 -2
  864. package/build/utils/box-sizing.js.map +1 -1
  865. package/build/utils/breakpoint-values.js +1 -2
  866. package/build/utils/breakpoint-values.js.map +1 -1
  867. package/build/utils/colors-values.js +44 -24
  868. package/build/utils/colors-values.js.map +1 -1
  869. package/build/utils/config-values.js +1 -2
  870. package/build/utils/config-values.js.map +1 -1
  871. package/build/utils/font-size.js +3 -6
  872. package/build/utils/font-size.js.map +1 -1
  873. package/build/utils/font-values.js +1 -2
  874. package/build/utils/font-values.js.map +1 -1
  875. package/build/utils/hooks/use-controlled-state.js +1 -2
  876. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  877. package/build/utils/hooks/use-update-effect.js +2 -3
  878. package/build/utils/hooks/use-update-effect.js.map +1 -1
  879. package/build/utils/input/base.js +2 -4
  880. package/build/utils/input/base.js.map +1 -1
  881. package/build/utils/input/input-control.js +1 -2
  882. package/build/utils/input/input-control.js.map +1 -1
  883. package/build/utils/use-deprecated-props.js +1 -15
  884. package/build/utils/use-deprecated-props.js.map +1 -1
  885. package/build/utils/use-responsive-value.js +2 -3
  886. package/build/utils/use-responsive-value.js.map +1 -1
  887. package/build/v-stack/component.js +2 -4
  888. package/build/v-stack/component.js.map +1 -1
  889. package/build/view/component.js +2 -4
  890. package/build/view/component.js.map +1 -1
  891. package/build/visually-hidden/component.js +2 -4
  892. package/build/visually-hidden/component.js.map +1 -1
  893. package/build/visually-hidden/styles.js +1 -2
  894. package/build/visually-hidden/styles.js.map +1 -1
  895. package/build/z-stack/component.js +2 -4
  896. package/build/z-stack/component.js.map +1 -1
  897. package/build/z-stack/styles.js +2 -4
  898. package/build/z-stack/styles.js.map +1 -1
  899. package/build-module/angle-picker-control/index.js +3 -13
  900. package/build-module/angle-picker-control/index.js.map +1 -1
  901. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +5 -17
  902. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  903. package/build-module/angle-picker-control/types.js.map +1 -1
  904. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  905. package/build-module/border-box-control/border-box-control/hook.js +3 -1
  906. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  907. package/build-module/border-box-control/types.js.map +1 -1
  908. package/build-module/border-control/border-control/component.js +5 -1
  909. package/build-module/border-control/border-control/component.js.map +1 -1
  910. package/build-module/border-control/border-control/hook.js +18 -15
  911. package/build-module/border-control/border-control/hook.js.map +1 -1
  912. package/build-module/border-control/border-control-dropdown/component.js +2 -1
  913. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  914. package/build-module/border-control/border-control-style-picker/component.js +21 -48
  915. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  916. package/build-module/border-control/styles.js +14 -24
  917. package/build-module/border-control/styles.js.map +1 -1
  918. package/build-module/border-control/types.js.map +1 -1
  919. package/build-module/box-control/all-input-control.js +38 -28
  920. package/build-module/box-control/all-input-control.js.map +1 -1
  921. package/build-module/box-control/axial-input-controls.js +42 -57
  922. package/build-module/box-control/axial-input-controls.js.map +1 -1
  923. package/build-module/box-control/index.js +22 -25
  924. package/build-module/box-control/index.js.map +1 -1
  925. package/build-module/box-control/input-controls.js +47 -40
  926. package/build-module/box-control/input-controls.js.map +1 -1
  927. package/build-module/box-control/styles/box-control-styles.js +45 -105
  928. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  929. package/build-module/box-control/types.js.map +1 -1
  930. package/build-module/box-control/utils.js +121 -7
  931. package/build-module/box-control/utils.js.map +1 -1
  932. package/build-module/button/index.js +14 -16
  933. package/build-module/button/index.js.map +1 -1
  934. package/build-module/button/index.native.js +0 -1
  935. package/build-module/button/index.native.js.map +1 -1
  936. package/build-module/button/types.js.map +1 -1
  937. package/build-module/checkbox-control/types.js.map +1 -1
  938. package/build-module/color-picker/hsl-input.js +55 -33
  939. package/build-module/color-picker/hsl-input.js.map +1 -1
  940. package/build-module/combobox-control/index.js +1 -2
  941. package/build-module/combobox-control/index.js.map +1 -1
  942. package/build-module/composite/current/index.js +15 -0
  943. package/build-module/composite/current/index.js.map +1 -0
  944. package/build-module/composite/index.js +6 -15
  945. package/build-module/composite/index.js.map +1 -1
  946. package/build-module/composite/legacy/index.js +117 -0
  947. package/build-module/composite/legacy/index.js.map +1 -0
  948. package/build-module/composite/v2.js +3 -13
  949. package/build-module/composite/v2.js.map +1 -1
  950. package/build-module/confirm-dialog/component.js +2 -0
  951. package/build-module/confirm-dialog/component.js.map +1 -1
  952. package/build-module/context/wordpress-component.js.map +1 -1
  953. package/build-module/custom-gradient-picker/index.js +2 -15
  954. package/build-module/custom-gradient-picker/index.js.map +1 -1
  955. package/build-module/custom-gradient-picker/types.js.map +1 -1
  956. package/build-module/custom-select-control/index.js +1 -1
  957. package/build-module/custom-select-control/index.js.map +1 -1
  958. package/build-module/custom-select-control-v2/index.js +6 -3
  959. package/build-module/custom-select-control-v2/index.js.map +1 -1
  960. package/build-module/date-time/time/timezone.js +1 -1
  961. package/build-module/date-time/time/timezone.js.map +1 -1
  962. package/build-module/dropdown-menu-v2/styles.js +14 -14
  963. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  964. package/build-module/external-link/index.js +1 -1
  965. package/build-module/focal-point-picker/index.js +2 -2
  966. package/build-module/focal-point-picker/index.js.map +1 -1
  967. package/build-module/focal-point-picker/index.native.js +0 -1
  968. package/build-module/focal-point-picker/index.native.js.map +1 -1
  969. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +29 -37
  970. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  971. package/build-module/focal-point-picker/styles/focal-point-style.js +10 -2
  972. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  973. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -2
  974. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  975. package/build-module/font-size-picker/index.js +3 -17
  976. package/build-module/font-size-picker/index.js.map +1 -1
  977. package/build-module/font-size-picker/styles.js +14 -20
  978. package/build-module/font-size-picker/styles.js.map +1 -1
  979. package/build-module/font-size-picker/types.js.map +1 -1
  980. package/build-module/form-token-field/index.js +1 -6
  981. package/build-module/form-token-field/index.js.map +1 -1
  982. package/build-module/form-token-field/suggestions-list.js +0 -1
  983. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  984. package/build-module/gradient-picker/index.js +18 -41
  985. package/build-module/gradient-picker/index.js.map +1 -1
  986. package/build-module/gradient-picker/types.js.map +1 -1
  987. package/build-module/input-control/backdrop.js +2 -0
  988. package/build-module/input-control/backdrop.js.map +1 -1
  989. package/build-module/input-control/index.js +1 -1
  990. package/build-module/input-control/index.js.map +1 -1
  991. package/build-module/input-control/input-base.js +6 -4
  992. package/build-module/input-control/input-base.js.map +1 -1
  993. package/build-module/input-control/styles/input-control-styles.js +25 -23
  994. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  995. package/build-module/input-control/types.js.map +1 -1
  996. package/build-module/isolated-event-container/index.js +0 -1
  997. package/build-module/isolated-event-container/index.js.map +1 -1
  998. package/build-module/item-group/styles.js +10 -10
  999. package/build-module/item-group/styles.js.map +1 -1
  1000. package/build-module/mobile/image/index.native.js +83 -8
  1001. package/build-module/mobile/image/index.native.js.map +1 -1
  1002. package/build-module/navigation/menu/menu-title-search.js +4 -6
  1003. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  1004. package/build-module/navigation/styles/navigation-styles.js +23 -24
  1005. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  1006. package/build-module/number-control/index.js +1 -1
  1007. package/build-module/number-control/index.js.map +1 -1
  1008. package/build-module/palette-edit/index.js +10 -15
  1009. package/build-module/palette-edit/index.js.map +1 -1
  1010. package/build-module/palette-edit/styles.js +43 -33
  1011. package/build-module/palette-edit/styles.js.map +1 -1
  1012. package/build-module/popover/index.js +2 -0
  1013. package/build-module/popover/index.js.map +1 -1
  1014. package/build-module/popover/types.js.map +1 -1
  1015. package/build-module/query-controls/index.js +5 -5
  1016. package/build-module/query-controls/index.js.map +1 -1
  1017. package/build-module/query-controls/index.native.js +4 -4
  1018. package/build-module/query-controls/index.native.js.map +1 -1
  1019. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  1020. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  1021. package/build-module/search-control/index.js +67 -57
  1022. package/build-module/search-control/index.js.map +1 -1
  1023. package/build-module/search-control/styles.js +29 -0
  1024. package/build-module/search-control/styles.js.map +1 -0
  1025. package/build-module/search-control/types.js.map +1 -1
  1026. package/build-module/select-control/index.js +1 -1
  1027. package/build-module/select-control/index.js.map +1 -1
  1028. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  1029. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  1030. package/build-module/snackbar/index.js +18 -6
  1031. package/build-module/snackbar/index.js.map +1 -1
  1032. package/build-module/tabs/index.js +21 -17
  1033. package/build-module/tabs/index.js.map +1 -1
  1034. package/build-module/tabs/tablist.js +22 -0
  1035. package/build-module/tabs/tablist.js.map +1 -1
  1036. package/build-module/theme/styles.js +11 -2
  1037. package/build-module/theme/styles.js.map +1 -1
  1038. package/build-module/toggle-group-control/toggle-group-control/utils.js +7 -1
  1039. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  1040. package/build-module/tooltip/index.js +16 -13
  1041. package/build-module/tooltip/index.js.map +1 -1
  1042. package/build-module/tooltip/types.js.map +1 -1
  1043. package/build-module/tree-select/index.js +1 -1
  1044. package/build-module/tree-select/index.js.map +1 -1
  1045. package/build-module/unit-control/index.js +1 -1
  1046. package/build-module/unit-control/index.js.map +1 -1
  1047. package/build-module/utils/colors-values.js +42 -19
  1048. package/build-module/utils/colors-values.js.map +1 -1
  1049. package/build-module/utils/hooks/use-update-effect.js +1 -1
  1050. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  1051. package/build-module/utils/use-deprecated-props.js +1 -13
  1052. package/build-module/utils/use-deprecated-props.js.map +1 -1
  1053. package/build-module/utils/use-responsive-value.js +2 -3
  1054. package/build-module/utils/use-responsive-value.js.map +1 -1
  1055. package/build-style/style-rtl.css +28 -113
  1056. package/build-style/style.css +28 -113
  1057. package/build-types/angle-picker-control/index.d.ts +0 -1
  1058. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  1059. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +0 -6
  1060. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  1061. package/build-types/angle-picker-control/types.d.ts +2 -0
  1062. package/build-types/angle-picker-control/types.d.ts.map +1 -1
  1063. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  1064. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  1065. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
  1066. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  1067. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +5 -5
  1068. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
  1069. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
  1070. package/build-types/border-box-control/stories/index.story.d.ts +2 -1
  1071. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  1072. package/build-types/border-box-control/types.d.ts +6 -0
  1073. package/build-types/border-box-control/types.d.ts.map +1 -1
  1074. package/build-types/border-control/border-control/component.d.ts +1 -0
  1075. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  1076. package/build-types/border-control/border-control/hook.d.ts +6 -4
  1077. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  1078. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -0
  1079. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  1080. package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -4
  1081. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  1082. package/build-types/border-control/border-control-style-picker/component.d.ts +3 -4
  1083. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  1084. package/build-types/border-control/stories/index.story.d.ts +12 -6
  1085. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  1086. package/build-types/border-control/styles.d.ts +0 -2
  1087. package/build-types/border-control/styles.d.ts.map +1 -1
  1088. package/build-types/border-control/types.d.ts +12 -1
  1089. package/build-types/border-control/types.d.ts.map +1 -1
  1090. package/build-types/box-control/all-input-control.d.ts +1 -1
  1091. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  1092. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  1093. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  1094. package/build-types/box-control/index.d.ts +1 -1
  1095. package/build-types/box-control/index.d.ts.map +1 -1
  1096. package/build-types/box-control/input-controls.d.ts +1 -1
  1097. package/build-types/box-control/input-controls.d.ts.map +1 -1
  1098. package/build-types/box-control/stories/index.story.d.ts +42 -36
  1099. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  1100. package/build-types/box-control/styles/box-control-styles.d.ts +49 -23
  1101. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  1102. package/build-types/box-control/types.d.ts +12 -12
  1103. package/build-types/box-control/types.d.ts.map +1 -1
  1104. package/build-types/box-control/utils.d.ts +2 -1
  1105. package/build-types/box-control/utils.d.ts.map +1 -1
  1106. package/build-types/button/deprecated.d.ts +3 -3
  1107. package/build-types/button/index.d.ts.map +1 -1
  1108. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  1109. package/build-types/button/types.d.ts +7 -3
  1110. package/build-types/button/types.d.ts.map +1 -1
  1111. package/build-types/card/card/hook.d.ts +4 -4
  1112. package/build-types/card/card-body/hook.d.ts +4 -4
  1113. package/build-types/card/card-divider/hook.d.ts +4 -4
  1114. package/build-types/card/card-footer/hook.d.ts +4 -4
  1115. package/build-types/card/card-header/hook.d.ts +4 -4
  1116. package/build-types/card/card-media/hook.d.ts +4 -4
  1117. package/build-types/card/stories/index.story.d.ts +2 -2
  1118. package/build-types/checkbox-control/stories/index.story.d.ts +11 -0
  1119. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  1120. package/build-types/checkbox-control/types.d.ts +2 -3
  1121. package/build-types/checkbox-control/types.d.ts.map +1 -1
  1122. package/build-types/color-palette/styles.d.ts +2 -2
  1123. package/build-types/color-picker/component.d.ts +1 -1
  1124. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  1125. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  1126. package/build-types/color-picker/styles.d.ts +3 -3
  1127. package/build-types/combobox-control/index.d.ts.map +1 -1
  1128. package/build-types/composite/current/index.d.ts +12 -0
  1129. package/build-types/composite/current/index.d.ts.map +1 -0
  1130. package/build-types/composite/current/stories/index.story.d.ts +13 -0
  1131. package/build-types/composite/current/stories/index.story.d.ts.map +1 -0
  1132. package/build-types/composite/current/stories/utils.d.ts +15 -0
  1133. package/build-types/composite/current/stories/utils.d.ts.map +1 -0
  1134. package/build-types/composite/index.d.ts +1 -14
  1135. package/build-types/composite/index.d.ts.map +1 -1
  1136. package/build-types/composite/legacy/index.d.ts +84 -0
  1137. package/build-types/composite/legacy/index.d.ts.map +1 -0
  1138. package/build-types/composite/legacy/stories/index.story.d.ts +12 -0
  1139. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -0
  1140. package/build-types/composite/legacy/stories/utils.d.ts +15 -0
  1141. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -0
  1142. package/build-types/composite/legacy/test/index.d.ts.map +1 -0
  1143. package/build-types/composite/v2.d.ts +1 -11
  1144. package/build-types/composite/v2.d.ts.map +1 -1
  1145. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  1146. package/build-types/custom-gradient-picker/index.d.ts +1 -3
  1147. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  1148. package/build-types/custom-gradient-picker/types.d.ts +2 -0
  1149. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  1150. package/build-types/custom-select-control/index.d.ts.map +1 -1
  1151. package/build-types/custom-select-control/styles.d.ts +2 -2
  1152. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  1153. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  1154. package/build-types/custom-select-control-v2/test/index.d.ts +2 -0
  1155. package/build-types/custom-select-control-v2/test/index.d.ts.map +1 -0
  1156. package/build-types/date-time/date/styles.d.ts +3 -3
  1157. package/build-types/date-time/date-time/styles.d.ts +1 -1
  1158. package/build-types/date-time/time/styles.d.ts +4 -4
  1159. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  1160. package/build-types/elevation/hook.d.ts +4 -4
  1161. package/build-types/flex/flex/hook.d.ts +4 -4
  1162. package/build-types/flex/flex-block/hook.d.ts +4 -4
  1163. package/build-types/flex/flex-item/hook.d.ts +4 -4
  1164. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  1165. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  1166. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  1167. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  1168. package/build-types/font-size-picker/index.d.ts.map +1 -1
  1169. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  1170. package/build-types/font-size-picker/styles.d.ts +1 -7
  1171. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  1172. package/build-types/font-size-picker/types.d.ts +3 -1
  1173. package/build-types/font-size-picker/types.d.ts.map +1 -1
  1174. package/build-types/form-token-field/index.d.ts.map +1 -1
  1175. package/build-types/gradient-picker/index.d.ts +1 -4
  1176. package/build-types/gradient-picker/index.d.ts.map +1 -1
  1177. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  1178. package/build-types/gradient-picker/types.d.ts +2 -0
  1179. package/build-types/gradient-picker/types.d.ts.map +1 -1
  1180. package/build-types/grid/hook.d.ts +4 -4
  1181. package/build-types/h-stack/hook.d.ts +4 -4
  1182. package/build-types/heading/component.d.ts +1 -1
  1183. package/build-types/heading/hook.d.ts +4 -4
  1184. package/build-types/input-control/backdrop.d.ts +2 -1
  1185. package/build-types/input-control/backdrop.d.ts.map +1 -1
  1186. package/build-types/input-control/index.d.ts.map +1 -1
  1187. package/build-types/input-control/input-base.d.ts +1 -3
  1188. package/build-types/input-control/input-base.d.ts.map +1 -1
  1189. package/build-types/input-control/styles/input-control-styles.d.ts +1 -0
  1190. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  1191. package/build-types/input-control/types.d.ts +7 -1
  1192. package/build-types/input-control/types.d.ts.map +1 -1
  1193. package/build-types/item-group/item/hook.d.ts +4 -4
  1194. package/build-types/item-group/item-group/hook.d.ts +4 -4
  1195. package/build-types/item-group/styles.d.ts.map +1 -1
  1196. package/build-types/menu-item/index.d.ts +1 -1
  1197. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  1198. package/build-types/navigation/styles/navigation-styles.d.ts +6 -13
  1199. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  1200. package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
  1201. package/build-types/navigator/navigator-button/hook.d.ts +4 -4
  1202. package/build-types/number-control/index.d.ts +1 -1
  1203. package/build-types/number-control/index.d.ts.map +1 -1
  1204. package/build-types/number-control/stories/index.story.d.ts +1 -1
  1205. package/build-types/palette-edit/index.d.ts.map +1 -1
  1206. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  1207. package/build-types/palette-edit/styles.d.ts +17 -23
  1208. package/build-types/palette-edit/styles.d.ts.map +1 -1
  1209. package/build-types/popover/index.d.ts.map +1 -1
  1210. package/build-types/popover/types.d.ts +9 -0
  1211. package/build-types/popover/types.d.ts.map +1 -1
  1212. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  1213. package/build-types/range-control/index.d.ts +1 -1
  1214. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  1215. package/build-types/resizable-box/index.d.ts +1 -1
  1216. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  1217. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  1218. package/build-types/scrollable/hook.d.ts +4 -4
  1219. package/build-types/search-control/index.d.ts +4 -9
  1220. package/build-types/search-control/index.d.ts.map +1 -1
  1221. package/build-types/search-control/stories/index.story.d.ts +2 -18
  1222. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  1223. package/build-types/search-control/styles.d.ts +10 -0
  1224. package/build-types/search-control/styles.d.ts.map +1 -0
  1225. package/build-types/search-control/test/index.d.ts +2 -0
  1226. package/build-types/search-control/test/index.d.ts.map +1 -0
  1227. package/build-types/search-control/types.d.ts +34 -18
  1228. package/build-types/search-control/types.d.ts.map +1 -1
  1229. package/build-types/select-control/index.d.ts.map +1 -1
  1230. package/build-types/snackbar/index.d.ts.map +1 -1
  1231. package/build-types/spacer/hook.d.ts +4 -4
  1232. package/build-types/surface/hook.d.ts +4 -4
  1233. package/build-types/tabs/index.d.ts.map +1 -1
  1234. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  1235. package/build-types/tabs/tablist.d.ts.map +1 -1
  1236. package/build-types/text/hook.d.ts +4 -4
  1237. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  1238. package/build-types/theme/styles.d.ts.map +1 -1
  1239. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  1240. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
  1241. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  1242. package/build-types/toolbar/toolbar-button/index.d.ts +3 -3
  1243. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  1244. package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
  1245. package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
  1246. package/build-types/tooltip/index.d.ts +1 -1
  1247. package/build-types/tooltip/index.d.ts.map +1 -1
  1248. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  1249. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  1250. package/build-types/tooltip/types.d.ts +1 -1
  1251. package/build-types/tooltip/types.d.ts.map +1 -1
  1252. package/build-types/tree-select/index.d.ts.map +1 -1
  1253. package/build-types/truncate/hook.d.ts +4 -4
  1254. package/build-types/unit-control/index.d.ts +1 -1
  1255. package/build-types/unit-control/index.d.ts.map +1 -1
  1256. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  1257. package/build-types/utils/colors-values.d.ts +28 -1
  1258. package/build-types/utils/colors-values.d.ts.map +1 -1
  1259. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  1260. package/build-types/utils/use-deprecated-props.d.ts +1 -5
  1261. package/build-types/utils/use-deprecated-props.d.ts.map +1 -1
  1262. package/build-types/v-stack/hook.d.ts +4 -4
  1263. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  1264. package/package.json +19 -20
  1265. package/src/angle-picker-control/README.md +0 -8
  1266. package/src/angle-picker-control/index.tsx +4 -23
  1267. package/src/angle-picker-control/stories/index.story.tsx +0 -3
  1268. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +0 -18
  1269. package/src/angle-picker-control/types.ts +2 -0
  1270. package/src/border-box-control/border-box-control/component.tsx +0 -1
  1271. package/src/border-box-control/border-box-control/hook.ts +5 -1
  1272. package/src/border-box-control/types.ts +6 -0
  1273. package/src/border-control/border-control/component.tsx +4 -0
  1274. package/src/border-control/border-control/hook.ts +22 -16
  1275. package/src/border-control/border-control-dropdown/component.tsx +2 -1
  1276. package/src/border-control/border-control-style-picker/component.tsx +31 -66
  1277. package/src/border-control/styles.ts +0 -15
  1278. package/src/border-control/types.ts +15 -1
  1279. package/src/box-control/all-input-control.tsx +57 -34
  1280. package/src/box-control/axial-input-controls.tsx +79 -69
  1281. package/src/box-control/index.tsx +47 -54
  1282. package/src/box-control/input-controls.tsx +114 -83
  1283. package/src/box-control/styles/box-control-styles.ts +21 -61
  1284. package/src/box-control/test/index.tsx +126 -18
  1285. package/src/box-control/types.ts +10 -21
  1286. package/src/box-control/utils.ts +43 -8
  1287. package/src/button/README.md +1 -1
  1288. package/src/button/index.tsx +21 -33
  1289. package/src/button/stories/e2e/index.story.tsx +6 -0
  1290. package/src/button/style.scss +17 -5
  1291. package/src/button/test/index.tsx +122 -0
  1292. package/src/button/types.ts +7 -3
  1293. package/src/card/test/__snapshots__/index.tsx.snap +3 -3
  1294. package/src/checkbox-control/README.md +1 -2
  1295. package/src/checkbox-control/stories/index.story.tsx +44 -0
  1296. package/src/checkbox-control/test/index.tsx +2 -2
  1297. package/src/checkbox-control/types.ts +2 -3
  1298. package/src/circular-option-picker/test/index.tsx +10 -16
  1299. package/src/color-picker/hsl-input.tsx +56 -30
  1300. package/src/color-picker/test/index.tsx +190 -16
  1301. package/src/combobox-control/index.tsx +1 -4
  1302. package/src/composite/current/index.ts +22 -0
  1303. package/src/composite/current/stories/index.story.tsx +86 -0
  1304. package/src/composite/current/stories/utils.tsx +61 -0
  1305. package/src/composite/index.ts +6 -21
  1306. package/src/composite/legacy/index.tsx +191 -0
  1307. package/src/composite/legacy/stories/index.story.tsx +205 -0
  1308. package/src/composite/legacy/stories/utils.tsx +67 -0
  1309. package/src/composite/legacy/test/index.tsx +579 -0
  1310. package/src/composite/v2.ts +3 -21
  1311. package/src/confirm-dialog/component.tsx +2 -0
  1312. package/src/context/wordpress-component.ts +1 -1
  1313. package/src/custom-gradient-picker/index.tsx +1 -22
  1314. package/src/custom-gradient-picker/stories/index.story.tsx +0 -3
  1315. package/src/custom-gradient-picker/style.scss +0 -7
  1316. package/src/custom-gradient-picker/types.ts +2 -0
  1317. package/src/custom-select-control/index.js +1 -5
  1318. package/src/custom-select-control-v2/index.tsx +7 -2
  1319. package/src/custom-select-control-v2/stories/index.story.tsx +1 -0
  1320. package/src/custom-select-control-v2/test/index.tsx +219 -0
  1321. package/src/date-time/time/timezone.tsx +1 -1
  1322. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  1323. package/src/divider/README.md +1 -1
  1324. package/src/dropdown-menu-v2/stories/index.story.tsx +1 -0
  1325. package/src/dropdown-menu-v2/styles.ts +1 -1
  1326. package/src/focal-point-picker/index.tsx +2 -2
  1327. package/src/focal-point-picker/styles/focal-point-picker-style.ts +26 -10
  1328. package/src/focal-point-picker/styles/focal-point-style.ts +21 -7
  1329. package/src/font-size-picker/README.md +0 -8
  1330. package/src/font-size-picker/font-size-picker-toggle-group.tsx +2 -9
  1331. package/src/font-size-picker/index.tsx +3 -21
  1332. package/src/font-size-picker/stories/index.story.tsx +0 -1
  1333. package/src/font-size-picker/styles.ts +0 -7
  1334. package/src/font-size-picker/test/index.tsx +16 -99
  1335. package/src/font-size-picker/types.ts +3 -1
  1336. package/src/form-token-field/index.tsx +1 -4
  1337. package/src/gradient-picker/README.md +0 -8
  1338. package/src/gradient-picker/index.tsx +32 -56
  1339. package/src/gradient-picker/stories/index.story.tsx +0 -1
  1340. package/src/gradient-picker/types.ts +2 -0
  1341. package/src/guide/style.scss +1 -1
  1342. package/src/input-control/backdrop.tsx +6 -1
  1343. package/src/input-control/index.tsx +1 -5
  1344. package/src/input-control/input-base.tsx +14 -7
  1345. package/src/input-control/styles/input-control-styles.tsx +6 -3
  1346. package/src/input-control/types.ts +10 -1
  1347. package/src/item-group/styles.ts +1 -4
  1348. package/src/mobile/image/index.native.js +117 -12
  1349. package/src/mobile/image/style.native.scss +6 -0
  1350. package/src/modal/style.scss +1 -1
  1351. package/src/navigation/menu/menu-title-search.tsx +6 -6
  1352. package/src/navigation/styles/navigation-styles.tsx +5 -27
  1353. package/src/number-control/index.tsx +1 -5
  1354. package/src/palette-edit/index.tsx +18 -16
  1355. package/src/palette-edit/stories/index.story.tsx +1 -0
  1356. package/src/palette-edit/{styles.js → styles.ts} +56 -13
  1357. package/src/palette-edit/test/index.tsx +326 -10
  1358. package/src/placeholder/style.scss +6 -5
  1359. package/src/popover/index.tsx +2 -0
  1360. package/src/popover/style.scss +1 -0
  1361. package/src/popover/test/index.tsx +250 -0
  1362. package/src/popover/types.ts +9 -0
  1363. package/src/progress-bar/stories/index.story.tsx +1 -0
  1364. package/src/query-controls/index.native.js +4 -4
  1365. package/src/query-controls/index.tsx +5 -5
  1366. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +3 -3
  1367. package/src/search-control/README.md +23 -3
  1368. package/src/search-control/index.tsx +88 -70
  1369. package/src/search-control/stories/index.story.tsx +1 -1
  1370. package/src/search-control/styles.ts +42 -0
  1371. package/src/search-control/test/index.tsx +107 -0
  1372. package/src/search-control/types.ts +37 -22
  1373. package/src/select-control/index.tsx +1 -5
  1374. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  1375. package/src/snackbar/index.tsx +19 -6
  1376. package/src/style.scss +0 -1
  1377. package/src/tabs/index.tsx +31 -27
  1378. package/src/tabs/stories/index.story.tsx +1 -0
  1379. package/src/tabs/tablist.tsx +19 -0
  1380. package/src/tabs/test/index.tsx +105 -47
  1381. package/src/theme/stories/index.story.tsx +1 -0
  1382. package/src/theme/styles.ts +3 -1
  1383. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +14 -14
  1384. package/src/toggle-group-control/test/index.tsx +73 -36
  1385. package/src/toggle-group-control/toggle-group-control/utils.ts +8 -3
  1386. package/src/toolbar/toolbar-button/README.md +2 -2
  1387. package/src/toolbar/toolbar-dropdown-menu/README.md +2 -2
  1388. package/src/toolbar/toolbar-item/README.md +2 -2
  1389. package/src/tooltip/index.tsx +29 -29
  1390. package/src/tooltip/test/index.tsx +32 -13
  1391. package/src/tooltip/types.ts +1 -1
  1392. package/src/tree-select/index.tsx +1 -5
  1393. package/src/unit-control/index.tsx +1 -5
  1394. package/src/utils/colors-values.js +45 -23
  1395. package/src/utils/hooks/use-update-effect.js +1 -1
  1396. package/src/utils/use-deprecated-props.ts +1 -18
  1397. package/tsconfig.tsbuildinfo +1 -1
  1398. package/build/border-control/border-control-style-picker/hook.js +0 -41
  1399. package/build/border-control/border-control-style-picker/hook.js.map +0 -1
  1400. package/build/box-control/styles/box-control-visualizer-styles.js +0 -93
  1401. package/build/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  1402. package/build/box-control/unit-control.js +0 -76
  1403. package/build/box-control/unit-control.js.map +0 -1
  1404. package/build-module/border-control/border-control-style-picker/hook.js +0 -32
  1405. package/build-module/border-control/border-control-style-picker/hook.js.map +0 -1
  1406. package/build-module/box-control/styles/box-control-visualizer-styles.js +0 -86
  1407. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  1408. package/build-module/box-control/unit-control.js +0 -68
  1409. package/build-module/box-control/unit-control.js.map +0 -1
  1410. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -267
  1411. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +0 -1
  1412. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +0 -46
  1413. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +0 -1
  1414. package/build-types/box-control/unit-control.d.ts +0 -4
  1415. package/build-types/box-control/unit-control.d.ts.map +0 -1
  1416. package/build-types/composite/test/index.d.ts.map +0 -1
  1417. package/src/border-control/border-control-style-picker/hook.ts +0 -35
  1418. package/src/box-control/styles/box-control-visualizer-styles.ts +0 -75
  1419. package/src/box-control/unit-control.tsx +0 -74
  1420. package/src/composite/test/index.tsx +0 -576
  1421. package/src/search-control/style.scss +0 -71
  1422. /package/build-types/composite/{test → legacy/test}/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","svmin","lvmin","dvmin","svmax","lvmax","dvmax","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","isFinite","cache","memoizedGetPxFromCssUnit","hash","hashOptions","hasOwnProperty","_default","exports","default"],"sources":["@wordpress/components/src/mobile/utils/get-px-from-css-unit.native.js"],"sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer onces.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\trelativeUnits.svw = relativeUnits.vmin;\n\trelativeUnits.lvw = relativeUnits.vmax;\n\trelativeUnits.dvw = relativeUnits.vw;\n\trelativeUnits.svh = relativeUnits.vmin;\n\trelativeUnits.lvh = relativeUnits.vmax;\n\trelativeUnits.dvh = relativeUnits.vh;\n\trelativeUnits.vi = relativeUnits.vh;\n\trelativeUnits.svi = relativeUnits.vmin;\n\trelativeUnits.lvi = relativeUnits.vmax;\n\trelativeUnits.dvi = relativeUnits.vw;\n\trelativeUnits.vb = relativeUnits.vh;\n\trelativeUnits.svb = relativeUnits.vmin;\n\trelativeUnits.lvb = relativeUnits.vmax;\n\trelativeUnits.dvb = relativeUnits.vh;\n\trelativeUnits.svmin = relativeUnits.vmin;\n\trelativeUnits.lvmin = relativeUnits.vmin;\n\trelativeUnits.dvmin = relativeUnits.vmin;\n\trelativeUnits.svmax = relativeUnits.vmax;\n\trelativeUnits.lvmax = relativeUnits.vmax;\n\trelativeUnits.dvmax = relativeUnits.vmax;\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAASA,CAAEC,OAAO,EAAG;EAC7B,MAAMC,KAAK,GAAGD,OAAO,EAClBE,IAAI,CAAC,CAAC,CACPD,KAAK,CACL,6EACD,CAAC;EACF,IAAK,CAAEE,KAAK,CAAEH,OAAQ,CAAC,IAAI,CAAEG,KAAK,CAAEC,UAAU,CAAEJ,OAAQ,CAAE,CAAC,EAAG;IAC7D,OAAO;MAAEK,KAAK,EAAED,UAAU,CAAEJ,OAAQ,CAAC;MAAEM,IAAI,EAAE;IAAK,CAAC;EACpD;EACA,OAAOL,KAAK,GACT;IAAEI,KAAK,EAAED,UAAU,CAAEH,KAAK,CAAE,CAAC,CAAG,CAAC,IAAIA,KAAK,CAAE,CAAC,CAAE;IAAEK,IAAI,EAAEL,KAAK,CAAE,CAAC;EAAG,CAAC,GACnE;IAAEI,KAAK,EAAEL,OAAO;IAAEM,IAAI,EAAEC;EAAU,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAEC,UAAU,EAAG;EAChC,IAAI;IACH,OAAOC,QAAQ,CAAG,yBAAyBD,UAAY,GAAG,CAAC,CAAC,CAAC;EAC9D,CAAC,CAAC,OAAQE,GAAG,EAAG;IACf,OAAO,IAAI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IAAI,GAAGvG,OAAO,GAAGwG,WAAW,CAAE1F,OAAQ,CAAC;EAE7C,IAAK,CAAEuF,KAAK,CAAEE,IAAI,CAAE,EAAG;IACtBF,KAAK,CAAEE,IAAI,CAAE,GAAGjF,gBAAgB,CAAEtB,OAAO,EAAEc,OAAQ,CAAC;EACrD;EACA,OAAOuF,KAAK,CAAEE,IAAI,CAAE;AACrB;AAEA,SAASC,WAAWA,CAAE1F,OAAO,EAAG;EAC/B,IAAIyF,IAAI,GAAG,EAAE;EACb,IAAKzF,OAAO,CAAC2F,cAAc,CAAE,UAAW,CAAC,EAAG;IAC3CF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACyC,KAAK;EAC3B;EACA,IAAKzC,OAAO,CAAC2F,cAAc,CAAE,YAAa,CAAC,EAAG;IAC7CF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACwC,UAAU;EAChC;EACA,IAAKxC,OAAO,CAAC2F,cAAc,CAAE,OAAQ,CAAC,EAAG;IACxCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAACyC,KAAK;EAC3B;EACA,IAAKzC,OAAO,CAAC2F,cAAc,CAAE,QAAS,CAAC,EAAG;IACzCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC0C,MAAM;EAC5B;EACA,IAAK1C,OAAO,CAAC2F,cAAc,CAAE,MAAO,CAAC,EAAG;IACvCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC2C,IAAI;EAC1B;EACA,OAAO8C,IAAI;AACZ;AAAC,IAAAG,QAAA,GAEcJ,wBAAwB;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","svmin","lvmin","dvmin","svmax","lvmax","dvmax","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","isFinite","cache","memoizedGetPxFromCssUnit","hash","hashOptions","hasOwnProperty","_default","exports","default"],"sources":["@wordpress/components/src/mobile/utils/get-px-from-css-unit.native.js"],"sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer onces.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\trelativeUnits.svw = relativeUnits.vmin;\n\trelativeUnits.lvw = relativeUnits.vmax;\n\trelativeUnits.dvw = relativeUnits.vw;\n\trelativeUnits.svh = relativeUnits.vmin;\n\trelativeUnits.lvh = relativeUnits.vmax;\n\trelativeUnits.dvh = relativeUnits.vh;\n\trelativeUnits.vi = relativeUnits.vh;\n\trelativeUnits.svi = relativeUnits.vmin;\n\trelativeUnits.lvi = relativeUnits.vmax;\n\trelativeUnits.dvi = relativeUnits.vw;\n\trelativeUnits.vb = relativeUnits.vh;\n\trelativeUnits.svb = relativeUnits.vmin;\n\trelativeUnits.lvb = relativeUnits.vmax;\n\trelativeUnits.dvb = relativeUnits.vh;\n\trelativeUnits.svmin = relativeUnits.vmin;\n\trelativeUnits.lvmin = relativeUnits.vmin;\n\trelativeUnits.dvmin = relativeUnits.vmin;\n\trelativeUnits.svmax = relativeUnits.vmax;\n\trelativeUnits.lvmax = relativeUnits.vmax;\n\trelativeUnits.dvmax = relativeUnits.vmax;\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAASA,CAAEC,OAAO,EAAG;EAC7B,MAAMC,KAAK,GAAGD,OAAO,EAClBE,IAAI,CAAC,CAAC,CACPD,KAAK,CACL,6EACD,CAAC;EACF,IAAK,CAAEE,KAAK,CAAEH,OAAQ,CAAC,IAAI,CAAEG,KAAK,CAAEC,UAAU,CAAEJ,OAAQ,CAAE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OAAO,CAAC2F,cAAc,CAAE,QAAS,CAAC,EAAG;IACzCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC0C,MAAM;EAC5B;EACA,IAAK1C,OAAO,CAAC2F,cAAc,CAAE,MAAO,CAAC,EAAG;IACvCF,IAAI,GAAG,GAAG,GAAGzF,OAAO,CAAC2C,IAAI;EAC1B;EACA,OAAO8C,IAAI;AACZ;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcN,wBAAwB"}
@@ -15,8 +15,8 @@ var _dom = require("@wordpress/dom");
15
15
  var ariaHelper = _interopRequireWildcard(require("./aria-helper"));
16
16
  var _button = _interopRequireDefault(require("../button"));
17
17
  var _styleProvider = _interopRequireDefault(require("../style-provider"));
18
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
20
  /**
21
21
  * External dependencies
22
22
  */
@@ -295,8 +295,6 @@ function UnforwardedModal(props, forwardedRef) {
295
295
  * };
296
296
  * ```
297
297
  */
298
- const Modal = (0, _element.forwardRef)(UnforwardedModal);
299
- exports.Modal = Modal;
300
- var _default = Modal;
301
- exports.default = _default;
298
+ const Modal = exports.Modal = (0, _element.forwardRef)(UnforwardedModal);
299
+ var _default = exports.default = Modal;
302
300
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_compose","_i18n","_icons","_dom","ariaHelper","_interopRequireWildcard","_button","_styleProvider","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ModalContext","createContext","bodyOpenClasses","Map","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","className","contentLabel","onKeyDown","isFullScreen","size","headerActions","__experimentalHideHeader","ref","useRef","instanceId","useInstanceId","Modal","headingId","focusOnMountRef","useFocusOnMount","constrainedTabbingRef","useConstrainedTabbing","focusReturnRef","useFocusReturn","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","useState","hasScrollableContent","setHasScrollableContent","sizeClass","isContentScrollable","useCallback","current","closestScrollContainer","getScrollContainer","useEffect","modalize","unmodalize","refOnRequestClose","dismissers","useContext","nestedDismissers","push","first","second","nested","shift","_bodyOpenClasses$get","theClass","oneMore","document","body","classList","add","oneLess","remove","delete","useLayoutEffect","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","nativeEvent","isComposing","keyCode","code","defaultPrevented","preventDefault","onContentContainerScroll","e","_e$currentTarget$scro","scrollY","currentTarget","scrollTop","pressTarget","overlayPressHandlers","onPointerDown","target","onPointerUp","button","isSameTarget","modal","_react","createElement","useMergeRefs","classnames","tabIndex","onScroll","__","id","onClick","close","label","createPortal","Provider","value","forwardRef","exports","_default"],"sources":["@wordpress/components/src/modal/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tForwardedRef,\n\tKeyboardEvent,\n\tMutableRefObject,\n\tUIEvent,\n} from 'react';\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';\n\n// Used to track and dismiss the prior modal when another opens unless nested.\nconst ModalContext = createContext<\n\tMutableRefObject< ModalProps[ 'onRequestClose' ] | undefined >[]\n>( [] );\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: 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,\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 refOnRequestClose = useRef< ModalProps[ 'onRequestClose' ] >();\n\tuseEffect( () => {\n\t\trefOnRequestClose.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 = useRef< typeof dismissers >( [] );\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\tdismissers.push( refOnRequestClose );\n\t\tconst [ first, second ] = dismissers;\n\t\tif ( second ) first?.current?.();\n\n\t\tconst nested = nestedDismissers.current;\n\t\treturn () => {\n\t\t\tnested[ 0 ]?.current?.();\n\t\t\tdismissers.shift();\n\t\t};\n\t}, [ dismissers ] );\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\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( event: KeyboardEvent< HTMLDivElement > ) {\n\t\tif (\n\t\t\t// Ignore keydowns from IMEs\n\t\t\tevent.nativeEvent.isComposing ||\n\t\t\t// Workaround for Mac Safari where the final Enter/Backspace of an IME composition\n\t\t\t// is `isComposing=false`, even though it's technically still part of the composition.\n\t\t\t// These can only be detected by keyCode.\n\t\t\tevent.keyCode === 229\n\t\t) {\n\t\t\treturn;\n\t\t}\n\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\tif ( onRequestClose ) {\n\t\t\t\tonRequestClose( event );\n\t\t\t}\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: 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 ) onRequestClose();\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={ classnames(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassName\n\t\t\t) }\n\t\t\tonKeyDown={ 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={ classnames(\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={ style }\n\t\t\t\t\tref={ useMergeRefs( [\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={ classnames( '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<Button\n\t\t\t\t\t\t\t\t\t\tonClick={ onRequestClose }\n\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel || __( 'Close' )\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.current }>\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AAWA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,cAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA8C,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBA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equireDefault","require","_element","_compose","_i18n","_icons","_dom","ariaHelper","_interopRequireWildcard","_button","_styleProvider","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ModalContext","createContext","bodyOpenClasses","Map","UnforwardedModal","props","forwardedRef","bodyOpenClassName","role","title","focusOnMount","shouldCloseOnEsc","shouldCloseOnClickOutside","isDismissible","aria","labelledby","undefined","describedby","onRequestClose","icon","closeButtonLabel","children","style","overlayClassName","className","contentLabel","onKeyDown","isFullScreen","size","headerActions","__experimentalHideHeader","ref","useRef","instanceId","useInstanceId","Modal","headingId","focusOnMountRef","useFocusOnMount","constrainedTabbingRef","useConstrainedTabbing","focusReturnRef","useFocusReturn","contentRef","childrenContainerRef","hasScrolledContent","setHasScrolledContent","useState","hasScrollableContent","setHasScrollableContent","sizeClass","isContentScrollable","useCallback","current","closestScrollContainer","getScrollContainer","useEffect","modalize","unmodalize","refOnRequestClose","dismissers","useContext","nestedDismissers","push","first","second","nested","shift","_bodyOpenClasses$get","theClass","oneMore","document","body","classList","add","oneLess","remove","delete","useLayoutEffect","window","ResizeObserver","resizeObserver","observe","disconnect","handleEscapeKeyDown","event","nativeEvent","isComposing","keyCode","code","key","defaultPrevented","preventDefault","onContentContainerScroll","_e$currentTarget$scro","scrollY","currentTarget","scrollTop","pressTarget","overlayPressHandlers","onPointerDown","target","onPointerUp","button","isSameTarget","modal","_react","createElement","useMergeRefs","classnames","tabIndex","onScroll","__","id","onClick","close","label","createPortal","Provider","value","exports","forwardRef","_default"],"sources":["@wordpress/components/src/modal/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tForwardedRef,\n\tKeyboardEvent,\n\tMutableRefObject,\n\tUIEvent,\n} from 'react';\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';\n\n// Used to track and dismiss the prior modal when another opens unless nested.\nconst ModalContext = createContext<\n\tMutableRefObject< ModalProps[ 'onRequestClose' ] | undefined >[]\n>( [] );\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: 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,\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 refOnRequestClose = useRef< ModalProps[ 'onRequestClose' ] >();\n\tuseEffect( () => {\n\t\trefOnRequestClose.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 = useRef< typeof dismissers >( [] );\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\tdismissers.push( refOnRequestClose );\n\t\tconst [ first, second ] = dismissers;\n\t\tif ( second ) first?.current?.();\n\n\t\tconst nested = nestedDismissers.current;\n\t\treturn () => {\n\t\t\tnested[ 0 ]?.current?.();\n\t\t\tdismissers.shift();\n\t\t};\n\t}, [ dismissers ] );\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\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( event: KeyboardEvent< HTMLDivElement > ) {\n\t\tif (\n\t\t\t// Ignore keydowns from IMEs\n\t\t\tevent.nativeEvent.isComposing ||\n\t\t\t// Workaround for Mac Safari where the final Enter/Backspace of an IME composition\n\t\t\t// is `isComposing=false`, even though it's technically still part of the composition.\n\t\t\t// These can only be detected by keyCode.\n\t\t\tevent.keyCode === 229\n\t\t) {\n\t\t\treturn;\n\t\t}\n\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\tif ( onRequestClose ) {\n\t\t\t\tonRequestClose( event );\n\t\t\t}\n\t\t}\n\t}\n\n\tconst onContentContainerScroll = useCallback(\n\t\t( e: 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 ) onRequestClose();\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={ classnames(\n\t\t\t\t'components-modal__screen-overlay',\n\t\t\t\toverlayClassName\n\t\t\t) }\n\t\t\tonKeyDown={ 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={ classnames(\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={ style }\n\t\t\t\t\tref={ useMergeRefs( [\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={ classnames( '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<Button\n\t\t\t\t\t\t\t\t\t\tonClick={ onRequestClose }\n\t\t\t\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tcloseButtonLabel || __( 'Close' )\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.current }>\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,QAAA,GAAAD,OAAA;AAWA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAC,uBAAA,CAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,cAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA8C,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAA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G,GAEHhB,QACE,CACD,CACD,CACS,CACX,CACL;EAED,OAAO,IAAAgG,qBAAY,EAClB,IAAAX,MAAA,CAAAC,aAAA,EAAC3G,YAAY,CAACsH,QAAQ;IAACC,KAAK,EAAGzD,gBAAgB,CAACT;EAAS,GACtDoD,KACoB,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;AACO,MAAMrC,KAAK,GAAAqF,OAAA,CAAArF,KAAA,GAAG,IAAAsF,mBAAU,EAAErH,gBAAiB,CAAC;AAAC,IAAAsH,QAAA,GAAAF,OAAA,CAAAvI,OAAA,GAErCkD,KAAK"}
@@ -167,6 +167,5 @@ const forwardedNavigableContainer = (props, ref) => {
167
167
  });
168
168
  };
169
169
  forwardedNavigableContainer.displayName = 'NavigableContainer';
170
- var _default = (0, _element.forwardRef)(forwardedNavigableContainer);
171
- exports.default = _default;
170
+ var _default = exports.default = (0, _element.forwardRef)(forwardedNavigableContainer);
172
171
  //# sourceMappingURL=container.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_dom","noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","Component","constructor","args","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","focus","tabbable","focusable","focusables","find","index","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","targetHasMenuItemRole","includes","preventDefault","activeElement","ownerDocument","context","nextIndex","length","code","render","children","restProps","_react","createElement","forwardedNavigableContainer","displayName","_default","forwardRef","exports","default"],"sources":["@wordpress/components/src/navigable-container/container.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport type { NavigableContainerProps } from './types';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value: number, total: number, offset: number ) {\n\tconst nextValue = value + offset;\n\tif ( nextValue < 0 ) {\n\t\treturn total + nextValue;\n\t} else if ( nextValue >= total ) {\n\t\treturn nextValue - total;\n\t}\n\n\treturn nextValue;\n}\n\nclass NavigableContainer extends Component< NavigableContainerProps > {\n\tcontainer?: HTMLDivElement;\n\n\tconstructor( args: NavigableContainerProps ) {\n\t\tsuper( args );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\n\t\tthis.getFocusableContext = this.getFocusableContext.bind( this );\n\t\tthis.getFocusableIndex = this.getFocusableIndex.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We use DOM event listeners instead of React event listeners\n\t\t// because we want to catch events from the underlying DOM tree\n\t\t// The React Tree can be different from the DOM tree when using\n\t\t// portals. Block Toolbars for instance are rendered in a separate\n\t\t// React Trees.\n\t\tthis.container.addEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tbindContainer( ref: HTMLDivElement ) {\n\t\tconst { forwardedRef } = this.props;\n\t\tthis.container = ref;\n\n\t\tif ( typeof forwardedRef === 'function' ) {\n\t\t\tforwardedRef( ref );\n\t\t} else if ( forwardedRef && 'current' in forwardedRef ) {\n\t\t\tforwardedRef.current = ref;\n\t\t}\n\t}\n\n\tgetFocusableContext( target: Element ) {\n\t\tif ( ! this.container ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container ) as HTMLElement[];\n\n\t\tconst index = this.getFocusableIndex( focusables, target );\n\t\tif ( index > -1 && target ) {\n\t\t\treturn { index, target, focusables };\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetFocusableIndex( focusables: Element[], target: Element ) {\n\t\treturn focusables.indexOf( target );\n\t}\n\n\tonKeyDown( event: KeyboardEvent ) {\n\t\tif ( this.props.onKeyDown ) {\n\t\t\tthis.props.onKeyDown( event );\n\t\t}\n\n\t\tconst { getFocusableContext } = this;\n\t\tconst {\n\t\t\tcycle = true,\n\t\t\teventToOffset,\n\t\t\tonNavigate = noop,\n\t\t\tstopNavigationEvents,\n\t\t} = this.props;\n\n\t\tconst offset = eventToOffset( event );\n\n\t\t// eventToOffset returns undefined if the event is not handled by the component.\n\t\tif ( offset !== undefined && stopNavigationEvents ) {\n\t\t\t// Prevents arrow key handlers bound to the document directly interfering.\n\t\t\tevent.stopImmediatePropagation();\n\n\t\t\t// When navigating a collection of items, prevent scroll containers\n\t\t\t// from scrolling. The preventDefault also prevents Voiceover from\n\t\t\t// 'handling' the event, as voiceover will try to use arrow keys\n\t\t\t// for highlighting text.\n\t\t\tconst targetRole = (\n\t\t\t\tevent.target as HTMLDivElement | null\n\t\t\t )?.getAttribute( 'role' );\n\t\t\tconst targetHasMenuItemRole =\n\t\t\t\t!! targetRole && MENU_ITEM_ROLES.includes( targetRole );\n\n\t\t\tif ( targetHasMenuItemRole ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! offset ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = ( event.target as HTMLElement | null )\n\t\t\t?.ownerDocument?.activeElement;\n\t\tif ( ! activeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst context = getFocusableContext( activeElement );\n\t\tif ( ! context ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { index, focusables } = context;\n\t\tconst nextIndex = cycle\n\t\t\t? cycleValue( index, focusables.length, offset )\n\t\t\t: index + offset;\n\n\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\n\n\t\t\t// `preventDefault()` on tab to avoid having the browser move the focus\n\t\t\t// after this component has already moved it.\n\t\t\tif ( event.code === 'Tab' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tstopNavigationEvents,\n\t\t\teventToOffset,\n\t\t\tonNavigate,\n\t\t\tonKeyDown,\n\t\t\tcycle,\n\t\t\tonlyBrowserTabstops,\n\t\t\tforwardedRef,\n\t\t\t...restProps\n\t\t} = this.props;\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer } { ...restProps }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nconst forwardedNavigableContainer = (\n\tprops: NavigableContainerProps,\n\tref: ForwardedRef< HTMLDivElement >\n) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,eAAe,GAAG,CAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,CAAE;AAE3E,SAASC,UAAUA,CAAEC,KAAa,EAAEC,KAAa,EAAEC,MAAc,EAAG;EACnE,MAAMC,SAAS,GAAGH,KAAK,GAAGE,MAAM;EACh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ACd,OACC,IAAAiC,MAAA,CAAAC,aAAA;MAAKpC,GAAG,EAAG,IAAI,CAACR,aAAe;MAAA,GAAM0C;IAAS,GAC3CD,QACE,CAAC;EAER;AACD;AAEA,MAAMI,2BAA2B,GAAGA,CACnCnC,KAA8B,EAC9BF,GAAmC,KAC/B;EACJ,OAAO,IAAAmC,MAAA,CAAAC,aAAA,EAAClD,kBAAkB;IAAA,GAAMgB,KAAK;IAAGD,YAAY,EAAGD;EAAK,CAAE,CAAC;AAChE,CAAC;AACDqC,2BAA2B,CAACC,WAAW,GAAG,oBAAoB;AAAC,IAAAC,QAAA,GAEhD,IAAAC,mBAAU,EAAEH,2BAA4B,CAAC;AAAAI,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_element","require","_dom","noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","Component","constructor","args","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","focus","tabbable","focusable","focusables","find","index","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","targetHasMenuItemRole","includes","preventDefault","activeElement","ownerDocument","context","nextIndex","length","code","render","children","restProps","_react","createElement","forwardedNavigableContainer","displayName","_default","exports","default","forwardRef"],"sources":["@wordpress/components/src/navigable-container/container.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport type { NavigableContainerProps } from './types';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value: number, total: number, offset: number ) {\n\tconst nextValue = value + offset;\n\tif ( nextValue < 0 ) {\n\t\treturn total + nextValue;\n\t} else if ( nextValue >= total ) {\n\t\treturn nextValue - total;\n\t}\n\n\treturn nextValue;\n}\n\nclass NavigableContainer extends Component< NavigableContainerProps > {\n\tcontainer?: HTMLDivElement;\n\n\tconstructor( args: NavigableContainerProps ) {\n\t\tsuper( args );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.bindContainer = this.bindContainer.bind( this );\n\n\t\tthis.getFocusableContext = this.getFocusableContext.bind( this );\n\t\tthis.getFocusableIndex = this.getFocusableIndex.bind( this );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We use DOM event listeners instead of React event listeners\n\t\t// because we want to catch events from the underlying DOM tree\n\t\t// The React Tree can be different from the DOM tree when using\n\t\t// portals. Block Toolbars for instance are rendered in a separate\n\t\t// React Trees.\n\t\tthis.container.addEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( ! this.container ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t}\n\n\tbindContainer( ref: HTMLDivElement ) {\n\t\tconst { forwardedRef } = this.props;\n\t\tthis.container = ref;\n\n\t\tif ( typeof forwardedRef === 'function' ) {\n\t\t\tforwardedRef( ref );\n\t\t} else if ( forwardedRef && 'current' in forwardedRef ) {\n\t\t\tforwardedRef.current = ref;\n\t\t}\n\t}\n\n\tgetFocusableContext( target: Element ) {\n\t\tif ( ! this.container ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container ) as HTMLElement[];\n\n\t\tconst index = this.getFocusableIndex( focusables, target );\n\t\tif ( index > -1 && target ) {\n\t\t\treturn { index, target, focusables };\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetFocusableIndex( focusables: Element[], target: Element ) {\n\t\treturn focusables.indexOf( target );\n\t}\n\n\tonKeyDown( event: KeyboardEvent ) {\n\t\tif ( this.props.onKeyDown ) {\n\t\t\tthis.props.onKeyDown( event );\n\t\t}\n\n\t\tconst { getFocusableContext } = this;\n\t\tconst {\n\t\t\tcycle = true,\n\t\t\teventToOffset,\n\t\t\tonNavigate = noop,\n\t\t\tstopNavigationEvents,\n\t\t} = this.props;\n\n\t\tconst offset = eventToOffset( event );\n\n\t\t// eventToOffset returns undefined if the event is not handled by the component.\n\t\tif ( offset !== undefined && stopNavigationEvents ) {\n\t\t\t// Prevents arrow key handlers bound to the document directly interfering.\n\t\t\tevent.stopImmediatePropagation();\n\n\t\t\t// When navigating a collection of items, prevent scroll containers\n\t\t\t// from scrolling. The preventDefault also prevents Voiceover from\n\t\t\t// 'handling' the event, as voiceover will try to use arrow keys\n\t\t\t// for highlighting text.\n\t\t\tconst targetRole = (\n\t\t\t\tevent.target as HTMLDivElement | null\n\t\t\t )?.getAttribute( 'role' );\n\t\t\tconst targetHasMenuItemRole =\n\t\t\t\t!! targetRole && MENU_ITEM_ROLES.includes( targetRole );\n\n\t\t\tif ( targetHasMenuItemRole ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tif ( ! offset ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = ( event.target as HTMLElement | null )\n\t\t\t?.ownerDocument?.activeElement;\n\t\tif ( ! activeElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst context = getFocusableContext( activeElement );\n\t\tif ( ! context ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { index, focusables } = context;\n\t\tconst nextIndex = cycle\n\t\t\t? cycleValue( index, focusables.length, offset )\n\t\t\t: index + offset;\n\n\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\n\n\t\t\t// `preventDefault()` on tab to avoid having the browser move the focus\n\t\t\t// after this component has already moved it.\n\t\t\tif ( event.code === 'Tab' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tstopNavigationEvents,\n\t\t\teventToOffset,\n\t\t\tonNavigate,\n\t\t\tonKeyDown,\n\t\t\tcycle,\n\t\t\tonlyBrowserTabstops,\n\t\t\tforwardedRef,\n\t\t\t...restProps\n\t\t} = this.props;\n\t\treturn (\n\t\t\t<div ref={ this.bindContainer } { ...restProps }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nconst forwardedNavigableContainer = (\n\tprops: NavigableContainerProps,\n\tref: ForwardedRef< HTMLDivElement >\n) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"],"mappings":";;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AASA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,eAAe,GAAG,CAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,CAAE;AAE3E,SAASC,UAAUA,CAAEC,KAAa,EAAEC,KAAa,EAAEC,MAAc,EAAG;EACnE,MAAMC,SAAS,GAAGH,KAAK,GAAGE,MAAM;EAChC,IAAKC,SAAS,GAAG,CAAC,EAAG;IACpB,OAAOF,KAAK,GAAGE,SAAS;EACzB,CAAC,MAAM,IAAKA,SAAS,IAAIF,KAAK,EAAG;IAChC,OAAOE,SAAS,GAAGF,KAAK;EACzB;EAEA,OAAOE,SAAS;AACjB;AAEA,MAAMC,kBAAkB,SAASC,kBAAS,CAA4B;EAGrEC,WAAWA,CAAEC,IAA6B,EAAG;IAC5C,KAAK,CAAEA,IAAK,CAAC;IACb,IAAI,CAACC,SA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,CAAC;AACDqC,2BAA2B,CAACC,WAAW,GAAG,oBAAoB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEhD,IAAAC,mBAAU,EAAEL,2BAA4B,CAAC"}
@@ -89,8 +89,6 @@ function UnforwardedNavigableMenu({
89
89
  * );
90
90
  * ```
91
91
  */
92
- const NavigableMenu = (0, _element.forwardRef)(UnforwardedNavigableMenu);
93
- exports.NavigableMenu = NavigableMenu;
94
- var _default = NavigableMenu;
95
- exports.default = _default;
92
+ const NavigableMenu = exports.NavigableMenu = (0, _element.forwardRef)(UnforwardedNavigableMenu);
93
+ var _default = exports.default = NavigableMenu;
96
94
  //# sourceMappingURL=menu.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_container","_interopRequireDefault","UnforwardedNavigableMenu","role","orientation","rest","ref","eventToOffset","evt","code","next","previous","includes","undefined","_react","createElement","default","stopNavigationEvents","onlyBrowserTabstops","NavigableMenu","forwardRef","exports","_default"],"sources":["@wordpress/components/src/navigable-container/menu.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { NavigableMenuProps } from './types';\n\nexport function UnforwardedNavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest }: NavigableMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst eventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code } = evt;\n\n\t\tlet next = [ 'ArrowDown' ];\n\t\tlet previous = [ 'ArrowUp' ];\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tnext = [ 'ArrowRight' ];\n\t\t\tprevious = [ 'ArrowLeft' ];\n\t\t}\n\n\t\tif ( orientation === 'both' ) {\n\t\t\tnext = [ 'ArrowRight', 'ArrowDown' ];\n\t\t\tprevious = [ 'ArrowLeft', 'ArrowUp' ];\n\t\t}\n\n\t\tif ( next.includes( code ) ) {\n\t\t\treturn 1;\n\t\t} else if ( previous.includes( code ) ) {\n\t\t\treturn -1;\n\t\t} else if (\n\t\t\t[ 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\t// Key press should be handled, e.g. have event propagation and\n\t\t\t// default behavior handled by NavigableContainer but not result\n\t\t\t// in an offset.\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops={ false }\n\t\t\trole={ role }\n\t\t\taria-orientation={\n\t\t\t\trole !== 'presentation' &&\n\t\t\t\t( orientation === 'vertical' || orientation === 'horizontal' )\n\t\t\t\t\t? orientation\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\n/**\n * A container for a navigable menu.\n *\n * ```jsx\n * import {\n * NavigableMenu,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyNavigableContainer = () => (\n * <div>\n * <span>Navigable Menu:</span>\n * <NavigableMenu onNavigate={ onNavigate } orientation=\"horizontal\">\n * <Button variant=\"secondary\">Item 1</Button>\n * <Button variant=\"secondary\">Item 2</Button>\n * <Button variant=\"secondary\">Item 3</Button>\n * </NavigableMenu>\n * </div>\n * );\n * ```\n */\nexport const NavigableMenu = forwardRef( UnforwardedNavigableMenu );\n\nexport default NavigableMenu;\n"],"mappings":";;;;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,SAASG,wBAAwBA,CACvC;EAAEC,IAAI,GA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMc,aAAa,GAAG,IAAAC,mBAAU,EAAElB,wBAAyB,CAAC;AAACmB,OAAA,CAAAF,aAAA,GAAAA,aAAA;AAAA,IAAAG,QAAA,GAErDH,aAAa;AAAAE,OAAA,CAAAL,OAAA,GAAAM,QAAA"}
1
+ {"version":3,"names":["_element","require","_container","_interopRequireDefault","UnforwardedNavigableMenu","role","orientation","rest","ref","eventToOffset","evt","code","next","previous","includes","undefined","_react","createElement","default","stopNavigationEvents","onlyBrowserTabstops","NavigableMenu","exports","forwardRef","_default"],"sources":["@wordpress/components/src/navigable-container/menu.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { NavigableMenuProps } from './types';\n\nexport function UnforwardedNavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest }: NavigableMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst eventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code } = evt;\n\n\t\tlet next = [ 'ArrowDown' ];\n\t\tlet previous = [ 'ArrowUp' ];\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tnext = [ 'ArrowRight' ];\n\t\t\tprevious = [ 'ArrowLeft' ];\n\t\t}\n\n\t\tif ( orientation === 'both' ) {\n\t\t\tnext = [ 'ArrowRight', 'ArrowDown' ];\n\t\t\tprevious = [ 'ArrowLeft', 'ArrowUp' ];\n\t\t}\n\n\t\tif ( next.includes( code ) ) {\n\t\t\treturn 1;\n\t\t} else if ( previous.includes( code ) ) {\n\t\t\treturn -1;\n\t\t} else if (\n\t\t\t[ 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight' ].includes(\n\t\t\t\tcode\n\t\t\t)\n\t\t) {\n\t\t\t// Key press should be handled, e.g. have event propagation and\n\t\t\t// default behavior handled by NavigableContainer but not result\n\t\t\t// in an offset.\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops={ false }\n\t\t\trole={ role }\n\t\t\taria-orientation={\n\t\t\t\trole !== 'presentation' &&\n\t\t\t\t( orientation === 'vertical' || orientation === 'horizontal' )\n\t\t\t\t\t? orientation\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\n/**\n * A container for a navigable menu.\n *\n * ```jsx\n * import {\n * NavigableMenu,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyNavigableContainer = () => (\n * <div>\n * <span>Navigable Menu:</span>\n * <NavigableMenu onNavigate={ onNavigate } orientation=\"horizontal\">\n * <Button variant=\"secondary\">Item 1</Button>\n * <Button variant=\"secondary\">Item 2</Button>\n * <Button variant=\"secondary\">Item 3</Button>\n * </NavigableMenu>\n * </div>\n * );\n * ```\n */\nexport const NavigableMenu = forwardRef( UnforwardedNavigableMenu );\n\nexport default NavigableMenu;\n"],"mappings":";;;;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,SAASG,wBAAwBA,CACvC;EAAEC,IAAI,GAAG,MAAM;EAAEC,WAAW,GAAG,UAAU;EAAE,GAAGC;AAAyB,CAAC,EACxEC,GAAwB,EACvB;EACD,MAAMC,aAAa,GAAKC,GAAkB,IAAM;IAC/C,MAAM;MAAEC;IAAK,CAAC,GAAGD,GAAG;IAEpB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B,wBAAyB,CAAC;AAAC,IAAAoB,QAAA,GAAAF,OAAA,CAAAJ,OAAA,GAErDG,aAAa"}
@@ -94,8 +94,6 @@ function UnforwardedTabbableContainer({
94
94
  * );
95
95
  * ```
96
96
  */
97
- const TabbableContainer = (0, _element.forwardRef)(UnforwardedTabbableContainer);
98
- exports.TabbableContainer = TabbableContainer;
99
- var _default = TabbableContainer;
100
- exports.default = _default;
97
+ const TabbableContainer = exports.TabbableContainer = (0, _element.forwardRef)(UnforwardedTabbableContainer);
98
+ var _default = exports.default = TabbableContainer;
101
99
  //# sourceMappingURL=tabbable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_container","_interopRequireDefault","UnforwardedTabbableContainer","eventToOffset","props","ref","innerEventToOffset","evt","code","shiftKey","undefined","_react","createElement","default","stopNavigationEvents","onlyBrowserTabstops","TabbableContainer","forwardRef","exports","_default"],"sources":["@wordpress/components/src/navigable-container/tabbable.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { TabbableContainerProps } from './types';\n\nexport function UnforwardedTabbableContainer(\n\t{ eventToOffset, ...props }: TabbableContainerProps,\n\tref: ForwardedRef< any >\n) {\n\tconst innerEventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code, shiftKey } = evt;\n\t\tif ( 'Tab' === code ) {\n\t\t\treturn shiftKey ? -1 : 1;\n\t\t}\n\n\t\t// Allow custom handling of keys besides Tab.\n\t\t//\n\t\t// By default, TabbableContainer will move focus forward on Tab and\n\t\t// backward on Shift+Tab. The handler below will be used for all other\n\t\t// events. The semantics for `eventToOffset`'s return\n\t\t// values are the following:\n\t\t//\n\t\t// - +1: move focus forward\n\t\t// - -1: move focus backward\n\t\t// - 0: don't move focus, but acknowledge event and thus stop it\n\t\t// - undefined: do nothing, let the event propagate.\n\t\tif ( eventToOffset ) {\n\t\t\treturn eventToOffset( evt );\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops\n\t\t\teventToOffset={ innerEventToOffset }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\n/**\n * A container for tabbable elements.\n *\n * ```jsx\n * import {\n * TabbableContainer,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyTabbableContainer = () => (\n * <div>\n * <span>Tabbable Container:</span>\n * <TabbableContainer onNavigate={ onNavigate }>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 1\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 2\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 3\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 4\n * </Button>\n * </TabbableContainer>\n * </div>\n * );\n * ```\n */\nexport const TabbableContainer = forwardRef( UnforwardedTabbableContainer );\n\nexport default TabbableContainer;\n"],"mappings":";;;;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,SAASG,4BAA4BA,CAC3C;EAAEC,aAAa;EAAE,GAAGC;AAA8B,CAAC,EACnDC,GAAwB,EACvB;EACD,MAAMC,kBAAkB,GAAKC,GAAkB,IAAM;IACpD,MAAM;MAAEC,IAAI;MAAEC;IAAS,CAAC,GAAGF,GAAG;IAC9B,IAAK,KAAK,KAAKC,IAAI,EAAG;MACrB,OAAOC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;IACzB;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAKN,aAAa,EAAG;MACpB,OAAOA,aAAa,CAAEI,GAAI,CAAC;IAC5B;IAEA,OAAOG,SAAS;EACjB,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,UAAA,CAAAa,OAAkB;IAClBR,GAAG,EAAGA,GAAK;IACXS,oBAAoB;IACpBC,mBAAmB;IACnBZ,aAAa,EAAGG,kBAAoB;IAAA,GAC/BF;EAAK,CACV,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,iBAAiB,GAAG,IAAAC,mBAAU,EAAEf,4BAA6B,CAAC;AAACgB,OAAA,CAAAF,iBAAA,GAAAA,iBAAA;AAAA,IAAAG,QAAA,GAE7DH,iBAAiB;AAAAE,OAAA,CAAAL,OAAA,GAAAM,QAAA"}
1
+ {"version":3,"names":["_element","require","_container","_interopRequireDefault","UnforwardedTabbableContainer","eventToOffset","props","ref","innerEventToOffset","evt","code","shiftKey","undefined","_react","createElement","default","stopNavigationEvents","onlyBrowserTabstops","TabbableContainer","exports","forwardRef","_default"],"sources":["@wordpress/components/src/navigable-container/tabbable.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\nimport type { TabbableContainerProps } from './types';\n\nexport function UnforwardedTabbableContainer(\n\t{ eventToOffset, ...props }: TabbableContainerProps,\n\tref: ForwardedRef< any >\n) {\n\tconst innerEventToOffset = ( evt: KeyboardEvent ) => {\n\t\tconst { code, shiftKey } = evt;\n\t\tif ( 'Tab' === code ) {\n\t\t\treturn shiftKey ? -1 : 1;\n\t\t}\n\n\t\t// Allow custom handling of keys besides Tab.\n\t\t//\n\t\t// By default, TabbableContainer will move focus forward on Tab and\n\t\t// backward on Shift+Tab. The handler below will be used for all other\n\t\t// events. The semantics for `eventToOffset`'s return\n\t\t// values are the following:\n\t\t//\n\t\t// - +1: move focus forward\n\t\t// - -1: move focus backward\n\t\t// - 0: don't move focus, but acknowledge event and thus stop it\n\t\t// - undefined: do nothing, let the event propagate.\n\t\tif ( eventToOffset ) {\n\t\t\treturn eventToOffset( evt );\n\t\t}\n\n\t\treturn undefined;\n\t};\n\n\treturn (\n\t\t<NavigableContainer\n\t\t\tref={ ref }\n\t\t\tstopNavigationEvents\n\t\t\tonlyBrowserTabstops\n\t\t\teventToOffset={ innerEventToOffset }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\n/**\n * A container for tabbable elements.\n *\n * ```jsx\n * import {\n * TabbableContainer,\n * Button,\n * } from '@wordpress/components';\n *\n * function onNavigate( index, target ) {\n * console.log( `Navigates to ${ index }`, target );\n * }\n *\n * const MyTabbableContainer = () => (\n * <div>\n * <span>Tabbable Container:</span>\n * <TabbableContainer onNavigate={ onNavigate }>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 1\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 2\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 3\n * </Button>\n * <Button variant=\"secondary\" tabIndex=\"0\">\n * Section 4\n * </Button>\n * </TabbableContainer>\n * </div>\n * );\n * ```\n */\nexport const TabbableContainer = forwardRef( UnforwardedTabbableContainer );\n\nexport default TabbableContainer;\n"],"mappings":";;;;;;;;;;AAQA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAIO,SAASG,4BAA4BA,CAC3C;EAAEC,aAAa;EAAE,GAAGC;AAA8B,CAAC,EACnDC,GAAwB,EACvB;EACD,MAAMC,kBAAkB,GAAKC,GAAkB,IAAM;IACpD,MAAM;MAAEC,IAAI;MAAEC;IAAS,CAAC,GAAGF,GAAG;IAC9B,IAAK,KAAK,KAAKC,IAAI,EAAG;MACrB,OAAOC,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;IACzB;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,IAAKN,aAAa,EAAG;MACpB,OAAOA,aAAa,CAAEI,GAAI,CAAC;IAC5B;IAEA,OAAOG,SAAS;EACjB,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,UAAA,CAAAa,OAAkB;IAClBR,GAAG,EAAGA,GAAK;IACXS,oBAAoB;IACpBC,mBAAmB;IACnBZ,aAAa,EAAGG,kBAAoB;IAAA,GAC/BF;EAAK,CACV,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,mBAAU,EAAEhB,4BAA6B,CAAC;AAAC,IAAAiB,QAAA,GAAAF,OAAA,CAAAJ,OAAA,GAE7DG,iBAAiB"}
@@ -57,8 +57,6 @@ function UnforwardedNavigationBackButton({
57
57
  icon: icon
58
58
  }), backButtonLabel || parentMenuTitle || (0, _i18n.__)('Back'));
59
59
  }
60
- const NavigationBackButton = (0, _element.forwardRef)(UnforwardedNavigationBackButton);
61
- exports.NavigationBackButton = NavigationBackButton;
62
- var _default = NavigationBackButton;
63
- exports.default = _default;
60
+ const NavigationBackButton = exports.NavigationBackButton = (0, _element.forwardRef)(UnforwardedNavigationBackButton);
61
+ var _default = exports.default = NavigationBackButton;
64
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_icons","_context","_navigationStyles","UnforwardedNavigationBackButton","backButtonLabel","className","href","onClick","parentMenu","ref","setActiveMenu","navigationTree","useNavigationContext","classes","classnames","parentMenuTitle","undefined","getMenu","title","handleOnClick","event","animationDirection","isRTL","defaultPrevented","icon","chevronRight","chevronLeft","_react","createElement","MenuBackButtonUI","variant","Icon","__","NavigationBackButton","forwardRef","exports","_default","default"],"sources":["@wordpress/components/src/navigation/back-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { MenuBackButtonUI } from '../styles/navigation-styles';\n\nimport type { NavigationBackButtonProps } from '../types';\n\nfunction UnforwardedNavigationBackButton(\n\t{\n\t\tbackButtonLabel,\n\t\tclassName,\n\t\thref,\n\t\tonClick,\n\t\tparentMenu,\n\t}: NavigationBackButtonProps,\n\tref: React.ForwardedRef< HTMLAnchorElement | HTMLButtonElement >\n) {\n\tconst { setActiveMenu, navigationTree } = useNavigationContext();\n\n\tconst classes = classnames(\n\t\t'components-navigation__back-button',\n\t\tclassName\n\t);\n\n\tconst parentMenuTitle =\n\t\tparentMenu !== undefined\n\t\t\t? navigationTree.getMenu( parentMenu )?.title\n\t\t\t: undefined;\n\n\tconst handleOnClick: React.MouseEventHandler< HTMLElement > = ( event ) => {\n\t\tif ( typeof onClick === 'function' ) {\n\t\t\tonClick( event );\n\t\t}\n\n\t\tconst animationDirection = isRTL() ? 'left' : 'right';\n\t\tif ( parentMenu && ! event.defaultPrevented ) {\n\t\t\tsetActiveMenu( parentMenu, animationDirection );\n\t\t}\n\t};\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\treturn (\n\t\t<MenuBackButtonUI\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tvariant=\"tertiary\"\n\t\t\tref={ ref }\n\t\t\tonClick={ handleOnClick }\n\t\t>\n\t\t\t<Icon icon={ icon } />\n\t\t\t{ backButtonLabel || parentMenuTitle || __( 'Back' ) }\n\t\t</MenuBackButtonUI>\n\t);\n}\n\nexport const NavigationBackButton = forwardRef(\n\tUnforwardedNavigationBackButton\n);\n\nexport default NavigationBackButton;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAfA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,SAASM,+BAA+BA,CACvC;EACCC,eAAe;EACfC,SAAS;EACTC,IAAI;EACJC,OAAO;EACPC;AAC0B,CAAC,EAC5BC,GAAgE,EAC/D;EACD,MAAM;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAG,IAAAC,6BAAoB,EAAC,CAAC;EAEhE,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EACzB,oCAAoC,EACpCT,SACD,CAAC;EAED,MAAMU,eAAe,GACpBP,UAAU,KAAKQ,SAAS,GACrBL,cAAc,CAACM,OAAO,CAAET,UAAW,CAAC,EAAEU,KAAK,GAC3CF,SAAS;EAEb,MAAMG,aAAqD,GAAKC,KAAK,IAAM;IAC1E,IAAK,OAAOb,OAAO,KAAK,UAAU,EAAG;MACpCA,OAAO,CAAEa,KAAM,CAAC;IACjB;IAEA,MAAMC,kBAAkB,GAAG,IAAAC,WAAK,EAAC,CAAC,GAAG,MAAM,GAAG,OAAO;IACrD,IAAKd,UAAU,IAAI,CAAEY,KAAK,CAACG,gBAAgB,EAAG;MAC7Cb,aAAa,CAAEF,UAAU,EAAEa,kBAAmB,CAAC;IAChD;EACD,CAAC;EACD,MAAMG,IAAI,GAAG,IAAAF,WAAK,EAAC,CAAC,GAAGG,mBAAY,GAAGC,kBAAW;EACjD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC1B,iBAAA,CAAA2B,gBAAgB;IAChBxB,SAAS,EAAGQ,OAAS;IACrBP,IAAI,EAAGA,IAAM;IACbwB,OAAO,EAAC,UAAU;IAClBrB,GAAG,EAAGA,GAAK;IACXF,OAAO,EAAGY;EAAe,GAEzB,IAAAQ,MAAA,CAAAC,aAAA,EAAC5B,MAAA,CAAA+B,IAAI;IAACP,IAAI,EAAGA;EAAM,CAAE,CAAC,EACpBpB,eAAe,IAAIW,eAAe,IAAI,IAAAiB,QAAE,EAAE,MAAO,CAClC,CAAC;AAErB;AAEO,MAAMC,oBAAoB,GAAG,IAAAC,mBAAU,EAC7C/B,+BACD,CAAC;AAACgC,OAAA,CAAAF,oBAAA,GAAAA,oBAAA;AAAA,IAAAG,QAAA,GAEaH,oBAAoB;AAAAE,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_icons","_context","_navigationStyles","UnforwardedNavigationBackButton","backButtonLabel","className","href","onClick","parentMenu","ref","setActiveMenu","navigationTree","useNavigationContext","classes","classnames","parentMenuTitle","undefined","getMenu","title","handleOnClick","event","animationDirection","isRTL","defaultPrevented","icon","chevronRight","chevronLeft","_react","createElement","MenuBackButtonUI","variant","Icon","__","NavigationBackButton","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/navigation/back-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useNavigationContext } from '../context';\nimport { MenuBackButtonUI } from '../styles/navigation-styles';\n\nimport type { NavigationBackButtonProps } from '../types';\n\nfunction UnforwardedNavigationBackButton(\n\t{\n\t\tbackButtonLabel,\n\t\tclassName,\n\t\thref,\n\t\tonClick,\n\t\tparentMenu,\n\t}: NavigationBackButtonProps,\n\tref: React.ForwardedRef< HTMLAnchorElement | HTMLButtonElement >\n) {\n\tconst { setActiveMenu, navigationTree } = useNavigationContext();\n\n\tconst classes = classnames(\n\t\t'components-navigation__back-button',\n\t\tclassName\n\t);\n\n\tconst parentMenuTitle =\n\t\tparentMenu !== undefined\n\t\t\t? navigationTree.getMenu( parentMenu )?.title\n\t\t\t: undefined;\n\n\tconst handleOnClick: React.MouseEventHandler< HTMLElement > = ( event ) => {\n\t\tif ( typeof onClick === 'function' ) {\n\t\t\tonClick( event );\n\t\t}\n\n\t\tconst animationDirection = isRTL() ? 'left' : 'right';\n\t\tif ( parentMenu && ! event.defaultPrevented ) {\n\t\t\tsetActiveMenu( parentMenu, animationDirection );\n\t\t}\n\t};\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\treturn (\n\t\t<MenuBackButtonUI\n\t\t\tclassName={ classes }\n\t\t\thref={ href }\n\t\t\tvariant=\"tertiary\"\n\t\t\tref={ ref }\n\t\t\tonClick={ handleOnClick }\n\t\t>\n\t\t\t<Icon icon={ icon } />\n\t\t\t{ backButtonLabel || parentMenuTitle || __( 'Back' ) }\n\t\t</MenuBackButtonUI>\n\t);\n}\n\nexport const NavigationBackButton = forwardRef(\n\tUnforwardedNavigationBackButton\n);\n\nexport default NavigationBackButton;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAfA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,SAASM,+BAA+BA,CACvC;EACCC,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AC,IAAAiC,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEaJ,oBAAoB"}
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SEARCH_FOCUS_DELAY = exports.ROOT_MENU = void 0;
7
- const ROOT_MENU = 'root';
8
- exports.ROOT_MENU = ROOT_MENU;
9
- const SEARCH_FOCUS_DELAY = 100;
10
- exports.SEARCH_FOCUS_DELAY = SEARCH_FOCUS_DELAY;
7
+ const ROOT_MENU = exports.ROOT_MENU = 'root';
8
+ const SEARCH_FOCUS_DELAY = exports.SEARCH_FOCUS_DELAY = 100;
11
9
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ROOT_MENU","exports","SEARCH_FOCUS_DELAY"],"sources":["@wordpress/components/src/navigation/constants.tsx"],"sourcesContent":["export const ROOT_MENU = 'root';\nexport const SEARCH_FOCUS_DELAY = 100;\n"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAG,MAAM;AAACC,OAAA,CAAAD,SAAA,GAAAA,SAAA;AACzB,MAAME,kBAAkB,GAAG,GAAG;AAACD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}
1
+ {"version":3,"names":["ROOT_MENU","exports","SEARCH_FOCUS_DELAY"],"sources":["@wordpress/components/src/navigation/constants.tsx"],"sourcesContent":["export const ROOT_MENU = 'root';\nexport const SEARCH_FOCUS_DELAY = 100;\n"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,MAAM;AACxB,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,GAAG"}
@@ -17,7 +17,7 @@ var _constants = require("./constants");
17
17
  const noop = () => {};
18
18
  const defaultIsEmpty = () => false;
19
19
  const defaultGetter = () => undefined;
20
- const NavigationContext = (0, _element.createContext)({
20
+ const NavigationContext = exports.NavigationContext = (0, _element.createContext)({
21
21
  activeItem: undefined,
22
22
  activeMenu: _constants.ROOT_MENU,
23
23
  setActiveMenu: noop,
@@ -35,7 +35,6 @@ const NavigationContext = (0, _element.createContext)({
35
35
  isMenuEmpty: defaultIsEmpty
36
36
  }
37
37
  });
38
- exports.NavigationContext = NavigationContext;
39
38
  const useNavigationContext = () => (0, _element.useContext)(NavigationContext);
40
39
  exports.useNavigationContext = useNavigationContext;
41
40
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_constants","noop","defaultIsEmpty","defaultGetter","undefined","NavigationContext","createContext","activeItem","activeMenu","ROOT_MENU","setActiveMenu","navigationTree","items","getItem","addItem","removeItem","menus","getMenu","addMenu","removeMenu","childMenu","traverseMenu","isMenuEmpty","exports","useNavigationContext","useContext"],"sources":["@wordpress/components/src/navigation/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from './constants';\n\nimport type { NavigationContext as NavigationContextType } from './types';\n\nconst noop = () => {};\nconst defaultIsEmpty = () => false;\nconst defaultGetter = () => undefined;\n\nexport const NavigationContext = createContext< NavigationContextType >( {\n\tactiveItem: undefined,\n\tactiveMenu: ROOT_MENU,\n\tsetActiveMenu: noop,\n\n\tnavigationTree: {\n\t\titems: {},\n\t\tgetItem: defaultGetter,\n\t\taddItem: noop,\n\t\tremoveItem: noop,\n\n\t\tmenus: {},\n\t\tgetMenu: defaultGetter,\n\t\taddMenu: noop,\n\t\tremoveMenu: noop,\n\t\tchildMenu: {},\n\t\ttraverseMenu: noop,\n\t\tisMenuEmpty: defaultIsEmpty,\n\t},\n} );\nexport const useNavigationContext = () => useContext( NavigationContext );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,cAAc,GAAGA,CAAA,KAAM,KAAK;AAClC,MAAMC,aAAa,GAAGA,CAAA,KAAMC,SAAS;AAE9B,MAAMC,iBAAiB,GAAG,IAAAC,sBAAa,EAA2B;EACxEC,UAAU,EAAEH,SAAS;EACrBI,UAAU,EAAEC,oBAAS;EACrBC,aAAa,EAAET,IAAI;EAEnBU,cAAc,EAAE;IACfC,KAAK,EAAE,CAAC,CAAC;IACTC,OAAO,EAAEV,aAAa;IACtBW,OAAO,EAAEb,IAAI;IACbc,UAAU,EAAEd,IAAI;IAEhBe,KAAK,EAAE,CAAC,CAAC;IACTC,OAAO,EAAEd,aAAa;IACtBe,OAAO,EAAEjB,IAAI;IACbkB,UAAU,EAAElB,IAAI;IAChBmB,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAEpB,IAAI;IAClBqB,WAAW,EAAEpB;EACd;AACD,CAAE,CAAC;AAACqB,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA;AACG,MAAMmB,oBAAoB,GAAGA,CAAA,KAAM,IAAAC,mBAAU,EAAEpB,iBAAkB,CAAC;AAACkB,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_element","require","_constants","noop","defaultIsEmpty","defaultGetter","undefined","NavigationContext","exports","createContext","activeItem","activeMenu","ROOT_MENU","setActiveMenu","navigationTree","items","getItem","addItem","removeItem","menus","getMenu","addMenu","removeMenu","childMenu","traverseMenu","isMenuEmpty","useNavigationContext","useContext"],"sources":["@wordpress/components/src/navigation/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ROOT_MENU } from './constants';\n\nimport type { NavigationContext as NavigationContextType } from './types';\n\nconst noop = () => {};\nconst defaultIsEmpty = () => false;\nconst defaultGetter = () => undefined;\n\nexport const NavigationContext = createContext< NavigationContextType >( {\n\tactiveItem: undefined,\n\tactiveMenu: ROOT_MENU,\n\tsetActiveMenu: noop,\n\n\tnavigationTree: {\n\t\titems: {},\n\t\tgetItem: defaultGetter,\n\t\taddItem: noop,\n\t\tremoveItem: noop,\n\n\t\tmenus: {},\n\t\tgetMenu: defaultGetter,\n\t\taddMenu: noop,\n\t\tremoveMenu: noop,\n\t\tchildMenu: {},\n\t\ttraverseMenu: noop,\n\t\tisMenuEmpty: defaultIsEmpty,\n\t},\n} );\nexport const useNavigationContext = () => useContext( NavigationContext );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAME,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AACrB,MAAMC,cAAc,GAAGA,CAAA,KAAM,KAAK;AAClC,MAAMC,aAAa,GAAGA,CAAA,KAAMC,SAAS;AAE9B,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAAE,sBAAa,EAA2B;EACxEC,UAAU,EAAEJ,SAAS;EACrBK,UAAU,EAAEC,oBAAS;EACrBC,aAAa,EAAEV,IAAI;EAEnBW,cAAc,EAAE;IACfC,KAAK,EAAE,CAAC,CAAC;IACTC,OAAO,EAAEX,aAAa;IACtBY,OAAO,EAAEd,IAAI;IACbe,UAAU,EAAEf,IAAI;IAEhBgB,KAAK,EAAE,CAAC,CAAC;IACTC,OAAO,EAAEf,aAAa;IACtBgB,OAAO,EAAElB,IAAI;IACbmB,UAAU,EAAEnB,IAAI;IAChBoB,SAAS,EAAE,CAAC,CAAC;IACbC,YAAY,EAAErB,IAAI;IAClBsB,WAAW,EAAErB;EACd;AACD,CAAE,CAAC;AACI,MAAMsB,oBAAoB,GAAGA,CAAA,KAAM,IAAAC,mBAAU,EAAEpB,iBAAkB,CAAC;AAACC,OAAA,CAAAkB,oBAAA,GAAAA,oBAAA"}
@@ -9,10 +9,9 @@ var _element = require("@wordpress/element");
9
9
  * WordPress dependencies
10
10
  */
11
11
 
12
- const NavigationGroupContext = (0, _element.createContext)({
12
+ const NavigationGroupContext = exports.NavigationGroupContext = (0, _element.createContext)({
13
13
  group: undefined
14
14
  });
15
- exports.NavigationGroupContext = NavigationGroupContext;
16
15
  const useNavigationGroupContext = () => (0, _element.useContext)(NavigationGroupContext);
17
16
  exports.useNavigationGroupContext = useNavigationGroupContext;
18
17
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","NavigationGroupContext","createContext","group","undefined","exports","useNavigationGroupContext","useContext"],"sources":["@wordpress/components/src/navigation/group/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { NavigationGroupContext as NavigationGroupContextType } from '../types';\n\nexport const NavigationGroupContext =\n\tcreateContext< NavigationGroupContextType >( { group: undefined } );\n\nexport const useNavigationGroupContext = () =>\n\tuseContext( NavigationGroupContext );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAQO,MAAMC,sBAAsB,GAClC,IAAAC,sBAAa,EAAgC;EAAEC,KAAK,EAAEC;AAAU,CAAE,CAAC;AAACC,OAAA,CAAAJ,sBAAA,GAAAA,sBAAA;AAE9D,MAAMK,yBAAyB,GAAGA,CAAA,KACxC,IAAAC,mBAAU,EAAEN,sBAAuB,CAAC;AAACI,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
1
+ {"version":3,"names":["_element","require","NavigationGroupContext","exports","createContext","group","undefined","useNavigationGroupContext","useContext"],"sources":["@wordpress/components/src/navigation/group/context.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { NavigationGroupContext as NavigationGroupContextType } from '../types';\n\nexport const NavigationGroupContext =\n\tcreateContext< NavigationGroupContextType >( { group: undefined } );\n\nexport const useNavigationGroupContext = () =>\n\tuseContext( NavigationGroupContext );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAQO,MAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAClC,IAAAE,sBAAa,EAAgC;EAAEC,KAAK,EAAEC;AAAU,CAAE,CAAC;AAE7D,MAAMC,yBAAyB,GAAGA,CAAA,KACxC,IAAAC,mBAAU,EAAEN,sBAAuB,CAAC;AAACC,OAAA,CAAAI,yBAAA,GAAAA,yBAAA"}
@@ -61,6 +61,5 @@ function NavigationGroup({
61
61
  role: "group"
62
62
  }, children)));
63
63
  }
64
- var _default = NavigationGroup;
65
- exports.default = _default;
64
+ var _default = exports.default = NavigationGroup;
66
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_context","_navigationStyles","_context2","uniqueId","NavigationGroup","children","className","title","groupId","useState","navigationTree","items","useNavigationContext","context","group","Object","values","some","item","_isVisible","_react","createElement","NavigationGroupContext","Provider","value","groupTitleId","classes","classnames","GroupTitleUI","id","level","role","_default","exports","default"],"sources":["@wordpress/components/src/navigation/group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigationGroupContext } from './context';\nimport { GroupTitleUI } from '../styles/navigation-styles';\nimport { useNavigationContext } from '../context';\n\nimport type { NavigationGroupProps } from '../types';\n\nlet uniqueId = 0;\n\nexport function NavigationGroup( {\n\tchildren,\n\tclassName,\n\ttitle,\n}: NavigationGroupProps ) {\n\tconst [ groupId ] = useState( `group-${ ++uniqueId }` );\n\tconst {\n\t\tnavigationTree: { items },\n\t} = useNavigationContext();\n\n\tconst context = { group: groupId };\n\n\t// Keep the children rendered to make sure invisible items are included in the navigation tree.\n\tif (\n\t\t! Object.values( items ).some(\n\t\t\t( item ) => item.group === groupId && item._isVisible\n\t\t)\n\t) {\n\t\treturn (\n\t\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t\t{ children }\n\t\t\t</NavigationGroupContext.Provider>\n\t\t);\n\t}\n\n\tconst groupTitleId = `components-navigation__group-title-${ groupId }`;\n\tconst classes = classnames( 'components-navigation__group', className );\n\n\treturn (\n\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t<li className={ classes }>\n\t\t\t\t{ title && (\n\t\t\t\t\t<GroupTitleUI\n\t\t\t\t\t\tclassName=\"components-navigation__group-title\"\n\t\t\t\t\t\tid={ groupTitleId }\n\t\t\t\t\t\tlevel={ 3 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</GroupTitleUI>\n\t\t\t\t) }\n\t\t\t\t<ul aria-labelledby={ groupTitleId } role=\"group\">\n\t\t\t\t\t{ children }\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</NavigationGroupContext.Provider>\n\t);\n}\n\nexport default NavigationGroup;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,IAAIK,QAAQ,GAAG,CAAC;AAET,SAASC,eAAeA,CAAE;EAChCC,QAAQ;EACRC,SAAS;EACTC;AACqB,CAAC,EAAG;EACzB,MAAM,CAAEC,OAAO,CAAE,GAAG,IAAAC,iBAAQ,EAAG,SAAS,EAAEN,QAAU,EAAE,CAAC;EACvD,MAAM;IACLO,cAAc,EAAE;MAAEC;IAAM;EACzB,CAAC,GAAG,IAAAC,8BAAoB,EAAC,CAAC;EAE1B,MAAMC,OAAO,GAAG;IAAEC,KAAK,EAAEN;EAAQ,CAAC;;EAElC;EACA,IACC,CAAEO,MAAM,CAACC,MAAM,CAAEL,KAAM,CAAC,CAACM,IAAI,CAC1BC,IAAI,IAAMA,IAAI,CAACJ,KAAK,KAAKN,OAAO,IAAIU,IAAI,CAACC,UAC5C,CAAC,EACA;IACD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACrB,QAAA,CAAAsB,sBAAsB,CAACC,QAAQ;MAACC,KAAK,EAAGX;IAAS,GAC/CR,QAC8B,CAAC;EAEpC;EAEA,MAAMoB,YAAY,GAAI,sCAAsCjB,OAAS,EAAC;EACtE,MAAMkB,OAAO,GAAG,IAAAC,mBAAU,EAAE,8BAA8B,EAAErB,SAAU,CAAC;EAEvE,OACC,IAAAc,MAAA,CAAAC,aAAA,EAACrB,QAAA,CAAAsB,sBAAsB,CAACC,QAAQ;IAACC,KAAK,EAAGX;EAAS,GACjD,IAAAO,MAAA,CAAAC,aAAA;IAAIf,SAAS,EAAGoB;EAAS,GACtBnB,KAAK,IACN,IAAAa,MAAA,CAAAC,aAAA,EAACpB,iBAAA,CAAA2B,YAAY;IACZtB,SAAS,EAAC,oCAAoC;IAC9CuB,EAAE,EAAGJ,YAAc;IACnBK,KAAK,EAAG;EAAG,GAETvB,KACW,CACd,EACD,IAAAa,MAAA,CAAAC,aAAA;IAAI,mBAAkBI,YAAc;IAACM,IAAI,EAAC;EAAO,GAC9C1B,QACC,CACD,CAC4B,CAAC;AAEpC;AAAC,IAAA2B,QAAA,GAEc5B,eAAe;AAAA6B,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_context","_navigationStyles","_context2","uniqueId","NavigationGroup","children","className","title","groupId","useState","navigationTree","items","useNavigationContext","context","group","Object","values","some","item","_isVisible","_react","createElement","NavigationGroupContext","Provider","value","groupTitleId","classes","classnames","GroupTitleUI","id","level","role","_default","exports","default"],"sources":["@wordpress/components/src/navigation/group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigationGroupContext } from './context';\nimport { GroupTitleUI } from '../styles/navigation-styles';\nimport { useNavigationContext } from '../context';\n\nimport type { NavigationGroupProps } from '../types';\n\nlet uniqueId = 0;\n\nexport function NavigationGroup( {\n\tchildren,\n\tclassName,\n\ttitle,\n}: NavigationGroupProps ) {\n\tconst [ groupId ] = useState( `group-${ ++uniqueId }` );\n\tconst {\n\t\tnavigationTree: { items },\n\t} = useNavigationContext();\n\n\tconst context = { group: groupId };\n\n\t// Keep the children rendered to make sure invisible items are included in the navigation tree.\n\tif (\n\t\t! Object.values( items ).some(\n\t\t\t( item ) => item.group === groupId && item._isVisible\n\t\t)\n\t) {\n\t\treturn (\n\t\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t\t{ children }\n\t\t\t</NavigationGroupContext.Provider>\n\t\t);\n\t}\n\n\tconst groupTitleId = `components-navigation__group-title-${ groupId }`;\n\tconst classes = classnames( 'components-navigation__group', className );\n\n\treturn (\n\t\t<NavigationGroupContext.Provider value={ context }>\n\t\t\t<li className={ classes }>\n\t\t\t\t{ title && (\n\t\t\t\t\t<GroupTitleUI\n\t\t\t\t\t\tclassName=\"components-navigation__group-title\"\n\t\t\t\t\t\tid={ groupTitleId }\n\t\t\t\t\t\tlevel={ 3 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</GroupTitleUI>\n\t\t\t\t) }\n\t\t\t\t<ul aria-labelledby={ groupTitleId } role=\"group\">\n\t\t\t\t\t{ children }\n\t\t\t\t</ul>\n\t\t\t</li>\n\t\t</NavigationGroupContext.Provider>\n\t);\n}\n\nexport default NavigationGroup;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AA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AO,GAC9C1B,QACC,CACD,CAC4B,CAAC;AAEpC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc9B,eAAe"}
@@ -126,6 +126,5 @@ function Navigation({
126
126
  value: context
127
127
  }, children)));
128
128
  }
129
- var _default = Navigation;
130
- exports.default = _default;
129
+ var _default = exports.default = Navigation;
131
130
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_animate","_constants","_context","_navigationStyles","_useCreateNavigationTree","noop","Navigation","activeItem","activeMenu","ROOT_MENU","children","className","onActivateMenu","menu","setMenu","useState","slideOrigin","setSlideOrigin","navigationTree","useCreateNavigationTree","defaultSlideOrigin","isRTL","setActiveMenu","menuId","slideInOrigin","getMenu","isMounted","useRef","useEffect","current","context","classes","classnames","animateClassName","getAnimateClassName","type","origin","_react","createElement","NavigationUI","key","undefined","NavigationContext","Provider","value","_default","exports","default"],"sources":["@wordpress/components/src/navigation/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../animate';\nimport { ROOT_MENU } from './constants';\nimport { NavigationContext } from './context';\nimport { NavigationUI } from './styles/navigation-styles';\nimport { useCreateNavigationTree } from './use-create-navigation-tree';\n\nimport type {\n\tNavigationProps,\n\tNavigationContext as NavigationContextType,\n} from './types';\n\nconst noop = () => {};\n\n/**\n * Render a navigation list with optional groupings and hierarchy.\n *\n * ```jsx\n * import {\n * __experimentalNavigation as Navigation,\n * __experimentalNavigationGroup as NavigationGroup,\n * __experimentalNavigationItem as NavigationItem,\n * __experimentalNavigationMenu as NavigationMenu,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <Navigation>\n * <NavigationMenu title=\"Home\">\n * <NavigationGroup title=\"Group 1\">\n * <NavigationItem item=\"item-1\" title=\"Item 1\" />\n * <NavigationItem item=\"item-2\" title=\"Item 2\" />\n * </NavigationGroup>\n * <NavigationGroup title=\"Group 2\">\n * <NavigationItem\n * item=\"item-3\"\n * navigateToMenu=\"category\"\n * title=\"Category\"\n * />\n * </NavigationGroup>\n * </NavigationMenu>\n *\n * <NavigationMenu\n * backButtonLabel=\"Home\"\n * menu=\"category\"\n * parentMenu=\"root\"\n * title=\"Category\"\n * >\n * <NavigationItem badge=\"1\" item=\"child-1\" title=\"Child 1\" />\n * <NavigationItem item=\"child-2\" title=\"Child 2\" />\n * </NavigationMenu>\n * </Navigation>\n * );\n * ```\n */\nexport function Navigation( {\n\tactiveItem,\n\tactiveMenu = ROOT_MENU,\n\tchildren,\n\tclassName,\n\tonActivateMenu = noop,\n}: NavigationProps ) {\n\tconst [ menu, setMenu ] = useState( activeMenu );\n\tconst [ slideOrigin, setSlideOrigin ] = useState< 'left' | 'right' >();\n\tconst navigationTree = useCreateNavigationTree();\n\tconst defaultSlideOrigin = isRTL() ? 'right' : 'left';\n\n\tconst setActiveMenu: NavigationContextType[ 'setActiveMenu' ] = (\n\t\tmenuId,\n\t\tslideInOrigin = defaultSlideOrigin\n\t) => {\n\t\tif ( ! navigationTree.getMenu( menuId ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSlideOrigin( slideInOrigin );\n\t\tsetMenu( menuId );\n\t\tonActivateMenu( menuId );\n\t};\n\n\t// Used to prevent the sliding animation on mount\n\tconst isMounted = useRef( false );\n\tuseEffect( () => {\n\t\tif ( ! isMounted.current ) {\n\t\t\tisMounted.current = true;\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( activeMenu !== menu ) {\n\t\t\tsetActiveMenu( activeMenu );\n\t\t}\n\t\t// Ignore exhaustive-deps here, as it would require either a larger refactor or some questionable workarounds.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41612 for context.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ activeMenu ] );\n\n\tconst context = {\n\t\tactiveItem,\n\t\tactiveMenu: menu,\n\t\tsetActiveMenu,\n\t\tnavigationTree,\n\t};\n\n\tconst classes = classnames( 'components-navigation', className );\n\tconst animateClassName = getAnimateClassName( {\n\t\ttype: 'slide-in',\n\t\torigin: slideOrigin,\n\t} );\n\n\treturn (\n\t\t<NavigationUI className={ classes }>\n\t\t\t<div\n\t\t\t\tkey={ menu }\n\t\t\t\tclassName={\n\t\t\t\t\tanimateClassName\n\t\t\t\t\t\t? classnames( {\n\t\t\t\t\t\t\t\t[ animateClassName ]:\n\t\t\t\t\t\t\t\t\tisMounted.current && slideOrigin,\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<NavigationContext.Provider value={ context }>\n\t\t\t\t\t{ children }\n\t\t\t\t</NavigationContext.Provider>\n\t\t\t</div>\n\t\t</NavigationUI>\n\t);\n}\n\nexport default Navigation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAYA,MAAMQ,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAE;EAC3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AG,IAAAC,4BAAmB,EAAE;IAC7CC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAEpB;EACT,CAAE,CAAC;EAEH,OACC,IAAAqB,MAAA,CAAAC,aAAA,EAACnC,iBAAA,CAAAoC,YAAY;IAAC5B,SAAS,EAAGoB;EAAS,GAClC,IAAAM,MAAA,CAAAC,aAAA;IACCE,GAAG,EAAG3B,IAAM;IACZF,SAAS,EACRsB,gBAAgB,GACb,IAAAD,mBAAU,EAAE;MACZ,CAAEC,gBAAgB,GACjBP,SAAS,CAACG,OAAO,IAAIb;IACtB,CAAE,CAAC,GACHyB;EACH,GAED,IAAAJ,MAAA,CAAAC,aAAA,EAACpC,QAAA,CAAAwC,iBAAiB,CAACC,QAAQ;IAACC,KAAK,EAAGd;EAAS,GAC1CpB,QACyB,CACxB,CACQ,CAAC;AAEjB;AAAC,IAAAmC,QAAA,GAEcvC,UAAU;AAAAwC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_animate","_constants","_context","_navigationStyles","_useCreateNavigationTree","noop","Navigation","activeItem","activeMenu","ROOT_MENU","children","className","onActivateMenu","menu","setMenu","useState","slideOrigin","setSlideOrigin","navigationTree","useCreateNavigationTree","defaultSlideOrigin","isRTL","setActiveMenu","menuId","slideInOrigin","getMenu","isMounted","useRef","useEffect","current","context","classes","classnames","animateClassName","getAnimateClassName","type","origin","_react","createElement","NavigationUI","key","undefined","NavigationContext","Provider","value","_default","exports","default"],"sources":["@wordpress/components/src/navigation/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getAnimateClassName } from '../animate';\nimport { ROOT_MENU } from './constants';\nimport { NavigationContext } from './context';\nimport { NavigationUI } from './styles/navigation-styles';\nimport { useCreateNavigationTree } from './use-create-navigation-tree';\n\nimport type {\n\tNavigationProps,\n\tNavigationContext as NavigationContextType,\n} from './types';\n\nconst noop = () => {};\n\n/**\n * Render a navigation list with optional groupings and hierarchy.\n *\n * ```jsx\n * import {\n * __experimentalNavigation as Navigation,\n * __experimentalNavigationGroup as NavigationGroup,\n * __experimentalNavigationItem as NavigationItem,\n * __experimentalNavigationMenu as NavigationMenu,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <Navigation>\n * <NavigationMenu title=\"Home\">\n * <NavigationGroup title=\"Group 1\">\n * <NavigationItem item=\"item-1\" title=\"Item 1\" />\n * <NavigationItem item=\"item-2\" title=\"Item 2\" />\n * </NavigationGroup>\n * <NavigationGroup title=\"Group 2\">\n * <NavigationItem\n * item=\"item-3\"\n * navigateToMenu=\"category\"\n * title=\"Category\"\n * />\n * </NavigationGroup>\n * </NavigationMenu>\n *\n * <NavigationMenu\n * backButtonLabel=\"Home\"\n * menu=\"category\"\n * parentMenu=\"root\"\n * title=\"Category\"\n * >\n * <NavigationItem badge=\"1\" item=\"child-1\" title=\"Child 1\" />\n * <NavigationItem item=\"child-2\" title=\"Child 2\" />\n * </NavigationMenu>\n * </Navigation>\n * );\n * ```\n */\nexport function Navigation( {\n\tactiveItem,\n\tactiveMenu = ROOT_MENU,\n\tchildren,\n\tclassName,\n\tonActivateMenu = noop,\n}: NavigationProps ) {\n\tconst [ menu, setMenu ] = useState( activeMenu );\n\tconst [ slideOrigin, setSlideOrigin ] = useState< 'left' | 'right' >();\n\tconst navigationTree = useCreateNavigationTree();\n\tconst defaultSlideOrigin = isRTL() ? 'right' : 'left';\n\n\tconst setActiveMenu: NavigationContextType[ 'setActiveMenu' ] = (\n\t\tmenuId,\n\t\tslideInOrigin = defaultSlideOrigin\n\t) => {\n\t\tif ( ! navigationTree.getMenu( menuId ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSlideOrigin( slideInOrigin );\n\t\tsetMenu( menuId );\n\t\tonActivateMenu( menuId );\n\t};\n\n\t// Used to prevent the sliding animation on mount\n\tconst isMounted = useRef( false );\n\tuseEffect( () => {\n\t\tif ( ! isMounted.current ) {\n\t\t\tisMounted.current = true;\n\t\t}\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( activeMenu !== menu ) {\n\t\t\tsetActiveMenu( activeMenu );\n\t\t}\n\t\t// Ignore exhaustive-deps here, as it would require either a larger refactor or some questionable workarounds.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41612 for context.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ activeMenu ] );\n\n\tconst context = {\n\t\tactiveItem,\n\t\tactiveMenu: menu,\n\t\tsetActiveMenu,\n\t\tnavigationTree,\n\t};\n\n\tconst classes = classnames( 'components-navigation', className );\n\tconst animateClassName = getAnimateClassName( {\n\t\ttype: 'slide-in',\n\t\torigin: slideOrigin,\n\t} );\n\n\treturn (\n\t\t<NavigationUI className={ classes }>\n\t\t\t<div\n\t\t\t\tkey={ menu }\n\t\t\t\tclassName={\n\t\t\t\t\tanimateClassName\n\t\t\t\t\t\t? classnames( {\n\t\t\t\t\t\t\t\t[ animateClassName ]:\n\t\t\t\t\t\t\t\t\tisMounted.current && slideOrigin,\n\t\t\t\t\t\t } )\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<NavigationContext.Provider value={ context }>\n\t\t\t\t\t{ children }\n\t\t\t\t</NavigationContext.Provider>\n\t\t\t</div>\n\t\t</NavigationUI>\n\t);\n}\n\nexport default Navigation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,wBAA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