@wordpress/components 20.0.2-next.957ca95e4c.0 → 21.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 (851) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/CONTRIBUTING.md +3 -54
  3. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  4. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  5. package/build/angle-picker-control/index.js +10 -0
  6. package/build/angle-picker-control/index.js.map +1 -1
  7. package/build/border-box-control/border-box-control/component.js +5 -1
  8. package/build/border-box-control/border-box-control/component.js.map +1 -1
  9. package/build/border-box-control/border-box-control-split-controls/component.js +5 -1
  10. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  11. package/build/border-control/border-control-dropdown/component.js +2 -1
  12. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  13. package/build/card/styles.js +17 -17
  14. package/build/card/styles.js.map +1 -1
  15. package/build/checkbox-control/index.js +3 -3
  16. package/build/checkbox-control/index.js.map +1 -1
  17. package/build/color-palette/index.js +1 -1
  18. package/build/color-palette/index.js.map +1 -1
  19. package/build/color-picker/input-with-slider.js +2 -1
  20. package/build/color-picker/input-with-slider.js.map +1 -1
  21. package/build/combobox-control/index.js +1 -1
  22. package/build/combobox-control/index.js.map +1 -1
  23. package/build/custom-gradient-picker/index.js +1 -1
  24. package/build/custom-gradient-picker/index.js.map +1 -1
  25. package/build/date-time/date/index.js +1 -1
  26. package/build/date-time/date/index.js.map +1 -1
  27. package/build/date-time/time/timezone.js +1 -1
  28. package/build/date-time/time/timezone.js.map +1 -1
  29. package/build/disabled/index.js +14 -6
  30. package/build/disabled/index.js.map +1 -1
  31. package/build/disabled/styles/disabled-styles.js +8 -18
  32. package/build/disabled/styles/disabled-styles.js.map +1 -1
  33. package/build/drop-zone/index.js +44 -9
  34. package/build/drop-zone/index.js.map +1 -1
  35. package/build/drop-zone/provider.js.map +1 -1
  36. package/build/drop-zone/types.js +6 -0
  37. package/build/drop-zone/types.js.map +1 -0
  38. package/build/flex/flex/hook.js +6 -30
  39. package/build/flex/flex/hook.js.map +1 -1
  40. package/build/focal-point-picker/controls.js +10 -5
  41. package/build/focal-point-picker/controls.js.map +1 -1
  42. package/build/focal-point-picker/focal-point.js.map +1 -1
  43. package/build/focal-point-picker/grid.js.map +1 -1
  44. package/build/focal-point-picker/index.js +83 -16
  45. package/build/focal-point-picker/index.js.map +1 -1
  46. package/build/focal-point-picker/media.js +4 -0
  47. package/build/focal-point-picker/media.js.map +1 -1
  48. package/build/focal-point-picker/styles/focal-point-picker-style.js +70 -41
  49. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  50. package/build/focal-point-picker/styles/focal-point-style.js +12 -12
  51. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  52. package/build/focal-point-picker/types.js +6 -0
  53. package/build/focal-point-picker/types.js.map +1 -0
  54. package/build/focal-point-picker/utils.js +6 -6
  55. package/build/focal-point-picker/utils.js.map +1 -1
  56. package/build/font-size-picker/index.js +11 -0
  57. package/build/font-size-picker/index.js.map +1 -1
  58. package/build/font-size-picker/utils.js +1 -1
  59. package/build/font-size-picker/utils.js.map +1 -1
  60. package/build/form-file-upload/index.js +22 -2
  61. package/build/form-file-upload/index.js.map +1 -1
  62. package/build/form-file-upload/types.js +6 -0
  63. package/build/form-file-upload/types.js.map +1 -0
  64. package/build/form-toggle/index.js +1 -3
  65. package/build/form-toggle/index.js.map +1 -1
  66. package/build/form-token-field/index.js +4 -6
  67. package/build/form-token-field/index.js.map +1 -1
  68. package/build/form-token-field/suggestions-list.js +1 -3
  69. package/build/form-token-field/suggestions-list.js.map +1 -1
  70. package/build/gradient-picker/index.js +25 -26
  71. package/build/gradient-picker/index.js.map +1 -1
  72. package/build/icon/index.js +1 -2
  73. package/build/icon/index.js.map +1 -1
  74. package/build/input-control/input-base.js +3 -2
  75. package/build/input-control/input-base.js.map +1 -1
  76. package/build/input-control/label.js +2 -2
  77. package/build/input-control/label.js.map +1 -1
  78. package/build/input-control/styles/input-control-styles.js +41 -128
  79. package/build/input-control/styles/input-control-styles.js.map +1 -1
  80. package/build/modal/aria-helper.js +3 -10
  81. package/build/modal/aria-helper.js.map +1 -1
  82. package/build/navigable-container/container.js +5 -1
  83. package/build/navigable-container/container.js.map +1 -1
  84. package/build/navigable-container/menu.js +10 -12
  85. package/build/navigable-container/menu.js.map +1 -1
  86. package/build/navigable-container/tabbable.js +2 -4
  87. package/build/navigable-container/tabbable.js.map +1 -1
  88. package/build/navigator/navigator-button/hook.js +1 -1
  89. package/build/navigator/navigator-button/hook.js.map +1 -1
  90. package/build/navigator/navigator-screen/component.js +2 -2
  91. package/build/navigator/navigator-screen/component.js.map +1 -1
  92. package/build/number-control/index.js +29 -25
  93. package/build/number-control/index.js.map +1 -1
  94. package/build/number-control/types.js +6 -0
  95. package/build/number-control/types.js.map +1 -0
  96. package/build/placeholder/index.js +1 -3
  97. package/build/placeholder/index.js.map +1 -1
  98. package/build/popover/index.js +155 -154
  99. package/build/popover/index.js.map +1 -1
  100. package/build/popover/types.js +6 -0
  101. package/build/popover/types.js.map +1 -0
  102. package/build/popover/utils.js +119 -24
  103. package/build/popover/utils.js.map +1 -1
  104. package/build/radio-control/index.js +7 -4
  105. package/build/radio-control/index.js.map +1 -1
  106. package/build/range-control/index.js +4 -1
  107. package/build/range-control/index.js.map +1 -1
  108. package/build/range-control/styles/range-control-styles.js +33 -33
  109. package/build/range-control/styles/range-control-styles.js.map +1 -1
  110. package/build/sandbox/index.js +2 -2
  111. package/build/sandbox/index.js.map +1 -1
  112. package/build/search-control/index.js +38 -10
  113. package/build/search-control/index.js.map +1 -1
  114. package/build/search-control/types.js +6 -0
  115. package/build/search-control/types.js.map +1 -0
  116. package/build/select-control/index.native.js +2 -1
  117. package/build/select-control/index.native.js.map +1 -1
  118. package/build/tab-panel/index.js +48 -9
  119. package/build/tab-panel/index.js.map +1 -1
  120. package/build/tab-panel/types.js +6 -0
  121. package/build/tab-panel/types.js.map +1 -0
  122. package/build/text-control/index.js +2 -0
  123. package/build/text-control/index.js.map +1 -1
  124. package/build/textarea-control/index.js +3 -3
  125. package/build/textarea-control/index.js.map +1 -1
  126. package/build/toggle-control/index.js +44 -4
  127. package/build/toggle-control/index.js.map +1 -1
  128. package/build/toggle-control/types.js +6 -0
  129. package/build/toggle-control/types.js.map +1 -0
  130. package/build/toggle-group-control/toggle-group-control/component.js +2 -2
  131. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  132. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  133. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  134. package/build/tooltip/index.js +1 -1
  135. package/build/tooltip/index.js.map +1 -1
  136. package/build/ui/context/context-connect.js +31 -22
  137. package/build/ui/context/context-connect.js.map +1 -1
  138. package/build/ui/context/context-system-provider.js +4 -3
  139. package/build/ui/context/context-system-provider.js.map +1 -1
  140. package/build/unit-control/index.js +1 -1
  141. package/build/unit-control/index.js.map +1 -1
  142. package/build/unit-control/styles/unit-control-styles.js +9 -9
  143. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  144. package/build/utils/colors-values.js +2 -30
  145. package/build/utils/colors-values.js.map +1 -1
  146. package/build/utils/math.js +4 -4
  147. package/build/utils/math.js.map +1 -1
  148. package/build/utils/values.js +62 -6
  149. package/build/utils/values.js.map +1 -1
  150. package/build/view/component.js +6 -7
  151. package/build/view/component.js.map +1 -1
  152. package/build/view/types.js +6 -0
  153. package/build/view/types.js.map +1 -0
  154. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  155. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  156. package/build-module/angle-picker-control/index.js +9 -0
  157. package/build-module/angle-picker-control/index.js.map +1 -1
  158. package/build-module/border-box-control/border-box-control/component.js +5 -1
  159. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  160. package/build-module/border-box-control/border-box-control-split-controls/component.js +5 -1
  161. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  162. package/build-module/border-control/border-control-dropdown/component.js +2 -1
  163. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  164. package/build-module/card/styles.js +17 -17
  165. package/build-module/card/styles.js.map +1 -1
  166. package/build-module/checkbox-control/index.js +3 -3
  167. package/build-module/checkbox-control/index.js.map +1 -1
  168. package/build-module/color-palette/index.js +1 -1
  169. package/build-module/color-palette/index.js.map +1 -1
  170. package/build-module/color-picker/input-with-slider.js +2 -1
  171. package/build-module/color-picker/input-with-slider.js.map +1 -1
  172. package/build-module/combobox-control/index.js +1 -1
  173. package/build-module/combobox-control/index.js.map +1 -1
  174. package/build-module/custom-gradient-picker/index.js +1 -1
  175. package/build-module/custom-gradient-picker/index.js.map +1 -1
  176. package/build-module/date-time/date/index.js +2 -3
  177. package/build-module/date-time/date/index.js.map +1 -1
  178. package/build-module/date-time/time/timezone.js +1 -1
  179. package/build-module/date-time/time/timezone.js.map +1 -1
  180. package/build-module/disabled/index.js +16 -8
  181. package/build-module/disabled/index.js.map +1 -1
  182. package/build-module/disabled/styles/disabled-styles.js +6 -12
  183. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  184. package/build-module/drop-zone/index.js +40 -9
  185. package/build-module/drop-zone/index.js.map +1 -1
  186. package/build-module/drop-zone/provider.js.map +1 -1
  187. package/build-module/drop-zone/types.js +2 -0
  188. package/build-module/drop-zone/types.js.map +1 -0
  189. package/build-module/flex/flex/hook.js +7 -29
  190. package/build-module/flex/flex/hook.js.map +1 -1
  191. package/build-module/focal-point-picker/controls.js +11 -6
  192. package/build-module/focal-point-picker/controls.js.map +1 -1
  193. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  194. package/build-module/focal-point-picker/grid.js.map +1 -1
  195. package/build-module/focal-point-picker/index.js +81 -16
  196. package/build-module/focal-point-picker/index.js.map +1 -1
  197. package/build-module/focal-point-picker/media.js +4 -0
  198. package/build-module/focal-point-picker/media.js.map +1 -1
  199. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +68 -40
  200. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  201. package/build-module/focal-point-picker/styles/focal-point-style.js +12 -12
  202. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  203. package/build-module/focal-point-picker/types.js +2 -0
  204. package/build-module/focal-point-picker/types.js.map +1 -0
  205. package/build-module/focal-point-picker/utils.js +6 -6
  206. package/build-module/focal-point-picker/utils.js.map +1 -1
  207. package/build-module/font-size-picker/index.js +10 -0
  208. package/build-module/font-size-picker/index.js.map +1 -1
  209. package/build-module/font-size-picker/utils.js +1 -1
  210. package/build-module/font-size-picker/utils.js.map +1 -1
  211. package/build-module/form-file-upload/index.js +21 -4
  212. package/build-module/form-file-upload/index.js.map +1 -1
  213. package/build-module/form-file-upload/types.js +2 -0
  214. package/build-module/form-file-upload/types.js.map +1 -0
  215. package/build-module/form-toggle/index.js +1 -3
  216. package/build-module/form-toggle/index.js.map +1 -1
  217. package/build-module/form-token-field/index.js +4 -5
  218. package/build-module/form-token-field/index.js.map +1 -1
  219. package/build-module/form-token-field/suggestions-list.js +1 -2
  220. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  221. package/build-module/gradient-picker/index.js +25 -26
  222. package/build-module/gradient-picker/index.js.map +1 -1
  223. package/build-module/icon/index.js +1 -2
  224. package/build-module/icon/index.js.map +1 -1
  225. package/build-module/input-control/input-base.js +4 -3
  226. package/build-module/input-control/input-base.js.map +1 -1
  227. package/build-module/input-control/label.js +3 -3
  228. package/build-module/input-control/label.js.map +1 -1
  229. package/build-module/input-control/styles/input-control-styles.js +41 -127
  230. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  231. package/build-module/modal/aria-helper.js +3 -8
  232. package/build-module/modal/aria-helper.js.map +1 -1
  233. package/build-module/navigable-container/container.js +5 -1
  234. package/build-module/navigable-container/container.js.map +1 -1
  235. package/build-module/navigable-container/menu.js +10 -11
  236. package/build-module/navigable-container/menu.js.map +1 -1
  237. package/build-module/navigable-container/tabbable.js +2 -3
  238. package/build-module/navigable-container/tabbable.js.map +1 -1
  239. package/build-module/navigator/navigator-button/hook.js +1 -1
  240. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  241. package/build-module/navigator/navigator-screen/component.js +2 -2
  242. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  243. package/build-module/number-control/index.js +31 -23
  244. package/build-module/number-control/index.js.map +1 -1
  245. package/build-module/number-control/types.js +2 -0
  246. package/build-module/number-control/types.js.map +1 -0
  247. package/build-module/placeholder/index.js +1 -3
  248. package/build-module/placeholder/index.js.map +1 -1
  249. package/build-module/popover/index.js +157 -156
  250. package/build-module/popover/index.js.map +1 -1
  251. package/build-module/popover/types.js +2 -0
  252. package/build-module/popover/types.js.map +1 -0
  253. package/build-module/popover/utils.js +112 -23
  254. package/build-module/popover/utils.js.map +1 -1
  255. package/build-module/radio-control/index.js +7 -5
  256. package/build-module/radio-control/index.js.map +1 -1
  257. package/build-module/range-control/index.js +4 -1
  258. package/build-module/range-control/index.js.map +1 -1
  259. package/build-module/range-control/styles/range-control-styles.js +33 -33
  260. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  261. package/build-module/sandbox/index.js +2 -2
  262. package/build-module/sandbox/index.js.map +1 -1
  263. package/build-module/search-control/index.js +34 -7
  264. package/build-module/search-control/index.js.map +1 -1
  265. package/build-module/search-control/types.js +2 -0
  266. package/build-module/search-control/types.js.map +1 -0
  267. package/build-module/select-control/index.native.js +1 -1
  268. package/build-module/select-control/index.native.js.map +1 -1
  269. package/build-module/tab-panel/index.js +46 -10
  270. package/build-module/tab-panel/index.js.map +1 -1
  271. package/build-module/tab-panel/types.js +2 -0
  272. package/build-module/tab-panel/types.js.map +1 -0
  273. package/build-module/text-control/index.js +2 -0
  274. package/build-module/text-control/index.js.map +1 -1
  275. package/build-module/textarea-control/index.js +3 -3
  276. package/build-module/textarea-control/index.js.map +1 -1
  277. package/build-module/toggle-control/index.js +38 -4
  278. package/build-module/toggle-control/index.js.map +1 -1
  279. package/build-module/toggle-control/types.js +2 -0
  280. package/build-module/toggle-control/types.js.map +1 -0
  281. package/build-module/toggle-group-control/toggle-group-control/component.js +2 -2
  282. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  283. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  284. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  285. package/build-module/tooltip/index.js +1 -1
  286. package/build-module/tooltip/index.js.map +1 -1
  287. package/build-module/ui/context/context-connect.js +30 -23
  288. package/build-module/ui/context/context-connect.js.map +1 -1
  289. package/build-module/ui/context/context-system-provider.js +5 -4
  290. package/build-module/ui/context/context-system-provider.js.map +1 -1
  291. package/build-module/unit-control/index.js +1 -1
  292. package/build-module/unit-control/index.js.map +1 -1
  293. package/build-module/unit-control/styles/unit-control-styles.js +9 -9
  294. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  295. package/build-module/utils/colors-values.js +2 -30
  296. package/build-module/utils/colors-values.js.map +1 -1
  297. package/build-module/utils/math.js +4 -4
  298. package/build-module/utils/math.js.map +1 -1
  299. package/build-module/utils/values.js +48 -6
  300. package/build-module/utils/values.js.map +1 -1
  301. package/build-module/view/component.js +5 -8
  302. package/build-module/view/component.js.map +1 -1
  303. package/build-module/view/types.js +2 -0
  304. package/build-module/view/types.js.map +1 -0
  305. package/build-style/style-rtl.css +2 -28
  306. package/build-style/style.css +2 -28
  307. package/build-types/base-field/hook.d.ts +54 -55
  308. package/build-types/base-field/hook.d.ts.map +1 -1
  309. package/build-types/border-box-control/border-box-control/component.d.ts +10 -2
  310. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  311. package/build-types/border-box-control/border-box-control/hook.d.ts +56 -57
  312. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  313. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +2 -1
  314. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  315. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +55 -56
  316. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  317. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +9 -2
  318. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  319. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +56 -57
  320. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  321. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +2 -1
  322. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  323. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +55 -56
  324. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  325. package/build-types/border-box-control/types.d.ts +5 -4
  326. package/build-types/border-box-control/types.d.ts.map +1 -1
  327. package/build-types/border-control/border-control/component.d.ts +14 -2
  328. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  329. package/build-types/border-control/border-control/hook.d.ts +56 -57
  330. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  331. package/build-types/border-control/border-control-dropdown/component.d.ts +10 -2
  332. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  333. package/build-types/border-control/border-control-dropdown/hook.d.ts +56 -57
  334. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  335. package/build-types/border-control/border-control-style-picker/component.d.ts +6 -2
  336. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  337. package/build-types/border-control/border-control-style-picker/hook.d.ts +55 -56
  338. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  339. package/build-types/border-control/stories/index.d.ts +74 -6
  340. package/build-types/border-control/stories/index.d.ts.map +1 -1
  341. package/build-types/border-control/types.d.ts +6 -8
  342. package/build-types/border-control/types.d.ts.map +1 -1
  343. package/build-types/button-group/index.d.ts +1 -3
  344. package/build-types/button-group/index.d.ts.map +1 -1
  345. package/build-types/card/card/component.d.ts +9 -2
  346. package/build-types/card/card/component.d.ts.map +1 -1
  347. package/build-types/card/card/hook.d.ts +55 -56
  348. package/build-types/card/card/hook.d.ts.map +1 -1
  349. package/build-types/card/card-body/component.d.ts +9 -2
  350. package/build-types/card/card-body/component.d.ts.map +1 -1
  351. package/build-types/card/card-body/hook.d.ts +55 -56
  352. package/build-types/card/card-body/hook.d.ts.map +1 -1
  353. package/build-types/card/card-divider/component.d.ts +7 -2
  354. package/build-types/card/card-divider/component.d.ts.map +1 -1
  355. package/build-types/card/card-divider/hook.d.ts +55 -55
  356. package/build-types/card/card-footer/component.d.ts +11 -2
  357. package/build-types/card/card-footer/component.d.ts.map +1 -1
  358. package/build-types/card/card-footer/hook.d.ts +55 -56
  359. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  360. package/build-types/card/card-header/component.d.ts +1 -1
  361. package/build-types/card/card-header/component.d.ts.map +1 -1
  362. package/build-types/card/card-header/hook.d.ts +55 -56
  363. package/build-types/card/card-header/hook.d.ts.map +1 -1
  364. package/build-types/card/card-media/component.d.ts +2 -1
  365. package/build-types/card/card-media/component.d.ts.map +1 -1
  366. package/build-types/card/card-media/hook.d.ts +55 -56
  367. package/build-types/card/card-media/hook.d.ts.map +1 -1
  368. package/build-types/checkbox-control/index.d.ts +1 -1
  369. package/build-types/checkbox-control/index.d.ts.map +1 -1
  370. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  371. package/build-types/checkbox-control/types.d.ts +1 -1
  372. package/build-types/checkbox-control/types.d.ts.map +1 -1
  373. package/build-types/color-indicator/index.d.ts +1 -3
  374. package/build-types/color-indicator/index.d.ts.map +1 -1
  375. package/build-types/color-palette/styles.d.ts +1 -3
  376. package/build-types/color-palette/styles.d.ts.map +1 -1
  377. package/build-types/color-picker/component.d.ts +2 -1
  378. package/build-types/color-picker/component.d.ts.map +1 -1
  379. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  380. package/build-types/color-picker/styles.d.ts +12 -25
  381. package/build-types/color-picker/styles.d.ts.map +1 -1
  382. package/build-types/confirm-dialog/component.d.ts +4 -8
  383. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  384. package/build-types/date-time/date/styles.d.ts +4 -8
  385. package/build-types/date-time/date/styles.d.ts.map +1 -1
  386. package/build-types/date-time/date-time/styles.d.ts +4 -6
  387. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  388. package/build-types/date-time/time/styles.d.ts +21 -43
  389. package/build-types/date-time/time/styles.d.ts.map +1 -1
  390. package/build-types/disabled/index.d.ts +1 -1
  391. package/build-types/disabled/index.d.ts.map +1 -1
  392. package/build-types/disabled/styles/disabled-styles.d.ts +1 -5
  393. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  394. package/build-types/divider/component.d.ts +7 -2
  395. package/build-types/divider/component.d.ts.map +1 -1
  396. package/build-types/drop-zone/index.d.ts +29 -0
  397. package/build-types/drop-zone/index.d.ts.map +1 -0
  398. package/build-types/drop-zone/provider.d.ts +5 -0
  399. package/build-types/drop-zone/provider.d.ts.map +1 -0
  400. package/build-types/drop-zone/stories/index.d.ts +12 -0
  401. package/build-types/drop-zone/stories/index.d.ts.map +1 -0
  402. package/build-types/drop-zone/types.d.ts +29 -0
  403. package/build-types/drop-zone/types.d.ts.map +1 -0
  404. package/build-types/dropdown/dropdown-content-wrapper.d.ts +2 -1
  405. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  406. package/build-types/elevation/component.d.ts +2 -1
  407. package/build-types/elevation/component.d.ts.map +1 -1
  408. package/build-types/elevation/hook.d.ts +54 -55
  409. package/build-types/elevation/hook.d.ts.map +1 -1
  410. package/build-types/external-link/index.d.ts +1 -1
  411. package/build-types/external-link/index.d.ts.map +1 -1
  412. package/build-types/external-link/styles/external-link-styles.d.ts +1 -1
  413. package/build-types/flex/flex/component.d.ts +2 -1
  414. package/build-types/flex/flex/component.d.ts.map +1 -1
  415. package/build-types/flex/flex/hook.d.ts +55 -56
  416. package/build-types/flex/flex/hook.d.ts.map +1 -1
  417. package/build-types/flex/flex-block/component.d.ts +2 -1
  418. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  419. package/build-types/flex/flex-block/hook.d.ts +55 -56
  420. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  421. package/build-types/flex/flex-item/component.d.ts +2 -1
  422. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  423. package/build-types/flex/flex-item/hook.d.ts +55 -56
  424. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  425. package/build-types/focal-point-picker/controls.d.ts +4 -0
  426. package/build-types/focal-point-picker/controls.d.ts.map +1 -0
  427. package/build-types/focal-point-picker/focal-point.d.ts +5 -0
  428. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -0
  429. package/build-types/focal-point-picker/grid.d.ts +5 -0
  430. package/build-types/focal-point-picker/grid.d.ts.map +1 -0
  431. package/build-types/focal-point-picker/index.d.ts +51 -0
  432. package/build-types/focal-point-picker/index.d.ts.map +1 -0
  433. package/build-types/focal-point-picker/media.d.ts +4 -0
  434. package/build-types/focal-point-picker/media.d.ts.map +1 -0
  435. package/build-types/focal-point-picker/stories/index.d.ts +15 -0
  436. package/build-types/focal-point-picker/stories/index.d.ts.map +1 -0
  437. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +56 -0
  438. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -0
  439. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +19 -0
  440. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -0
  441. package/build-types/focal-point-picker/types.d.ts +79 -0
  442. package/build-types/focal-point-picker/types.d.ts.map +1 -0
  443. package/build-types/focal-point-picker/utils.d.ts +26 -0
  444. package/build-types/focal-point-picker/utils.d.ts.map +1 -0
  445. package/build-types/form-file-upload/index.d.ts +22 -0
  446. package/build-types/form-file-upload/index.d.ts.map +1 -0
  447. package/build-types/form-file-upload/stories/index.d.ts +23 -0
  448. package/build-types/form-file-upload/stories/index.d.ts.map +1 -0
  449. package/build-types/form-file-upload/test/index.d.ts +2 -0
  450. package/build-types/form-file-upload/test/index.d.ts.map +1 -0
  451. package/build-types/form-file-upload/types.d.ts +63 -0
  452. package/build-types/form-file-upload/types.d.ts.map +1 -0
  453. package/build-types/form-toggle/index.d.ts +1 -1
  454. package/build-types/form-toggle/index.d.ts.map +1 -1
  455. package/build-types/form-token-field/index.d.ts.map +1 -1
  456. package/build-types/form-token-field/styles.d.ts +1 -3
  457. package/build-types/form-token-field/styles.d.ts.map +1 -1
  458. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  459. package/build-types/form-token-field/token-input.d.ts +1 -3
  460. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  461. package/build-types/grid/component.d.ts +2 -1
  462. package/build-types/grid/component.d.ts.map +1 -1
  463. package/build-types/grid/hook.d.ts +55 -56
  464. package/build-types/grid/hook.d.ts.map +1 -1
  465. package/build-types/h-stack/component.d.ts +5 -2
  466. package/build-types/h-stack/component.d.ts.map +1 -1
  467. package/build-types/h-stack/hook.d.ts +55 -56
  468. package/build-types/h-stack/hook.d.ts.map +1 -1
  469. package/build-types/heading/component.d.ts +4 -2
  470. package/build-types/heading/component.d.ts.map +1 -1
  471. package/build-types/heading/hook.d.ts +54 -55
  472. package/build-types/heading/hook.d.ts.map +1 -1
  473. package/build-types/input-control/index.d.ts +1 -1
  474. package/build-types/input-control/index.d.ts.map +1 -1
  475. package/build-types/input-control/input-base.d.ts.map +1 -1
  476. package/build-types/input-control/input-field.d.ts +1 -3
  477. package/build-types/input-control/input-field.d.ts.map +1 -1
  478. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -1
  479. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  480. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -1
  481. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  482. package/build-types/input-control/label.d.ts.map +1 -1
  483. package/build-types/input-control/stories/index.d.ts +5 -5
  484. package/build-types/input-control/stories/index.d.ts.map +1 -1
  485. package/build-types/input-control/styles/input-control-styles.d.ts +2 -6
  486. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  487. package/build-types/input-control/types.d.ts +3 -0
  488. package/build-types/input-control/types.d.ts.map +1 -1
  489. package/build-types/item-group/item/component.d.ts +2 -1
  490. package/build-types/item-group/item/component.d.ts.map +1 -1
  491. package/build-types/item-group/item/hook.d.ts +54 -55
  492. package/build-types/item-group/item/hook.d.ts.map +1 -1
  493. package/build-types/item-group/item-group/component.d.ts +2 -1
  494. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  495. package/build-types/item-group/item-group/hook.d.ts +54 -55
  496. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  497. package/build-types/modal/aria-helper.d.ts.map +1 -1
  498. package/build-types/navigable-container/menu.d.ts.map +1 -1
  499. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  500. package/build-types/navigator/navigator-back-button/component.d.ts +4 -2
  501. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  502. package/build-types/navigator/navigator-back-button/hook.d.ts +59 -60
  503. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  504. package/build-types/navigator/navigator-button/component.d.ts +7 -2
  505. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  506. package/build-types/navigator/navigator-button/hook.d.ts +59 -60
  507. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  508. package/build-types/navigator/navigator-provider/component.d.ts +2 -1
  509. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  510. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  511. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  512. package/build-types/number-control/index.d.ts +10 -28
  513. package/build-types/number-control/index.d.ts.map +1 -1
  514. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  515. package/build-types/number-control/types.d.ts +72 -0
  516. package/build-types/number-control/types.d.ts.map +1 -0
  517. package/build-types/placeholder/index.d.ts +1 -1
  518. package/build-types/placeholder/index.d.ts.map +1 -1
  519. package/build-types/popover/index.d.ts +28 -24
  520. package/build-types/popover/index.d.ts.map +1 -1
  521. package/build-types/popover/stories/index.d.ts +12 -0
  522. package/build-types/popover/stories/index.d.ts.map +1 -0
  523. package/build-types/popover/types.d.ts +161 -0
  524. package/build-types/popover/types.d.ts.map +1 -0
  525. package/build-types/popover/utils.d.ts +42 -24
  526. package/build-types/popover/utils.d.ts.map +1 -1
  527. package/build-types/radio-control/index.d.ts +1 -1
  528. package/build-types/radio-control/index.d.ts.map +1 -1
  529. package/build-types/range-control/index.d.ts +2 -4
  530. package/build-types/range-control/index.d.ts.map +1 -1
  531. package/build-types/range-control/input-range.d.ts +2 -4
  532. package/build-types/range-control/input-range.d.ts.map +1 -1
  533. package/build-types/range-control/styles/range-control-styles.d.ts +5 -10
  534. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  535. package/build-types/resizable-box/index.d.ts +1 -1
  536. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  537. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  538. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +1 -3
  539. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  540. package/build-types/scrollable/component.d.ts +2 -1
  541. package/build-types/scrollable/component.d.ts.map +1 -1
  542. package/build-types/scrollable/hook.d.ts +55 -56
  543. package/build-types/scrollable/hook.d.ts.map +1 -1
  544. package/build-types/search-control/index.d.ts +29 -0
  545. package/build-types/search-control/index.d.ts.map +1 -0
  546. package/build-types/search-control/stories/index.d.ts +47 -0
  547. package/build-types/search-control/stories/index.d.ts.map +1 -0
  548. package/build-types/search-control/types.d.ts +39 -0
  549. package/build-types/search-control/types.d.ts.map +1 -0
  550. package/build-types/select-control/index.d.ts +1 -3
  551. package/build-types/select-control/index.d.ts.map +1 -1
  552. package/build-types/select-control/stories/index.d.ts +2 -6
  553. package/build-types/select-control/stories/index.d.ts.map +1 -1
  554. package/build-types/select-control/styles/select-control-styles.d.ts +1 -3
  555. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  556. package/build-types/spacer/component.d.ts +2 -1
  557. package/build-types/spacer/component.d.ts.map +1 -1
  558. package/build-types/spacer/hook.d.ts +55 -56
  559. package/build-types/spacer/hook.d.ts.map +1 -1
  560. package/build-types/spinner/index.d.ts +1 -3
  561. package/build-types/spinner/index.d.ts.map +1 -1
  562. package/build-types/surface/component.d.ts +2 -1
  563. package/build-types/surface/component.d.ts.map +1 -1
  564. package/build-types/surface/hook.d.ts +55 -56
  565. package/build-types/surface/hook.d.ts.map +1 -1
  566. package/build-types/tab-panel/index.d.ts +42 -0
  567. package/build-types/tab-panel/index.d.ts.map +1 -0
  568. package/build-types/tab-panel/stories/index.d.ts +12 -0
  569. package/build-types/tab-panel/stories/index.d.ts.map +1 -0
  570. package/build-types/tab-panel/test/index.d.ts +2 -0
  571. package/build-types/tab-panel/test/index.d.ts.map +1 -0
  572. package/build-types/tab-panel/types.d.ts +64 -0
  573. package/build-types/tab-panel/types.d.ts.map +1 -0
  574. package/build-types/text/component.d.ts +1 -1
  575. package/build-types/text/component.d.ts.map +1 -1
  576. package/build-types/text/hook.d.ts +55 -56
  577. package/build-types/text/hook.d.ts.map +1 -1
  578. package/build-types/text-control/index.d.ts +2 -4
  579. package/build-types/text-control/index.d.ts.map +1 -1
  580. package/build-types/text-control/types.d.ts +1 -1
  581. package/build-types/text-control/types.d.ts.map +1 -1
  582. package/build-types/textarea-control/index.d.ts +1 -1
  583. package/build-types/textarea-control/index.d.ts.map +1 -1
  584. package/build-types/textarea-control/types.d.ts +1 -1
  585. package/build-types/textarea-control/types.d.ts.map +1 -1
  586. package/build-types/toggle-control/index.d.ts +26 -0
  587. package/build-types/toggle-control/index.d.ts.map +1 -0
  588. package/build-types/toggle-control/stories/index.d.ts +13 -0
  589. package/build-types/toggle-control/stories/index.d.ts.map +1 -0
  590. package/build-types/toggle-control/test/index.d.ts +2 -0
  591. package/build-types/toggle-control/test/index.d.ts.map +1 -0
  592. package/build-types/toggle-control/types.d.ts +20 -0
  593. package/build-types/toggle-control/types.d.ts.map +1 -0
  594. package/build-types/toggle-group-control/stories/index.d.ts +4 -2
  595. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -1
  596. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +12 -2
  597. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  598. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +2 -4
  599. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  600. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +2 -1
  601. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  602. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +3 -5
  603. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  604. package/build-types/toggle-group-control/types.d.ts +2 -2
  605. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  606. package/build-types/tools-panel/tools-panel/component.d.ts +2 -1
  607. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  608. package/build-types/tools-panel/tools-panel/hook.d.ts +55 -56
  609. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  610. package/build-types/tools-panel/tools-panel-header/component.d.ts +2 -1
  611. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  612. package/build-types/tools-panel/tools-panel-header/hook.d.ts +55 -56
  613. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  614. package/build-types/tools-panel/tools-panel-item/component.d.ts +6 -2
  615. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  616. package/build-types/tools-panel/tools-panel-item/hook.d.ts +55 -56
  617. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  618. package/build-types/truncate/component.d.ts +2 -1
  619. package/build-types/truncate/component.d.ts.map +1 -1
  620. package/build-types/truncate/hook.d.ts +55 -56
  621. package/build-types/truncate/hook.d.ts.map +1 -1
  622. package/build-types/ui/context/context-connect.d.ts +10 -9
  623. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  624. package/build-types/ui/context/context-system-provider.d.ts.map +1 -1
  625. package/build-types/ui/context/test/context-connect.d.ts +2 -0
  626. package/build-types/ui/context/test/context-connect.d.ts.map +1 -0
  627. package/build-types/ui/context/test/wordpress-component.d.ts +2 -0
  628. package/build-types/ui/context/test/wordpress-component.d.ts.map +1 -0
  629. package/build-types/ui/context/wordpress-component.d.ts +8 -9
  630. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  631. package/build-types/ui/control-group/component.d.ts +4 -1
  632. package/build-types/ui/control-group/component.d.ts.map +1 -1
  633. package/build-types/ui/control-group/hook.d.ts +55 -56
  634. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  635. package/build-types/ui/control-label/component.d.ts +4 -1
  636. package/build-types/ui/control-label/component.d.ts.map +1 -1
  637. package/build-types/ui/control-label/hook.d.ts +55 -56
  638. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  639. package/build-types/ui/form-group/form-group.d.ts +4 -8
  640. package/build-types/ui/form-group/form-group.d.ts.map +1 -1
  641. package/build-types/ui/form-group/use-form-group.d.ts +112 -114
  642. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  643. package/build-types/ui/shortcut/component.d.ts +2 -1
  644. package/build-types/ui/shortcut/component.d.ts.map +1 -1
  645. package/build-types/ui/spinner/component.d.ts +1 -1
  646. package/build-types/ui/tooltip/component.d.ts +11 -1
  647. package/build-types/ui/tooltip/component.d.ts.map +1 -1
  648. package/build-types/ui/tooltip/content.d.ts +7 -1
  649. package/build-types/ui/tooltip/styles.d.ts +1 -3
  650. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  651. package/build-types/unit-control/index.d.ts +2 -12
  652. package/build-types/unit-control/index.d.ts.map +1 -1
  653. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  654. package/build-types/unit-control/styles/unit-control-styles.d.ts +5 -10
  655. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  656. package/build-types/unit-control/types.d.ts +3 -35
  657. package/build-types/unit-control/types.d.ts.map +1 -1
  658. package/build-types/utils/colors-values.d.ts +0 -18
  659. package/build-types/utils/colors-values.d.ts.map +1 -1
  660. package/build-types/utils/math.d.ts +6 -6
  661. package/build-types/utils/math.d.ts.map +1 -1
  662. package/build-types/utils/values.d.ts +10 -8
  663. package/build-types/utils/values.d.ts.map +1 -1
  664. package/build-types/v-stack/component.d.ts +8 -2
  665. package/build-types/v-stack/component.d.ts.map +1 -1
  666. package/build-types/v-stack/hook.d.ts +55 -56
  667. package/build-types/v-stack/hook.d.ts.map +1 -1
  668. package/build-types/v-stack/stories/index.d.ts +8 -1
  669. package/build-types/v-stack/stories/index.d.ts.map +1 -1
  670. package/build-types/view/component.d.ts +8 -6
  671. package/build-types/view/component.d.ts.map +1 -1
  672. package/build-types/view/stories/index.d.ts +12 -0
  673. package/build-types/view/stories/index.d.ts.map +1 -0
  674. package/build-types/view/types.d.ts +8 -0
  675. package/build-types/view/types.d.ts.map +1 -0
  676. package/build-types/visually-hidden/component.d.ts +2 -1
  677. package/build-types/visually-hidden/component.d.ts.map +1 -1
  678. package/build-types/z-stack/component.d.ts +2 -1
  679. package/build-types/z-stack/component.d.ts.map +1 -1
  680. package/package.json +17 -17
  681. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -1
  682. package/src/angle-picker-control/README.md +9 -1
  683. package/src/angle-picker-control/index.js +12 -0
  684. package/src/angle-picker-control/stories/index.js +3 -3
  685. package/src/base-field/test/__snapshots__/index.js.snap +3 -5
  686. package/src/border-box-control/border-box-control/component.tsx +9 -2
  687. package/src/border-box-control/border-box-control-split-controls/component.tsx +8 -2
  688. package/src/border-box-control/types.ts +5 -4
  689. package/src/border-control/border-control-dropdown/component.tsx +3 -8
  690. package/src/border-control/types.ts +7 -9
  691. package/src/card/styles.ts +1 -1
  692. package/src/card/test/__snapshots__/index.tsx.snap +39 -51
  693. package/src/checkbox-control/index.tsx +3 -6
  694. package/src/checkbox-control/stories/index.tsx +6 -2
  695. package/src/checkbox-control/types.ts +4 -1
  696. package/src/color-palette/index.js +1 -1
  697. package/src/color-palette/test/__snapshots__/index.js.snap +67 -91
  698. package/src/color-picker/input-with-slider.tsx +1 -0
  699. package/src/combobox-control/index.js +1 -1
  700. package/src/combobox-control/test/index.js +311 -0
  701. package/src/custom-gradient-picker/index.js +1 -1
  702. package/src/date-time/date/index.tsx +2 -2
  703. package/src/date-time/time/timezone.tsx +1 -1
  704. package/src/dimension-control/test/__snapshots__/index.test.js.snap +1122 -164
  705. package/src/dimension-control/test/index.test.js +29 -38
  706. package/src/disabled/index.tsx +27 -9
  707. package/src/disabled/styles/disabled-styles.tsx +2 -2
  708. package/src/disabled/test/index.tsx +38 -0
  709. package/src/drop-zone/README.md +3 -3
  710. package/src/drop-zone/{index.js → index.tsx} +48 -13
  711. package/src/drop-zone/{provider.js → provider.ts} +5 -1
  712. package/src/drop-zone/stories/index.tsx +30 -0
  713. package/src/drop-zone/types.ts +29 -0
  714. package/src/dropdown/README.md +6 -4
  715. package/src/dropdown/stories/index.js +1 -1
  716. package/src/flex/flex/hook.ts +5 -54
  717. package/src/flex/test/__snapshots__/index.tsx.snap +7 -15
  718. package/src/focal-point-picker/README.md +2 -2
  719. package/src/focal-point-picker/{controls.js → controls.tsx} +38 -10
  720. package/src/focal-point-picker/{focal-point.js → focal-point.tsx} +7 -1
  721. package/src/focal-point-picker/{grid.js → grid.tsx} +6 -1
  722. package/src/focal-point-picker/{index.js → index.tsx} +99 -15
  723. package/src/focal-point-picker/{media.js → media.tsx} +10 -4
  724. package/src/focal-point-picker/stories/index.tsx +93 -0
  725. package/src/focal-point-picker/styles/{focal-point-picker-style.js → focal-point-picker-style.ts} +31 -5
  726. package/src/focal-point-picker/styles/{focal-point-style.js → focal-point-style.ts} +2 -1
  727. package/src/focal-point-picker/test/index.js +27 -7
  728. package/src/focal-point-picker/types.ts +93 -0
  729. package/src/focal-point-picker/{utils.js → utils.ts} +9 -9
  730. package/src/font-size-picker/README.md +9 -0
  731. package/src/font-size-picker/index.js +9 -0
  732. package/src/font-size-picker/stories/index.js +3 -5
  733. package/src/font-size-picker/test/index.js +15 -2
  734. package/src/font-size-picker/test/utils.js +1 -2
  735. package/src/font-size-picker/utils.js +1 -1
  736. package/src/form-file-upload/README.md +6 -1
  737. package/src/form-file-upload/{index.js → index.tsx} +22 -4
  738. package/src/form-file-upload/stories/index.tsx +74 -0
  739. package/src/form-file-upload/test/{index.js → index.tsx} +7 -3
  740. package/src/form-file-upload/types.ts +63 -0
  741. package/src/form-toggle/index.tsx +1 -6
  742. package/src/form-token-field/index.tsx +4 -5
  743. package/src/form-token-field/suggestions-list.tsx +1 -2
  744. package/src/gradient-picker/index.js +41 -47
  745. package/src/gradient-picker/stories/index.js +10 -0
  746. package/src/h-stack/test/__snapshots__/index.tsx.snap +3 -12
  747. package/src/higher-order/with-filters/test/__snapshots__/index.js.snap +87 -0
  748. package/src/higher-order/with-filters/test/index.js +20 -74
  749. package/src/icon/index.tsx +1 -1
  750. package/src/icon/stories/index.js +18 -0
  751. package/src/icon/test/index.js +32 -83
  752. package/src/input-control/input-base.tsx +9 -11
  753. package/src/input-control/label.tsx +9 -4
  754. package/src/input-control/styles/input-control-styles.tsx +0 -43
  755. package/src/input-control/types.ts +3 -0
  756. package/src/isolated-event-container/test/index.js +53 -11
  757. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  758. package/src/keyboard-shortcuts/test/index.js +16 -31
  759. package/src/menu-item/test/__snapshots__/index.js.snap +60 -62
  760. package/src/menu-item/test/index.js +30 -22
  761. package/src/modal/aria-helper.js +3 -8
  762. package/src/navigable-container/README.md +2 -0
  763. package/src/navigable-container/container.js +8 -1
  764. package/src/navigable-container/menu.js +14 -11
  765. package/src/navigable-container/stories/navigable-menu.js +49 -0
  766. package/src/navigable-container/stories/tabbable-container.js +40 -0
  767. package/src/navigable-container/tabbable.js +2 -3
  768. package/src/navigable-container/test/navigable-menu.js +277 -0
  769. package/src/navigable-container/test/tababble-container.js +175 -0
  770. package/src/navigator/navigator-button/hook.ts +1 -1
  771. package/src/navigator/navigator-screen/component.tsx +6 -1
  772. package/src/number-control/index.tsx +209 -0
  773. package/src/number-control/stories/index.js +6 -18
  774. package/src/number-control/types.ts +75 -0
  775. package/src/panel/test/__snapshots__/header.js.snap +9 -0
  776. package/src/panel/test/__snapshots__/index.js.snap +17 -0
  777. package/src/panel/test/__snapshots__/row.js.snap +17 -0
  778. package/src/panel/test/header.js +30 -23
  779. package/src/panel/test/index.js +33 -25
  780. package/src/panel/test/row.js +18 -11
  781. package/src/placeholder/index.tsx +4 -5
  782. package/src/placeholder/style.scss +4 -0
  783. package/src/popover/README.md +83 -48
  784. package/src/popover/{index.js → index.tsx} +246 -176
  785. package/src/popover/stories/{index.js → index.tsx} +51 -54
  786. package/src/popover/types.ts +173 -0
  787. package/src/popover/utils.ts +230 -0
  788. package/src/radio-control/index.tsx +28 -29
  789. package/src/radio-control/style.scss +0 -17
  790. package/src/range-control/index.tsx +4 -1
  791. package/src/range-control/styles/range-control-styles.ts +8 -8
  792. package/src/sandbox/index.js +2 -2
  793. package/src/search-control/README.md +5 -3
  794. package/src/search-control/{index.js → index.tsx} +35 -7
  795. package/src/search-control/stories/index.tsx +66 -0
  796. package/src/search-control/types.ts +43 -0
  797. package/src/select-control/index.native.js +1 -1
  798. package/src/slot-fill/test/index.js +69 -12
  799. package/src/style.scss +0 -1
  800. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  801. package/src/tab-panel/README.md +1 -2
  802. package/src/tab-panel/{index.js → index.tsx} +58 -13
  803. package/src/tab-panel/stories/index.tsx +37 -0
  804. package/src/tab-panel/test/index.tsx +120 -0
  805. package/src/tab-panel/types.ts +65 -0
  806. package/src/text-control/index.tsx +2 -0
  807. package/src/text-control/types.ts +5 -1
  808. package/src/textarea-control/index.tsx +3 -6
  809. package/src/textarea-control/types.ts +1 -1
  810. package/src/toggle-control/index.tsx +97 -0
  811. package/src/toggle-control/stories/index.tsx +58 -0
  812. package/src/toggle-control/test/index.tsx +53 -0
  813. package/src/toggle-control/types.ts +28 -0
  814. package/src/toggle-group-control/stories/index.tsx +10 -3
  815. package/src/toggle-group-control/toggle-group-control/component.tsx +3 -3
  816. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  817. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  818. package/src/toggle-group-control/types.ts +2 -2
  819. package/src/tooltip/index.js +1 -1
  820. package/src/ui/context/context-connect.ts +58 -31
  821. package/src/ui/context/context-system-provider.js +5 -4
  822. package/src/ui/context/test/context-connect.tsx +55 -0
  823. package/src/ui/context/test/wordpress-component.tsx +36 -0
  824. package/src/ui/context/wordpress-component.ts +18 -12
  825. package/src/ui/control-group/test/__snapshots__/index.js.snap +1 -4
  826. package/src/unit-control/index.tsx +1 -1
  827. package/src/unit-control/stories/index.tsx +7 -16
  828. package/src/unit-control/styles/unit-control-styles.ts +2 -2
  829. package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -6
  830. package/src/unit-control/types.ts +3 -44
  831. package/src/utils/colors-values.js +2 -24
  832. package/src/utils/math.js +4 -4
  833. package/src/utils/values.js +48 -6
  834. package/src/v-stack/test/__snapshots__/index.tsx.snap +3 -12
  835. package/src/view/{component.js → component.tsx} +13 -4
  836. package/src/view/stories/index.tsx +32 -0
  837. package/src/view/types.ts +6 -0
  838. package/tsconfig.json +0 -6
  839. package/tsconfig.tsbuildinfo +1 -1
  840. package/src/focal-point-picker/stories/index.js +0 -76
  841. package/src/navigable-container/test/menu.js +0 -310
  842. package/src/navigable-container/test/tabbable.js +0 -158
  843. package/src/number-control/index.js +0 -192
  844. package/src/popover/utils.js +0 -107
  845. package/src/search-control/stories/index.js +0 -39
  846. package/src/tab-panel/stories/index.js +0 -39
  847. package/src/tab-panel/test/index.js +0 -179
  848. package/src/toggle-control/index.js +0 -55
  849. package/src/toggle-control/stories/index.js +0 -64
  850. package/src/toggle-control/style.scss +0 -14
  851. package/src/toggle-control/test/index.js +0 -52
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"names":["css","Flex","FlexItem","Text","baseLabelTypography","COLORS","rtl","space","rootFocusedStyles","isFocused","rootLabelPositionStyles","labelPosition","Root","containerDisabledStyles","disabled","backgroundColor","ui","backgroundDisabled","background","containerMarginStyles","hideLabel","containerWidthStyles","__unstableInputWidth","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","default","small","fontSize","fontSizeMobile","getSizeConfig","__next36pxDefaultSize","height","lineHeight","minHeight","paddingLeft","paddingRight","sizeStyles","props","customPaddings","paddingInlineStart","paddingInlineEnd","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","gray","labelMargin","marginBottom","marginTop","marginRight","marginLeft","BaseLabel","Label","LabelWrapper","backdropFocusedStyles","borderColor","borderFocus","border","boxShadow","borderDisabled","borderStyle","borderWidth","BackdropUI","Prefix","Suffix"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAsC,gBAAtC;AAQA,SAASC,IAAT,EAAeC,QAAf,QAA+B,YAA/B;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,mBAAT,EAA8BC,MAA9B,EAAsCC,GAAtC,QAAiD,aAAjD;AAEA,SAASC,KAAT,QAAsB,sBAAtB;;;;;;;;;;;;AAcA,MAAMC,iBAAiB,GAAG,SAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB;AACA,CAJD;;;;;;;;;;;;;;;;;;;;;;;;;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Q;AACvC,MAAIwD,WAAW,GAAGxD,SAAS,GAAGJ,MAAM,CAACW,EAAP,CAAUkD,WAAb,GAA2B7D,MAAM,CAACW,EAAP,CAAUmD,MAAhE;AAEA,MAAIC,SAAJ;;AAEA,MAAK3D,SAAL,EAAiB;AAChB2D,IAAAA,SAAS,GAAI,aAAa/D,MAAM,CAACW,EAAP,CAAUkD,WAAa,QAAjD;AACA;;AAED,MAAKpD,QAAL,EAAgB;AACfmD,IAAAA,WAAW,GAAG5D,MAAM,CAACW,EAAP,CAAUqD,cAAxB;AACA;;AAED,sBAAOrE,GAAG,CAAE;AACXoE,IAAAA,SADW;AAEXH,IAAAA,WAFW;AAGXK,IAAAA,WAAW,EAAE,OAHF;AAIXC,IAAAA,WAAW,EAAE;AAJF,GAAF,+oWAAV;AAMA,CAtBD;;AAwBA,OAAO,MAAMC,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,8IAalBR,qBAbkB,OAclB1D,GAAG,CAAE;AAAEoC,EAAAA,WAAW,EAAE;AAAf,CAAF,CAde,8kWAAhB;AAkBP,OAAO,MAAM+B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAZ;AAKP,OAAO,MAAMC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAZ","sourcesContent":["/**\n * External dependencies\n */\nimport { css, SerializedStyles } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { baseLabelTypography, COLORS, rtl } from '../../utils';\nimport type { LabelPosition, Size } from '../types';\nimport { space } from '../../ui/utils/space';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\ntype RootProps = {\n\tisFocused?: boolean;\n\tlabelPosition?: LabelPosition;\n};\n\nconst rootFocusedStyles = ( { isFocused }: RootProps ) => {\n\tif ( ! isFocused ) return '';\n\n\treturn css( { zIndex: 1 } );\n};\n\nconst rootLabelPositionStyles = ( { labelPosition }: RootProps ) => {\n\tswitch ( labelPosition ) {\n\t\tcase 'top':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column;\n\t\t\t`;\n\t\tcase 'bottom':\n\t\t\treturn css`\n\t\t\t\talign-items: flex-start;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t`;\n\t\tcase 'edge':\n\t\t\treturn css`\n\t\t\t\tjustify-content: space-between;\n\t\t\t`;\n\t\tdefault:\n\t\t\treturn '';\n\t}\n};\n\nexport const Root = styled( Flex )< RootProps >`\n\tposition: relative;\n\tborder-radius: 2px;\n\tpadding-top: 0;\n\t${ rootFocusedStyles }\n\t${ rootLabelPositionStyles }\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\n// Normalizes the margins from the <Flex /> (components/ui/flex/) container.\nconst containerMarginStyles = ( { hideLabel }: ContainerProps ) => {\n\treturn hideLabel ? css( { margin: '0 !important' } ) : null;\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) return css( { width: '100%' } );\n\n\tif ( labelPosition === 'side' ) return '';\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerMarginStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\t__next36pxDefaultSize?: boolean;\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) return '';\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nconst fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) return '';\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nexport const getSizeConfig = ( {\n\tinputSize: size,\n\t__next36pxDefaultSize,\n}: InputProps ) => {\n\t// Paddings may be overridden by the custom paddings props.\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 36,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 36,\n\t\t\tpaddingLeft: space( 4 ),\n\t\t\tpaddingRight: space( 4 ),\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: space( 2 ),\n\t\t\tpaddingRight: space( 2 ),\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: space( 4 ),\n\t\t\tpaddingRight: space( 4 ),\n\t\t},\n\t};\n\n\tif ( ! __next36pxDefaultSize ) {\n\t\tsizes.default = {\n\t\t\theight: 30,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 30,\n\t\t\tpaddingLeft: space( 2 ),\n\t\t\tpaddingRight: space( 2 ),\n\t\t};\n\t}\n\n\treturn sizes[ size as Size ] || sizes.default;\n};\n\nconst sizeStyles = ( props: InputProps ) => {\n\treturn css( getSizeConfig( props ) );\n};\n\nconst customPaddings = ( {\n\tpaddingInlineStart,\n\tpaddingInlineEnd,\n}: InputProps ) => {\n\treturn css( { paddingInlineStart, paddingInlineEnd } );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.gray[ 900 ] };\n\t\tdisplay: block;\n\t\tfont-family: inherit;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\t\t${ customPaddings }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\t}\n`;\n\nconst labelMargin = ( {\n\tlabelPosition,\n}: {\n\tlabelPosition?: LabelPosition;\n} ) => {\n\tlet marginBottom = 8;\n\n\tif ( labelPosition === 'edge' || labelPosition === 'side' ) {\n\t\tmarginBottom = 0;\n\t}\n\n\treturn css( { marginTop: 0, marginRight: 0, marginBottom, marginLeft: 0 } );\n};\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\t${ baseLabelTypography };\n\n\t\tbox-sizing: border-box;\n\t\tdisplay: block;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\t${ labelMargin }\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisFocused?: boolean;\n};\n\nconst backdropFocusedStyles = ( {\n\tdisabled,\n\tisFocused,\n}: BackdropProps ): SerializedStyles => {\n\tlet borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;\n\n\tlet boxShadow;\n\n\tif ( isFocused ) {\n\t\tboxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;\n\t}\n\n\tif ( disabled ) {\n\t\tborderColor = COLORS.ui.borderDisabled;\n\t}\n\n\treturn css( {\n\t\tboxShadow,\n\t\tborderColor,\n\t\tborderStyle: 'solid',\n\t\tborderWidth: 1,\n\t} );\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-radius: inherit;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ backdropFocusedStyles }\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/input-control/styles/input-control-styles.tsx"],"names":["css","Flex","FlexItem","Text","baseLabelTypography","COLORS","rtl","space","rootFocusedStyles","isFocused","Root","containerDisabledStyles","disabled","backgroundColor","ui","backgroundDisabled","background","containerWidthStyles","__unstableInputWidth","labelPosition","flex","width","Container","disabledStyles","color","textDisabled","fontSizeStyles","inputSize","size","sizes","default","small","fontSize","fontSizeMobile","getSizeConfig","__next36pxDefaultSize","height","lineHeight","minHeight","paddingLeft","paddingRight","sizeStyles","props","customPaddings","paddingInlineStart","paddingInlineEnd","dragStyles","isDragging","dragCursor","defaultArrowStyles","activeDragCursorStyles","Input","gray","BaseLabel","Label","LabelWrapper","backdropFocusedStyles","borderColor","borderFocus","border","boxShadow","borderDisabled","borderStyle","borderWidth","BackdropUI","Prefix","Suffix"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAsC,gBAAtC;AAQA,SAASC,IAAT,EAAeC,QAAf,QAA+B,YAA/B;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,mBAAT,EAA8BC,MAA9B,EAAsCC,GAAtC,QAAiD,aAAjD;AAEA,SAASC,KAAT,QAAsB,sBAAtB;;;;;;;;;;;;AAcA,MAAMC,iBAAiB,GAAG,SAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8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;AAAA;AAAA;AAAA;AAAA,EAAZ;AAKP,OAAO,MAAMC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAZ","sourcesContent":["/**\n * External dependencies\n */\nimport { css, SerializedStyles } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport type { CSSProperties, ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../ui/context';\nimport { Flex, FlexItem } from '../../flex';\nimport { Text } from '../../text';\nimport { baseLabelTypography, COLORS, rtl } from '../../utils';\nimport type { LabelPosition, Size } from '../types';\nimport { space } from '../../ui/utils/space';\n\ntype ContainerProps = {\n\tdisabled?: boolean;\n\thideLabel?: boolean;\n\t__unstableInputWidth?: CSSProperties[ 'width' ];\n\tlabelPosition?: LabelPosition;\n};\n\ntype RootProps = {\n\tisFocused?: boolean;\n\tlabelPosition?: LabelPosition;\n};\n\nconst rootFocusedStyles = ( { isFocused }: RootProps ) => {\n\tif ( ! isFocused ) return '';\n\n\treturn css( { zIndex: 1 } );\n};\n\nexport const Root = styled( Flex )< RootProps >`\n\tposition: relative;\n\tborder-radius: 2px;\n\tpadding-top: 0;\n\t${ rootFocusedStyles }\n`;\n\nconst containerDisabledStyles = ( { disabled }: ContainerProps ) => {\n\tconst backgroundColor = disabled\n\t\t? COLORS.ui.backgroundDisabled\n\t\t: COLORS.ui.background;\n\n\treturn css( { backgroundColor } );\n};\n\nconst containerWidthStyles = ( {\n\t__unstableInputWidth,\n\tlabelPosition,\n}: ContainerProps ) => {\n\tif ( ! __unstableInputWidth ) return css( { width: '100%' } );\n\n\tif ( labelPosition === 'side' ) return '';\n\n\tif ( labelPosition === 'edge' ) {\n\t\treturn css( {\n\t\t\tflex: `0 0 ${ __unstableInputWidth }`,\n\t\t} );\n\t}\n\n\treturn css( { width: __unstableInputWidth } );\n};\n\nexport const Container = styled.div< ContainerProps >`\n\talign-items: center;\n\tbox-sizing: border-box;\n\tborder-radius: inherit;\n\tdisplay: flex;\n\tflex: 1;\n\tposition: relative;\n\n\t${ containerDisabledStyles }\n\t${ containerWidthStyles }\n`;\n\ntype InputProps = {\n\t__next36pxDefaultSize?: boolean;\n\tdisabled?: boolean;\n\tinputSize?: Size;\n\tisDragging?: boolean;\n\tdragCursor?: CSSProperties[ 'cursor' ];\n\tpaddingInlineStart?: CSSProperties[ 'paddingInlineStart' ];\n\tpaddingInlineEnd?: CSSProperties[ 'paddingInlineEnd' ];\n};\n\nconst disabledStyles = ( { disabled }: InputProps ) => {\n\tif ( ! disabled ) return '';\n\n\treturn css( {\n\t\tcolor: COLORS.ui.textDisabled,\n\t} );\n};\n\nconst fontSizeStyles = ( { inputSize: size }: InputProps ) => {\n\tconst sizes = {\n\t\tdefault: '13px',\n\t\tsmall: '11px',\n\t\t'__unstable-large': '13px',\n\t};\n\n\tconst fontSize = sizes[ size as Size ] || sizes.default;\n\tconst fontSizeMobile = '16px';\n\n\tif ( ! fontSize ) return '';\n\n\treturn css`\n\t\tfont-size: ${ fontSizeMobile };\n\n\t\t@media ( min-width: 600px ) {\n\t\t\tfont-size: ${ fontSize };\n\t\t}\n\t`;\n};\n\nexport const getSizeConfig = ( {\n\tinputSize: size,\n\t__next36pxDefaultSize,\n}: InputProps ) => {\n\t// Paddings may be overridden by the custom paddings props.\n\tconst sizes = {\n\t\tdefault: {\n\t\t\theight: 36,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 36,\n\t\t\tpaddingLeft: space( 4 ),\n\t\t\tpaddingRight: space( 4 ),\n\t\t},\n\t\tsmall: {\n\t\t\theight: 24,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 24,\n\t\t\tpaddingLeft: space( 2 ),\n\t\t\tpaddingRight: space( 2 ),\n\t\t},\n\t\t'__unstable-large': {\n\t\t\theight: 40,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 40,\n\t\t\tpaddingLeft: space( 4 ),\n\t\t\tpaddingRight: space( 4 ),\n\t\t},\n\t};\n\n\tif ( ! __next36pxDefaultSize ) {\n\t\tsizes.default = {\n\t\t\theight: 30,\n\t\t\tlineHeight: 1,\n\t\t\tminHeight: 30,\n\t\t\tpaddingLeft: space( 2 ),\n\t\t\tpaddingRight: space( 2 ),\n\t\t};\n\t}\n\n\treturn sizes[ size as Size ] || sizes.default;\n};\n\nconst sizeStyles = ( props: InputProps ) => {\n\treturn css( getSizeConfig( props ) );\n};\n\nconst customPaddings = ( {\n\tpaddingInlineStart,\n\tpaddingInlineEnd,\n}: InputProps ) => {\n\treturn css( { paddingInlineStart, paddingInlineEnd } );\n};\n\nconst dragStyles = ( { isDragging, dragCursor }: InputProps ) => {\n\tlet defaultArrowStyles: SerializedStyles | undefined;\n\tlet activeDragCursorStyles: SerializedStyles | undefined;\n\n\tif ( isDragging ) {\n\t\tdefaultArrowStyles = css`\n\t\t\tcursor: ${ dragCursor };\n\t\t\tuser-select: none;\n\n\t\t\t&::-webkit-outer-spin-button,\n\t\t\t&::-webkit-inner-spin-button {\n\t\t\t\t-webkit-appearance: none !important;\n\t\t\t\tmargin: 0 !important;\n\t\t\t}\n\t\t`;\n\t}\n\n\tif ( isDragging && dragCursor ) {\n\t\tactiveDragCursorStyles = css`\n\t\t\t&:active {\n\t\t\t\tcursor: ${ dragCursor };\n\t\t\t}\n\t\t`;\n\t}\n\n\treturn css`\n\t\t${ defaultArrowStyles }\n\t\t${ activeDragCursorStyles }\n\t`;\n};\n\n// TODO: Resolve need to use &&& to increase specificity\n// https://github.com/WordPress/gutenberg/issues/18483\n\nexport const Input = styled.input< InputProps >`\n\t&&& {\n\t\tbackground-color: transparent;\n\t\tbox-sizing: border-box;\n\t\tborder: none;\n\t\tbox-shadow: none !important;\n\t\tcolor: ${ COLORS.gray[ 900 ] };\n\t\tdisplay: block;\n\t\tfont-family: inherit;\n\t\tmargin: 0;\n\t\toutline: none;\n\t\twidth: 100%;\n\n\t\t${ dragStyles }\n\t\t${ disabledStyles }\n\t\t${ fontSizeStyles }\n\t\t${ sizeStyles }\n\t\t${ customPaddings }\n\n\t\t&::-webkit-input-placeholder {\n\t\t\tline-height: normal;\n\t\t}\n\t}\n`;\n\nconst BaseLabel = styled( Text )< { labelPosition?: LabelPosition } >`\n\t&&& {\n\t\t${ baseLabelTypography };\n\n\t\tbox-sizing: border-box;\n\t\tdisplay: block;\n\t\tpadding-top: 0;\n\t\tpadding-bottom: 0;\n\t\tmax-width: 100%;\n\t\tz-index: 1;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n`;\n\nexport const Label = (\n\tprops: WordPressComponentProps<\n\t\t{ labelPosition?: LabelPosition; children: ReactNode },\n\t\t'label',\n\t\tfalse\n\t>\n) => <BaseLabel { ...props } as=\"label\" />;\n\nexport const LabelWrapper = styled( FlexItem )`\n\tmax-width: calc( 100% - 10px );\n`;\n\ntype BackdropProps = {\n\tdisabled?: boolean;\n\tisFocused?: boolean;\n};\n\nconst backdropFocusedStyles = ( {\n\tdisabled,\n\tisFocused,\n}: BackdropProps ): SerializedStyles => {\n\tlet borderColor = isFocused ? COLORS.ui.borderFocus : COLORS.ui.border;\n\n\tlet boxShadow;\n\n\tif ( isFocused ) {\n\t\tboxShadow = `0 0 0 1px ${ COLORS.ui.borderFocus } inset`;\n\t}\n\n\tif ( disabled ) {\n\t\tborderColor = COLORS.ui.borderDisabled;\n\t}\n\n\treturn css( {\n\t\tboxShadow,\n\t\tborderColor,\n\t\tborderStyle: 'solid',\n\t\tborderWidth: 1,\n\t} );\n};\n\nexport const BackdropUI = styled.div< BackdropProps >`\n\t&&& {\n\t\tbox-sizing: border-box;\n\t\tborder-radius: inherit;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tpointer-events: none;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\n\t\t${ backdropFocusedStyles }\n\t\t${ rtl( { paddingLeft: 2 } ) }\n\t}\n`;\n\nexport const Prefix = styled.span`\n\tbox-sizing: border-box;\n\tdisplay: block;\n`;\n\nexport const Suffix = styled.span`\n\talign-items: center;\n\talign-self: stretch;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n`;\n"]}
@@ -1,9 +1,4 @@
1
1
  // @ts-nocheck
2
-
3
- /**
4
- * External dependencies
5
- */
6
- import { forEach } from 'lodash';
7
2
  const LIVE_REGION_ARIA_ROLES = new Set(['alert', 'status', 'log', 'marquee', 'timer']);
8
3
  let hiddenElements = [],
9
4
  isHidden = false;
@@ -25,8 +20,8 @@ export function hideApp(unhiddenElement) {
25
20
  return;
26
21
  }
27
22
 
28
- const elements = document.body.children;
29
- forEach(elements, element => {
23
+ const elements = Array.from(document.body.children);
24
+ elements.forEach(element => {
30
25
  if (element === unhiddenElement) {
31
26
  return;
32
27
  }
@@ -60,7 +55,7 @@ export function showApp() {
60
55
  return;
61
56
  }
62
57
 
63
- forEach(hiddenElements, element => {
58
+ hiddenElements.forEach(element => {
64
59
  element.removeAttribute('aria-hidden');
65
60
  });
66
61
  hiddenElements = [];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/modal/aria-helper.js"],"names":["forEach","LIVE_REGION_ARIA_ROLES","Set","hiddenElements","isHidden","hideApp","unhiddenElement","elements","document","body","children","element","elementShouldBeHidden","setAttribute","push","role","getAttribute","tagName","hasAttribute","has","showApp","removeAttribute"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA,MAAMC,sBAAsB,GAAG,IAAIC,GAAJ,CAAS,CACvC,OADuC,EAEvC,QAFuC,EAGvC,KAHuC,EAIvC,SAJuC,EAKvC,OALuC,CAAT,CAA/B;AAQA,IAAIC,cAAc,GAAG,EAArB;AAAA,IACCC,QAAQ,GAAG,KADZ;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,OAAT,CAAkBC,eAAlB,EAAoC;AAC1C,MAAKF,QAAL,EAAgB;AACf;AACA;;AACD,QAAMG,QAAQ,GAAGC,QAAQ,CAACC,IAAT,CAAcC,QAA/B;AACAV,EAAAA,OAAO,CAAEO,QAAF,EAAcI,OAAF,IAAe;AACjC,QAAKA,OAAO,KAAKL,eAAjB,EAAmC;AAClC;AACA;;AACD,QAAKM,qBAAqB,CAAED,OAAF,CAA1B,EAAwC;AACvCA,MAAAA,OAAO,CAACE,YAAR,CAAsB,aAAtB,EAAqC,MAArC;AACAV,MAAAA,cAAc,CAACW,IAAf,CAAqBH,OAArB;AACA;AACD,GARM,CAAP;AASAP,EAAAA,QAAQ,GAAG,IAAX;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASQ,qBAAT,CAAgCD,OAAhC,EAA0C;AAChD,QAAMI,IAAI,GAAGJ,OAAO,CAACK,YAAR,CAAsB,MAAtB,CAAb;AACA,SAAO,EACNL,OAAO,CAACM,OAAR,KAAoB,QAApB,IACAN,OAAO,CAACO,YAAR,CAAsB,aAAtB,CADA,IAEAP,OAAO,CAACO,YAAR,CAAsB,WAAtB,CAFA,IAGAjB,sBAAsB,CAACkB,GAAvB,CAA4BJ,IAA5B,CAJM,CAAP;AAMA;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASK,OAAT,GAAmB;AACzB,MAAK,CAAEhB,QAAP,EAAkB;AACjB;AACA;;AACDJ,EAAAA,OAAO,CAAEG,cAAF,EAAoBQ,OAAF,IAAe;AACvCA,IAAAA,OAAO,CAACU,eAAR,CAAyB,aAAzB;AACA,GAFM,CAAP;AAGAlB,EAAAA,cAAc,GAAG,EAAjB;AACAC,EAAAA,QAAQ,GAAG,KAAX;AACA","sourcesContent":["// @ts-nocheck\n\n/**\n * External dependencies\n */\nimport { forEach } from 'lodash';\n\nconst LIVE_REGION_ARIA_ROLES = new Set( [\n\t'alert',\n\t'status',\n\t'log',\n\t'marquee',\n\t'timer',\n] );\n\nlet hiddenElements = [],\n\tisHidden = false;\n\n/**\n * Hides all elements in the body element from screen-readers except\n * the provided element and elements that should not be hidden from\n * screen-readers.\n *\n * The reason we do this is because `aria-modal=\"true\"` currently is bugged\n * in Safari, and support is spotty in other browsers overall. In the future\n * we should consider removing these helper functions in favor of\n * `aria-modal=\"true\"`.\n *\n * @param {Element} unhiddenElement The element that should not be hidden.\n */\nexport function hideApp( unhiddenElement ) {\n\tif ( isHidden ) {\n\t\treturn;\n\t}\n\tconst elements = document.body.children;\n\tforEach( elements, ( element ) => {\n\t\tif ( element === unhiddenElement ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( elementShouldBeHidden( element ) ) {\n\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\t\t\thiddenElements.push( element );\n\t\t}\n\t} );\n\tisHidden = true;\n}\n\n/**\n * Determines if the passed element should not be hidden from screen readers.\n *\n * @param {HTMLElement} element The element that should be checked.\n *\n * @return {boolean} Whether the element should not be hidden from screen-readers.\n */\nexport function elementShouldBeHidden( element ) {\n\tconst role = element.getAttribute( 'role' );\n\treturn ! (\n\t\telement.tagName === 'SCRIPT' ||\n\t\telement.hasAttribute( 'aria-hidden' ) ||\n\t\telement.hasAttribute( 'aria-live' ) ||\n\t\tLIVE_REGION_ARIA_ROLES.has( role )\n\t);\n}\n\n/**\n * Makes all elements in the body that have been hidden by `hideApp`\n * visible again to screen-readers.\n */\nexport function showApp() {\n\tif ( ! isHidden ) {\n\t\treturn;\n\t}\n\tforEach( hiddenElements, ( element ) => {\n\t\telement.removeAttribute( 'aria-hidden' );\n\t} );\n\thiddenElements = [];\n\tisHidden = false;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/modal/aria-helper.js"],"names":["LIVE_REGION_ARIA_ROLES","Set","hiddenElements","isHidden","hideApp","unhiddenElement","elements","Array","from","document","body","children","forEach","element","elementShouldBeHidden","setAttribute","push","role","getAttribute","tagName","hasAttribute","has","showApp","removeAttribute"],"mappings":"AAAA;AAEA,MAAMA,sBAAsB,GAAG,IA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U,eAAR,CAAyB,aAAzB;AACA,GAFD;AAGArB,EAAAA,cAAc,GAAG,EAAjB;AACAC,EAAAA,QAAQ,GAAG,KAAX;AACA","sourcesContent":["// @ts-nocheck\n\nconst LIVE_REGION_ARIA_ROLES = new Set( [\n\t'alert',\n\t'status',\n\t'log',\n\t'marquee',\n\t'timer',\n] );\n\nlet hiddenElements = [],\n\tisHidden = false;\n\n/**\n * Hides all elements in the body element from screen-readers except\n * the provided element and elements that should not be hidden from\n * screen-readers.\n *\n * The reason we do this is because `aria-modal=\"true\"` currently is bugged\n * in Safari, and support is spotty in other browsers overall. In the future\n * we should consider removing these helper functions in favor of\n * `aria-modal=\"true\"`.\n *\n * @param {Element} unhiddenElement The element that should not be hidden.\n */\nexport function hideApp( unhiddenElement ) {\n\tif ( isHidden ) {\n\t\treturn;\n\t}\n\tconst elements = Array.from( document.body.children );\n\telements.forEach( ( element ) => {\n\t\tif ( element === unhiddenElement ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( elementShouldBeHidden( element ) ) {\n\t\t\telement.setAttribute( 'aria-hidden', 'true' );\n\t\t\thiddenElements.push( element );\n\t\t}\n\t} );\n\tisHidden = true;\n}\n\n/**\n * Determines if the passed element should not be hidden from screen readers.\n *\n * @param {HTMLElement} element The element that should be checked.\n *\n * @return {boolean} Whether the element should not be hidden from screen-readers.\n */\nexport function elementShouldBeHidden( element ) {\n\tconst role = element.getAttribute( 'role' );\n\treturn ! (\n\t\telement.tagName === 'SCRIPT' ||\n\t\telement.hasAttribute( 'aria-hidden' ) ||\n\t\telement.hasAttribute( 'aria-live' ) ||\n\t\tLIVE_REGION_ARIA_ROLES.has( role )\n\t);\n}\n\n/**\n * Makes all elements in the body that have been hidden by `hideApp`\n * visible again to screen-readers.\n */\nexport function showApp() {\n\tif ( ! isHidden ) {\n\t\treturn;\n\t}\n\thiddenElements.forEach( ( element ) => {\n\t\telement.removeAttribute( 'aria-hidden' );\n\t} );\n\thiddenElements = [];\n\tisHidden = false;\n}\n"]}
@@ -112,8 +112,12 @@ class NavigableContainer extends Component {
112
112
  // for highlighting text.
113
113
 
114
114
  const targetRole = event.target.getAttribute('role');
115
+ const targetHasMenuItemRole = MENU_ITEM_ROLES.includes(targetRole); // `preventDefault()` on tab to avoid having the browser move the focus
116
+ // after this component has already moved it.
115
117
 
116
- if (MENU_ITEM_ROLES.includes(targetRole)) {
118
+ const isTab = event.code === 'Tab';
119
+
120
+ if (targetHasMenuItemRole || isTab) {
117
121
  event.preventDefault();
118
122
  }
119
123
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/container.js"],"names":["Component","forwardRef","focus","noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","constructor","arguments","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","onFocus","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","tabbable","focusable","focusables","find","index","directIndex","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","includes","preventDefault","context","ownerDocument","activeElement","nextIndex","length","render","children","restProps","forwardedNavigableContainer","displayName"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,UAApB,QAAsC,oBAAtC;AACA,SAASC,KAAT,QAAsB,gBAAtB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,eAAe,GAAG,CAAE,UAAF,EAAc,eAAd,EAA+B,kBAA/B,CAAxB;;AAEA,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,KAA5B,EAAmCC,MAAnC,EAA4C;AAC3C,QAAMC,SAAS,GAAGH,KAAK,GAAGE,MAA1B;;AACA,MAAKC,SAAS,GAAG,CAAjB,EAAqB;AACpB,WAAOF,KAAK,GAAGE,SAAf;AACA,GAFD,MAEO,IAAKA,SAAS,IAAIF,KAAlB,EAA0B;AAChC,WAAOE,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A2B,CAACC,WAA5B,GAA0C,oBAA1C;AAEA,eAAezD,UAAU,CAAEwD,2BAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value, total, offset ) {\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 {\n\tconstructor() {\n\t\tsuper( ...arguments );\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\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\tthis.container.addEventListener( 'focus', this.onFocus );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t\tthis.container.removeEventListener( 'focus', this.onFocus );\n\t}\n\n\tbindContainer( ref ) {\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 ) {\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container );\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, target ) {\n\t\tconst directIndex = focusables.indexOf( target );\n\t\tif ( directIndex !== -1 ) {\n\t\t\treturn directIndex;\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\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 = event.target.getAttribute( 'role' );\n\t\t\tif ( MENU_ITEM_ROLES.includes( targetRole ) ) {\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 context = getFocusableContext(\n\t\t\tevent.target.ownerDocument.activeElement\n\t\t);\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\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\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 = ( props, ref ) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/container.js"],"names":["Component","forwardRef","focus","noop","MENU_ITEM_ROLES","cycleValue","value","total","offset","nextValue","NavigableContainer","constructor","arguments","onKeyDown","bind","bindContainer","getFocusableContext","getFocusableIndex","componentDidMount","container","addEventListener","onFocus","componentWillUnmount","removeEventListener","ref","forwardedRef","props","current","target","onlyBrowserTabstops","finder","tabbable","focusable","focusables","find","index","directIndex","indexOf","event","cycle","eventToOffset","onNavigate","stopNavigationEvents","undefined","stopImmediatePropagation","targetRole","getAttribute","targetHasMenuItemRole","includes","isTab","code","preventDefault","context","ownerDocument","activeElement","nextIndex","length","render","children","restProps","forwardedNavigableContainer","displayName"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,UAApB,QAAsC,oBAAtC;AACA,SAASC,KAAT,QAAsB,gBAAtB;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AACA,MAAMC,eAAe,GAAG,CAAE,UAAF,EAAc,eAAd,EAA+B,kBAA/B,CAAxB;;AAEA,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,KAA5B,EAAmCC,MAAnC,EAA4C;AAC3C,QAAMC,SAAS,GAAGH,KAAK,GAAGE,MAA1B;;AACA,MA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,WACC;AAAK,MAAA,GAAG,EAAG,KAAKX;AAAhB,OAAqC4C,SAArC,GACGD,QADH,CADD;AAKA;;AAlIyC;;AAqI3C,MAAME,2BAA2B,GAAG,CAAElC,KAAF,EAASF,GAAT,KAAkB;AACrD,SAAO,cAAC,kBAAD,eAAyBE,KAAzB;AAAiC,IAAA,YAAY,EAAGF;AAAhD,KAAP;AACA,CAFD;;AAGAoC,2BAA2B,CAACC,WAA5B,GAA0C,oBAA1C;AAEA,eAAe5D,UAAU,CAAE2D,2BAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { Component, forwardRef } from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\n\nconst noop = () => {};\nconst MENU_ITEM_ROLES = [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ];\n\nfunction cycleValue( value, total, offset ) {\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 {\n\tconstructor() {\n\t\tsuper( ...arguments );\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\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\tthis.container.addEventListener( 'focus', this.onFocus );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.container.removeEventListener( 'keydown', this.onKeyDown );\n\t\tthis.container.removeEventListener( 'focus', this.onFocus );\n\t}\n\n\tbindContainer( ref ) {\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 ) {\n\t\tconst { onlyBrowserTabstops } = this.props;\n\t\tconst finder = onlyBrowserTabstops ? focus.tabbable : focus.focusable;\n\t\tconst focusables = finder.find( this.container );\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, target ) {\n\t\tconst directIndex = focusables.indexOf( target );\n\t\tif ( directIndex !== -1 ) {\n\t\t\treturn directIndex;\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\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 = event.target.getAttribute( 'role' );\n\t\t\tconst targetHasMenuItemRole =\n\t\t\t\tMENU_ITEM_ROLES.includes( targetRole );\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\tconst isTab = event.code === 'Tab';\n\n\t\t\tif ( targetHasMenuItemRole || isTab ) {\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 context = getFocusableContext(\n\t\t\tevent.target.ownerDocument.activeElement\n\t\t);\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\t\tif ( nextIndex >= 0 && nextIndex < focusables.length ) {\n\t\t\tfocusables[ nextIndex ].focus();\n\t\t\tonNavigate( nextIndex, focusables[ nextIndex ] );\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 = ( props, ref ) => {\n\treturn <NavigableContainer { ...props } forwardedRef={ ref } />;\n};\nforwardedNavigableContainer.displayName = 'NavigableContainer';\n\nexport default forwardRef( forwardedNavigableContainer );\n"]}
@@ -6,7 +6,6 @@ import { createElement } from "@wordpress/element";
6
6
  * WordPress dependencies
7
7
  */
8
8
  import { forwardRef } from '@wordpress/element';
9
- import { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';
10
9
  /**
11
10
  * Internal dependencies
12
11
  */
@@ -21,26 +20,26 @@ export function NavigableMenu(_ref, ref) {
21
20
 
22
21
  const eventToOffset = evt => {
23
22
  const {
24
- keyCode
23
+ code
25
24
  } = evt;
26
- let next = [DOWN];
27
- let previous = [UP];
25
+ let next = ['ArrowDown'];
26
+ let previous = ['ArrowUp'];
28
27
 
29
28
  if (orientation === 'horizontal') {
30
- next = [RIGHT];
31
- previous = [LEFT];
29
+ next = ['ArrowRight'];
30
+ previous = ['ArrowLeft'];
32
31
  }
33
32
 
34
33
  if (orientation === 'both') {
35
- next = [RIGHT, DOWN];
36
- previous = [LEFT, UP];
34
+ next = ['ArrowRight', 'ArrowDown'];
35
+ previous = ['ArrowLeft', 'ArrowUp'];
37
36
  }
38
37
 
39
- if (next.includes(keyCode)) {
38
+ if (next.includes(code)) {
40
39
  return 1;
41
- } else if (previous.includes(keyCode)) {
40
+ } else if (previous.includes(code)) {
42
41
  return -1;
43
- } else if ([DOWN, UP, LEFT, RIGHT].includes(keyCode)) {
42
+ } else if (['ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight'].includes(code)) {
44
43
  // Key press should be handled, e.g. have event propagation and
45
44
  // default behavior handled by NavigableContainer but not result
46
45
  // in an offset.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/menu.js"],"names":["forwardRef","UP","DOWN","LEFT","RIGHT","NavigableContainer","NavigableMenu","ref","role","orientation","rest","eventToOffset","evt","keyCode","next","previous","includes"],"mappings":";;AAAA;;AAEA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,QAAsC,qBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,aAA/B;AAEA,OAAO,SAASC,aAAT,OAENC,GAFM,EAGL;AAAA,MAFD;AAAEC,IAAAA,IAAI,GAAG,MAAT;AAAiBC,IAAAA,WAAW,GAAG,UAA/B;AAA2C,OAAGC;AAA9C,GAEC;;AACD,QAAMC,aAAa,GAAKC,GAAF,IAAW;AAChC,UAAM;AAAEC,MAAAA;AAAF,QAAcD,GAApB;AAEA,QAAIE,IAAI,GAAG,CAAEZ,IAAF,CAAX;AACA,QAAIa,QAAQ,GAAG,CAAEd,EAAF,CAAf;;AAEA,QAAKQ,WAAW,KAAK,YAArB,EAAoC;AACnCK,MAAAA,IAAI,GAAG,CAAEV,KAAF,CAAP;AACAW,MAAAA,QAAQ,GAAG,CAAEZ,IAAF,CAAX;AACA;;AAED,QAAKM,WAAW,KAAK,MAArB,EAA8B;AAC7BK,MAAAA,IAAI,GAAG,CAAEV,KAAF,EAASF,IAAT,CAAP;AACAa,MAAAA,QAAQ,GAAG,CAAEZ,IAAF,EAAQF,EAAR,CAAX;AACA;;AAED,QAAKa,IAAI,CAACE,QAAL,CAAeH,OAAf,CAAL,EAAgC;AAC/B,aAAO,CAAP;AACA,KAFD,MAEO,IAAKE,QAAQ,CAACC,QAAT,CAAmBH,OAAnB,CAAL,EAAoC;AAC1C,aAAO,CAAC,CAAR;AACA,KAFM,MAEA,IAAK,CAAEX,IAAF,EAAQD,EAAR,EAAYE,IAAZ,EAAkBC,KAAlB,EAA0BY,QAA1B,CAAoCH,OAApC,CAAL,EAAqD;AAC3D;AACA;AACA;AACA,aAAO,CAAP;AACA;AACD,GA1BD;;AA4BA,SACC,cAAC,kBAAD;AACC,IAAA,GAAG,EAAGN,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,EAAG,KAHvB;AAIC,IAAA,IAAI,EAAGC,IAJR;AAKC,wBAAmBA,IAAI,KAAK,cAAT,GAA0B,IAA1B,GAAiCC,WALrD;AAMC,IAAA,aAAa,EAAGE;AANjB,KAOMD,IAPN,EADD;AAWA;AAED,eAAeV,UAAU,CAAEM,aAAF,CAAzB","sourcesContent":["// @ts-nocheck\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\n\nexport function NavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest },\n\tref\n) {\n\tconst eventToOffset = ( evt ) => {\n\t\tconst { keyCode } = evt;\n\n\t\tlet next = [ DOWN ];\n\t\tlet previous = [ UP ];\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tnext = [ RIGHT ];\n\t\t\tprevious = [ LEFT ];\n\t\t}\n\n\t\tif ( orientation === 'both' ) {\n\t\t\tnext = [ RIGHT, DOWN ];\n\t\t\tprevious = [ LEFT, UP ];\n\t\t}\n\n\t\tif ( next.includes( keyCode ) ) {\n\t\t\treturn 1;\n\t\t} else if ( previous.includes( keyCode ) ) {\n\t\t\treturn -1;\n\t\t} else if ( [ DOWN, UP, LEFT, RIGHT ].includes( keyCode ) ) {\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\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={ role === 'presentation' ? null : orientation }\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NavigableMenu );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/menu.js"],"names":["forwardRef","NavigableContainer","NavigableMenu","ref","role","orientation","rest","eventToOffset","evt","code","next","previous","includes"],"mappings":";;AAAA;;AAEA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,aAA/B;AAEA,OAAO,SAASC,aAAT,OAENC,GAFM,EAGL;AAAA,MAFD;AAAEC,IAAAA,IAAI,GAAG,MAAT;AAAiBC,IAAAA,WAAW,GAAG,UAA/B;AAA2C,OAAGC;AAA9C,GAEC;;AACD,QAAMC,aAAa,GAAKC,GAAF,IAAW;AAChC,UAAM;AAAEC,MAAAA;AAAF,QAAWD,GAAjB;AAEA,QAAIE,IAAI,GAAG,CAAE,WAAF,CAAX;AACA,QAAIC,QAAQ,GAAG,CAAE,SAAF,CAAf;;AAEA,QAAKN,WAAW,KAAK,YAArB,EAAoC;AACnCK,MAAAA,IAAI,GAAG,CAAE,YAAF,CAAP;AACAC,MAAAA,QAAQ,GAAG,CAAE,WAAF,CAAX;AACA;;AAED,QAAKN,WAAW,KAAK,MAArB,EAA8B;AAC7BK,MAAAA,IAAI,GAAG,CAAE,YAAF,EAAgB,WAAhB,CAAP;AACAC,MAAAA,QAAQ,GAAG,CAAE,WAAF,EAAe,SAAf,CAAX;AACA;;AAED,QAAKD,IAAI,CAACE,QAAL,CAAeH,IAAf,CAAL,EAA6B;AAC5B,aAAO,CAAP;AACA,KAFD,MAEO,IAAKE,QAAQ,CAACC,QAAT,CAAmBH,IAAnB,CAAL,EAAiC;AACvC,aAAO,CAAC,CAAR;AACA,KAFM,MAEA,IACN,CAAE,WAAF,EAAe,SAAf,EAA0B,WAA1B,EAAuC,YAAvC,EAAsDG,QAAtD,CACCH,IADD,CADM,EAIL;AACD;AACA;AACA;AACA,aAAO,CAAP;AACA;AACD,GA9BD;;AAgCA,SACC,cAAC,kBAAD;AACC,IAAA,GAAG,EAAGN,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,EAAG,KAHvB;AAIC,IAAA,IAAI,EAAGC,IAJR;AAKC,wBAAmBA,IAAI,KAAK,cAAT,GAA0B,IAA1B,GAAiCC,WALrD;AAMC,IAAA,aAAa,EAAGE;AANjB,KAOMD,IAPN,EADD;AAWA;AAED,eAAeN,UAAU,CAAEE,aAAF,CAAzB","sourcesContent":["// @ts-nocheck\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\n\nexport function NavigableMenu(\n\t{ role = 'menu', orientation = 'vertical', ...rest },\n\tref\n) {\n\tconst eventToOffset = ( evt ) => {\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\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={ role === 'presentation' ? null : orientation }\n\t\t\teventToOffset={ eventToOffset }\n\t\t\t{ ...rest }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( NavigableMenu );\n"]}
@@ -6,7 +6,6 @@ import { createElement } from "@wordpress/element";
6
6
  * WordPress dependencies
7
7
  */
8
8
  import { forwardRef } from '@wordpress/element';
9
- import { TAB } from '@wordpress/keycodes';
10
9
  /**
11
10
  * Internal dependencies
12
11
  */
@@ -20,11 +19,11 @@ export function TabbableContainer(_ref, ref) {
20
19
 
21
20
  const innerEventToOffset = evt => {
22
21
  const {
23
- keyCode,
22
+ code,
24
23
  shiftKey
25
24
  } = evt;
26
25
 
27
- if (TAB === keyCode) {
26
+ if ('Tab' === code) {
28
27
  return shiftKey ? -1 : 1;
29
28
  } // Allow custom handling of keys besides Tab.
30
29
  //
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigable-container/tabbable.js"],"names":["forwardRef","TAB","NavigableContainer","TabbableContainer","ref","eventToOffset","props","innerEventToOffset","evt","keyCode","shiftKey"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AACA,SAASC,GAAT,QAAoB,qBAApB;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,aAA/B;AAEA,OAAO,SAASC,iBAAT,OAAyDC,GAAzD,EAA+D;AAAA,MAAnC;AAAEC,IAAAA,aAAF;AAAiB,OAAGC;AAApB,GAAmC;;AACrE,QAAMC,kBAAkB,GAAKC,GAAF,IAAW;AACrC,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA;AAAX,QAAwBF,GAA9B;;AACA,QAAKP,GAAG,KAAKQ,OAAb,EAAuB;AACtB,aAAOC,QAAQ,GAAG,CAAC,CAAJ,GAAQ,CAAvB;AACA,KAJoC,CAMrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,QAAKL,aAAL,EAAqB;AACpB,aAAOA,aAAa,CAAEG,GAAF,CAApB;AACA;AACD,GApBD;;AAsBA,SACC,cAAC,kBAAD;AACC,IAAA,GAAG,EAAGJ,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,MAHpB;AAIC,IAAA,aAAa,EAAGG;AAJjB,KAKMD,KALN,EADD;AASA;AAED,eAAeN,UAAU,CAAEG,iBAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { TAB } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\n\nexport function TabbableContainer( { eventToOffset, ...props }, ref ) {\n\tconst innerEventToOffset = ( evt ) => {\n\t\tconst { keyCode, shiftKey } = evt;\n\t\tif ( TAB === keyCode ) {\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\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\nexport default forwardRef( TabbableContainer );\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigable-container/tabbable.js"],"names":["forwardRef","NavigableContainer","TabbableContainer","ref","eventToOffset","props","innerEventToOffset","evt","code","shiftKey"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,kBAAP,MAA+B,aAA/B;AAEA,OAAO,SAASC,iBAAT,OAAyDC,GAAzD,EAA+D;AAAA,MAAnC;AAAEC,IAAAA,aAAF;AAAiB,OAAGC;AAApB,GAAmC;;AACrE,QAAMC,kBAAkB,GAAKC,GAAF,IAAW;AACrC,UAAM;AAAEC,MAAAA,IAAF;AAAQC,MAAAA;AAAR,QAAqBF,GAA3B;;AACA,QAAK,UAAUC,IAAf,EAAsB;AACrB,aAAOC,QAAQ,GAAG,CAAC,CAAJ,GAAQ,CAAvB;AACA,KAJoC,CAMrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,QAAKL,aAAL,EAAqB;AACpB,aAAOA,aAAa,CAAEG,GAAF,CAApB;AACA;AACD,GApBD;;AAsBA,SACC,cAAC,kBAAD;AACC,IAAA,GAAG,EAAGJ,GADP;AAEC,IAAA,oBAAoB,MAFrB;AAGC,IAAA,mBAAmB,MAHpB;AAIC,IAAA,aAAa,EAAGG;AAJjB,KAKMD,KALN,EADD;AASA;AAED,eAAeL,UAAU,CAAEE,iBAAF,CAAzB","sourcesContent":["// @ts-nocheck\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport NavigableContainer from './container';\n\nexport function TabbableContainer( { eventToOffset, ...props }, ref ) {\n\tconst innerEventToOffset = ( evt ) => {\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\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\nexport default forwardRef( TabbableContainer );\n"]}
@@ -31,7 +31,7 @@ export function useNavigatorButton(props) {
31
31
  focusTargetSelector: cssSelectorForAttribute(attributeName, escapedPath)
32
32
  });
33
33
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
34
- }, [goTo, onClick]);
34
+ }, [goTo, onClick, attributeName, escapedPath]);
35
35
  return {
36
36
  as,
37
37
  onClick: handleClick,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"names":["useCallback","escapeAttribute","useContextSystem","Button","useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SAASC,eAAT,QAAgC,wBAAhC;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAGA,MAAMC,uBAAuB,GAAG,CAAEC,QAAF,EAAoBC,SAApB,KAC9B,IAAID,QAAU,KAAKC,SAAW,IADhC;;AAGA,OAAO,SAASC,kBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,IADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,EAAE,GAAGT,MAHA;AAILU,IAAAA,aAAa,GAAG,IAJX;AAKL,OAAGC;AALE,MAMFZ,gBAAgB,CAAEO,KAAF,EAAS,iBAAT,CANpB;AAQA,QAAMM,WAAW,GAAGd,eAAe,CAAES,IAAF,CAAnC;AAEA,QAAM;AAAEM,IAAAA;AAAF,MAAWZ,YAAY,EAA7B;AACA,QAAMa,WAAyD,GAC9DjB,WAAW,CACRkB,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;AACAH,IAAAA,IAAI,CAAED,WAAF,EAAe;AAClBK,MAAAA,mBAAmB,EAAEf,uBAAuB,CAC3CQ,aAD2C,EAE3CE,WAF2C;AAD1B,KAAf,CAAJ;AAMAJ,IAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAIO,CAAJ,CAAP;AACA,GAVS,EAWV,CAAEF,IAAF,EAAQL,OAAR,CAXU,CADZ;AAeA,SAAO;AACNC,IAAAA,EADM;AAEND,IAAAA,OAAO,EAAEM,WAFH;AAGN,OAAGH,UAHG;AAIN,KAAED,aAAF,GAAmBE;AAJb,GAAP;AAMA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"names":["useCallback","escapeAttribute","useContextSystem","Button","useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,oBAA5B;AACA,SAASC,eAAT,QAAgC,wBAAhC;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAGA,MAAMC,uBAAuB,GAAG,CAAEC,QAAF,EAAoBC,SAApB,KAC9B,IAAID,QAAU,KAAKC,SAAW,IADhC;;AAGA,OAAO,SAASC,kBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,IADK;AAELC,IAAAA,OAFK;AAGLC,IAAAA,EAAE,GAAGT,MAHA;AAILU,IAAAA,aAAa,GAAG,IAJX;AAKL,OAAGC;AALE,MAMFZ,gBAAgB,CAAEO,KAAF,EAAS,iBAAT,CANpB;AAQA,QAAMM,WAAW,GAAGd,eAAe,CAAES,IAAF,CAAnC;AAEA,QAAM;AAAEM,IAAAA;AAAF,MAAWZ,YAAY,EAA7B;AACA,QAAMa,WAAyD,GAC9DjB,WAAW,CACRkB,CAAF,IAAS;AACRA,IAAAA,CAAC,CAACC,cAAF;AACAH,IAAAA,IAAI,CAAED,WAAF,EAAe;AAClBK,MAAAA,mBAAmB,EAAEf,uBAAuB,CAC3CQ,aAD2C,EAE3CE,WAF2C;AAD1B,KAAf,CAAJ;AAMAJ,IAAAA,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAIO,CAAJ,CAAP;AACA,GAVS,EAWV,CAAEF,IAAF,EAAQL,OAAR,EAAiBE,aAAjB,EAAgCE,WAAhC,CAXU,CADZ;AAeA,SAAO;AACNH,IAAAA,EADM;AAEND,IAAAA,OAAO,EAAEM,WAFH;AAGN,OAAGH,UAHG;AAIN,KAAED,aAAF,GAAmBE;AAJb,GAAP;AAMA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"]}
@@ -38,7 +38,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
38
38
  } : {
39
39
  name: "1ulogbc-classes",
40
40
  styles: "overflow-x:auto;max-height:100%;label:classes;",
41
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvbmF2aWdhdG9yL25hdmlnYXRvci1zY3JlZW4vY29tcG9uZW50LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErREkiLCJmaWxlIjoiQHdvcmRwcmVzcy9jb21wb25lbnRzL3NyYy9uYXZpZ2F0b3IvbmF2aWdhdG9yLXNjcmVlbi9jb21wb25lbnQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHR5cGUgeyBGb3J3YXJkZWRSZWYgfSBmcm9tICdyZWFjdCc7XG4vLy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YXZpZ2F0b3JTY3JlZW4sXG5cdCdOYXZpZ2F0b3JTY3JlZW4nXG4pO1xuXG5leHBvcnQgZGVmYXVsdCBDb25uZWN0ZWROYXZpZ2F0b3JTY3JlZW47XG4iXX0= */",
42
42
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
43
  };
44
44
 
@@ -84,7 +84,7 @@ function NavigatorScreen(props, forwardedRef) {
84
84
  }
85
85
 
86
86
  elementToFocus.focus();
87
- }, [isInitialLocation, isMatch]);
87
+ }, [isInitialLocation, isMatch, location.isBack, previousLocation === null || previousLocation === void 0 ? void 0 : previousLocation.focusTargetSelector]);
88
88
  const mergedWrapperRef = useMergeRefs([forwardedRef, wrapperRef]);
89
89
 
90
90
  if (!isMatch) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["motion","css","focus","useContext","useEffect","useMemo","useRef","useReducedMotion","useMergeRefs","usePrevious","isRTL","escapeAttribute","contextConnect","useContextSystem","useCx","View","NavigatorContext","animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;AAAA;AACA;AACA;AAEA;AACA,SAASA,MAAT,QAAoC,eAApC;AACA,SAASC,GAAT,QAAoB,gBAApB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,OAAhC,EAAyCC,MAAzC,QAAuD,oBAAvD;AACA,SACCC,gBADD,EAECC,YAFD,EAGCC,WAHD,QAIO,oBAJP;AAKA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,eAAT,QAAgC,wB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C,EACE1C,KAAK,MAAMmB,QAAQ,CAACQ,MAAtB,IAAoC,CAAE3B,KAAK,EAAP,IAAa,CAAEmB,QAAQ,CAACQ,MAA5D,GACG,EADH,GAEG,CAAC;AALU,GAAhB;AAOA,QAAMiB,IAAI,GAAG;AACZL,IAAAA,KAAK,EAAE7B,kBADK;AAEZ2B,IAAAA,OAAO,EAAE,CAFG;AAGZK,IAAAA,CAAC,EACE,CAAE1C,KAAK,EAAP,IAAamB,QAAQ,CAACQ,MAAxB,IAAsC3B,KAAK,MAAM,CAAEmB,QAAQ,CAACQ,MAA5D,GACG,EADH,GAEG,CAAC,EANO;AAOZW,IAAAA,UAAU,EAAE;AACXE,MAAAA,QAAQ,EAAE/B,qBADC;AAEXgC,MAAAA,IAAI,EAAE;AAFK;AAPA,GAAb;AAaA,QAAMI,aAAa,GAAG;AACrBT,IAAAA,OADqB;AAErBQ,IAAAA,IAFqB;AAGrBD,IAAAA;AAHqB,GAAtB;AAMA,SACC,cAAC,MAAD,CAAQ,GAAR;AACC,IAAA,GAAG,EAAGR,gBADP;AAEC,IAAA,SAAS,EAAGX;AAFb,KAGMP,UAHN,EAIM4B,aAJN,GAMG/B,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMgC,wBAAwB,GAAG5C,cAAc,CAC9CS,eAD8C,EAE9C,iBAF8C,CAA/C;AAKA,eAAemC,wBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === escapeAttribute( path );\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [ isInitialLocation, isMatch ] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/navigator/navigator-screen/component.tsx"],"names":["motion","css","focus","useContext","useEffect","useMemo","useRef","useReducedMotion","useMergeRefs","usePrevious","isRTL","escapeAttribute","contextConnect","useContextSystem","useCx","View","NavigatorContext","animationEnterDelay","animationEnterDuration","animationExitDuration","animationExitDelay","NavigatorScreen","props","forwardedRef","children","className","path","otherProps","prefersReducedMotion","location","isMatch","wrapperRef","previousLocation","cx","classes","isInitialLocation","isInitial","isBack","current","elementToFocus","focusTargetSelector","querySelector","firstTabbable","tabbable","find","mergedWrapperRef","animate","opacity","transition","delay","duration","ease","x","initial","exit","animatedProps","ConnectedNavigatorScreen"],"mappings":";;;;;AAAA;AACA;AACA;AAEA;AACA,SAASA,MAAT,QAAoC,eAApC;AACA,SAASC,GAAT,QAAoB,gBAApB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,OAAhC,EAAyCC,MAAzC,QAAuD,oBAAvD;AACA,SACCC,gBADD,EAECC,YAFD,EAGCC,WAHD,QAIO,oBAJP;AAKA,SAASC,KAAT,QAAsB,iBAAtB;AACA,SAASC,eAAT,QAAgC,wBAAhC;AAEA;AACA;AACA;;AACA,SACCC,cADD,EAECC,gBAFD,QAIO,kBAJP;AAKA,SAASC,KAAT,QAAsB,0BAAtB;AACA,SAASC,IAAT,QAAqB,YAArB;AACA,SAASC,gBAAT,QAAiC,YAAjC;AAGA,MAAMC,mBAAmB,GAAG,CAA5B;AACA,MAAMC,sBAAsB,GAAG,IAA/B;AACA,MAAMC,qBAAqB,GAAG,IAA9B;AACA,MAAMC,kBAAkB,GAAG,CAA3B,C,CAEA;AACA;;;;;;;;;;;;AAMA,SAASC,eAAT,CAA0BC,KAA1B,EAAwCC,YAAxC,EAA4E;AAC3E,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA,IAAvB;AAA6B,OAAGC;AAAhC,MAA+Cd,gBAAgB,CACpES,KADoE,EAEpE,iBAFoE,CAArE;AAKA,QAAMM,oBAAoB,GAAGrB,gBAAgB,EAA7C;AACA,QAAM;AAAEsB,IAAAA;AAAF,MAAe1B,UAAU,CAAEa,gBAAF,CAA/B;AACA,QAAMc,OAAO,GAAGD,QAAQ,CAACH,IAAT,KAAkBf,eAAe,CAAEe,IAAF,CAAjD;AACA,QAAM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,EAAGR,gBADP;AAEC,IAAA,SAAS,EAAGX;AAFb,KAGMP,UAHN,EAIM4B,aAJN,GAMG/B,QANH,CADD;AAUA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMgC,wBAAwB,GAAG5C,cAAc,CAC9CS,eAD8C,EAE9C,iBAF8C,CAA/C;AAKA,eAAemC,wBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n// eslint-disable-next-line no-restricted-imports\nimport { motion, MotionProps } from 'framer-motion';\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { useContext, useEffect, useMemo, useRef } from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseMergeRefs,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcontextConnect,\n\tuseContextSystem,\n\tWordPressComponentProps,\n} from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport type { NavigatorScreenProps } from '../types';\n\nconst animationEnterDelay = 0;\nconst animationEnterDuration = 0.14;\nconst animationExitDuration = 0.14;\nconst animationExitDelay = 0;\n\n// Props specific to `framer-motion` can't be currently passed to `NavigatorScreen`,\n// as some of them would overlap with HTML props (e.g. `onAnimationStart`, ...)\ntype Props = Omit<\n\tWordPressComponentProps< NavigatorScreenProps, 'div', false >,\n\tkeyof MotionProps\n>;\n\nfunction NavigatorScreen( props: Props, forwardedRef: ForwardedRef< any > ) {\n\tconst { children, className, path, ...otherProps } = useContextSystem(\n\t\tprops,\n\t\t'NavigatorScreen'\n\t);\n\n\tconst prefersReducedMotion = useReducedMotion();\n\tconst { location } = useContext( NavigatorContext );\n\tconst isMatch = location.path === escapeAttribute( path );\n\tconst wrapperRef = useRef< HTMLDivElement >( null );\n\n\tconst previousLocation = usePrevious( location );\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() =>\n\t\t\tcx(\n\t\t\t\tcss( {\n\t\t\t\t\t// Ensures horizontal overflow is visually accessible.\n\t\t\t\t\toverflowX: 'auto',\n\t\t\t\t\t// In case the root has a height, it should not be exceeded.\n\t\t\t\t\tmaxHeight: '100%',\n\t\t\t\t} ),\n\t\t\t\tclassName\n\t\t\t),\n\t\t[ className, cx ]\n\t);\n\n\t// Focus restoration\n\tconst isInitialLocation = location.isInitial && ! location.isBack;\n\tuseEffect( () => {\n\t\t// Only attempt to restore focus:\n\t\t// - if the current location is not the initial one (to avoid moving focus on page load)\n\t\t// - when the screen becomes visible\n\t\t// - if the wrapper ref has been assigned\n\t\tif ( isInitialLocation || ! isMatch || ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet elementToFocus: HTMLElement | null = null;\n\n\t\t// When navigating back, if a selector is provided, use it to look for the\n\t\t// target element (assumed to be a node inside the current NavigatorScreen)\n\t\tif ( location.isBack && previousLocation?.focusTargetSelector ) {\n\t\t\telementToFocus = wrapperRef.current.querySelector(\n\t\t\t\tpreviousLocation.focusTargetSelector\n\t\t\t);\n\t\t}\n\n\t\t// If the previous query didn't run or find any element to focus, fallback\n\t\t// to the first tabbable element in the screen (or the screen itself).\n\t\tif ( ! elementToFocus ) {\n\t\t\tconst firstTabbable = (\n\t\t\t\tfocus.tabbable.find( wrapperRef.current ) as HTMLElement[]\n\t\t\t )[ 0 ];\n\n\t\t\telementToFocus = firstTabbable ?? wrapperRef.current;\n\t\t}\n\n\t\telementToFocus.focus();\n\t}, [\n\t\tisInitialLocation,\n\t\tisMatch,\n\t\tlocation.isBack,\n\t\tpreviousLocation?.focusTargetSelector,\n\t] );\n\n\tconst mergedWrapperRef = useMergeRefs( [ forwardedRef, wrapperRef ] );\n\n\tif ( ! isMatch ) {\n\t\treturn null;\n\t}\n\n\tif ( prefersReducedMotion ) {\n\t\treturn (\n\t\t\t<View\n\t\t\t\tref={ mergedWrapperRef }\n\t\t\t\tclassName={ classes }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</View>\n\t\t);\n\t}\n\n\tconst animate = {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tdelay: animationEnterDelay,\n\t\t\tduration: animationEnterDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t\tx: 0,\n\t};\n\tconst initial = {\n\t\topacity: 0,\n\t\tx:\n\t\t\t( isRTL() && location.isBack ) || ( ! isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t};\n\tconst exit = {\n\t\tdelay: animationExitDelay,\n\t\topacity: 0,\n\t\tx:\n\t\t\t( ! isRTL() && location.isBack ) || ( isRTL() && ! location.isBack )\n\t\t\t\t? 50\n\t\t\t\t: -50,\n\t\ttransition: {\n\t\t\tduration: animationExitDuration,\n\t\t\tease: 'easeInOut',\n\t\t},\n\t};\n\n\tconst animatedProps = {\n\t\tanimate,\n\t\texit,\n\t\tinitial,\n\t};\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ mergedWrapperRef }\n\t\t\tclassName={ classes }\n\t\t\t{ ...otherProps }\n\t\t\t{ ...animatedProps }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n}\n\n/**\n * The `NavigatorScreen` component represents a single view/screen/panel and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorButton` and the `NavigatorBackButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nconst ConnectedNavigatorScreen = contextConnect(\n\tNavigatorScreen,\n\t'NavigatorScreen'\n);\n\nexport default ConnectedNavigatorScreen;\n"]}
@@ -1,15 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * External dependencies
7
6
  */
8
7
  import classNames from 'classnames';
8
+
9
9
  /**
10
10
  * WordPress dependencies
11
11
  */
12
-
13
12
  import { forwardRef } from '@wordpress/element';
14
13
  import { isRTL } from '@wordpress/i18n';
15
14
  /**
@@ -19,8 +18,9 @@ import { isRTL } from '@wordpress/i18n';
19
18
  import { Input } from './styles/number-control-styles';
20
19
  import * as inputControlActionTypes from '../input-control/reducer/actions';
21
20
  import { add, subtract, roundClamp } from '../utils/math';
22
- import { isValueEmpty } from '../utils/values';
23
- export function NumberControl(_ref, ref) {
21
+ import { ensureNumber, isValueEmpty } from '../utils/values';
22
+
23
+ function UnforwardedNumberControl(_ref, ref) {
24
24
  let {
25
25
  __unstableStateReducer: stateReducerProp,
26
26
  className,
@@ -39,24 +39,22 @@ export function NumberControl(_ref, ref) {
39
39
  ...props
40
40
  } = _ref;
41
41
  const isStepAny = step === 'any';
42
- const baseStep = isStepAny ? 1 : parseFloat(step);
42
+ const baseStep = isStepAny ? 1 : ensureNumber(step);
43
43
  const baseValue = roundClamp(0, min, max, baseStep);
44
44
 
45
45
  const constrainValue = (value, stepOverride) => {
46
46
  // When step is "any" clamp the value, otherwise round and clamp it.
47
- return isStepAny ? Math.min(max, Math.max(min, value)) : roundClamp(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
47
+ return isStepAny ? Math.min(max, Math.max(min, ensureNumber(value))) : roundClamp(value, min, max, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
48
48
  };
49
49
 
50
- const autoComplete = typeProp === 'number' ? 'off' : null;
50
+ const autoComplete = typeProp === 'number' ? 'off' : undefined;
51
51
  const classes = classNames('components-number-control', className);
52
52
  /**
53
53
  * "Middleware" function that intercepts updates from InputControl.
54
54
  * This allows us to tap into actions to transform the (next) state for
55
55
  * InputControl.
56
56
  *
57
- * @param {Object} state State from InputControl
58
- * @param {Object} action Action triggering state change
59
- * @return {Object} The updated state to apply to InputControl
57
+ * @return The updated state to apply to InputControl
60
58
  */
61
59
 
62
60
  const numberControlStateReducer = (state, action) => {
@@ -66,15 +64,15 @@ export function NumberControl(_ref, ref) {
66
64
  type,
67
65
  payload
68
66
  } = action;
69
- const event = payload === null || payload === void 0 ? void 0 : payload.event;
67
+ const event = payload.event;
70
68
  const currentValue = nextState.value;
71
69
  /**
72
70
  * Handles custom UP and DOWN Keyboard events
73
71
  */
74
72
 
75
73
  if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {
76
- const enableShift = event.shiftKey && isShiftStepEnabled;
77
- const incrementalValue = enableShift ? parseFloat(shiftStep) * baseStep : baseStep;
74
+ const enableShift = (event === null || event === void 0 ? void 0 : event.shiftKey) && isShiftStepEnabled;
75
+ const incrementalValue = enableShift ? ensureNumber(shiftStep) * baseStep : baseStep;
78
76
  let nextValue = isValueEmpty(currentValue) ? baseValue : currentValue;
79
77
 
80
78
  if (event !== null && event !== void 0 && event.preventDefault) {
@@ -87,9 +85,10 @@ export function NumberControl(_ref, ref) {
87
85
 
88
86
  if (type === inputControlActionTypes.PRESS_DOWN) {
89
87
  nextValue = subtract(nextValue, incrementalValue);
90
- }
88
+ } // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
89
+
91
90
 
92
- nextState.value = constrainValue(nextValue, enableShift ? incrementalValue : null);
91
+ nextState.value = constrainValue(nextValue, enableShift ? incrementalValue : undefined);
93
92
  }
94
93
  /**
95
94
  * Handles drag to update events
@@ -97,9 +96,11 @@ export function NumberControl(_ref, ref) {
97
96
 
98
97
 
99
98
  if (type === inputControlActionTypes.DRAG && isDragEnabled) {
100
- const [x, y] = payload.delta;
99
+ // @ts-expect-error TODO: See if reducer actions can be typed better
100
+ const [x, y] = payload.delta; // @ts-expect-error TODO: See if reducer actions can be typed better
101
+
101
102
  const enableShift = payload.shiftKey && isShiftStepEnabled;
102
- const modifier = enableShift ? parseFloat(shiftStep) * baseStep : baseStep;
103
+ const modifier = enableShift ? ensureNumber(shiftStep) * baseStep : baseStep;
103
104
  let directionModifier;
104
105
  let delta;
105
106
 
@@ -127,8 +128,10 @@ export function NumberControl(_ref, ref) {
127
128
 
128
129
  if (delta !== 0) {
129
130
  delta = Math.ceil(Math.abs(delta)) * Math.sign(delta);
130
- const distance = delta * modifier * directionModifier;
131
- nextState.value = constrainValue(add(currentValue, distance), enableShift ? modifier : null);
131
+ const distance = delta * modifier * directionModifier; // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
132
+
133
+ nextState.value = constrainValue( // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
134
+ add(currentValue, distance), enableShift ? modifier : undefined);
132
135
  }
133
136
  }
134
137
  /**
@@ -137,8 +140,10 @@ export function NumberControl(_ref, ref) {
137
140
 
138
141
 
139
142
  if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) {
140
- const applyEmptyValue = required === false && currentValue === '';
141
- nextState.value = applyEmptyValue ? currentValue : constrainValue(currentValue);
143
+ const applyEmptyValue = required === false && currentValue === ''; // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
144
+
145
+ nextState.value = applyEmptyValue ? currentValue : // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined
146
+ constrainValue(currentValue);
142
147
  }
143
148
 
144
149
  return nextState;
@@ -158,7 +163,8 @@ export function NumberControl(_ref, ref) {
158
163
  ref: ref,
159
164
  required: required,
160
165
  step: step,
161
- type: typeProp,
166
+ type: typeProp // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components
167
+ ,
162
168
  value: valueProp,
163
169
  __unstableStateReducer: (state, action) => {
164
170
  var _stateReducerProp;
@@ -168,5 +174,7 @@ export function NumberControl(_ref, ref) {
168
174
  }
169
175
  }));
170
176
  }
171
- export default forwardRef(NumberControl);
177
+
178
+ export const NumberControl = forwardRef(UnforwardedNumberControl);
179
+ export default NumberControl;
172
180
  //# sourceMappingURL=index.js.map