@wordpress/components 19.15.0 → 20.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 (1313) hide show
  1. package/CHANGELOG.md +161 -0
  2. package/CONTRIBUTING.md +10 -10
  3. package/build/alignment-matrix-control/index.js +1 -1
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  6. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  7. package/build/angle-picker-control/index.js +5 -2
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/angle-picker-control/styles/angle-picker-control-styles.js +14 -4
  10. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  11. package/build/autocomplete/index.js +9 -11
  12. package/build/autocomplete/index.js.map +1 -1
  13. package/build/base-control/index.js +6 -3
  14. package/build/base-control/index.js.map +1 -1
  15. package/build/base-control/styles/base-control-styles.js +8 -8
  16. package/build/base-control/styles/base-control-styles.js.map +1 -1
  17. package/build/base-field/styles.js +5 -5
  18. package/build/base-field/styles.js.map +1 -1
  19. package/build/border-control/border-control/component.js +38 -25
  20. package/build/border-control/border-control/component.js.map +1 -1
  21. package/build/border-control/border-control/hook.js +4 -7
  22. package/build/border-control/border-control/hook.js.map +1 -1
  23. package/build/border-control/border-control-dropdown/component.js +13 -7
  24. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  25. package/build/border-control/border-control-dropdown/hook.js +0 -4
  26. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  27. package/build/border-control/styles.js +29 -60
  28. package/build/border-control/styles.js.map +1 -1
  29. package/build/box-control/all-input-control.js +2 -27
  30. package/build/box-control/all-input-control.js.map +1 -1
  31. package/build/box-control/axial-input-controls.js +1 -1
  32. package/build/box-control/axial-input-controls.js.map +1 -1
  33. package/build/box-control/index.js +10 -5
  34. package/build/box-control/index.js.map +1 -1
  35. package/build/box-control/styles/box-control-styles.js +17 -9
  36. package/build/box-control/styles/box-control-styles.js.map +1 -1
  37. package/build/box-control/styles/box-control-visualizer-styles.js +8 -8
  38. package/build/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  39. package/build/box-control/utils.js +37 -8
  40. package/build/box-control/utils.js.map +1 -1
  41. package/build/card/card/component.js +6 -11
  42. package/build/card/card/component.js.map +1 -1
  43. package/build/card/card/hook.js +0 -10
  44. package/build/card/card/hook.js.map +1 -1
  45. package/build/card/card/index.js.map +1 -1
  46. package/build/card/card-body/component.js +7 -8
  47. package/build/card/card-body/component.js.map +1 -1
  48. package/build/card/card-body/hook.js +0 -4
  49. package/build/card/card-body/hook.js.map +1 -1
  50. package/build/card/card-body/index.js.map +1 -1
  51. package/build/card/card-divider/component.js +7 -8
  52. package/build/card/card-divider/component.js.map +1 -1
  53. package/build/card/card-divider/hook.js +0 -4
  54. package/build/card/card-divider/hook.js.map +1 -1
  55. package/build/card/card-divider/index.js.map +1 -1
  56. package/build/card/card-footer/component.js +7 -8
  57. package/build/card/card-footer/component.js.map +1 -1
  58. package/build/card/card-footer/hook.js +0 -4
  59. package/build/card/card-footer/hook.js.map +1 -1
  60. package/build/card/card-footer/index.js.map +1 -1
  61. package/build/card/card-header/component.js +7 -8
  62. package/build/card/card-header/component.js.map +1 -1
  63. package/build/card/card-header/hook.js +0 -4
  64. package/build/card/card-header/hook.js.map +1 -1
  65. package/build/card/card-header/index.js.map +1 -1
  66. package/build/card/card-media/component.js +7 -7
  67. package/build/card/card-media/component.js.map +1 -1
  68. package/build/card/card-media/hook.js +0 -4
  69. package/build/card/card-media/hook.js.map +1 -1
  70. package/build/card/card-media/index.js.map +1 -1
  71. package/build/card/context.js.map +1 -1
  72. package/build/card/index.js.map +1 -1
  73. package/build/card/styles.js +17 -17
  74. package/build/card/styles.js.map +1 -1
  75. package/build/color-list-picker/index.js +16 -5
  76. package/build/color-list-picker/index.js.map +1 -1
  77. package/build/color-palette/index.js +36 -14
  78. package/build/color-palette/index.js.map +1 -1
  79. package/build/color-palette/index.native.js +3 -3
  80. package/build/color-palette/index.native.js.map +1 -1
  81. package/build/color-picker/hex-input.js +2 -1
  82. package/build/color-picker/hex-input.js.map +1 -1
  83. package/build/color-picker/input-with-slider.js +3 -2
  84. package/build/color-picker/input-with-slider.js.map +1 -1
  85. package/build/color-picker/styles.js +10 -15
  86. package/build/color-picker/styles.js.map +1 -1
  87. package/build/combobox-control/index.js +26 -17
  88. package/build/combobox-control/index.js.map +1 -1
  89. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  90. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  91. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  92. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  93. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  94. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  95. package/build/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  96. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  97. package/build/custom-gradient-picker/index.js +19 -4
  98. package/build/custom-gradient-picker/index.js.map +1 -1
  99. package/build/custom-select-control/index.js +43 -13
  100. package/build/custom-select-control/index.js.map +1 -1
  101. package/build/custom-select-control/styles.js +34 -0
  102. package/build/custom-select-control/styles.js.map +1 -0
  103. package/build/date-time/constants.js +9 -0
  104. package/build/date-time/constants.js.map +1 -0
  105. package/build/date-time/date/index.js +175 -186
  106. package/build/date-time/date/index.js.map +1 -1
  107. package/build/date-time/date/styles.js +59 -40
  108. package/build/date-time/date/styles.js.map +1 -1
  109. package/build/date-time/date-time/index.js +5 -2
  110. package/build/date-time/date-time/index.js.map +1 -1
  111. package/build/date-time/time/index.js +28 -19
  112. package/build/date-time/time/index.js.map +1 -1
  113. package/build/date-time/time/styles.js +17 -24
  114. package/build/date-time/time/styles.js.map +1 -1
  115. package/build/date-time/utils.js +27 -0
  116. package/build/date-time/utils.js.map +1 -0
  117. package/build/dimension-control/index.js +2 -6
  118. package/build/dimension-control/index.js.map +1 -1
  119. package/build/disabled/index.js +28 -11
  120. package/build/disabled/index.js.map +1 -1
  121. package/build/disabled/styles/disabled-styles.js +3 -3
  122. package/build/disabled/styles/disabled-styles.js.map +1 -1
  123. package/build/disabled/types.js +6 -0
  124. package/build/disabled/types.js.map +1 -0
  125. package/build/divider/component.js +0 -1
  126. package/build/divider/component.js.map +1 -1
  127. package/build/divider/index.js.map +1 -1
  128. package/build/divider/styles.js +5 -5
  129. package/build/divider/styles.js.map +1 -1
  130. package/build/drop-zone/index.js +2 -4
  131. package/build/drop-zone/index.js.map +1 -1
  132. package/build/dropdown/dropdown-content-wrapper.js +60 -0
  133. package/build/dropdown/dropdown-content-wrapper.js.map +1 -0
  134. package/build/dropdown/index.js +5 -6
  135. package/build/dropdown/index.js.map +1 -1
  136. package/build/dropdown/styles.js +42 -0
  137. package/build/dropdown/styles.js.map +1 -0
  138. package/build/dropdown/types.js +6 -0
  139. package/build/dropdown/types.js.map +1 -0
  140. package/build/duotone-picker/custom-duotone-bar.js +2 -2
  141. package/build/duotone-picker/custom-duotone-bar.js.map +1 -1
  142. package/build/duotone-picker/duotone-picker.js +9 -1
  143. package/build/duotone-picker/duotone-picker.js.map +1 -1
  144. package/build/duotone-picker/duotone-swatch.js +13 -3
  145. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  146. package/build/elevation/component.js +15 -15
  147. package/build/elevation/component.js.map +1 -1
  148. package/build/elevation/hook.js +5 -17
  149. package/build/elevation/hook.js.map +1 -1
  150. package/build/elevation/index.js.map +1 -1
  151. package/build/elevation/styles.js +1 -1
  152. package/build/elevation/styles.js.map +1 -1
  153. package/build/external-link/index.js +6 -0
  154. package/build/external-link/index.js.map +1 -1
  155. package/build/flex/flex/component.js +20 -26
  156. package/build/flex/flex/component.js.map +1 -1
  157. package/build/flex/flex/hook.js +6 -16
  158. package/build/flex/flex/hook.js.map +1 -1
  159. package/build/flex/flex/index.js.map +1 -1
  160. package/build/flex/flex-block/component.js +18 -12
  161. package/build/flex/flex-block/component.js.map +1 -1
  162. package/build/flex/flex-block/hook.js +0 -4
  163. package/build/flex/flex-block/hook.js.map +1 -1
  164. package/build/flex/flex-block/index.js.map +1 -1
  165. package/build/flex/flex-item/component.js +18 -12
  166. package/build/flex/flex-item/component.js.map +1 -1
  167. package/build/flex/flex-item/hook.js +1 -5
  168. package/build/flex/flex-item/hook.js.map +1 -1
  169. package/build/flex/flex-item/index.js.map +1 -1
  170. package/build/flex/index.js.map +1 -1
  171. package/build/flex/styles.js +5 -5
  172. package/build/flex/styles.js.map +1 -1
  173. package/build/focal-point-picker/index.js +4 -6
  174. package/build/focal-point-picker/index.js.map +1 -1
  175. package/build/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  176. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  177. package/build/focal-point-picker/styles/focal-point-style.js +5 -5
  178. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  179. package/build/font-size-picker/index.js +56 -18
  180. package/build/font-size-picker/index.js.map +1 -1
  181. package/build/font-size-picker/utils.js +32 -22
  182. package/build/font-size-picker/utils.js.map +1 -1
  183. package/build/form-token-field/index.js +35 -22
  184. package/build/form-token-field/index.js.map +1 -1
  185. package/build/form-token-field/suggestions-list.js +19 -6
  186. package/build/form-token-field/suggestions-list.js.map +1 -1
  187. package/build/gradient-picker/index.js +15 -3
  188. package/build/gradient-picker/index.js.map +1 -1
  189. package/build/guide/index.js +5 -3
  190. package/build/guide/index.js.map +1 -1
  191. package/build/guide/page-control.js +3 -7
  192. package/build/guide/page-control.js.map +1 -1
  193. package/build/index.js +31 -1
  194. package/build/index.js.map +1 -1
  195. package/build/input-control/index.js +7 -0
  196. package/build/input-control/index.js.map +1 -1
  197. package/build/input-control/input-base.js +24 -3
  198. package/build/input-control/input-base.js.map +1 -1
  199. package/build/input-control/input-prefix-wrapper.js +54 -0
  200. package/build/input-control/input-prefix-wrapper.js.map +1 -0
  201. package/build/input-control/input-suffix-wrapper.js +54 -0
  202. package/build/input-control/input-suffix-wrapper.js.map +1 -0
  203. package/build/input-control/reducer/actions.js +3 -1
  204. package/build/input-control/reducer/actions.js.map +1 -1
  205. package/build/input-control/reducer/reducer.js +28 -11
  206. package/build/input-control/reducer/reducer.js.map +1 -1
  207. package/build/input-control/reducer/state.js.map +1 -1
  208. package/build/input-control/styles/input-control-styles.js +61 -42
  209. package/build/input-control/styles/input-control-styles.js.map +1 -1
  210. package/build/item-group/styles.js +10 -10
  211. package/build/item-group/styles.js.map +1 -1
  212. package/build/mobile/bottom-sheet/index.native.js +3 -6
  213. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  214. package/build/mobile/global-styles-context/utils.native.js +26 -4
  215. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  216. package/build/mobile/image/index.native.js +9 -5
  217. package/build/mobile/image/index.native.js.map +1 -1
  218. package/build/mobile/link-picker/link-picker-screen.native.js +10 -4
  219. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  220. package/build/mobile/media-edit/index.native.js +1 -7
  221. package/build/mobile/media-edit/index.native.js.map +1 -1
  222. package/build/mobile/picker/index.android.js +3 -3
  223. package/build/mobile/picker/index.android.js.map +1 -1
  224. package/build/mobile/picker/index.ios.js +16 -3
  225. package/build/mobile/picker/index.ios.js.map +1 -1
  226. package/build/modal/index.js +1 -3
  227. package/build/modal/index.js.map +1 -1
  228. package/build/navigable-container/container.js +9 -8
  229. package/build/navigable-container/container.js.map +1 -1
  230. package/build/navigable-container/menu.js +3 -9
  231. package/build/navigable-container/menu.js.map +1 -1
  232. package/build/navigator/navigator-back-button/hook.js +0 -4
  233. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  234. package/build/navigator/navigator-button/hook.js +0 -4
  235. package/build/navigator/navigator-button/hook.js.map +1 -1
  236. package/build/notice/list.js +10 -6
  237. package/build/notice/list.js.map +1 -1
  238. package/build/palette-edit/index.js +1 -0
  239. package/build/palette-edit/index.js.map +1 -1
  240. package/build/palette-edit/styles.js +10 -10
  241. package/build/palette-edit/styles.js.map +1 -1
  242. package/build/placeholder/index.js +11 -14
  243. package/build/placeholder/index.js.map +1 -1
  244. package/build/placeholder/types.js +6 -0
  245. package/build/placeholder/types.js.map +1 -0
  246. package/build/popover/index.js +202 -145
  247. package/build/popover/index.js.map +1 -1
  248. package/build/popover/utils.js +178 -0
  249. package/build/popover/utils.js.map +1 -0
  250. package/build/radio-control/index.js +1 -3
  251. package/build/radio-control/index.js.map +1 -1
  252. package/build/range-control/index.js +3 -0
  253. package/build/range-control/index.js.map +1 -1
  254. package/build/range-control/styles/range-control-styles.js +51 -45
  255. package/build/range-control/styles/range-control-styles.js.map +1 -1
  256. package/build/range-control/utils.js +1 -1
  257. package/build/range-control/utils.js.map +1 -1
  258. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  259. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  260. package/build/sandbox/index.native.js +13 -2
  261. package/build/sandbox/index.native.js.map +1 -1
  262. package/build/scroll-lock/index.js +35 -6
  263. package/build/scroll-lock/index.js.map +1 -1
  264. package/build/select-control/chevron-down.js +30 -0
  265. package/build/select-control/chevron-down.js.map +1 -0
  266. package/build/select-control/index.js +8 -10
  267. package/build/select-control/index.js.map +1 -1
  268. package/build/select-control/styles/select-control-styles.js +54 -19
  269. package/build/select-control/styles/select-control-styles.js.map +1 -1
  270. package/build/shortcut/index.js +4 -13
  271. package/build/shortcut/index.js.map +1 -1
  272. package/build/shortcut/types.js +6 -0
  273. package/build/shortcut/types.js.map +1 -0
  274. package/build/snackbar/list.js +5 -3
  275. package/build/snackbar/list.js.map +1 -1
  276. package/build/spacer/component.js +3 -1
  277. package/build/spacer/component.js.map +1 -1
  278. package/build/spinner/index.js +2 -0
  279. package/build/spinner/index.js.map +1 -1
  280. package/build/style-provider/index.js +10 -7
  281. package/build/style-provider/index.js.map +1 -1
  282. package/build/style-provider/types.js +6 -0
  283. package/build/style-provider/types.js.map +1 -0
  284. package/build/text/hook.js +5 -8
  285. package/build/text/hook.js.map +1 -1
  286. package/build/text/styles.js +7 -7
  287. package/build/text/styles.js.map +1 -1
  288. package/build/toggle-group-control/toggle-group-control/component.js +19 -8
  289. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  290. package/build/toggle-group-control/toggle-group-control/styles.js +22 -4
  291. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  292. package/build/toggle-group-control/toggle-group-control-option/component.js +15 -5
  293. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  294. package/build/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  295. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  296. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +20 -9
  297. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  298. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +26 -7
  299. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  300. package/build/tools-panel/styles.js +13 -10
  301. package/build/tools-panel/styles.js.map +1 -1
  302. package/build/tools-panel/tools-panel/hook.js +1 -1
  303. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  304. package/build/tooltip/index.js +52 -21
  305. package/build/tooltip/index.js.map +1 -1
  306. package/build/tree-grid/index.js +4 -10
  307. package/build/tree-grid/index.js.map +1 -1
  308. package/build/tree-select/index.js +2 -2
  309. package/build/tree-select/index.js.map +1 -1
  310. package/build/ui/context/context-connect.js +1 -3
  311. package/build/ui/context/context-connect.js.map +1 -1
  312. package/build/ui/context/use-context-system.js +7 -2
  313. package/build/ui/context/use-context-system.js.map +1 -1
  314. package/build/ui/tooltip/styles.js +4 -4
  315. package/build/ui/tooltip/styles.js.map +1 -1
  316. package/build/ui/utils/space.js +7 -1
  317. package/build/ui/utils/space.js.map +1 -1
  318. package/build/unit-control/index.js +2 -3
  319. package/build/unit-control/index.js.map +1 -1
  320. package/build/unit-control/styles/unit-control-styles.js +38 -29
  321. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  322. package/build/utils/base-label.js +24 -0
  323. package/build/utils/base-label.js.map +1 -0
  324. package/build/utils/box-sizing.js +22 -0
  325. package/build/utils/box-sizing.js.map +1 -0
  326. package/build/utils/colors-values.js +52 -142
  327. package/build/utils/colors-values.js.map +1 -1
  328. package/build/utils/config-values.js +1 -1
  329. package/build/utils/config-values.js.map +1 -1
  330. package/build/utils/input/input-control.js +1 -1
  331. package/build/utils/input/input-control.js.map +1 -1
  332. package/build/utils/rtl.js +6 -5
  333. package/build/utils/rtl.js.map +1 -1
  334. package/build/utils/strings.js +50 -0
  335. package/build/utils/strings.js.map +1 -0
  336. package/build/utils/style-mixins.js +16 -0
  337. package/build/utils/style-mixins.js.map +1 -1
  338. package/build-module/alignment-matrix-control/index.js +1 -1
  339. package/build-module/alignment-matrix-control/index.js.map +1 -1
  340. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  341. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  342. package/build-module/angle-picker-control/index.js +5 -2
  343. package/build-module/angle-picker-control/index.js.map +1 -1
  344. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +13 -4
  345. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  346. package/build-module/autocomplete/index.js +9 -10
  347. package/build-module/autocomplete/index.js.map +1 -1
  348. package/build-module/base-control/index.js +7 -5
  349. package/build-module/base-control/index.js.map +1 -1
  350. package/build-module/base-control/styles/base-control-styles.js +9 -9
  351. package/build-module/base-control/styles/base-control-styles.js.map +1 -1
  352. package/build-module/base-field/styles.js +5 -5
  353. package/build-module/base-field/styles.js.map +1 -1
  354. package/build-module/border-control/border-control/component.js +37 -25
  355. package/build-module/border-control/border-control/component.js.map +1 -1
  356. package/build-module/border-control/border-control/hook.js +4 -7
  357. package/build-module/border-control/border-control/hook.js.map +1 -1
  358. package/build-module/border-control/border-control-dropdown/component.js +12 -7
  359. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  360. package/build-module/border-control/border-control-dropdown/hook.js +0 -4
  361. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  362. package/build-module/border-control/styles.js +30 -54
  363. package/build-module/border-control/styles.js.map +1 -1
  364. package/build-module/box-control/all-input-control.js +3 -28
  365. package/build-module/box-control/all-input-control.js.map +1 -1
  366. package/build-module/box-control/axial-input-controls.js +1 -1
  367. package/build-module/box-control/axial-input-controls.js.map +1 -1
  368. package/build-module/box-control/index.js +4 -4
  369. package/build-module/box-control/index.js.map +1 -1
  370. package/build-module/box-control/styles/box-control-styles.js +18 -10
  371. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  372. package/build-module/box-control/styles/box-control-visualizer-styles.js +8 -8
  373. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +1 -1
  374. package/build-module/box-control/utils.js +35 -7
  375. package/build-module/box-control/utils.js.map +1 -1
  376. package/build-module/card/card/component.js +5 -10
  377. package/build-module/card/card/component.js.map +1 -1
  378. package/build-module/card/card/hook.js +0 -9
  379. package/build-module/card/card/hook.js.map +1 -1
  380. package/build-module/card/card/index.js.map +1 -1
  381. package/build-module/card/card-body/component.js +7 -8
  382. package/build-module/card/card-body/component.js.map +1 -1
  383. package/build-module/card/card-body/hook.js +0 -4
  384. package/build-module/card/card-body/hook.js.map +1 -1
  385. package/build-module/card/card-body/index.js.map +1 -1
  386. package/build-module/card/card-divider/component.js +7 -8
  387. package/build-module/card/card-divider/component.js.map +1 -1
  388. package/build-module/card/card-divider/hook.js +0 -4
  389. package/build-module/card/card-divider/hook.js.map +1 -1
  390. package/build-module/card/card-divider/index.js.map +1 -1
  391. package/build-module/card/card-footer/component.js +7 -8
  392. package/build-module/card/card-footer/component.js.map +1 -1
  393. package/build-module/card/card-footer/hook.js +0 -4
  394. package/build-module/card/card-footer/hook.js.map +1 -1
  395. package/build-module/card/card-footer/index.js.map +1 -1
  396. package/build-module/card/card-header/component.js +7 -8
  397. package/build-module/card/card-header/component.js.map +1 -1
  398. package/build-module/card/card-header/hook.js +0 -4
  399. package/build-module/card/card-header/hook.js.map +1 -1
  400. package/build-module/card/card-header/index.js.map +1 -1
  401. package/build-module/card/card-media/component.js +7 -7
  402. package/build-module/card/card-media/component.js.map +1 -1
  403. package/build-module/card/card-media/hook.js +0 -4
  404. package/build-module/card/card-media/hook.js.map +1 -1
  405. package/build-module/card/card-media/index.js.map +1 -1
  406. package/build-module/card/context.js.map +1 -1
  407. package/build-module/card/index.js.map +1 -1
  408. package/build-module/card/styles.js +17 -17
  409. package/build-module/card/styles.js.map +1 -1
  410. package/build-module/color-list-picker/index.js +13 -5
  411. package/build-module/color-list-picker/index.js.map +1 -1
  412. package/build-module/color-palette/index.js +32 -12
  413. package/build-module/color-palette/index.js.map +1 -1
  414. package/build-module/color-palette/index.native.js +4 -4
  415. package/build-module/color-palette/index.native.js.map +1 -1
  416. package/build-module/color-picker/hex-input.js +2 -1
  417. package/build-module/color-picker/hex-input.js.map +1 -1
  418. package/build-module/color-picker/input-with-slider.js +3 -2
  419. package/build-module/color-picker/input-with-slider.js.map +1 -1
  420. package/build-module/color-picker/styles.js +10 -16
  421. package/build-module/color-picker/styles.js.map +1 -1
  422. package/build-module/combobox-control/index.js +24 -15
  423. package/build-module/combobox-control/index.js.map +1 -1
  424. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  425. package/build-module/custom-gradient-picker/gradient-bar/constants.js.map +1 -0
  426. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +34 -41
  427. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -0
  428. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -1
  429. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -0
  430. package/build-module/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  431. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -0
  432. package/build-module/custom-gradient-picker/index.js +16 -3
  433. package/build-module/custom-gradient-picker/index.js.map +1 -1
  434. package/build-module/custom-select-control/index.js +41 -16
  435. package/build-module/custom-select-control/index.js.map +1 -1
  436. package/build-module/custom-select-control/styles.js +22 -0
  437. package/build-module/custom-select-control/styles.js.map +1 -0
  438. package/build-module/date-time/constants.js +2 -0
  439. package/build-module/date-time/constants.js.map +1 -0
  440. package/build-module/date-time/date/index.js +178 -184
  441. package/build-module/date-time/date/index.js.map +1 -1
  442. package/build-module/date-time/date/styles.js +47 -38
  443. package/build-module/date-time/date/styles.js.map +1 -1
  444. package/build-module/date-time/date-time/index.js +4 -2
  445. package/build-module/date-time/date-time/index.js.map +1 -1
  446. package/build-module/date-time/time/index.js +26 -19
  447. package/build-module/date-time/time/index.js.map +1 -1
  448. package/build-module/date-time/time/styles.js +15 -21
  449. package/build-module/date-time/time/styles.js.map +1 -1
  450. package/build-module/date-time/utils.js +19 -0
  451. package/build-module/date-time/utils.js.map +1 -0
  452. package/build-module/dimension-control/index.js +1 -5
  453. package/build-module/dimension-control/index.js.map +1 -1
  454. package/build-module/disabled/index.js +28 -11
  455. package/build-module/disabled/index.js.map +1 -1
  456. package/build-module/disabled/styles/disabled-styles.js +3 -3
  457. package/build-module/disabled/styles/disabled-styles.js.map +1 -1
  458. package/build-module/disabled/types.js +2 -0
  459. package/build-module/disabled/types.js.map +1 -0
  460. package/build-module/divider/component.js +0 -1
  461. package/build-module/divider/component.js.map +1 -1
  462. package/build-module/divider/index.js.map +1 -1
  463. package/build-module/divider/styles.js +5 -5
  464. package/build-module/divider/styles.js.map +1 -1
  465. package/build-module/drop-zone/index.js +2 -3
  466. package/build-module/drop-zone/index.js.map +1 -1
  467. package/build-module/dropdown/dropdown-content-wrapper.js +47 -0
  468. package/build-module/dropdown/dropdown-content-wrapper.js.map +1 -0
  469. package/build-module/dropdown/index.js +5 -6
  470. package/build-module/dropdown/index.js.map +1 -1
  471. package/build-module/dropdown/styles.js +31 -0
  472. package/build-module/dropdown/styles.js.map +1 -0
  473. package/build-module/dropdown/types.js +2 -0
  474. package/build-module/dropdown/types.js.map +1 -0
  475. package/build-module/duotone-picker/custom-duotone-bar.js +1 -1
  476. package/build-module/duotone-picker/custom-duotone-bar.js.map +1 -1
  477. package/build-module/duotone-picker/duotone-picker.js +7 -1
  478. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  479. package/build-module/duotone-picker/duotone-swatch.js +11 -3
  480. package/build-module/duotone-picker/duotone-swatch.js.map +1 -1
  481. package/build-module/elevation/component.js +15 -15
  482. package/build-module/elevation/component.js.map +1 -1
  483. package/build-module/elevation/hook.js +5 -17
  484. package/build-module/elevation/hook.js.map +1 -1
  485. package/build-module/elevation/index.js.map +1 -1
  486. package/build-module/elevation/styles.js +1 -1
  487. package/build-module/elevation/styles.js.map +1 -1
  488. package/build-module/external-link/index.js +6 -0
  489. package/build-module/external-link/index.js.map +1 -1
  490. package/build-module/flex/flex/component.js +20 -26
  491. package/build-module/flex/flex/component.js.map +1 -1
  492. package/build-module/flex/flex/hook.js +6 -15
  493. package/build-module/flex/flex/hook.js.map +1 -1
  494. package/build-module/flex/flex/index.js.map +1 -1
  495. package/build-module/flex/flex-block/component.js +18 -12
  496. package/build-module/flex/flex-block/component.js.map +1 -1
  497. package/build-module/flex/flex-block/hook.js +0 -4
  498. package/build-module/flex/flex-block/hook.js.map +1 -1
  499. package/build-module/flex/flex-block/index.js.map +1 -1
  500. package/build-module/flex/flex-item/component.js +18 -12
  501. package/build-module/flex/flex-item/component.js.map +1 -1
  502. package/build-module/flex/flex-item/hook.js +1 -5
  503. package/build-module/flex/flex-item/hook.js.map +1 -1
  504. package/build-module/flex/flex-item/index.js.map +1 -1
  505. package/build-module/flex/index.js.map +1 -1
  506. package/build-module/flex/styles.js +5 -5
  507. package/build-module/flex/styles.js.map +1 -1
  508. package/build-module/focal-point-picker/index.js +4 -5
  509. package/build-module/focal-point-picker/index.js.map +1 -1
  510. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +22 -22
  511. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  512. package/build-module/focal-point-picker/styles/focal-point-style.js +5 -5
  513. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  514. package/build-module/font-size-picker/index.js +51 -18
  515. package/build-module/font-size-picker/index.js.map +1 -1
  516. package/build-module/font-size-picker/utils.js +31 -23
  517. package/build-module/font-size-picker/utils.js.map +1 -1
  518. package/build-module/form-token-field/index.js +35 -22
  519. package/build-module/form-token-field/index.js.map +1 -1
  520. package/build-module/form-token-field/suggestions-list.js +19 -6
  521. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  522. package/build-module/gradient-picker/index.js +14 -3
  523. package/build-module/gradient-picker/index.js.map +1 -1
  524. package/build-module/guide/index.js +5 -3
  525. package/build-module/guide/index.js.map +1 -1
  526. package/build-module/guide/page-control.js +3 -6
  527. package/build-module/guide/page-control.js.map +1 -1
  528. package/build-module/index.js +4 -1
  529. package/build-module/index.js.map +1 -1
  530. package/build-module/input-control/index.js +6 -0
  531. package/build-module/input-control/index.js.map +1 -1
  532. package/build-module/input-control/input-base.js +25 -5
  533. package/build-module/input-control/input-base.js.map +1 -1
  534. package/build-module/input-control/input-prefix-wrapper.js +41 -0
  535. package/build-module/input-control/input-prefix-wrapper.js.map +1 -0
  536. package/build-module/input-control/input-suffix-wrapper.js +41 -0
  537. package/build-module/input-control/input-suffix-wrapper.js.map +1 -0
  538. package/build-module/input-control/reducer/actions.js +1 -0
  539. package/build-module/input-control/reducer/actions.js.map +1 -1
  540. package/build-module/input-control/reducer/reducer.js +28 -11
  541. package/build-module/input-control/reducer/reducer.js.map +1 -1
  542. package/build-module/input-control/reducer/state.js.map +1 -1
  543. package/build-module/input-control/styles/input-control-styles.js +58 -42
  544. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  545. package/build-module/item-group/styles.js +10 -10
  546. package/build-module/item-group/styles.js.map +1 -1
  547. package/build-module/mobile/bottom-sheet/index.native.js +3 -5
  548. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  549. package/build-module/mobile/global-styles-context/utils.native.js +24 -4
  550. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  551. package/build-module/mobile/image/index.native.js +12 -8
  552. package/build-module/mobile/image/index.native.js.map +1 -1
  553. package/build-module/mobile/link-picker/link-picker-screen.native.js +11 -4
  554. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  555. package/build-module/mobile/media-edit/index.native.js +1 -6
  556. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  557. package/build-module/mobile/picker/index.android.js +3 -3
  558. package/build-module/mobile/picker/index.android.js.map +1 -1
  559. package/build-module/mobile/picker/index.ios.js +14 -3
  560. package/build-module/mobile/picker/index.ios.js.map +1 -1
  561. package/build-module/modal/index.js +1 -2
  562. package/build-module/modal/index.js.map +1 -1
  563. package/build-module/navigable-container/container.js +9 -7
  564. package/build-module/navigable-container/container.js.map +1 -1
  565. package/build-module/navigable-container/menu.js +3 -8
  566. package/build-module/navigable-container/menu.js.map +1 -1
  567. package/build-module/navigator/navigator-back-button/hook.js +0 -4
  568. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  569. package/build-module/navigator/navigator-button/hook.js +0 -4
  570. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  571. package/build-module/notice/list.js +10 -5
  572. package/build-module/notice/list.js.map +1 -1
  573. package/build-module/palette-edit/index.js +1 -0
  574. package/build-module/palette-edit/index.js.map +1 -1
  575. package/build-module/palette-edit/styles.js +10 -10
  576. package/build-module/palette-edit/styles.js.map +1 -1
  577. package/build-module/placeholder/index.js +10 -15
  578. package/build-module/placeholder/index.js.map +1 -1
  579. package/build-module/placeholder/types.js +2 -0
  580. package/build-module/placeholder/types.js.map +1 -0
  581. package/build-module/popover/index.js +202 -147
  582. package/build-module/popover/index.js.map +1 -1
  583. package/build-module/popover/utils.js +164 -0
  584. package/build-module/popover/utils.js.map +1 -0
  585. package/build-module/radio-control/index.js +1 -2
  586. package/build-module/radio-control/index.js.map +1 -1
  587. package/build-module/range-control/index.js +3 -0
  588. package/build-module/range-control/index.js.map +1 -1
  589. package/build-module/range-control/styles/range-control-styles.js +51 -45
  590. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  591. package/build-module/range-control/utils.js +1 -1
  592. package/build-module/range-control/utils.js.map +1 -1
  593. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  594. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  595. package/build-module/sandbox/index.native.js +13 -3
  596. package/build-module/sandbox/index.native.js.map +1 -1
  597. package/build-module/scroll-lock/index.js +32 -6
  598. package/build-module/scroll-lock/index.js.map +1 -1
  599. package/build-module/select-control/chevron-down.js +21 -0
  600. package/build-module/select-control/chevron-down.js.map +1 -0
  601. package/build-module/select-control/index.js +8 -9
  602. package/build-module/select-control/index.js.map +1 -1
  603. package/build-module/select-control/styles/select-control-styles.js +48 -17
  604. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  605. package/build-module/shortcut/index.js +4 -13
  606. package/build-module/shortcut/index.js.map +1 -1
  607. package/build-module/shortcut/types.js +2 -0
  608. package/build-module/shortcut/types.js.map +1 -0
  609. package/build-module/snackbar/list.js +5 -2
  610. package/build-module/snackbar/list.js.map +1 -1
  611. package/build-module/spacer/component.js +3 -1
  612. package/build-module/spacer/component.js.map +1 -1
  613. package/build-module/spinner/index.js +2 -0
  614. package/build-module/spinner/index.js.map +1 -1
  615. package/build-module/style-provider/index.js +10 -5
  616. package/build-module/style-provider/index.js.map +1 -1
  617. package/build-module/style-provider/types.js +2 -0
  618. package/build-module/style-provider/types.js.map +1 -0
  619. package/build-module/text/hook.js +5 -7
  620. package/build-module/text/hook.js.map +1 -1
  621. package/build-module/text/styles.js +7 -7
  622. package/build-module/text/styles.js.map +1 -1
  623. package/build-module/toggle-group-control/toggle-group-control/component.js +17 -7
  624. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  625. package/build-module/toggle-group-control/toggle-group-control/styles.js +16 -3
  626. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  627. package/build-module/toggle-group-control/toggle-group-control-option/component.js +17 -3
  628. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  629. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +5 -1
  630. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  631. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +16 -7
  632. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  633. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +27 -5
  634. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  635. package/build-module/tools-panel/styles.js +12 -11
  636. package/build-module/tools-panel/styles.js.map +1 -1
  637. package/build-module/tools-panel/tools-panel/hook.js +1 -1
  638. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  639. package/build-module/tooltip/index.js +54 -22
  640. package/build-module/tooltip/index.js.map +1 -1
  641. package/build-module/tree-grid/index.js +4 -9
  642. package/build-module/tree-grid/index.js.map +1 -1
  643. package/build-module/tree-select/index.js +3 -3
  644. package/build-module/tree-select/index.js.map +1 -1
  645. package/build-module/ui/context/context-connect.js +1 -2
  646. package/build-module/ui/context/context-connect.js.map +1 -1
  647. package/build-module/ui/context/use-context-system.js +7 -2
  648. package/build-module/ui/context/use-context-system.js.map +1 -1
  649. package/build-module/ui/tooltip/styles.js +4 -4
  650. package/build-module/ui/tooltip/styles.js.map +1 -1
  651. package/build-module/ui/utils/space.js +7 -1
  652. package/build-module/ui/utils/space.js.map +1 -1
  653. package/build-module/unit-control/index.js +2 -2
  654. package/build-module/unit-control/index.js.map +1 -1
  655. package/build-module/unit-control/styles/unit-control-styles.js +39 -30
  656. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  657. package/build-module/utils/base-label.js +18 -0
  658. package/build-module/utils/base-label.js.map +1 -0
  659. package/build-module/utils/box-sizing.js +16 -0
  660. package/build-module/utils/box-sizing.js.map +1 -0
  661. package/build-module/utils/colors-values.js +52 -141
  662. package/build-module/utils/colors-values.js.map +1 -1
  663. package/build-module/utils/config-values.js +1 -1
  664. package/build-module/utils/config-values.js.map +1 -1
  665. package/build-module/utils/input/input-control.js +1 -1
  666. package/build-module/utils/input/input-control.js.map +1 -1
  667. package/build-module/utils/rtl.js +6 -4
  668. package/build-module/utils/rtl.js.map +1 -1
  669. package/build-module/utils/strings.js +37 -0
  670. package/build-module/utils/strings.js.map +1 -0
  671. package/build-module/utils/style-mixins.js +2 -0
  672. package/build-module/utils/style-mixins.js.map +1 -1
  673. package/build-style/style-rtl.css +236 -1281
  674. package/build-style/style.css +237 -1281
  675. package/build-types/base-control/index.d.ts +4 -3
  676. package/build-types/base-control/index.d.ts.map +1 -1
  677. package/build-types/base-control/stories/index.d.ts +1 -1
  678. package/build-types/base-control/stories/index.d.ts.map +1 -1
  679. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  680. package/build-types/base-control/types.d.ts +0 -1
  681. package/build-types/base-control/types.d.ts.map +1 -1
  682. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  683. package/build-types/border-control/border-control/hook.d.ts +1 -1
  684. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  685. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  686. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  687. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  688. package/build-types/border-control/stories/index.d.ts.map +1 -1
  689. package/build-types/border-control/styles.d.ts +1 -4
  690. package/build-types/border-control/styles.d.ts.map +1 -1
  691. package/build-types/card/card/component.d.ts +3 -3
  692. package/build-types/card/card/component.d.ts.map +1 -1
  693. package/build-types/card/card/hook.d.ts +7 -2
  694. package/build-types/card/card/hook.d.ts.map +1 -1
  695. package/build-types/card/card/index.d.ts +2 -2
  696. package/build-types/card/card/index.d.ts.map +1 -1
  697. package/build-types/card/card-body/component.d.ts +3 -3
  698. package/build-types/card/card-body/component.d.ts.map +1 -1
  699. package/build-types/card/card-body/hook.d.ts +5 -2
  700. package/build-types/card/card-body/hook.d.ts.map +1 -1
  701. package/build-types/card/card-body/index.d.ts +2 -2
  702. package/build-types/card/card-body/index.d.ts.map +1 -1
  703. package/build-types/card/card-divider/component.d.ts +3 -3
  704. package/build-types/card/card-divider/component.d.ts.map +1 -1
  705. package/build-types/card/card-divider/hook.d.ts +6 -3
  706. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  707. package/build-types/card/card-divider/index.d.ts +2 -2
  708. package/build-types/card/card-divider/index.d.ts.map +1 -1
  709. package/build-types/card/card-footer/component.d.ts +3 -3
  710. package/build-types/card/card-footer/component.d.ts.map +1 -1
  711. package/build-types/card/card-footer/hook.d.ts +5 -2
  712. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  713. package/build-types/card/card-footer/index.d.ts +2 -2
  714. package/build-types/card/card-footer/index.d.ts.map +1 -1
  715. package/build-types/card/card-header/component.d.ts +3 -3
  716. package/build-types/card/card-header/component.d.ts.map +1 -1
  717. package/build-types/card/card-header/hook.d.ts +5 -2
  718. package/build-types/card/card-header/hook.d.ts.map +1 -1
  719. package/build-types/card/card-header/index.d.ts +2 -2
  720. package/build-types/card/card-header/index.d.ts.map +1 -1
  721. package/build-types/card/card-media/component.d.ts +3 -4
  722. package/build-types/card/card-media/component.d.ts.map +1 -1
  723. package/build-types/card/card-media/hook.d.ts +6 -5
  724. package/build-types/card/card-media/hook.d.ts.map +1 -1
  725. package/build-types/card/card-media/index.d.ts +2 -2
  726. package/build-types/card/card-media/index.d.ts.map +1 -1
  727. package/build-types/card/context.d.ts +3 -2
  728. package/build-types/card/context.d.ts.map +1 -1
  729. package/build-types/card/index.d.ts +6 -6
  730. package/build-types/card/index.d.ts.map +1 -1
  731. package/build-types/card/stories/index.d.ts +12 -0
  732. package/build-types/card/stories/index.d.ts.map +1 -0
  733. package/build-types/card/styles.d.ts +20 -22
  734. package/build-types/card/styles.d.ts.map +1 -1
  735. package/build-types/card/test/index.d.ts +2 -0
  736. package/build-types/card/test/index.d.ts.map +1 -0
  737. package/build-types/card/types.d.ts +7 -1
  738. package/build-types/card/types.d.ts.map +1 -1
  739. package/build-types/color-palette/index.d.ts +3 -1
  740. package/build-types/color-palette/index.d.ts.map +1 -1
  741. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  742. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  743. package/build-types/color-picker/styles.d.ts +2 -2
  744. package/build-types/color-picker/styles.d.ts.map +1 -1
  745. package/build-types/date-time/constants.d.ts +2 -0
  746. package/build-types/date-time/constants.d.ts.map +1 -0
  747. package/build-types/date-time/date/index.d.ts +3 -1
  748. package/build-types/date-time/date/index.d.ts.map +1 -1
  749. package/build-types/date-time/date/styles.d.ts +22 -8
  750. package/build-types/date-time/date/styles.d.ts.map +1 -1
  751. package/build-types/date-time/date/test/index.d.ts +1 -1
  752. package/build-types/date-time/date/test/index.d.ts.map +1 -1
  753. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  754. package/build-types/date-time/time/index.d.ts.map +1 -1
  755. package/build-types/date-time/time/styles.d.ts +0 -4
  756. package/build-types/date-time/time/styles.d.ts.map +1 -1
  757. package/build-types/date-time/utils.d.ts +8 -0
  758. package/build-types/date-time/utils.d.ts.map +1 -0
  759. package/build-types/disabled/index.d.ts +35 -28
  760. package/build-types/disabled/index.d.ts.map +1 -1
  761. package/build-types/disabled/stories/index.d.ts +13 -0
  762. package/build-types/disabled/stories/index.d.ts.map +1 -0
  763. package/build-types/disabled/styles/disabled-styles.d.ts +2 -1
  764. package/build-types/disabled/styles/disabled-styles.d.ts.map +1 -1
  765. package/build-types/disabled/test/index.d.ts +2 -0
  766. package/build-types/disabled/test/index.d.ts.map +1 -0
  767. package/build-types/disabled/types.d.ts +14 -0
  768. package/build-types/disabled/types.d.ts.map +1 -0
  769. package/build-types/divider/component.d.ts +2 -3
  770. package/build-types/divider/component.d.ts.map +1 -1
  771. package/build-types/divider/index.d.ts +1 -1
  772. package/build-types/divider/index.d.ts.map +1 -1
  773. package/build-types/divider/styles.d.ts +6 -2
  774. package/build-types/divider/styles.d.ts.map +1 -1
  775. package/build-types/divider/test/index.d.ts +2 -0
  776. package/build-types/divider/test/index.d.ts.map +1 -0
  777. package/build-types/divider/types.d.ts +18 -10
  778. package/build-types/divider/types.d.ts.map +1 -1
  779. package/build-types/dropdown/dropdown-content-wrapper.d.ts +23 -0
  780. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -0
  781. package/build-types/dropdown/index.d.ts.map +1 -1
  782. package/build-types/dropdown/styles.d.ts +7 -0
  783. package/build-types/dropdown/styles.d.ts.map +1 -0
  784. package/build-types/dropdown/types.d.ts +9 -0
  785. package/build-types/dropdown/types.d.ts.map +1 -0
  786. package/build-types/elevation/component.d.ts +11 -10
  787. package/build-types/elevation/component.d.ts.map +1 -1
  788. package/build-types/elevation/hook.d.ts +6 -7
  789. package/build-types/elevation/hook.d.ts.map +1 -1
  790. package/build-types/elevation/index.d.ts +2 -2
  791. package/build-types/elevation/index.d.ts.map +1 -1
  792. package/build-types/elevation/stories/index.d.ts +22 -0
  793. package/build-types/elevation/stories/index.d.ts.map +1 -0
  794. package/build-types/elevation/styles.d.ts +1 -1
  795. package/build-types/elevation/styles.d.ts.map +1 -1
  796. package/build-types/elevation/test/index.d.ts +2 -0
  797. package/build-types/elevation/test/index.d.ts.map +1 -0
  798. package/build-types/elevation/types.d.ts +12 -19
  799. package/build-types/elevation/types.d.ts.map +1 -1
  800. package/build-types/external-link/index.d.ts.map +1 -1
  801. package/build-types/flex/flex/component.d.ts +16 -21
  802. package/build-types/flex/flex/component.d.ts.map +1 -1
  803. package/build-types/flex/flex/hook.d.ts +5 -2
  804. package/build-types/flex/flex/hook.d.ts.map +1 -1
  805. package/build-types/flex/flex/index.d.ts +2 -2
  806. package/build-types/flex/flex/index.d.ts.map +1 -1
  807. package/build-types/flex/flex-block/component.d.ts +14 -7
  808. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  809. package/build-types/flex/flex-block/hook.d.ts +6 -3
  810. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  811. package/build-types/flex/flex-block/index.d.ts +2 -2
  812. package/build-types/flex/flex-block/index.d.ts.map +1 -1
  813. package/build-types/flex/flex-item/component.d.ts +14 -7
  814. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  815. package/build-types/flex/flex-item/hook.d.ts +6 -3
  816. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  817. package/build-types/flex/flex-item/index.d.ts +2 -2
  818. package/build-types/flex/flex-item/index.d.ts.map +1 -1
  819. package/build-types/flex/index.d.ts +3 -3
  820. package/build-types/flex/index.d.ts.map +1 -1
  821. package/build-types/flex/stories/index.d.ts +13 -0
  822. package/build-types/flex/stories/index.d.ts.map +1 -0
  823. package/build-types/flex/styles.d.ts +5 -5
  824. package/build-types/flex/styles.d.ts.map +1 -1
  825. package/build-types/flex/test/index.d.ts +2 -0
  826. package/build-types/flex/test/index.d.ts.map +1 -0
  827. package/build-types/flex/types.d.ts +17 -10
  828. package/build-types/flex/types.d.ts.map +1 -1
  829. package/build-types/form-token-field/index.d.ts.map +1 -1
  830. package/build-types/form-token-field/stories/index.d.ts +7 -0
  831. package/build-types/form-token-field/stories/index.d.ts.map +1 -1
  832. package/build-types/form-token-field/suggestions-list.d.ts +1 -1
  833. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  834. package/build-types/form-token-field/test/index.d.ts +2 -0
  835. package/build-types/form-token-field/test/index.d.ts.map +1 -0
  836. package/build-types/form-token-field/types.d.ts +22 -3
  837. package/build-types/form-token-field/types.d.ts.map +1 -1
  838. package/build-types/input-control/index.d.ts +1 -1
  839. package/build-types/input-control/index.d.ts.map +1 -1
  840. package/build-types/input-control/input-base.d.ts +1 -1
  841. package/build-types/input-control/input-base.d.ts.map +1 -1
  842. package/build-types/input-control/input-prefix-wrapper.d.ts +19 -0
  843. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -0
  844. package/build-types/input-control/input-suffix-wrapper.d.ts +19 -0
  845. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -0
  846. package/build-types/input-control/reducer/actions.d.ts +3 -1
  847. package/build-types/input-control/reducer/actions.d.ts.map +1 -1
  848. package/build-types/input-control/reducer/reducer.d.ts +2 -2
  849. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  850. package/build-types/input-control/reducer/state.d.ts +2 -2
  851. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  852. package/build-types/input-control/stories/index.d.ts +10 -0
  853. package/build-types/input-control/stories/index.d.ts.map +1 -1
  854. package/build-types/input-control/styles/input-control-styles.d.ts +21 -0
  855. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  856. package/build-types/input-control/types.d.ts +45 -3
  857. package/build-types/input-control/types.d.ts.map +1 -1
  858. package/build-types/navigable-container/menu.d.ts.map +1 -1
  859. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -3
  860. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  861. package/build-types/navigator/navigator-button/hook.d.ts +0 -3
  862. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  863. package/build-types/placeholder/index.d.ts +16 -0
  864. package/build-types/placeholder/index.d.ts.map +1 -0
  865. package/build-types/placeholder/stories/index.d.ts +12 -0
  866. package/build-types/placeholder/stories/index.d.ts.map +1 -0
  867. package/build-types/placeholder/test/index.d.ts +2 -0
  868. package/build-types/placeholder/test/index.d.ts.map +1 -0
  869. package/build-types/placeholder/types.d.ts +47 -0
  870. package/build-types/placeholder/types.d.ts.map +1 -0
  871. package/build-types/popover/index.d.ts +2 -2
  872. package/build-types/popover/index.d.ts.map +1 -1
  873. package/build-types/popover/utils.d.ts +27 -0
  874. package/build-types/popover/utils.d.ts.map +1 -0
  875. package/build-types/radio-control/index.d.ts.map +1 -1
  876. package/build-types/range-control/index.d.ts +2 -2
  877. package/build-types/range-control/index.d.ts.map +1 -1
  878. package/build-types/range-control/styles/range-control-styles.d.ts +5 -2
  879. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  880. package/build-types/range-control/types.d.ts +6 -4
  881. package/build-types/range-control/types.d.ts.map +1 -1
  882. package/build-types/range-control/utils.d.ts.map +1 -1
  883. package/build-types/scroll-lock/index.d.ts +32 -3
  884. package/build-types/scroll-lock/index.d.ts.map +1 -1
  885. package/build-types/scroll-lock/stories/index.d.ts +9 -0
  886. package/build-types/scroll-lock/stories/index.d.ts.map +1 -0
  887. package/build-types/scroll-lock/test/index.d.ts +2 -0
  888. package/build-types/scroll-lock/test/index.d.ts.map +1 -0
  889. package/build-types/select-control/chevron-down.d.ts +4 -0
  890. package/build-types/select-control/chevron-down.d.ts.map +1 -0
  891. package/build-types/select-control/index.d.ts.map +1 -1
  892. package/build-types/select-control/styles/select-control-styles.d.ts +9 -1
  893. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  894. package/build-types/select-control/types.d.ts +1 -1
  895. package/build-types/select-control/types.d.ts.map +1 -1
  896. package/build-types/shortcut/index.d.ts +5 -24
  897. package/build-types/shortcut/index.d.ts.map +1 -1
  898. package/build-types/shortcut/test/index.d.ts +2 -0
  899. package/build-types/shortcut/test/index.d.ts.map +1 -0
  900. package/build-types/shortcut/types.d.ts +14 -0
  901. package/build-types/shortcut/types.d.ts.map +1 -0
  902. package/build-types/spacer/component.d.ts +3 -1
  903. package/build-types/spacer/component.d.ts.map +1 -1
  904. package/build-types/spinner/index.d.ts.map +1 -1
  905. package/build-types/style-provider/index.d.ts +7 -4
  906. package/build-types/style-provider/index.d.ts.map +1 -1
  907. package/build-types/style-provider/types.d.ts +15 -0
  908. package/build-types/style-provider/types.d.ts.map +1 -0
  909. package/build-types/text/hook.d.ts.map +1 -1
  910. package/build-types/toggle-group-control/stories/index.d.ts +25 -0
  911. package/build-types/toggle-group-control/stories/index.d.ts.map +1 -0
  912. package/build-types/toggle-group-control/test/index.d.ts +2 -0
  913. package/build-types/toggle-group-control/test/index.d.ts.map +1 -0
  914. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +6 -3
  915. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  916. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +6 -1
  917. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  918. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +6 -7
  919. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  920. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  921. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +4 -1
  922. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  923. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +11 -9
  924. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  925. package/build-types/toggle-group-control/types.d.ts +27 -8
  926. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  927. package/build-types/tools-panel/styles.d.ts +1 -1
  928. package/build-types/tools-panel/styles.d.ts.map +1 -1
  929. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  930. package/build-types/tooltip/index.d.ts.map +1 -1
  931. package/build-types/tree-select/index.d.ts.map +1 -1
  932. package/build-types/tree-select/types.d.ts +1 -0
  933. package/build-types/tree-select/types.d.ts.map +1 -1
  934. package/build-types/ui/context/context-connect.d.ts +3 -0
  935. package/build-types/ui/context/context-connect.d.ts.map +1 -1
  936. package/build-types/ui/context/use-context-system.d.ts.map +1 -1
  937. package/build-types/ui/form-group/use-form-group.d.ts +2 -2
  938. package/build-types/ui/tooltip/styles.d.ts.map +1 -1
  939. package/build-types/ui/utils/space.d.ts +7 -1
  940. package/build-types/ui/utils/space.d.ts.map +1 -1
  941. package/build-types/unit-control/index.d.ts +4 -3
  942. package/build-types/unit-control/index.d.ts.map +1 -1
  943. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  944. package/build-types/unit-control/styles/unit-control-styles.d.ts +0 -1
  945. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  946. package/build-types/unit-control/types.d.ts +7 -9
  947. package/build-types/unit-control/types.d.ts.map +1 -1
  948. package/build-types/utils/base-label.d.ts +2 -0
  949. package/build-types/utils/base-label.d.ts.map +1 -0
  950. package/build-types/utils/box-sizing.d.ts +2 -0
  951. package/build-types/utils/box-sizing.d.ts.map +1 -0
  952. package/build-types/utils/colors-values.d.ts +18 -97
  953. package/build-types/utils/colors-values.d.ts.map +1 -1
  954. package/build-types/utils/rtl.d.ts.map +1 -1
  955. package/build-types/utils/strings.d.ts +2 -0
  956. package/build-types/utils/strings.d.ts.map +1 -0
  957. package/build-types/utils/style-mixins.d.ts +2 -0
  958. package/package.json +22 -21
  959. package/src/alignment-matrix-control/index.js +1 -1
  960. package/src/alignment-matrix-control/stories/index.js +49 -24
  961. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.js +1 -3
  962. package/src/angle-picker-control/index.js +7 -2
  963. package/src/angle-picker-control/stories/index.js +8 -5
  964. package/src/angle-picker-control/styles/angle-picker-control-styles.js +12 -3
  965. package/src/autocomplete/index.js +9 -18
  966. package/src/base-control/index.tsx +5 -3
  967. package/src/base-control/stories/index.tsx +1 -0
  968. package/src/base-control/styles/base-control-styles.ts +11 -2
  969. package/src/base-control/types.ts +0 -1
  970. package/src/base-field/styles.js +1 -1
  971. package/src/base-field/test/__snapshots__/index.js.snap +2 -2
  972. package/src/border-control/border-control/component.tsx +41 -32
  973. package/src/border-control/border-control/hook.ts +4 -9
  974. package/src/border-control/border-control-dropdown/component.tsx +50 -45
  975. package/src/border-control/border-control-dropdown/hook.ts +0 -5
  976. package/src/border-control/stories/index.tsx +3 -0
  977. package/src/border-control/styles.ts +25 -70
  978. package/src/border-control/test/index.js +19 -8
  979. package/src/box-control/all-input-control.js +3 -27
  980. package/src/box-control/axial-input-controls.js +1 -1
  981. package/src/box-control/index.js +5 -6
  982. package/src/box-control/styles/box-control-styles.js +1 -2
  983. package/src/box-control/styles/box-control-visualizer-styles.js +0 -1
  984. package/src/box-control/test/index.js +8 -8
  985. package/src/box-control/utils.js +38 -13
  986. package/src/button/test/index.js +188 -146
  987. package/src/card/card/{component.js → component.tsx} +13 -9
  988. package/src/card/card/{hook.js → hook.ts} +11 -11
  989. package/src/card/card/{index.js → index.ts} +0 -0
  990. package/src/card/card-body/{component.js → component.tsx} +13 -9
  991. package/src/card/card-body/{hook.js → hook.ts} +5 -5
  992. package/src/card/card-body/{index.js → index.ts} +0 -0
  993. package/src/card/card-divider/{component.js → component.tsx} +16 -10
  994. package/src/card/card-divider/{hook.js → hook.ts} +5 -5
  995. package/src/card/card-divider/{index.js → index.ts} +0 -0
  996. package/src/card/card-footer/{component.js → component.tsx} +13 -9
  997. package/src/card/card-footer/{hook.js → hook.ts} +5 -5
  998. package/src/card/card-footer/{index.js → index.ts} +0 -0
  999. package/src/card/card-header/{component.js → component.tsx} +13 -9
  1000. package/src/card/card-header/{hook.js → hook.ts} +5 -5
  1001. package/src/card/card-header/{index.js → index.ts} +0 -0
  1002. package/src/card/card-media/{component.js → component.tsx} +13 -8
  1003. package/src/card/card-media/{hook.js → hook.ts} +5 -5
  1004. package/src/card/card-media/{index.js → index.ts} +0 -0
  1005. package/src/card/{context.js → context.ts} +0 -0
  1006. package/src/card/{index.js → index.ts} +0 -0
  1007. package/src/card/stories/index.tsx +75 -0
  1008. package/src/card/{styles.js → styles.ts} +0 -0
  1009. package/src/card/test/__snapshots__/{index.js.snap → index.tsx.snap} +8 -8
  1010. package/src/card/test/{index.js → index.tsx} +3 -3
  1011. package/src/card/types.ts +8 -1
  1012. package/src/color-list-picker/index.js +15 -3
  1013. package/src/color-list-picker/style.scss +11 -0
  1014. package/src/color-palette/index.js +51 -24
  1015. package/src/color-palette/index.native.js +10 -6
  1016. package/src/color-palette/stories/index.js +1 -1
  1017. package/src/color-palette/style.scss +5 -0
  1018. package/src/color-palette/test/__snapshots__/index.js.snap +17 -3
  1019. package/src/color-palette/test/utils.ts +19 -1
  1020. package/src/color-picker/hex-input.tsx +2 -1
  1021. package/src/color-picker/input-with-slider.tsx +2 -1
  1022. package/src/color-picker/styles.ts +3 -11
  1023. package/src/combobox-control/README.md +7 -0
  1024. package/src/combobox-control/index.js +25 -15
  1025. package/src/combobox-control/stories/index.js +57 -7
  1026. package/src/combobox-control/style.scss +0 -1
  1027. package/src/confirm-dialog/README.md +1 -1
  1028. package/src/confirm-dialog/test/index.js +85 -62
  1029. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/constants.js +0 -0
  1030. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/control-points.js +54 -50
  1031. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/index.js +0 -3
  1032. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/test/utils.js +0 -0
  1033. package/src/{custom-gradient-bar → custom-gradient-picker/gradient-bar}/utils.js +0 -0
  1034. package/src/custom-gradient-picker/index.js +18 -3
  1035. package/src/custom-gradient-picker/stories/index.js +4 -3
  1036. package/src/custom-gradient-picker/style.scss +30 -39
  1037. package/src/custom-select-control/README.md +10 -0
  1038. package/src/custom-select-control/index.js +54 -29
  1039. package/src/custom-select-control/stories/index.js +7 -2
  1040. package/src/custom-select-control/style.scss +2 -43
  1041. package/src/custom-select-control/styles.ts +28 -0
  1042. package/src/custom-select-control/test/index.js +4 -1
  1043. package/src/date-time/constants.ts +1 -0
  1044. package/src/date-time/date/index.tsx +289 -184
  1045. package/src/date-time/date/styles.ts +86 -27
  1046. package/src/date-time/date/test/index.tsx +18 -28
  1047. package/src/date-time/date-time/index.tsx +3 -2
  1048. package/src/date-time/time/index.tsx +30 -24
  1049. package/src/date-time/time/styles.ts +3 -6
  1050. package/src/date-time/utils.ts +17 -0
  1051. package/src/dimension-control/index.js +1 -5
  1052. package/src/disabled/index.tsx +80 -0
  1053. package/src/disabled/stories/index.tsx +87 -0
  1054. package/src/disabled/styles/{disabled-styles.js → disabled-styles.tsx} +0 -0
  1055. package/src/disabled/test/index.tsx +174 -0
  1056. package/src/disabled/types.ts +13 -0
  1057. package/src/divider/README.md +12 -5
  1058. package/src/divider/component.tsx +2 -3
  1059. package/src/divider/index.ts +1 -1
  1060. package/src/divider/stories/index.tsx +4 -4
  1061. package/src/divider/styles.ts +7 -7
  1062. package/src/divider/test/__snapshots__/{index.js.snap → index.tsx.snap} +7 -7
  1063. package/src/divider/test/index.tsx +40 -0
  1064. package/src/divider/types.ts +21 -15
  1065. package/src/draggable/README.md +1 -1
  1066. package/src/drop-zone/index.js +2 -3
  1067. package/src/dropdown/dropdown-content-wrapper.tsx +59 -0
  1068. package/src/dropdown/index.js +3 -5
  1069. package/src/dropdown/stories/index.js +60 -69
  1070. package/src/dropdown/styles.ts +38 -0
  1071. package/src/dropdown/types.ts +8 -0
  1072. package/src/dropdown-menu/stories/index.js +13 -2
  1073. package/src/duotone-picker/custom-duotone-bar.js +1 -1
  1074. package/src/duotone-picker/duotone-picker.js +34 -26
  1075. package/src/duotone-picker/duotone-swatch.js +12 -5
  1076. package/src/duotone-picker/stories/duotone-picker.js +66 -0
  1077. package/src/duotone-picker/stories/duotone-swatch.js +32 -0
  1078. package/src/elevation/README.md +16 -14
  1079. package/src/elevation/component.tsx +48 -0
  1080. package/src/elevation/{hook.js → hook.ts} +20 -17
  1081. package/src/elevation/{index.js → index.ts} +0 -0
  1082. package/src/elevation/stories/index.tsx +85 -0
  1083. package/src/elevation/{styles.js → styles.ts} +0 -0
  1084. package/src/elevation/test/__snapshots__/{index.js.snap → index.tsx.snap} +19 -13
  1085. package/src/elevation/test/index.tsx +64 -0
  1086. package/src/elevation/types.ts +12 -19
  1087. package/src/external-link/index.tsx +10 -0
  1088. package/src/flex/flex/README.md +20 -18
  1089. package/src/flex/flex/component.tsx +59 -0
  1090. package/src/flex/flex/{hook.js → hook.ts} +14 -13
  1091. package/src/flex/flex/{index.js → index.ts} +0 -0
  1092. package/src/flex/flex-block/README.md +3 -7
  1093. package/src/flex/flex-block/component.tsx +41 -0
  1094. package/src/flex/flex-block/{hook.js → hook.ts} +5 -5
  1095. package/src/flex/flex-block/{index.js → index.ts} +0 -0
  1096. package/src/flex/flex-item/README.md +6 -9
  1097. package/src/flex/flex-item/component.tsx +41 -0
  1098. package/src/flex/flex-item/{hook.js → hook.ts} +10 -7
  1099. package/src/flex/flex-item/{index.js → index.ts} +0 -0
  1100. package/src/flex/{index.js → index.ts} +0 -0
  1101. package/src/flex/stories/index.tsx +81 -0
  1102. package/src/flex/{styles.js → styles.ts} +0 -0
  1103. package/src/flex/test/__snapshots__/{index.js.snap → index.tsx.snap} +49 -9
  1104. package/src/flex/test/index.tsx +84 -0
  1105. package/src/flex/types.ts +17 -10
  1106. package/src/focal-point-picker/index.js +10 -5
  1107. package/src/focal-point-picker/styles/focal-point-picker-style.js +0 -5
  1108. package/src/focal-point-picker/styles/focal-point-style.js +0 -2
  1109. package/src/focal-point-picker/test/index.js +78 -45
  1110. package/src/font-size-picker/index.js +160 -132
  1111. package/src/font-size-picker/stories/index.js +7 -0
  1112. package/src/font-size-picker/style.scss +8 -5
  1113. package/src/font-size-picker/test/index.js +13 -6
  1114. package/src/font-size-picker/test/{util.js → utils.js} +77 -1
  1115. package/src/font-size-picker/utils.js +38 -23
  1116. package/src/form-token-field/README.md +3 -1
  1117. package/src/form-token-field/index.tsx +46 -35
  1118. package/src/form-token-field/stories/index.tsx +22 -0
  1119. package/src/form-token-field/style.scss +0 -5
  1120. package/src/form-token-field/suggestions-list.tsx +21 -12
  1121. package/src/form-token-field/test/index.tsx +2106 -0
  1122. package/src/form-token-field/types.ts +23 -2
  1123. package/src/gradient-picker/index.js +22 -7
  1124. package/src/gradient-picker/stories/index.js +56 -81
  1125. package/src/guide/index.js +3 -1
  1126. package/src/guide/page-control.js +1 -6
  1127. package/src/guide/stories/index.js +12 -11
  1128. package/src/guide/test/index.js +54 -37
  1129. package/src/guide/test/page-control.js +14 -17
  1130. package/src/higher-order/with-notices/test/index.js +4 -2
  1131. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  1132. package/src/index.js +7 -1
  1133. package/src/input-control/index.tsx +6 -0
  1134. package/src/input-control/input-base.tsx +28 -13
  1135. package/src/input-control/input-prefix-wrapper.tsx +48 -0
  1136. package/src/input-control/input-suffix-wrapper.tsx +48 -0
  1137. package/src/input-control/reducer/actions.ts +3 -1
  1138. package/src/input-control/reducer/reducer.ts +27 -10
  1139. package/src/input-control/reducer/state.ts +7 -2
  1140. package/src/input-control/stories/index.tsx +15 -2
  1141. package/src/input-control/styles/input-control-styles.tsx +28 -12
  1142. package/src/input-control/test/index.js +20 -4
  1143. package/src/input-control/types.ts +52 -3
  1144. package/src/item-group/styles.ts +3 -3
  1145. package/src/menu-group/test/index.js +18 -7
  1146. package/src/mobile/bottom-sheet/index.native.js +2 -4
  1147. package/src/mobile/global-styles-context/utils.native.js +22 -4
  1148. package/src/mobile/image/index.native.js +17 -8
  1149. package/src/mobile/link-picker/link-picker-screen.native.js +12 -4
  1150. package/src/mobile/media-edit/index.native.js +2 -7
  1151. package/src/mobile/picker/index.android.js +10 -4
  1152. package/src/mobile/picker/index.ios.js +16 -0
  1153. package/src/mobile/picker/styles.native.scss +12 -4
  1154. package/src/modal/index.js +1 -2
  1155. package/src/modal/style.scss +5 -1
  1156. package/src/modal/test/index.js +11 -9
  1157. package/src/navigable-container/container.js +12 -18
  1158. package/src/navigable-container/menu.js +3 -7
  1159. package/src/navigable-container/test/menu.js +14 -11
  1160. package/src/navigator/navigator-back-button/hook.ts +0 -3
  1161. package/src/navigator/navigator-button/hook.ts +0 -3
  1162. package/src/notice/list.js +12 -10
  1163. package/src/palette-edit/index.js +1 -0
  1164. package/src/palette-edit/styles.js +6 -5
  1165. package/src/panel/style.scss +4 -1
  1166. package/src/placeholder/README.md +49 -9
  1167. package/src/placeholder/{index.js → index.tsx} +27 -23
  1168. package/src/placeholder/stories/index.tsx +64 -0
  1169. package/src/placeholder/style.scss +65 -24
  1170. package/src/placeholder/test/index.tsx +174 -0
  1171. package/src/placeholder/types.ts +48 -0
  1172. package/src/popover/README.md +7 -0
  1173. package/src/popover/index.js +256 -157
  1174. package/src/popover/stories/index.js +213 -96
  1175. package/src/popover/style.scss +61 -7
  1176. package/src/popover/test/__snapshots__/index.js.snap +6 -6
  1177. package/src/popover/test/index.js +138 -23
  1178. package/src/popover/utils.js +107 -0
  1179. package/src/radio-control/index.tsx +1 -2
  1180. package/src/range-control/README.md +1 -1
  1181. package/src/range-control/index.tsx +3 -0
  1182. package/src/range-control/styles/range-control-styles.ts +9 -16
  1183. package/src/range-control/test/index.tsx +30 -0
  1184. package/src/range-control/types.ts +9 -4
  1185. package/src/range-control/utils.ts +4 -1
  1186. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +1 -1
  1187. package/src/sandbox/index.native.js +14 -1
  1188. package/src/scroll-lock/README.md +1 -1
  1189. package/src/scroll-lock/{index.js → index.tsx} +34 -7
  1190. package/src/scroll-lock/stories/index.tsx +96 -0
  1191. package/src/scroll-lock/test/index.tsx +26 -0
  1192. package/src/select-control/chevron-down.tsx +25 -0
  1193. package/src/select-control/index.tsx +7 -11
  1194. package/src/select-control/styles/select-control-styles.ts +54 -22
  1195. package/src/select-control/types.ts +1 -0
  1196. package/src/shortcut/{index.js → index.tsx} +5 -9
  1197. package/src/shortcut/test/__snapshots__/index.tsx.snap +15 -0
  1198. package/src/shortcut/test/index.tsx +41 -0
  1199. package/src/shortcut/types.ts +10 -0
  1200. package/src/slot-fill/test/slot.js +5 -5
  1201. package/src/snackbar/list.js +3 -2
  1202. package/src/spacer/component.tsx +3 -1
  1203. package/src/spinner/index.tsx +2 -0
  1204. package/src/style-provider/index.tsx +41 -0
  1205. package/src/style-provider/types.ts +15 -0
  1206. package/src/style.scss +0 -2
  1207. package/src/text/hook.js +5 -3
  1208. package/src/text/styles.js +1 -1
  1209. package/src/text/test/index.tsx +1 -1
  1210. package/src/toggle-group-control/stories/index.tsx +127 -0
  1211. package/src/toggle-group-control/test/__snapshots__/{index.js.snap → index.tsx.snap} +56 -26
  1212. package/src/toggle-group-control/test/{index.js → index.tsx} +2 -4
  1213. package/src/toggle-group-control/toggle-group-control/README.md +2 -0
  1214. package/src/toggle-group-control/toggle-group-control/component.tsx +20 -11
  1215. package/src/toggle-group-control/toggle-group-control/styles.ts +30 -7
  1216. package/src/toggle-group-control/toggle-group-control-option/component.tsx +19 -3
  1217. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -0
  1218. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +17 -3
  1219. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +6 -8
  1220. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +30 -7
  1221. package/src/toggle-group-control/types.ts +74 -53
  1222. package/src/toolbar/test/index.js +4 -4
  1223. package/src/toolbar-group/test/index.js +9 -15
  1224. package/src/tools-panel/styles.ts +9 -18
  1225. package/src/tools-panel/test/index.js +3 -2
  1226. package/src/tools-panel/tools-panel/README.md +94 -21
  1227. package/src/tools-panel/tools-panel/hook.ts +6 -1
  1228. package/src/tooltip/index.js +57 -15
  1229. package/src/tooltip/stories/index.js +28 -13
  1230. package/src/tooltip/style.scss +1 -1
  1231. package/src/tooltip/test/index.js +188 -172
  1232. package/src/tree-grid/index.js +4 -9
  1233. package/src/tree-select/index.tsx +5 -4
  1234. package/src/tree-select/types.ts +4 -0
  1235. package/src/ui/context/context-connect.ts +3 -2
  1236. package/src/ui/context/test/context-system-provider.js +101 -1
  1237. package/src/ui/context/use-context-system.js +7 -2
  1238. package/src/ui/tooltip/styles.js +1 -0
  1239. package/src/ui/tooltip/test/__snapshots__/index.js.snap +1 -0
  1240. package/src/ui/utils/space.ts +7 -1
  1241. package/src/unit-control/index.tsx +2 -2
  1242. package/src/unit-control/stories/index.tsx +16 -23
  1243. package/src/unit-control/styles/unit-control-styles.ts +100 -46
  1244. package/src/unit-control/test/__snapshots__/index.tsx.snap +4 -4
  1245. package/src/unit-control/types.ts +12 -9
  1246. package/src/utils/base-label.ts +13 -0
  1247. package/src/utils/box-sizing.ts +14 -0
  1248. package/src/utils/colors-values.js +42 -137
  1249. package/src/utils/config-values.js +1 -1
  1250. package/src/utils/input/input-control.js +6 -6
  1251. package/src/utils/rtl.js +6 -2
  1252. package/src/utils/strings.ts +72 -0
  1253. package/src/utils/style-mixins.js +2 -0
  1254. package/src/utils/test/strings.js +15 -0
  1255. package/tsconfig.json +1 -0
  1256. package/tsconfig.tsbuildinfo +1 -1
  1257. package/build/custom-gradient-bar/constants.js.map +0 -1
  1258. package/build/custom-gradient-bar/control-points.js.map +0 -1
  1259. package/build/custom-gradient-bar/index.js.map +0 -1
  1260. package/build/custom-gradient-bar/utils.js.map +0 -1
  1261. package/build/date-time/date/utils.js +0 -34
  1262. package/build/date-time/date/utils.js.map +0 -1
  1263. package/build/swatch/index.js +0 -39
  1264. package/build/swatch/index.js.map +0 -1
  1265. package/build-module/custom-gradient-bar/constants.js.map +0 -1
  1266. package/build-module/custom-gradient-bar/control-points.js.map +0 -1
  1267. package/build-module/custom-gradient-bar/index.js.map +0 -1
  1268. package/build-module/custom-gradient-bar/utils.js.map +0 -1
  1269. package/build-module/date-time/date/utils.js +0 -22
  1270. package/build-module/date-time/date/utils.js.map +0 -1
  1271. package/build-module/swatch/index.js +0 -28
  1272. package/build-module/swatch/index.js.map +0 -1
  1273. package/build-types/date-time/date/test/utils.d.ts +0 -2
  1274. package/build-types/date-time/date/test/utils.d.ts.map +0 -1
  1275. package/build-types/date-time/date/utils.d.ts +0 -15
  1276. package/build-types/date-time/date/utils.d.ts.map +0 -1
  1277. package/build-types/form-token-field/test/lib/fixtures.d.ts +0 -26
  1278. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +0 -1
  1279. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +0 -21
  1280. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +0 -1
  1281. package/src/card/stories/index.js +0 -209
  1282. package/src/date-time/date/datepicker.scss +0 -863
  1283. package/src/date-time/date/style.scss +0 -85
  1284. package/src/date-time/date/test/utils.ts +0 -32
  1285. package/src/date-time/date/utils.ts +0 -20
  1286. package/src/date-time/style.scss +0 -1
  1287. package/src/disabled/index.js +0 -55
  1288. package/src/disabled/stories/index.js +0 -61
  1289. package/src/disabled/test/index.js +0 -240
  1290. package/src/divider/test/index.js +0 -41
  1291. package/src/elevation/component.js +0 -43
  1292. package/src/elevation/stories/index.js +0 -148
  1293. package/src/elevation/test/index.js +0 -51
  1294. package/src/flex/flex/component.js +0 -60
  1295. package/src/flex/flex-block/component.js +0 -30
  1296. package/src/flex/flex-item/component.js +0 -30
  1297. package/src/flex/stories/index.js +0 -29
  1298. package/src/flex/test/index.js +0 -77
  1299. package/src/form-token-field/test/index.js +0 -411
  1300. package/src/form-token-field/test/lib/fixtures.js +0 -89
  1301. package/src/form-token-field/test/lib/token-field-wrapper.tsx +0 -71
  1302. package/src/menu-group/test/__snapshots__/index.js.snap +0 -23
  1303. package/src/placeholder/stories/index.js +0 -44
  1304. package/src/placeholder/test/index.js +0 -163
  1305. package/src/popover/stories/_utils.js +0 -64
  1306. package/src/scroll-lock/stories/index.js +0 -71
  1307. package/src/scroll-lock/test/index.js +0 -53
  1308. package/src/shortcut/test/index.js +0 -37
  1309. package/src/style-provider/index.js +0 -31
  1310. package/src/swatch/index.js +0 -19
  1311. package/src/swatch/style.scss +0 -21
  1312. package/src/toggle-group-control/stories/index.js +0 -187
  1313. package/src/tools-panel/test/__snapshots__/index.js.snap +0 -219
@@ -1,16 +1,11 @@
1
1
  import { createElement } from "@wordpress/element";
2
2
  // @ts-nocheck
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { includes } from 'lodash';
8
4
  /**
9
5
  * WordPress dependencies
10
6
  */
11
-
12
- import { Children, cloneElement, concatChildren, useEffect, useState } from '@wordpress/element';
13
- import { useDebounce } from '@wordpress/compose';
7
+ import { Children, cloneElement, concatChildren, useEffect, useState, useRef } from '@wordpress/element';
8
+ import { useDebounce, useMergeRefs } from '@wordpress/compose';
14
9
  /**
15
10
  * Internal dependencies
16
11
  */
@@ -32,33 +27,40 @@ const getDisabledElement = _ref => {
32
27
  let {
33
28
  eventHandlers,
34
29
  child,
35
- childrenWithPopover
30
+ childrenWithPopover,
31
+ mergedRefs
36
32
  } = _ref;
37
33
  return cloneElement(createElement("span", {
38
34
  className: "disabled-element-wrapper"
39
35
  }, cloneElement(eventCatcher, eventHandlers), cloneElement(child, {
40
- children: childrenWithPopover
41
- })), eventHandlers);
36
+ children: childrenWithPopover,
37
+ ref: mergedRefs
38
+ })), { ...eventHandlers
39
+ });
42
40
  };
43
41
 
44
42
  const getRegularElement = _ref2 => {
45
43
  let {
46
44
  child,
47
45
  eventHandlers,
48
- childrenWithPopover
46
+ childrenWithPopover,
47
+ mergedRefs
49
48
  } = _ref2;
50
49
  return cloneElement(child, { ...eventHandlers,
51
- children: childrenWithPopover
50
+ children: childrenWithPopover,
51
+ ref: mergedRefs
52
52
  });
53
53
  };
54
54
 
55
55
  const addPopoverToGrandchildren = _ref3 => {
56
56
  let {
57
+ anchorRef,
57
58
  grandchildren,
58
59
  isOver,
60
+ offset,
59
61
  position,
60
- text,
61
- shortcut
62
+ shortcut,
63
+ text
62
64
  } = _ref3;
63
65
  return concatChildren(grandchildren, isOver && createElement(Popover, {
64
66
  focusOnMount: false,
@@ -66,7 +68,8 @@ const addPopoverToGrandchildren = _ref3 => {
66
68
  className: "components-tooltip",
67
69
  "aria-hidden": "true",
68
70
  animate: false,
69
- offset: 12,
71
+ offset: offset,
72
+ anchorRef: anchorRef,
70
73
  __unstableShift: true
71
74
  }, text, createElement(Shortcut, {
72
75
  className: "components-tooltip__shortcut",
@@ -91,6 +94,8 @@ const emitToChild = (children, eventName, event) => {
91
94
  };
92
95
 
93
96
  function Tooltip(props) {
97
+ var _Children$toArray$;
98
+
94
99
  const {
95
100
  children,
96
101
  position = 'bottom middle',
@@ -107,10 +112,25 @@ function Tooltip(props) {
107
112
 
108
113
  const [isMouseDown, setIsMouseDown] = useState(false);
109
114
  const [isOver, setIsOver] = useState(false);
110
- const delayedSetIsOver = useDebounce(setIsOver, delay);
115
+ const delayedSetIsOver = useDebounce(setIsOver, delay); // Create a reference to the Tooltip's child, to be passed to the Popover
116
+ // so that the Tooltip can be correctly positioned. Also, merge with the
117
+ // existing ref for the first child, so that its ref is preserved.
118
+
119
+ const childRef = useRef(null);
120
+ const existingChildRef = (_Children$toArray$ = Children.toArray(children)[0]) === null || _Children$toArray$ === void 0 ? void 0 : _Children$toArray$.ref;
121
+ const mergedChildRefs = useMergeRefs([childRef, existingChildRef]);
111
122
 
112
123
  const createMouseDown = event => {
113
- // Preserve original child callback behavior.
124
+ // In firefox, the mouse down event is also fired when the select
125
+ // list is chosen.
126
+ // Cancel further processing because re-rendering of child components
127
+ // causes onChange to be triggered with the old value.
128
+ // See https://github.com/WordPress/gutenberg/pull/42483
129
+ if (event.target.tagName === 'OPTION') {
130
+ return;
131
+ } // Preserve original child callback behavior.
132
+
133
+
114
134
  emitToChild(children, 'onMouseDown', event); // On mouse down, the next `mouseup` should revert the value of the
115
135
  // instance property and remove its own event handler. The bind is
116
136
  // made on the document since the `mouseup` might not occur within
@@ -121,6 +141,15 @@ function Tooltip(props) {
121
141
  };
122
142
 
123
143
  const createMouseUp = event => {
144
+ // In firefox, the mouse up event is also fired when the select
145
+ // list is chosen.
146
+ // Cancel further processing because re-rendering of child components
147
+ // causes onChange to be triggered with the old value.
148
+ // See https://github.com/WordPress/gutenberg/pull/42483
149
+ if (event.target.tagName === 'OPTION') {
150
+ return;
151
+ }
152
+
124
153
  emitToChild(children, 'onMouseUp', event);
125
154
  document.removeEventListener('mouseup', cancelIsMouseDown);
126
155
  setIsMouseDown(false);
@@ -146,7 +175,7 @@ function Tooltip(props) {
146
175
  emitToChild(children, eventName, event); // Mouse events behave unreliably in React for disabled elements,
147
176
  // firing on mouseenter but not mouseleave. Further, the default
148
177
  // behavior for disabled elements in some browsers is to ignore
149
- // mouse events. Don't bother trying to to handle them.
178
+ // mouse events. Don't bother trying to handle them.
150
179
  //
151
180
  // See: https://github.com/facebook/react/issues/4251
152
181
 
@@ -165,7 +194,7 @@ function Tooltip(props) {
165
194
 
166
195
  delayedSetIsOver.cancel();
167
196
 
168
- const _isOver = includes(['focus', 'mouseenter'], event.type);
197
+ const _isOver = ['focus', 'mouseenter'].includes(event.type);
169
198
 
170
199
  if (_isOver === isOver) {
171
200
  return;
@@ -210,10 +239,12 @@ function Tooltip(props) {
210
239
  } = child.props;
211
240
  const getElementWithPopover = disabled ? getDisabledElement : getRegularElement;
212
241
  const popoverData = {
242
+ anchorRef: childRef,
213
243
  isOver,
244
+ offset: 4,
214
245
  position,
215
- text,
216
- shortcut
246
+ shortcut,
247
+ text
217
248
  };
218
249
  const childrenWithPopover = addPopoverToGrandchildren({
219
250
  grandchildren,
@@ -222,7 +253,8 @@ function Tooltip(props) {
222
253
  return getElementWithPopover({
223
254
  child,
224
255
  eventHandlers,
225
- childrenWithPopover
256
+ childrenWithPopover,
257
+ mergedRefs: mergedChildRefs
226
258
  });
227
259
  }
228
260
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["includes","Children","cloneElement","concatChildren","useEffect","useState","useDebounce","Popover","Shortcut","TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","children","getRegularElement","addPopoverToGrandchildren","grandchildren","isOver","position","text","shortcut","emitToChild","eventName","event","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","createMouseDown","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";AAAA;;AACA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,YAFD,EAGCC,cAHD,EAICC,SAJD,EAKCC,QALD,QAMO,oBANP;AAOA,SAASC,WAAT,QAA4B,oBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,MAAqB,aAArB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAG,GAAtB;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG;AAAA,MAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA,KAAjB;AAAwBC,IAAAA;AAAxB,GAAF;AAAA,SAC1BZ,YAAY,CACX;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,YAAY,CAAEQ,YAAF,EAAgBE,aAAhB,CADf,EAEGV,YAAY,CAAEW,KAAF,EAAS;AACtBE,IAAAA,QAAQ,EAAED;AADY,GAAT,CAFf,CADW,EAOXF,aAPW,CADc;AAAA,CAA3B;;AAWA,MAAMI,iBAAiB,GAAG;AAAA,MAAE;AAAEH,IAAAA,KAAF;AAASD,IAAAA,aAAT;AAAwBE,IAAAA;AAAxB,GAAF;AAAA,SACzBZ,YAAY,CAAEW,KAAF,EAAS,EACpB,GAAGD,aADiB;AAEpBG,IAAAA,QAAQ,EAAED;AAFU,GAAT,CADa;AAAA,CAA1B;;AAMA,MAAMG,yBAAyB,GAAG;AAAA,MAAE;AACnCC,IAAAA,aADmC;AAEnCC,IAAAA,MAFmC;AAGnCC,IAAAA,QAHmC;AAInCC,IAAAA,IAJmC;AAKnCC,IAAAA;AALmC,GAAF;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AA3B,MAAwChB,KAAK,CAACe,KAApD;AACA,QAAMiC,qBAAqB,GAAGhC,QAAQ,GACnClB,kBADmC,GAEnCK,iBAFH;AAIA,QAAM8C,WAAW,GAAG;AACnB3C,IAAAA,MADmB;AAEnBC,IAAAA,QAFmB;AAGnBC,IAAAA,IAHmB;AAInBC,IAAAA;AAJmB,GAApB;AAMA,QAAMR,mBAAmB,GAAGG,yBAAyB,CAAE;AACtDC,IAAAA,aADsD;AAEtD,OAAG4C;AAFmD,GAAF,CAArD;AAKA,SAAOD,qBAAqB,CAAE;AAC7BhD,IAAAA,KAD6B;AAE7BD,IAAAA,aAF6B;AAG7BE,IAAAA;AAH6B,GAAF,CAA5B;AAKA;;AAED,eAAegB,OAAf","sourcesContent":["// @ts-nocheck\n/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( { eventHandlers, child, childrenWithPopover } ) =>\n\tcloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t} ) }\n\t\t</span>,\n\t\teventHandlers\n\t);\n\nconst getRegularElement = ( { child, eventHandlers, childrenWithPopover } ) =>\n\tcloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t} );\n\nconst addPopoverToGrandchildren = ( {\n\tgrandchildren,\n\tisOver,\n\tposition,\n\ttext,\n\tshortcut,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ 12 }\n\t\t\t\t__unstableShift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = includes( [ 'focus', 'mouseenter' ], event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tisOver,\n\t\tposition,\n\t\ttext,\n\t\tshortcut,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t} );\n}\n\nexport default Tooltip;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tooltip/index.js"],"names":["Children","cloneElement","concatChildren","useEffect","useState","useRef","useDebounce","useMergeRefs","Popover","Shortcut","TOOLTIP_DELAY","eventCatcher","getDisabledElement","eventHandlers","child","childrenWithPopover","mergedRefs","children","ref","getRegularElement","addPopoverToGrandchildren","anchorRef","grandchildren","isOver","offset","position","shortcut","text","emitToChild","eventName","event","count","only","props","disabled","Tooltip","delay","isMouseDown","setIsMouseDown","setIsOver","delayedSetIsOver","childRef","existingChildRef","toArray","mergedChildRefs","createMouseDown","target","tagName","document","addEventListener","cancelIsMouseDown","createMouseUp","removeEventListener","createMouseEvent","type","createToggleIsOver","isDelayed","currentTarget","cancel","_isOver","includes","clearOnUnmount","process","env","NODE_ENV","console","error","onMouseEnter","onMouseLeave","onClick","onFocus","onBlur","onMouseDown","getElementWithPopover","popoverData"],"mappings":";AAAA;;AAEA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,cAHD,EAICC,SAJD,EAKCC,QALD,EAMCC,MAND,QAOO,oBAPP;AAQA,SAASC,WAAT,EAAsBC,YAAtB,QAA0C,oBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,QAAP,MAAqB,aAArB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAG,GAAtB;AAEP,MAAMC,YAAY,GAAG;AAAK,EAAA,SAAS,EAAC;AAAf,EAArB;;AAEA,MAAMC,kBAAkB,GAAG,QAKpB;AAAA,MALsB;AAC5BC,IAAAA,aAD4B;AAE5BC,IAAAA,KAF4B;AAG5BC,IAAAA,mBAH4B;AAI5BC,IAAAA;AAJ4B,GAKtB;AACN,SAAOf,YAAY,CAClB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,YAAY,CAAEU,YAAF,EAAgBE,aAAhB,CADf,EAEGZ,YAAY,CAAEa,KAAF,EAAS;AACtBG,IAAAA,QAAQ,EAAEF,mBADY;AAEtBG,IAAAA,GAAG,EAAEF;AAFiB,GAAT,CAFf,CADkB,EAQlB,EAAE,GAAGH;AAAL,GARkB,CAAnB;AAUA,CAhBD;;AAkBA,MAAMM,iBAAiB,GAAG,SAKnB;AAAA,MALqB;AAC3BL,IAAAA,KAD2B;AAE3BD,IAAAA,aAF2B;AAG3BE,IAAAA,mBAH2B;AAI3BC,IAAAA;AAJ2B,GAKrB;AACN,SAAOf,YAAY,CAAEa,KAAF,EAAS,EAC3B,GAAGD,aADwB;AAE3BI,IAAAA,QAAQ,EAAEF,mBAFiB;AAG3BG,IAAAA,GAAG,EAAEF;AAHsB,GAAT,CAAnB;AAKA,CAXD;;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AAA,mBAH6B;AAI7BC,IAAAA,UAAU,EAAE4B;AAJiB,GAAF,CAA5B;AAMA;;AAED,eAAeT,OAAf","sourcesContent":["// @ts-nocheck\n\n/**\n * WordPress dependencies\n */\nimport {\n\tChildren,\n\tcloneElement,\n\tconcatChildren,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n} from '@wordpress/element';\nimport { useDebounce, useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Popover from '../popover';\nimport Shortcut from '../shortcut';\n\n/**\n * Time over children to wait before showing tooltip\n *\n * @type {number}\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst eventCatcher = <div className=\"event-catcher\" />;\n\nconst getDisabledElement = ( {\n\teventHandlers,\n\tchild,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement(\n\t\t<span className=\"disabled-element-wrapper\">\n\t\t\t{ cloneElement( eventCatcher, eventHandlers ) }\n\t\t\t{ cloneElement( child, {\n\t\t\t\tchildren: childrenWithPopover,\n\t\t\t\tref: mergedRefs,\n\t\t\t} ) }\n\t\t</span>,\n\t\t{ ...eventHandlers }\n\t);\n};\n\nconst getRegularElement = ( {\n\tchild,\n\teventHandlers,\n\tchildrenWithPopover,\n\tmergedRefs,\n} ) => {\n\treturn cloneElement( child, {\n\t\t...eventHandlers,\n\t\tchildren: childrenWithPopover,\n\t\tref: mergedRefs,\n\t} );\n};\n\nconst addPopoverToGrandchildren = ( {\n\tanchorRef,\n\tgrandchildren,\n\tisOver,\n\toffset,\n\tposition,\n\tshortcut,\n\ttext,\n} ) =>\n\tconcatChildren(\n\t\tgrandchildren,\n\t\tisOver && (\n\t\t\t<Popover\n\t\t\t\tfocusOnMount={ false }\n\t\t\t\tposition={ position }\n\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tanimate={ false }\n\t\t\t\toffset={ offset }\n\t\t\t\tanchorRef={ anchorRef }\n\t\t\t\t__unstableShift\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t\t<Shortcut\n\t\t\t\t\tclassName=\"components-tooltip__shortcut\"\n\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t/>\n\t\t\t</Popover>\n\t\t)\n\t);\n\nconst emitToChild = ( children, eventName, event ) => {\n\tif ( Children.count( children ) !== 1 ) {\n\t\treturn;\n\t}\n\n\tconst child = Children.only( children );\n\n\t// If the underlying element is disabled, do not emit the event.\n\tif ( child.props.disabled ) {\n\t\treturn;\n\t}\n\n\tif ( typeof child.props[ eventName ] === 'function' ) {\n\t\tchild.props[ eventName ]( event );\n\t}\n};\n\nfunction Tooltip( props ) {\n\tconst {\n\t\tchildren,\n\t\tposition = 'bottom middle',\n\t\ttext,\n\t\tshortcut,\n\t\tdelay = TOOLTIP_DELAY,\n\t} = props;\n\t/**\n\t * Whether a mouse is currently pressed, used in determining whether\n\t * to handle a focus event as displaying the tooltip immediately.\n\t *\n\t * @type {boolean}\n\t */\n\tconst [ isMouseDown, setIsMouseDown ] = useState( false );\n\tconst [ isOver, setIsOver ] = useState( false );\n\tconst delayedSetIsOver = useDebounce( setIsOver, delay );\n\n\t// Create a reference to the Tooltip's child, to be passed to the Popover\n\t// so that the Tooltip can be correctly positioned. Also, merge with the\n\t// existing ref for the first child, so that its ref is preserved.\n\tconst childRef = useRef( null );\n\tconst existingChildRef = Children.toArray( children )[ 0 ]?.ref;\n\tconst mergedChildRefs = useMergeRefs( [ childRef, existingChildRef ] );\n\n\tconst createMouseDown = ( event ) => {\n\t\t// In firefox, the mouse down event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Preserve original child callback behavior.\n\t\temitToChild( children, 'onMouseDown', event );\n\n\t\t// On mouse down, the next `mouseup` should revert the value of the\n\t\t// instance property and remove its own event handler. The bind is\n\t\t// made on the document since the `mouseup` might not occur within\n\t\t// the bounds of the element.\n\t\tdocument.addEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( true );\n\t};\n\n\tconst createMouseUp = ( event ) => {\n\t\t// In firefox, the mouse up event is also fired when the select\n\t\t// list is chosen.\n\t\t// Cancel further processing because re-rendering of child components\n\t\t// causes onChange to be triggered with the old value.\n\t\t// See https://github.com/WordPress/gutenberg/pull/42483\n\t\tif ( event.target.tagName === 'OPTION' ) {\n\t\t\treturn;\n\t\t}\n\n\t\temitToChild( children, 'onMouseUp', event );\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t\tsetIsMouseDown( false );\n\t};\n\n\tconst createMouseEvent = ( type ) => {\n\t\tif ( type === 'mouseUp' ) return createMouseUp;\n\t\tif ( type === 'mouseDown' ) return createMouseDown;\n\t};\n\n\t/**\n\t * Prebound `isInMouseDown` handler, created as a constant reference to\n\t * assure ability to remove in component unmount.\n\t *\n\t * @type {Function}\n\t */\n\tconst cancelIsMouseDown = createMouseEvent( 'mouseUp' );\n\n\tconst createToggleIsOver = ( eventName, isDelayed ) => {\n\t\treturn ( event ) => {\n\t\t\t// Preserve original child callback behavior.\n\t\t\temitToChild( children, eventName, event );\n\n\t\t\t// Mouse events behave unreliably in React for disabled elements,\n\t\t\t// firing on mouseenter but not mouseleave. Further, the default\n\t\t\t// behavior for disabled elements in some browsers is to ignore\n\t\t\t// mouse events. Don't bother trying to handle them.\n\t\t\t//\n\t\t\t// See: https://github.com/facebook/react/issues/4251\n\t\t\tif ( event.currentTarget.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// A focus event will occur as a result of a mouse click, but it\n\t\t\t// should be disambiguated between interacting with the button and\n\t\t\t// using an explicit focus shift as a cue to display the tooltip.\n\t\t\tif ( 'focus' === event.type && isMouseDown ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Needed in case unsetting is over while delayed set pending, i.e.\n\t\t\t// quickly blur/mouseleave before delayedSetIsOver is called.\n\t\t\tdelayedSetIsOver.cancel();\n\n\t\t\tconst _isOver = [ 'focus', 'mouseenter' ].includes( event.type );\n\t\t\tif ( _isOver === isOver ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( isDelayed ) {\n\t\t\t\tdelayedSetIsOver( _isOver );\n\t\t\t} else {\n\t\t\t\tsetIsOver( _isOver );\n\t\t\t}\n\t\t};\n\t};\n\tconst clearOnUnmount = () => {\n\t\tdelayedSetIsOver.cancel();\n\t\tdocument.removeEventListener( 'mouseup', cancelIsMouseDown );\n\t};\n\n\tuseEffect( () => clearOnUnmount, [] );\n\n\tif ( Children.count( children ) !== 1 ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\n\t\treturn children;\n\t}\n\n\tconst eventHandlers = {\n\t\tonMouseEnter: createToggleIsOver( 'onMouseEnter', true ),\n\t\tonMouseLeave: createToggleIsOver( 'onMouseLeave' ),\n\t\tonClick: createToggleIsOver( 'onClick' ),\n\t\tonFocus: createToggleIsOver( 'onFocus' ),\n\t\tonBlur: createToggleIsOver( 'onBlur' ),\n\t\tonMouseDown: createMouseEvent( 'mouseDown' ),\n\t};\n\n\tconst child = Children.only( children );\n\tconst { children: grandchildren, disabled } = child.props;\n\tconst getElementWithPopover = disabled\n\t\t? getDisabledElement\n\t\t: getRegularElement;\n\n\tconst popoverData = {\n\t\tanchorRef: childRef,\n\t\tisOver,\n\t\toffset: 4,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\t};\n\tconst childrenWithPopover = addPopoverToGrandchildren( {\n\t\tgrandchildren,\n\t\t...popoverData,\n\t} );\n\n\treturn getElementWithPopover( {\n\t\tchild,\n\t\teventHandlers,\n\t\tchildrenWithPopover,\n\t\tmergedRefs: mergedChildRefs,\n\t} );\n}\n\nexport default Tooltip;\n"]}
@@ -1,14 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { includes } from 'lodash';
8
4
  /**
9
5
  * WordPress dependencies
10
6
  */
11
-
12
7
  import { focus } from '@wordpress/dom';
13
8
  import { forwardRef, useCallback } from '@wordpress/element';
14
9
  import { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';
@@ -71,7 +66,7 @@ function TreeGrid(_ref, ref) {
71
66
 
72
67
  const hasModifierKeyPressed = metaKey || ctrlKey || altKey;
73
68
 
74
- if (hasModifierKeyPressed || !includes([UP, DOWN, LEFT, RIGHT, HOME, END], keyCode)) {
69
+ if (hasModifierKeyPressed || ![UP, DOWN, LEFT, RIGHT, HOME, END].includes(keyCode)) {
75
70
  return;
76
71
  } // The event will be handled, stop propagation.
77
72
 
@@ -95,7 +90,7 @@ function TreeGrid(_ref, ref) {
95
90
  const canExpandCollapse = 0 === currentColumnIndex;
96
91
  const cannotFocusNextColumn = canExpandCollapse && activeRow.getAttribute('aria-expanded') === 'false' && keyCode === RIGHT;
97
92
 
98
- if (includes([LEFT, RIGHT], keyCode)) {
93
+ if ([LEFT, RIGHT].includes(keyCode)) {
99
94
  // Calculate to the next element.
100
95
  let nextIndex;
101
96
 
@@ -169,7 +164,7 @@ function TreeGrid(_ref, ref) {
169
164
  // doesn't try to handle key navigation.
170
165
 
171
166
  event.preventDefault();
172
- } else if (includes([UP, DOWN], keyCode)) {
167
+ } else if ([UP, DOWN].includes(keyCode)) {
173
168
  // Calculate the rowIndex of the next row.
174
169
  const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
175
170
  const currentRowIndex = rows.indexOf(activeRow);
@@ -210,7 +205,7 @@ function TreeGrid(_ref, ref) {
210
205
  // doesn't try to handle key navigation.
211
206
 
212
207
  event.preventDefault();
213
- } else if (includes([HOME, END], keyCode)) {
208
+ } else if ([HOME, END].includes(keyCode)) {
214
209
  // Calculate the rowIndex of the next row.
215
210
  const rows = Array.from(treeGridElement.querySelectorAll('[role="row"]'));
216
211
  const currentRowIndex = rows.indexOf(activeRow);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["includes","focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,QAAzB;AAEA;AACA;AACA;;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsCC,GAAtC,QAAiD,qBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,oBAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAAMC,eAAe,GAAGZ,KAAK,CAACa,SAAN,CAAgBC,IAAhB,CAAsBH,UAAtB,EAAkC;AACzDI,IAAAA,UAAU,EAAE;AAD6C,GAAlC,CAAxB;;AAIA,MAAK,CAAEH,eAAF,IAAqB,CAAEA,eAAe,CAACI,MAA5C,EAAqD;AACpD;AACA;;AAED,S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ADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGN;AAJP,MAMC,6BAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;AAED,eAAepB,UAAU,CAAEkB,QAAF,CAAzB;AACA,SAAS2C,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * External dependencies\n */\nimport { includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\t...props\n\t},\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! includes( [ UP, DOWN, LEFT, RIGHT, HOME, END ], keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( includes( [ LEFT, RIGHT ], keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ UP, DOWN ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( includes( [ HOME, END ], keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-grid/index.js"],"names":["focus","forwardRef","useCallback","UP","DOWN","LEFT","RIGHT","HOME","END","RovingTabIndexContainer","getRowFocusables","rowElement","focusablesInRow","focusable","find","sequential","length","filter","closest","TreeGrid","ref","children","onExpandRow","onCollapseRow","onFocusRow","props","onKeyDown","event","keyCode","metaKey","ctrlKey","altKey","hasModifierKeyPressed","includes","stopPropagation","activeElement","document","currentTarget","treeGridElement","contains","activeRow","currentColumnIndex","indexOf","canExpandCollapse","cannotFocusNextColumn","getAttribute","nextIndex","Math","max","min","preventDefault","level","parseInt","rows","Array","from","querySelectorAll","parentRow","currentRowIndex","i","focusableItems","nextRowIndex","focusablesInNextRow","default","TreeGridRow","TreeGridCell","TreeGridItem"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,gBAAtB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,IAAb,EAAmBC,IAAnB,EAAyBC,KAAzB,EAAgCC,IAAhC,EAAsCC,GAAtC,QAAiD,qBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,oBAApC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,gBAAT,CAA2BC,UAA3B,EAAwC;AACvC,QAA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gD/C;AACA;;AACAlC,MAAAA,KAAK,CAACuB,cAAN;AACA;AACD,GAjO2B,EAkO5B,CAAE5B,WAAF,EAAeC,aAAf,EAA8BC,UAA9B,CAlO4B,CAA7B;AAqOA;;AACA;;AACA,SACC,cAAC,uBAAD,QACC,oCACMC,KADN;AAEC,IAAA,IAAI,EAAC,UAFN;AAGC,IAAA,SAAS,EAAGC,SAHb;AAIC,IAAA,GAAG,EAAGN;AAJP,MAMC,6BAASC,QAAT,CAND,CADD,CADD;AAYA;AACA;;AAED,eAAepB,UAAU,CAAEkB,QAAF,CAAzB;AACA,SAAS4C,OAAO,IAAIC,WAApB,QAAuC,OAAvC;AACA,SAASD,OAAO,IAAIE,YAApB,QAAwC,QAAxC;AACA,SAASF,OAAO,IAAIG,YAApB,QAAwC,QAAxC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus } from '@wordpress/dom';\nimport { forwardRef, useCallback } from '@wordpress/element';\nimport { UP, DOWN, LEFT, RIGHT, HOME, END } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport RovingTabIndexContainer from './roving-tab-index';\n\n/**\n * Return focusables in a row element, excluding those from other branches\n * nested within the row.\n *\n * @param {Element} rowElement The DOM element representing the row.\n *\n * @return {?Array} The array of focusables in the row.\n */\nfunction getRowFocusables( rowElement ) {\n\tconst focusablesInRow = focus.focusable.find( rowElement, {\n\t\tsequential: true,\n\t} );\n\n\tif ( ! focusablesInRow || ! focusablesInRow.length ) {\n\t\treturn;\n\t}\n\n\treturn focusablesInRow.filter( ( focusable ) => {\n\t\treturn focusable.closest( '[role=\"row\"]' ) === rowElement;\n\t} );\n}\n\n/**\n * Renders both a table and tbody element, used to create a tree hierarchy.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/components/src/tree-grid/README.md\n * @param {Object} props Component props.\n * @param {WPElement} props.children Children to be rendered.\n * @param {Function} props.onExpandRow Callback to fire when row is expanded.\n * @param {Function} props.onCollapseRow Callback to fire when row is collapsed.\n * @param {Function} props.onFocusRow Callback to fire when moving focus to a different row.\n * @param {Object} ref A ref to the underlying DOM table element.\n */\nfunction TreeGrid(\n\t{\n\t\tchildren,\n\t\tonExpandRow = () => {},\n\t\tonCollapseRow = () => {},\n\t\tonFocusRow = () => {},\n\t\t...props\n\t},\n\tref\n) {\n\tconst onKeyDown = useCallback(\n\t\t( event ) => {\n\t\t\tconst { keyCode, metaKey, ctrlKey, altKey } = event;\n\n\t\t\t// The shift key is intentionally absent from the following list,\n\t\t\t// to enable shift + up/down to select items from the list.\n\t\t\tconst hasModifierKeyPressed = metaKey || ctrlKey || altKey;\n\n\t\t\tif (\n\t\t\t\thasModifierKeyPressed ||\n\t\t\t\t! [ UP, DOWN, LEFT, RIGHT, HOME, END ].includes( keyCode )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The event will be handled, stop propagation.\n\t\t\tevent.stopPropagation();\n\n\t\t\tconst { activeElement } = document;\n\t\t\tconst { currentTarget: treeGridElement } = event;\n\t\t\tif ( ! treeGridElement.contains( activeElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Calculate the columnIndex of the active element.\n\t\t\tconst activeRow = activeElement.closest( '[role=\"row\"]' );\n\t\t\tconst focusablesInRow = getRowFocusables( activeRow );\n\t\t\tconst currentColumnIndex = focusablesInRow.indexOf( activeElement );\n\t\t\tconst canExpandCollapse = 0 === currentColumnIndex;\n\t\t\tconst cannotFocusNextColumn =\n\t\t\t\tcanExpandCollapse &&\n\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'false' &&\n\t\t\t\tkeyCode === RIGHT;\n\n\t\t\tif ( [ LEFT, RIGHT ].includes( keyCode ) ) {\n\t\t\t\t// Calculate to the next element.\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\tnextIndex = Math.max( 0, currentColumnIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex = Math.min(\n\t\t\t\t\t\tcurrentColumnIndex + 1,\n\t\t\t\t\t\tfocusablesInRow.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is at the left most column.\n\t\t\t\tif ( canExpandCollapse ) {\n\t\t\t\t\tif ( keyCode === LEFT ) {\n\t\t\t\t\t\t// Left:\n\t\t\t\t\t\t// If a row is focused, and it is expanded, collapses the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) === 'true'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonCollapseRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, moves to the parent row (if there is one).\n\t\t\t\t\t\tconst level = Math.max(\n\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\tactiveRow?.getAttribute( 'aria-level' ) ?? 1,\n\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t) - 1,\n\t\t\t\t\t\t\t1\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst rows = Array.from(\n\t\t\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t\t\t);\n\t\t\t\t\t\tlet parentRow = activeRow;\n\t\t\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\t\t\tfor ( let i = currentRowIndex; i >= 0; i-- ) {\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tparseInt(\n\t\t\t\t\t\t\t\t\trows[ i ].getAttribute( 'aria-level' ),\n\t\t\t\t\t\t\t\t\t10\n\t\t\t\t\t\t\t\t) === level\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tparentRow = rows[ i ];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgetRowFocusables( parentRow )?.[ 0 ]?.focus();\n\t\t\t\t\t}\n\t\t\t\t\tif ( keyCode === RIGHT ) {\n\t\t\t\t\t\t// Right:\n\t\t\t\t\t\t// If a row is focused, and it is collapsed, expands the current row.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tactiveRow.getAttribute( 'aria-expanded' ) ===\n\t\t\t\t\t\t\t'false'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tonExpandRow( activeRow );\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If a row is focused, and it is expanded, focuses the rightmost cell in the row.\n\t\t\t\t\t\tconst focusableItems = getRowFocusables( activeRow );\n\t\t\t\t\t\tif ( focusableItems.length > 0 ) {\n\t\t\t\t\t\t\tfocusableItems[\n\t\t\t\t\t\t\t\tfocusableItems.length - 1\n\t\t\t\t\t\t\t]?.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start reading text on continued use of left/right arrow\n\t\t\t\t\t// keys.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Focus the next element. If at most left column and row is collapsed, moving right is not allowed as this will expand. However, if row is collapsed, moving left is allowed.\n\t\t\t\tif ( cannotFocusNextColumn ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tfocusablesInRow[ nextIndex ].focus();\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( [ UP, DOWN ].includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === UP ) {\n\t\t\t\t\tnextRowIndex = Math.max( 0, currentRowIndex - 1 );\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = Math.min(\n\t\t\t\t\t\tcurrentRowIndex + 1,\n\t\t\t\t\t\trows.length - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t} else if ( [ HOME, END ].includes( keyCode ) ) {\n\t\t\t\t// Calculate the rowIndex of the next row.\n\t\t\t\tconst rows = Array.from(\n\t\t\t\t\ttreeGridElement.querySelectorAll( '[role=\"row\"]' )\n\t\t\t\t);\n\t\t\t\tconst currentRowIndex = rows.indexOf( activeRow );\n\t\t\t\tlet nextRowIndex;\n\n\t\t\t\tif ( keyCode === HOME ) {\n\t\t\t\t\tnextRowIndex = 0;\n\t\t\t\t} else {\n\t\t\t\t\tnextRowIndex = rows.length - 1;\n\t\t\t\t}\n\n\t\t\t\t// Focus is either at the top or bottom edge of the grid. Do nothing.\n\t\t\t\tif ( nextRowIndex === currentRowIndex ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will start navigating horizontally when reaching the vertical\n\t\t\t\t\t// bounds of a table.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Get the focusables in the next row.\n\t\t\t\tconst focusablesInNextRow = getRowFocusables(\n\t\t\t\t\trows[ nextRowIndex ]\n\t\t\t\t);\n\n\t\t\t\t// If for some reason there are no focusables in the next row, do nothing.\n\t\t\t\tif ( ! focusablesInNextRow || ! focusablesInNextRow.length ) {\n\t\t\t\t\t// Prevent key use for anything else. For example, Voiceover\n\t\t\t\t\t// will still focus text when using arrow keys, while this\n\t\t\t\t\t// component should limit navigation to focusables.\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Try to focus the element in the next row that's at a similar column to the activeElement.\n\t\t\t\tconst nextIndex = Math.min(\n\t\t\t\t\tcurrentColumnIndex,\n\t\t\t\t\tfocusablesInNextRow.length - 1\n\t\t\t\t);\n\t\t\t\tfocusablesInNextRow[ nextIndex ].focus();\n\n\t\t\t\t// Let consumers know the row that was originally focused,\n\t\t\t\t// and the row that is now in focus.\n\t\t\t\tonFocusRow( event, activeRow, rows[ nextRowIndex ] );\n\n\t\t\t\t// Prevent key use for anything else. This ensures Voiceover\n\t\t\t\t// doesn't try to handle key navigation.\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ onExpandRow, onCollapseRow, onFocusRow ]\n\t);\n\n\t/* Disable reason: A treegrid is implemented using a table element. */\n\t/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */\n\treturn (\n\t\t<RovingTabIndexContainer>\n\t\t\t<table\n\t\t\t\t{ ...props }\n\t\t\t\trole=\"treegrid\"\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t<tbody>{ children }</tbody>\n\t\t\t</table>\n\t\t</RovingTabIndexContainer>\n\t);\n\t/* eslint-enable jsx-a11y/no-noninteractive-element-to-interactive-role */\n}\n\nexport default forwardRef( TreeGrid );\nexport { default as TreeGridRow } from './row';\nexport { default as TreeGridCell } from './cell';\nexport { default as TreeGridItem } from './item';\n"]}
@@ -4,7 +4,7 @@ import { createElement } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- import { unescape as unescapeString, compact } from 'lodash';
7
+ import { unescape as unescapeString } from 'lodash';
8
8
  /**
9
9
  * WordPress dependencies
10
10
  */
@@ -83,10 +83,10 @@ export function TreeSelect(_ref) {
83
83
  ...props
84
84
  } = _ref;
85
85
  const options = useMemo(() => {
86
- return compact([noOptionLabel && {
86
+ return [noOptionLabel && {
87
87
  value: '',
88
88
  label: noOptionLabel
89
- }, ...getSelectOptions(tree)]);
89
+ }, ...getSelectOptions(tree)].filter(option => !!option);
90
90
  }, [noOptionLabel, tree]);
91
91
  return createElement(SelectControl, _extends({
92
92
  label,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["unescape","unescapeString","compact","useMemo","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,cAArB,EAAqCC,OAArC,QA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AvB;AAOA,SACC,cAAC,aAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA;AAED,eAAeJ,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { unescape as unescapeString, compact } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, SelectOptions } from './types';\n\nfunction getSelectOptions( tree: Tree[], level = 0 ): SelectOptions {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + unescapeString( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn compact( [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t] );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/tree-select/index.tsx"],"names":["unescape","unescapeString","useMemo","SelectControl","getSelectOptions","tree","level","flatMap","treeNode","value","id","label","repeat","name","children","TreeSelect","noOptionLabel","onChange","selectedId","props","options","filter","option"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAQ,IAAIC,cAArB,QAA2C,QAA3C;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;;AAGA,SAASC,gBAAT,CAA2BC,IAA3B,EAAoE;AAAA,MAA3BC,KAA2B,uEAAnB,CAAmB;AACnE,SAAOD,IAAI,CAACE,OAAL,CAAgBC,QAAF,IAAgB,CACpC;AACCC,IAAAA,KAAK,EAAED,QAAQ,CAACE,EADjB;AAECC,IAAAA,KAAK,EACJ,SAASC,MAAT,CAAiBN,KAAK,GAAG,CAAzB,IAA+BL,cAAc,CAAEO,QAAQ,CAACK,IAAX;AAH/C,GADoC,EAMpC,GAAGT,gBAAgB,CAAEI,QAAQ,CAACM,QAAT,IAAqB,EAAvB,EAA2BR,KAAK,GAAG,CAAnC,CANiB,CAA9B,CAAP;AAQA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEA,OAAO,SAASS,UAAT,OAOc;AAAA,MAPO;AAC3BJ,IAAAA,KAD2B;AAE3BK,IAAAA,aAF2B;AAG3BC,IAAAA,QAH2B;AAI3BC,IAAAA,UAJ2B;AAK3Bb,IAAAA,IAAI,GAAG,EALoB;AAM3B,OAAGc;AANwB,GAOP;AACpB,QAAMC,OAAO,GAAGlB,OAAO,CAAE,MAAM;AAC9B,WAAO,CACNc,aAAa,IAAI;AAAEP,MAAAA,KAAK,EAAE,EAAT;AAAaE,MAAAA,KAAK,EAAEK;AAApB,KADX,EAEN,GAAGZ,gBAAgB,CAAEC,IAAF,CAFb,EAGLgB,MAHK,CAGWC,MAAR,IAA8C,CAAC,CAAEA,MAHpD,CAAP;AAIA,GALsB,EAKpB,CAAEN,aAAF,EAAiBX,IAAjB,CALoB,CAAvB;AAOA,SACC,cAAC,aAAD;AACQM,IAAAA,KADR;AACeS,IAAAA,OADf;AACwBH,IAAAA,QADxB;AAEC,IAAA,KAAK,EAAGC;AAFT,KAGMC,KAHN,EADD;AAOA;AAED,eAAeJ,UAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { unescape as unescapeString } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n/**\n * Internal dependencies\n */\nimport { SelectControl } from '../select-control';\nimport type { TreeSelectProps, Tree, SelectOptions, Truthy } from './types';\n\nfunction getSelectOptions( tree: Tree[], level = 0 ): SelectOptions {\n\treturn tree.flatMap( ( treeNode ) => [\n\t\t{\n\t\t\tvalue: treeNode.id,\n\t\t\tlabel:\n\t\t\t\t'\\u00A0'.repeat( level * 3 ) + unescapeString( treeNode.name ),\n\t\t},\n\t\t...getSelectOptions( treeNode.children || [], level + 1 ),\n\t] );\n}\n\n/**\n * TreeSelect component is used to generate select input fields.\n *\n * @example\n * ```jsx\n * import { TreeSelect } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyTreeSelect = () => {\n * \tconst [ page, setPage ] = useState( 'p21' );\n *\n * \treturn (\n * \t\t<TreeSelect\n * \t\t\tlabel=\"Parent page\"\n * \t\t\tnoOptionLabel=\"No parent page\"\n * \t\t\tonChange={ ( newPage ) => setPage( newPage ) }\n * \t\t\tselectedId={ page }\n * \t\t\ttree={ [\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 1',\n * \t\t\t\t\tid: 'p1',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{ name: 'Descend 1 of page 1', id: 'p11' },\n * \t\t\t\t\t\t{ name: 'Descend 2 of page 1', id: 'p12' },\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\tname: 'Page 2',\n * \t\t\t\t\tid: 'p2',\n * \t\t\t\t\tchildren: [\n * \t\t\t\t\t\t{\n * \t\t\t\t\t\t\tname: 'Descend 1 of page 2',\n * \t\t\t\t\t\t\tid: 'p21',\n * \t\t\t\t\t\t\tchildren: [\n * \t\t\t\t\t\t\t\t{\n * \t\t\t\t\t\t\t\t\tname: 'Descend 1 of Descend 1 of page 2',\n * \t\t\t\t\t\t\t\t\tid: 'p211',\n * \t\t\t\t\t\t\t\t},\n * \t\t\t\t\t\t\t],\n * \t\t\t\t\t\t},\n * \t\t\t\t\t],\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\n\nexport function TreeSelect( {\n\tlabel,\n\tnoOptionLabel,\n\tonChange,\n\tselectedId,\n\ttree = [],\n\t...props\n}: TreeSelectProps ) {\n\tconst options = useMemo( () => {\n\t\treturn [\n\t\t\tnoOptionLabel && { value: '', label: noOptionLabel },\n\t\t\t...getSelectOptions( tree ),\n\t\t].filter( < T, >( option: T ): option is Truthy< T > => !! option );\n\t}, [ noOptionLabel, tree ] );\n\n\treturn (\n\t\t<SelectControl\n\t\t\t{ ...{ label, options, onChange } }\n\t\t\tvalue={ selectedId }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default TreeSelect;\n"]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { uniq } from 'lodash';
5
4
 
6
5
  /**
7
6
  * WordPress dependencies
@@ -60,7 +59,7 @@ export function contextConnect(Component, namespace) {
60
59
 
61
60
  WrappedComponent.displayName = namespace; // @ts-ignore internal property
62
61
 
63
- WrappedComponent[CONNECT_STATIC_NAMESPACE] = uniq(mergedNamespace); // @ts-ignore WordPressComponent property
62
+ WrappedComponent[CONNECT_STATIC_NAMESPACE] = [...new Set(mergedNamespace)]; // @ts-ignore WordPressComponent property
64
63
 
65
64
  WrappedComponent.selector = `.${getStyledClassNameFromKey(namespace)}`; // @ts-ignore
66
65
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["uniq","forwardRef","memo","warn","CONNECT_STATIC_NAMESPACE","getStyledClassNameFromKey","contextConnect","Component","namespace","options","memoProp","WrappedComponent","mergedNamespace","Array","isArray","displayName","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;;AAGA;AACA;AACA;AACA,SAASC,UAAT,EAAqBC,IAArB,QAAiC,oBAAjC;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA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ACA;;AACA,OAAO,SAASM,mBAAT,CACNV,SADM,EAEK;AACX,MAAK,CAAEA,SAAP,EAAmB,OAAO,EAAP;AAEnB,MAAIW,UAAU,GAAG,EAAjB,CAHW,CAKX;;AACA,MAAKX,SAAS,CAAEH,wBAAF,CAAd,EAA6C;AAC5C;AACAc,IAAAA,UAAU,GAAGX,SAAS,CAAEH,wBAAF,CAAtB;AACA,GATU,CAWX;;;AACA,MAAKG,SAAS,CAACY,IAAV,IAAkBZ,SAAS,CAACY,IAAV,CAAgBf,wBAAhB,CAAvB,EAAoE;AACnE;AACAc,IAAAA,UAAU,GAAGX,SAAS,CAACY,IAAV,CAAgBf,wBAAhB,CAAb;AACA;;AAED,SAAOc,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,mBAAT,CACNb,SADM,EAENc,KAFM,EAGI;AACV,MAAK,CAAEd,SAAP,EAAmB,OAAO,KAAP;;AAEnB,MAAK,OAAOc,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAOJ,mBAAmB,CAAEV,SAAF,CAAnB,CAAiCe,QAAjC,CAA2CD,KAA3C,CAAP;AACA;;AACD,MAAKR,KAAK,CAACC,OAAN,CAAeO,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEV,SAAF,CAAnB,CAAiCe,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { uniq } from 'lodash';\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype ContextConnectOptions = {\n\t/** Defaults to `false`. */\n\tmemo?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * This is an (experimental) evolution of the initial connect() HOC.\n * The hope is that we can improve render performance by removing functional\n * component wrappers.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @param options\n * @return The connected WordPressComponent\n */\nexport function contextConnect< P >(\n\tComponent: ( props: P, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tnamespace: string,\n\toptions: ContextConnectOptions = {}\n): WordPressComponentFromProps< P > {\n\tconst { memo: memoProp = false } = options;\n\n\tlet WrappedComponent = forwardRef( Component );\n\tif ( memoProp ) {\n\t\t// @ts-ignore\n\t\tWrappedComponent = memo( WrappedComponent );\n\t}\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-ignore internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\tWrappedComponent.displayName = namespace;\n\n\t// @ts-ignore internal property\n\tWrappedComponent[ CONNECT_STATIC_NAMESPACE ] = uniq( mergedNamespace );\n\n\t// @ts-ignore WordPressComponent property\n\tWrappedComponent.selector = `.${ getStyledClassNameFromKey( namespace ) }`;\n\n\t// @ts-ignore\n\treturn WrappedComponent;\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/context-connect.ts"],"names":["forwardRef","memo","warn","CONNECT_STATIC_NAMESPACE","getStyledClassNameFromKey","contextConnect","Component","namespace","options","memoProp","WrappedComponent","mergedNamespace","Array","isArray","displayName","Set","selector","getConnectNamespace","namespaces","type","hasConnectNamespace","match","includes","some","result"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,UAAT,EAAqBC,IAArB,QAAiC,oBAAjC;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,aAAzC;AACA,SAASC,yBAAT,QAA0C,kCAA1C;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAT,CACNC,SADM,EAENC,SAFM,EAI6B;AAAA,MADnCC,OACmC,uEADF,EACE;AACnC,QAAM;AAAEP,IAAAA,IAAI,EAAEQ,QAAQ,GAAG;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,GATU,CAWX;;;AACA,MAAKG,SAAS,CAACa,IAAV,IAAkBb,SAAS,CAACa,IAAV,CAAgBhB,wBAAhB,CAAvB,EAAoE;AACnE;AACAe,IAAAA,UAAU,GAAGZ,SAAS,CAACa,IAAV,CAAgBhB,wBAAhB,CAAb;AACA;;AAED,SAAOe,UAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,mBAAT,CACNd,SADM,EAENe,KAFM,EAGI;AACV,MAAK,CAAEf,SAAP,EAAmB,OAAO,KAAP;;AAEnB,MAAK,OAAOe,KAAP,KAAiB,QAAtB,EAAiC;AAChC,WAAOJ,mBAAmB,CAAEX,SAAF,CAAnB,CAAiCgB,QAAjC,CAA2CD,KAA3C,CAAP;AACA;;AACD,MAAKT,KAAK,CAACC,OAAN,CAAeQ,KAAf,CAAL,EAA8B;AAC7B,WAAOA,KAAK,CAACE,IAAN,CAAcC,MAAF,IAClBP,mBAAmB,CAAEX,SAAF,CAAnB,CAAiCgB,QAAjC,CAA2CE,MAA3C,CADM,CAAP;AAGA;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, ReactChild, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, memo } from '@wordpress/element';\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { CONNECT_STATIC_NAMESPACE } from './constants';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport type { WordPressComponentFromProps } from '.';\n\ntype ContextConnectOptions = {\n\t/** Defaults to `false`. */\n\tmemo?: boolean;\n};\n\n/**\n * Forwards ref (React.ForwardRef) and \"Connects\" (or registers) a component\n * within the Context system under a specified namespace.\n *\n * This is an (experimental) evolution of the initial connect() HOC.\n * The hope is that we can improve render performance by removing functional\n * component wrappers.\n *\n * @param Component The component to register into the Context system.\n * @param namespace The namespace to register the component under.\n * @param options\n * @return The connected WordPressComponent\n */\nexport function contextConnect< P >(\n\tComponent: ( props: P, ref: ForwardedRef< any > ) => JSX.Element | null,\n\tnamespace: string,\n\toptions: ContextConnectOptions = {}\n): WordPressComponentFromProps< P > {\n\tconst { memo: memoProp = false } = options;\n\n\tlet WrappedComponent = forwardRef( Component );\n\tif ( memoProp ) {\n\t\t// @ts-ignore\n\t\tWrappedComponent = memo( WrappedComponent );\n\t}\n\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'contextConnect: Please provide a namespace' );\n\t}\n\n\t// @ts-ignore internal property\n\tlet mergedNamespace = WrappedComponent[ CONNECT_STATIC_NAMESPACE ] || [\n\t\tnamespace,\n\t];\n\n\t/**\n\t * Consolidate (merge) namespaces before attaching it to the WrappedComponent.\n\t */\n\tif ( Array.isArray( namespace ) ) {\n\t\tmergedNamespace = [ ...mergedNamespace, ...namespace ];\n\t}\n\tif ( typeof namespace === 'string' ) {\n\t\tmergedNamespace = [ ...mergedNamespace, namespace ];\n\t}\n\n\tWrappedComponent.displayName = namespace;\n\n\t// @ts-ignore internal property\n\tWrappedComponent[ CONNECT_STATIC_NAMESPACE ] = [\n\t\t...new Set( mergedNamespace ),\n\t];\n\n\t// @ts-ignore WordPressComponent property\n\tWrappedComponent.selector = `.${ getStyledClassNameFromKey( namespace ) }`;\n\n\t// @ts-ignore\n\treturn WrappedComponent;\n}\n\n/**\n * Attempts to retrieve the connected namespace from a component.\n *\n * @param Component The component to retrieve a namespace from.\n * @return The connected namespaces.\n */\nexport function getConnectNamespace(\n\tComponent: ReactChild | undefined | {}\n): string[] {\n\tif ( ! Component ) return [];\n\n\tlet namespaces = [];\n\n\t// @ts-ignore internal property\n\tif ( Component[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore internal property\n\t\tnamespaces = Component[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\t// @ts-ignore\n\tif ( Component.type && Component.type[ CONNECT_STATIC_NAMESPACE ] ) {\n\t\t// @ts-ignore\n\t\tnamespaces = Component.type[ CONNECT_STATIC_NAMESPACE ];\n\t}\n\n\treturn namespaces;\n}\n\n/**\n * Checks to see if a component is connected within the Context system.\n *\n * @param Component The component to retrieve a namespace from.\n * @param match The namespace to check.\n */\nexport function hasConnectNamespace(\n\tComponent: ReactNode,\n\tmatch: string[] | string\n): boolean {\n\tif ( ! Component ) return false;\n\n\tif ( typeof match === 'string' ) {\n\t\treturn getConnectNamespace( Component ).includes( match );\n\t}\n\tif ( Array.isArray( match ) ) {\n\t\treturn match.some( ( result ) =>\n\t\t\tgetConnectNamespace( Component ).includes( result )\n\t\t);\n\t}\n\n\treturn false;\n}\n"]}
@@ -61,10 +61,15 @@ export function useContextSystem(props, namespace) {
61
61
  for (const key in overrideProps) {
62
62
  // @ts-ignore filling in missing props
63
63
  finalComponentProps[key] = overrideProps[key];
64
- } // @ts-ignore
64
+ } // Setting an `undefined` explicitly can cause unintended overwrites
65
+ // when a `cloneElement()` is involved.
65
66
 
66
67
 
67
- finalComponentProps.children = rendered;
68
+ if (rendered !== undefined) {
69
+ // @ts-ignore
70
+ finalComponentProps.children = rendered;
71
+ }
72
+
68
73
  finalComponentProps.className = classes;
69
74
  return finalComponentProps;
70
75
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,YAAT,EAAuBC,qBAAvB,QAAoD,SAApD;AACA,SAASC,yBAAT,QAA0C,kCAA1C;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AEe,GAAF,CAAnB,GAA6Bb,aAAa,CAAEa,GAAF,CAA1C;AACA,GA5CmD,CA8CpD;;;AACAf,EAAAA,mBAAmB,CAACc,QAApB,GAA+BF,QAA/B;AACAZ,EAAAA,mBAAmB,CAACW,SAApB,GAAgCD,OAAhC;AAEA,SAAOV,mBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// @ts-ignore\n\tfinalComponentProps.children = rendered;\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/context/use-context-system.js"],"names":["warn","useComponentsContext","getNamespace","getConnectedNamespace","getStyledClassNameFromKey","useCx","useContextSystem","props","namespace","contextSystemProps","contextProps","finalComponentProps","_overrides","overrideProps","otherContextProps","initialMergedProps","Object","entries","length","assign","cx","classes","className","rendered","renderChildren","children","key","undefined"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAP,MAAiB,oBAAjB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,YAAT,EAAuBC,qBAAvB,QAAoD,SAApD;AACA,SAASC,yBAAT,QAA0C,kCAA1C;AACA,SAASC,KAAT,QAAsB,0BAAtB;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,KAA3B,EAAkCC,SAAlC,EAA8C;AACpD,QAAMC,kBAAkB,GAAGR,oBAAoB,EAA/C;;AACA,MAAK,OAAOO,SAAP,KAAqB,WAA1B,EAAwC;AACvC,6FAAAR,IAAI,CAAE,8CAAF,CAAJ;AACA;;AAED,QAAMU,YAAY,GAAG,CAAAD,kBAAkB,SAAlB,IAAAA,kBAAkB,WAAlB,YAAAA,kBAAkB,CAAID,SAAJ,CAAlB,KAAqC,EAA1D;AAEA;;AACA;AACA;;AACA,QAAMG,mBAAmB,GAAG,EAC3B,GAAGR,qBAAqB,EADG;AAE3B,OAAGD,YAAY,CAAEM,SAAF;AAFY,GAA5B;AAIA;;AAEA,QAAM;AAAEI,IAAAA,UAAU,EAAEC,aAAd;AAA6B,OAAGC;AAAhC,MAAsDJ,YAA5D;AAEA,QAAMK,kBAAkB,GAAGC,MAAM,CAACC,OAAP,CAAgBH,iBAAhB,EAAoCI,MAApC,GACxBF,MAAM,CAACG,MAAP,CAAe,EAAf,EAAmBL,iBAAnB,EAAsCP,KAAtC,CADwB,GAExBA,KAFH;AAIA,QAAMa,EAAE,GAAGf,KAAK,EAAhB;AAEA,QAAMgB,OAAO,GAAGD,EAAE,CACjBhB,yBAAyB,CAAEI,SAAF,CADR,EAEjBD,KAAK,CAACe,SAFW,CAAlB,CAzBoD,CA8BpD;;AACA,QAAMC,QAAQ,GACb,OAAOR,kBAAkB,CAACS,cAA1B,KAA6C,UAA7C,GACGT,kBAAkB,CAACS,cAAnB,CAAmCT,kBAAnC,CADH,GAEGA,kBAAkB,CAACU,QAHvB;;AAKA,OAAM,MAAMC,GAAZ,IAAmBX,kBAAnB,EAAwC;AACvC;AACAJ,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6BX,kBAAkB,CAAEW,GAAF,CAA/C;AACA;;AAED,OAAM,MAAMA,GAAZ,IAAmBb,aAAnB,EAAmC;AAClC;AACAF,IAAAA,mBAAmB,CAAEe,GAAF,CAAnB,GAA6Bb,aAAa,CAAEa,GAAF,CAA1C;AACA,GA5CmD,CA8CpD;AACA;;;AACA,MAAKH,QAAQ,KAAKI,SAAlB,EAA8B;AAC7B;AACAhB,IAAAA,mBAAmB,CAACc,QAApB,GAA+BF,QAA/B;AACA;;AAEDZ,EAAAA,mBAAmB,CAACW,SAApB,GAAgCD,OAAhC;AAEA,SAAOV,mBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport warn from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { useComponentsContext } from './context-system-provider';\nimport { getNamespace, getConnectedNamespace } from './utils';\nimport { getStyledClassNameFromKey } from './get-styled-class-name-from-key';\nimport { useCx } from '../../utils/hooks/use-cx';\n\n/**\n * @template TProps\n * @typedef {TProps & { className: string }} ConnectedProps\n */\n\n/**\n * Custom hook that derives registered props from the Context system.\n * These derived props are then consolidated with incoming component props.\n *\n * @template {{ className?: string }} P\n * @param {P} props Incoming props from the component.\n * @param {string} namespace The namespace to register and to derive context props from.\n * @return {ConnectedProps<P>} The connected props.\n */\nexport function useContextSystem( props, namespace ) {\n\tconst contextSystemProps = useComponentsContext();\n\tif ( typeof namespace === 'undefined' ) {\n\t\twarn( 'useContextSystem: Please provide a namespace' );\n\t}\n\n\tconst contextProps = contextSystemProps?.[ namespace ] || {};\n\n\t/* eslint-disable jsdoc/no-undefined-types */\n\t/** @type {ConnectedProps<P>} */\n\t// @ts-ignore We fill in the missing properties below\n\tconst finalComponentProps = {\n\t\t...getConnectedNamespace(),\n\t\t...getNamespace( namespace ),\n\t};\n\t/* eslint-enable jsdoc/no-undefined-types */\n\n\tconst { _overrides: overrideProps, ...otherContextProps } = contextProps;\n\n\tconst initialMergedProps = Object.entries( otherContextProps ).length\n\t\t? Object.assign( {}, otherContextProps, props )\n\t\t: props;\n\n\tconst cx = useCx();\n\n\tconst classes = cx(\n\t\tgetStyledClassNameFromKey( namespace ),\n\t\tprops.className\n\t);\n\n\t// Provides the ability to customize the render of the component.\n\tconst rendered =\n\t\ttypeof initialMergedProps.renderChildren === 'function'\n\t\t\t? initialMergedProps.renderChildren( initialMergedProps )\n\t\t\t: initialMergedProps.children;\n\n\tfor ( const key in initialMergedProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = initialMergedProps[ key ];\n\t}\n\n\tfor ( const key in overrideProps ) {\n\t\t// @ts-ignore filling in missing props\n\t\tfinalComponentProps[ key ] = overrideProps[ key ];\n\t}\n\n\t// Setting an `undefined` explicitly can cause unintended overwrites\n\t// when a `cloneElement()` is involved.\n\tif ( rendered !== undefined ) {\n\t\t// @ts-ignore\n\t\tfinalComponentProps.children = rendered;\n\t}\n\n\tfinalComponentProps.className = classes;\n\n\treturn finalComponentProps;\n}\n"]}
@@ -15,20 +15,20 @@ import * as ZIndex from '../../utils/z-index';
15
15
  import CONFIG from '../../utils/config-values';
16
16
  import { space } from '../utils/space';
17
17
  import { COLORS } from '../../utils/colors-values';
18
- export const TooltipContent = /*#__PURE__*/css("z-index:", ZIndex.Tooltip, ";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ", CONFIG.transitionDurationFastest, " ease;&[data-enter]{opacity:1;}" + (process.env.NODE_ENV === "production" ? "" : ";label:TooltipContent;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZWlDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFNob3J0Y3V0IH0gZnJvbSAnLi4vc2hvcnRjdXQnO1xuaW1wb3J0ICogYXMgWkluZGV4IGZyb20gJy4uLy4uL3V0aWxzL3otaW5kZXgnO1xuaW1wb3J0IENPTkZJRyBmcm9tICcuLi8uLi91dGlscy9jb25maWctdmFsdWVzJztcbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSAnLi4vLi4vdXRpbHMvY29sb3JzLXZhbHVlcyc7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwQ29udGVudCA9IGNzc2Bcblx0ei1pbmRleDogJHsgWkluZGV4LlRvb2x0aXAgfTtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0b3BhY2l0eTogMDtcblx0b3V0bGluZTogbm9uZTtcblx0dHJhbnNmb3JtLW9yaWdpbjogdG9wIGNlbnRlcjtcblx0dHJhbnNpdGlvbjogb3BhY2l0eSAkeyBDT05GSUcudHJhbnNpdGlvbkR1cmF0aW9uRmFzdGVzdCB9IGVhc2U7XG5cblx0JltkYXRhLWVudGVyXSB7XG5cdFx0b3BhY2l0eTogMTtcblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBQb3BvdmVyVmlldyA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQ6IHJnYmEoIDAsIDAsIDAsIDAuOCApO1xuXHRib3JkZXItcmFkaXVzOiAycHg7XG5cdGJveC1zaGFkb3c6IDAgMCAwIDFweCByZ2JhKCAyNTUsIDI1NSwgMjU1LCAwLjA0ICk7XG5cdGNvbG9yOiAkeyBDT0xPUlMud2hpdGUgfTtcblx0cGFkZGluZzogNHB4IDhweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBub091dGxpbmUgPSBjc3NgXG5cdG91dGxpbmU6IG5vbmU7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFNob3J0Y3V0ID0gc3R5bGVkKCBTaG9ydGN1dCApYFxuXHRkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5cdG1hcmdpbi1sZWZ0OiAkeyBzcGFjZSggMSApIH07XG5gO1xuIl19 */");
18
+ export const TooltipContent = /*#__PURE__*/css("z-index:", ZIndex.Tooltip, ";box-sizing:border-box;opacity:0;outline:none;transform-origin:top center;transition:opacity ", CONFIG.transitionDurationFastest, " ease;font-size:", CONFIG.fontSize, ";&[data-enter]{opacity:1;}" + (process.env.NODE_ENV === "production" ? "" : ";label:TooltipContent;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZWlDIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IFNob3J0Y3V0IH0gZnJvbSAnLi4vc2hvcnRjdXQnO1xuaW1wb3J0ICogYXMgWkluZGV4IGZyb20gJy4uLy4uL3V0aWxzL3otaW5kZXgnO1xuaW1wb3J0IENPTkZJRyBmcm9tICcuLi8uLi91dGlscy9jb25maWctdmFsdWVzJztcbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vdXRpbHMvc3BhY2UnO1xuaW1wb3J0IHsgQ09MT1JTIH0gZnJvbSAnLi4vLi4vdXRpbHMvY29sb3JzLXZhbHVlcyc7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwQ29udGVudCA9IGNzc2Bcblx0ei1pbmRleDogJHsgWkluZGV4LlRvb2x0aXAgfTtcblx0Ym94LXNpemluZzogYm9yZGVyLWJveDtcblx0b3BhY2l0eTogMDtcblx0b3V0bGluZTogbm9uZTtcblx0dHJhbnNmb3JtLW9yaWdpbjogdG9wIGNlbnRlcjtcblx0dHJhbnNpdGlvbjogb3BhY2l0eSAkeyBDT05GSUcudHJhbnNpdGlvbkR1cmF0aW9uRmFzdGVzdCB9IGVhc2U7XG5cdGZvbnQtc2l6ZTogJHsgQ09ORklHLmZvbnRTaXplIH07XG5cblx0JltkYXRhLWVudGVyXSB7XG5cdFx0b3BhY2l0eTogMTtcblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBQb3BvdmVyVmlldyA9IHN0eWxlZC5kaXZgXG5cdGJhY2tncm91bmQ6IHJnYmEoIDAsIDAsIDAsIDAuOCApO1xuXHRib3JkZXItcmFkaXVzOiAycHg7XG5cdGJveC1zaGFkb3c6IDAgMCAwIDFweCByZ2JhKCAyNTUsIDI1NSwgMjU1LCAwLjA0ICk7XG5cdGNvbG9yOiAkeyBDT0xPUlMud2hpdGUgfTtcblx0cGFkZGluZzogNHB4IDhweDtcbmA7XG5cbmV4cG9ydCBjb25zdCBub091dGxpbmUgPSBjc3NgXG5cdG91dGxpbmU6IG5vbmU7XG5gO1xuXG5leHBvcnQgY29uc3QgVG9vbHRpcFNob3J0Y3V0ID0gc3R5bGVkKCBTaG9ydGN1dCApYFxuXHRkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG5cdG1hcmdpbi1sZWZ0OiAkeyBzcGFjZSggMSApIH07XG5gO1xuIl19 */");
19
19
  export const TooltipPopoverView = _styled("div", process.env.NODE_ENV === "production" ? {
20
20
  target: "e7tfjmw1"
21
21
  } : {
22
22
  target: "e7tfjmw1",
23
23
  label: "TooltipPopoverView"
24
- })("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:", COLORS.white, ";padding:4px 8px;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9v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lwUG9wb3ZlclZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiByZ2JhKCAwLCAwLCAwLCAwLjggKTtcblx0Ym9yZGVyLXJhZGl1czogMnB4O1xuXHRib3gtc2hhZG93OiAwIDAgMCAxcHggcmdiYSggMjU1LCAyNTUsIDI1NSwgMC4wNCApO1xuXHRjb2xvcjogJHsgQ09MT1JTLndoaXRlIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5gO1xuXG5leHBvcnQgY29uc3Qgbm9PdXRsaW5lID0gY3NzYFxuXHRvdXRsaW5lOiBub25lO1xuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBTaG9ydGN1dCA9IHN0eWxlZCggU2hvcnRjdXQgKWBcblx0ZGlzcGxheTogaW5saW5lLWJsb2NrO1xuXHRtYXJnaW4tbGVmdDogJHsgc3BhY2UoIDEgKSB9O1xuYDtcbiJdfQ== */"));
24
+ })("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;box-shadow:0 0 0 1px rgba( 255, 255, 255, 0.04 );color:", COLORS.white, ";padding:4px 8px;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNkI0QyIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3VpL3Rvb2x0aXAvc3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG4vKipcbiAqIEludGVybmFs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0gY3NzYFxuXHRvdXRsaW5lOiBub25lO1xuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBTaG9ydGN1dCA9IHN0eWxlZCggU2hvcnRjdXQgKWBcblx0ZGlzcGxheTogaW5saW5lLWJsb2NrO1xuXHRtYXJnaW4tbGVmdDogJHsgc3BhY2UoIDEgKSB9O1xuYDtcbiJdfQ== */"));
25
25
  export const noOutline = process.env.NODE_ENV === "production" ? {
26
26
  name: "12mkfdx",
27
27
  styles: "outline:none"
28
28
  } : {
29
29
  name: "160q0w1-noOutline",
30
30
  styles: "outline:none;label:noOutline;",
31
- map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBb0M0QiIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3VpL3Rvb2x0aXAvc3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBTaG9ydGN1dCB9IGZyb20gJy4uL3Nob3J0Y3V0JztcbmltcG9ydCAqIGFzIFpJbmRleCBmcm9tICcuLi8uLi91dGlscy96LWluZGV4JztcbmltcG9ydCBDT05GSUcgZnJvbSAnLi4vLi4vdXRpbHMvY29uZmlnLXZhbHVlcyc7XG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy4uL3V0aWxzL3NwYWNlJztcbmltcG9ydCB7IENPTE9SUyB9IGZyb20g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bmA7XG5cbmV4cG9ydCBjb25zdCBUb29sdGlwUG9wb3ZlclZpZXcgPSBzdHlsZWQuZGl2YFxuXHRiYWNrZ3JvdW5kOiByZ2JhKCAwLCAwLCAwLCAwLjggKTtcblx0Ym9yZGVyLXJhZGl1czogMnB4O1xuXHRib3gtc2hhZG93OiAwIDAgMCAxcHggcmdiYSggMjU1LCAyNTUsIDI1NSwgMC4wNCApO1xuXHRjb2xvcjogJHsgQ09MT1JTLndoaXRlIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5gO1xuXG5leHBvcnQgY29uc3Qgbm9PdXRsaW5lID0gY3NzYFxuXHRvdXRsaW5lOiBub25lO1xuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBTaG9ydGN1dCA9IHN0eWxlZCggU2hvcnRjdXQgKWBcblx0ZGlzcGxheTogaW5saW5lLWJsb2NrO1xuXHRtYXJnaW4tbGVmdDogJHsgc3BhY2UoIDEgKSB9O1xuYDtcbiJdfQ== */",
32
32
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
33
  };
34
34
  export const TooltipShortcut = /*#__PURE__*/_styled(Shortcut, process.env.NODE_ENV === "production" ? {
@@ -36,5 +36,5 @@ export const TooltipShortcut = /*#__PURE__*/_styled(Shortcut, process.env.NODE_E
36
36
  } : {
37
37
  target: "e7tfjmw0",
38
38
  label: "TooltipShortcut"
39
- })("display:inline-block;margin-left:", space(1), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBd0NpRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3VpL3Rvb2x0aXAvc3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4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UsIDI1NSwgMC4wNCApO1xuXHRjb2xvcjogJHsgQ09MT1JTLndoaXRlIH07XG5cdHBhZGRpbmc6IDRweCA4cHg7XG5gO1xuXG5leHBvcnQgY29uc3Qgbm9PdXRsaW5lID0gY3NzYFxuXHRvdXRsaW5lOiBub25lO1xuYDtcblxuZXhwb3J0IGNvbnN0IFRvb2x0aXBTaG9ydGN1dCA9IHN0eWxlZCggU2hvcnRjdXQgKWBcblx0ZGlzcGxheTogaW5saW5lLWJsb2NrO1xuXHRtYXJnaW4tbGVmdDogJHsgc3BhY2UoIDEgKSB9O1xuYDtcbiJdfQ== */"));
39
+ })("display:inline-block;margin-left:", space(1), ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvdWkvdG9vbHRpcC9zdHlsZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeUNpRCIsImZpbGUiOiJAd29yZHByZXNzL2NvbXBvbmVudHMvc3JjL3VpL3Rvb2x0aXAvc3R5bGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBTaG9ydGN1dCB9IGZyb20gJy4uL3Nob3J0Y3V0JztcbmltcG9ydCAqIGFzIFpJbmRleCBmcm9tICcuLi8uLi91dGlscy96LWluZGV4JztcbmltcG9ydCBDT05GSUcgZnJvbSAnLi4vLi4vdXRpbHMvY29uZmlnLXZhbHVlcyc7XG5pbXBvcnQgeyBzcGFjZSB9IGZyb20gJy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 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/ui/tooltip/styles.js"],"names":["css","Shortcut","ZIndex","CONFIG","space","COLORS","TooltipContent","Tooltip","transitionDurationFastest","TooltipPopoverView","white","noOutline","TooltipShortcut"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,SAASC,QAAT,QAAyB,aAAzB;AACA,OAAO,KAAKC,MAAZ,MAAwB,qBAAxB;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,MAAT,QAAuB,2BAAvB;AAEA,OAAO,MAAMC,cAAc,gBAAGN,GAAH,aACdE,MAAM,CAACK,OADO,mGAMHJ,MAAM,CAACK,yBANJ,80DAApB;AAaP,OAAO,MAAMC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,gHAIpBJ,MAAM,CAACK,KAJa,6vDAAxB;AAQP,OAAO,MAAMC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAf;AAIP,OAAO,MAAMC,eAAe,GAAG,qBAAQX,QAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,sCAEXG,KAAK,CAAE,CAAF,CAFM,6uDAArB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Shortcut } from '../shortcut';\nimport * as ZIndex from '../../utils/z-index';\nimport CONFIG from '../../utils/config-values';\nimport { space } from '../utils/space';\nimport { COLORS } from '../../utils/colors-values';\n\nexport const TooltipContent = css`\n\tz-index: ${ ZIndex.Tooltip };\n\tbox-sizing: border-box;\n\topacity: 0;\n\toutline: none;\n\ttransform-origin: top center;\n\ttransition: opacity ${ CONFIG.transitionDurationFastest } ease;\n\n\t&[data-enter] {\n\t\topacity: 1;\n\t}\n`;\n\nexport const TooltipPopoverView = styled.div`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tbox-shadow: 0 0 0 1px rgba( 255, 255, 255, 0.04 );\n\tcolor: ${ COLORS.white };\n\tpadding: 4px 8px;\n`;\n\nexport const noOutline = css`\n\toutline: none;\n`;\n\nexport const TooltipShortcut = styled( Shortcut )`\n\tdisplay: inline-block;\n\tmargin-left: ${ space( 1 ) };\n`;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/ui/tooltip/styles.js"],"names":["css","Shortcut","ZIndex","CONFIG","space","COLORS","TooltipContent","Tooltip","transitionDurationFastest","fontSize","TooltipPopoverView","white","noOutline","TooltipShortcut"],"mappings":";;;;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,gBAApB;;AAGA;AACA;AACA;AACA,SAASC,QAAT,QAAyB,aAAzB;AACA,OAAO,KAAKC,MAAZ,MAAwB,qBAAxB;AACA,OAAOC,MAAP,MAAmB,2BAAnB;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,MAAT,QAAuB,2BAAvB;AAEA,OAAO,MAAMC,cAAc,gBAAGN,GAAH,aACdE,MAAM,CAACK,OADO,mGAMHJ,MAAM,CAACK,yBANJ,sBAOZL,MAAM,CAACM,QAPK,y3DAApB;AAcP,OAAO,MAAMC,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,gHAIpBL,MAAM,CAACM,KAJa,6yDAAxB;AAQP,OAAO,MAAMC,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAf;AAIP,OAAO,MAAMC,eAAe,GAAG,qBAAQZ,QAAR;AAAA;AAAA;AAAA;AAAA;AAAA,EAAH,sCAEXG,KAAK,CAAE,CAAF,CAFM,6xDAArB","sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { Shortcut } from '../shortcut';\nimport * as ZIndex from '../../utils/z-index';\nimport CONFIG from '../../utils/config-values';\nimport { space } from '../utils/space';\nimport { COLORS } from '../../utils/colors-values';\n\nexport const TooltipContent = css`\n\tz-index: ${ ZIndex.Tooltip };\n\tbox-sizing: border-box;\n\topacity: 0;\n\toutline: none;\n\ttransform-origin: top center;\n\ttransition: opacity ${ CONFIG.transitionDurationFastest } ease;\n\tfont-size: ${ CONFIG.fontSize };\n\n\t&[data-enter] {\n\t\topacity: 1;\n\t}\n`;\n\nexport const TooltipPopoverView = styled.div`\n\tbackground: rgba( 0, 0, 0, 0.8 );\n\tborder-radius: 2px;\n\tbox-shadow: 0 0 0 1px rgba( 255, 255, 255, 0.04 );\n\tcolor: ${ COLORS.white };\n\tpadding: 4px 8px;\n`;\n\nexport const noOutline = css`\n\toutline: none;\n`;\n\nexport const TooltipShortcut = styled( Shortcut )`\n\tdisplay: inline-block;\n\tmargin-left: ${ space( 1 ) };\n`;\n"]}
@@ -1,5 +1,11 @@
1
1
  /**
2
- * A real number or something parsable as a number
2
+ * The argument value for the `space()` utility function.
3
+ *
4
+ * When this is a number or a numeric string, it will be interpreted as a
5
+ * multiplier for the grid base value (4px). For example, `space( 2 )` will be 8px.
6
+ *
7
+ * Otherwise, it will be interpreted as a literal CSS length value. For example,
8
+ * `space( 'auto' )` will be 'auto', and `space( '2px' )` will be 2px.
3
9
  */
4
10
  const GRID_BASE = '4px';
5
11
  /**