@wordpress/components 23.8.0 → 24.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 (389) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/CONTRIBUTING.md +65 -1
  3. package/README.md +1 -3
  4. package/build/autocomplete/autocompleter-ui.js +0 -2
  5. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  6. package/build/autocomplete/index.js +2 -0
  7. package/build/autocomplete/index.js.map +1 -1
  8. package/build/button/index.js +2 -0
  9. package/build/button/index.js.map +1 -1
  10. package/build/card/card-media/component.js +2 -1
  11. package/build/card/card-media/component.js.map +1 -1
  12. package/build/checkbox-control/index.js +2 -2
  13. package/build/checkbox-control/index.js.map +1 -1
  14. package/build/color-palette/index.native.js +12 -0
  15. package/build/color-palette/index.native.js.map +1 -1
  16. package/build/combobox-control/index.js +7 -5
  17. package/build/combobox-control/index.js.map +1 -1
  18. package/build/combobox-control/styles.js +3 -3
  19. package/build/combobox-control/styles.js.map +1 -1
  20. package/build/custom-gradient-picker/index.native.js +3 -1
  21. package/build/custom-gradient-picker/index.native.js.map +1 -1
  22. package/build/dimension-control/index.js +1 -1
  23. package/build/dimension-control/index.js.map +1 -1
  24. package/build/draggable/index.js +8 -8
  25. package/build/draggable/index.js.map +1 -1
  26. package/build/form-token-field/index.js +5 -3
  27. package/build/form-token-field/index.js.map +1 -1
  28. package/build/form-token-field/styles.js +3 -3
  29. package/build/form-token-field/styles.js.map +1 -1
  30. package/build/index.js.map +1 -1
  31. package/build/mobile/bottom-sheet/cell.native.js +6 -6
  32. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  33. package/build/mobile/color-settings/palette.screen.native.js +0 -8
  34. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  35. package/build/mobile/global-styles-context/index.native.js +13 -1
  36. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  37. package/build/mobile/global-styles-context/utils.native.js +21 -4
  38. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  39. package/build/mobile/link-picker/link-picker-results.native.js +3 -1
  40. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  41. package/build/mobile/segmented-control/index.native.js +4 -2
  42. package/build/mobile/segmented-control/index.native.js.map +1 -1
  43. package/build/modal/index.js +2 -1
  44. package/build/modal/index.js.map +1 -1
  45. package/build/navigable-container/container.js +39 -19
  46. package/build/navigable-container/container.js.map +1 -1
  47. package/build/navigable-container/index.js.map +1 -1
  48. package/build/navigable-container/menu.js +37 -5
  49. package/build/navigable-container/menu.js.map +1 -1
  50. package/build/navigable-container/tabbable.js +45 -4
  51. package/build/navigable-container/tabbable.js.map +1 -1
  52. package/build/navigable-container/types.js +6 -0
  53. package/build/navigable-container/types.js.map +1 -0
  54. package/build/navigator/navigator-screen/component.js +1 -1
  55. package/build/navigator/navigator-screen/component.js.map +1 -1
  56. package/build/palette-edit/index.js +34 -12
  57. package/build/palette-edit/index.js.map +1 -1
  58. package/build/popover/index.js +1 -8
  59. package/build/popover/index.js.map +1 -1
  60. package/build/private-apis.js +4 -1
  61. package/build/private-apis.js.map +1 -1
  62. package/build/sandbox/index.native.js +10 -3
  63. package/build/sandbox/index.native.js.map +1 -1
  64. package/build/slot-fill/bubbles-virtually/fill.js +2 -1
  65. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  66. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +45 -35
  67. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  68. package/build/slot-fill/bubbles-virtually/use-slot.js +11 -26
  69. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  70. package/build/slot-fill/fill.js +7 -31
  71. package/build/slot-fill/fill.js.map +1 -1
  72. package/build/slot-fill/index.js +20 -7
  73. package/build/slot-fill/index.js.map +1 -1
  74. package/build/slot-fill/provider.js +0 -6
  75. package/build/slot-fill/provider.js.map +1 -1
  76. package/build/slot-fill/slot.js +0 -5
  77. package/build/slot-fill/slot.js.map +1 -1
  78. package/build/spinner/styles.js +4 -4
  79. package/build/spinner/styles.js.map +1 -1
  80. package/build/tab-panel/index.js.map +1 -1
  81. package/build/theme/color-algorithms.js +1 -1
  82. package/build/theme/color-algorithms.js.map +1 -1
  83. package/build/toolbar/toolbar-button/index.js +1 -2
  84. package/build/toolbar/toolbar-button/index.js.map +1 -1
  85. package/build/toolbar/toolbar-item/index.js +4 -2
  86. package/build/toolbar/toolbar-item/index.js.map +1 -1
  87. package/build/tree-grid/index.js +3 -3
  88. package/build/tree-grid/index.js.map +1 -1
  89. package/build/utils/colors-values.js +3 -3
  90. package/build/utils/colors-values.js.map +1 -1
  91. package/build/utils/use-deprecated-props.js +35 -0
  92. package/build/utils/use-deprecated-props.js.map +1 -0
  93. package/build/view/component.js +1 -2
  94. package/build/view/component.js.map +1 -1
  95. package/build-module/autocomplete/autocompleter-ui.js +1 -3
  96. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  97. package/build-module/autocomplete/index.js +3 -3
  98. package/build-module/autocomplete/index.js.map +1 -1
  99. package/build-module/button/index.js +2 -0
  100. package/build-module/button/index.js.map +1 -1
  101. package/build-module/card/card-media/component.js +2 -1
  102. package/build-module/card/card-media/component.js.map +1 -1
  103. package/build-module/checkbox-control/index.js +2 -2
  104. package/build-module/checkbox-control/index.js.map +1 -1
  105. package/build-module/color-palette/index.native.js +13 -1
  106. package/build-module/color-palette/index.native.js.map +1 -1
  107. package/build-module/combobox-control/index.js +6 -5
  108. package/build-module/combobox-control/index.js.map +1 -1
  109. package/build-module/combobox-control/styles.js +3 -3
  110. package/build-module/combobox-control/styles.js.map +1 -1
  111. package/build-module/custom-gradient-picker/index.native.js +3 -1
  112. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  113. package/build-module/dimension-control/index.js +1 -1
  114. package/build-module/dimension-control/index.js.map +1 -1
  115. package/build-module/draggable/index.js +8 -8
  116. package/build-module/draggable/index.js.map +1 -1
  117. package/build-module/form-token-field/index.js +4 -3
  118. package/build-module/form-token-field/index.js.map +1 -1
  119. package/build-module/form-token-field/styles.js +3 -3
  120. package/build-module/form-token-field/styles.js.map +1 -1
  121. package/build-module/index.js.map +1 -1
  122. package/build-module/mobile/bottom-sheet/cell.native.js +6 -5
  123. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  124. package/build-module/mobile/color-settings/palette.screen.native.js +0 -8
  125. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  126. package/build-module/mobile/global-styles-context/index.native.js +13 -1
  127. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  128. package/build-module/mobile/global-styles-context/utils.native.js +21 -3
  129. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  130. package/build-module/mobile/link-picker/link-picker-results.native.js +3 -1
  131. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  132. package/build-module/mobile/segmented-control/index.native.js +4 -2
  133. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  134. package/build-module/modal/index.js +2 -1
  135. package/build-module/modal/index.js.map +1 -1
  136. package/build-module/navigable-container/container.js +43 -19
  137. package/build-module/navigable-container/container.js.map +1 -1
  138. package/build-module/navigable-container/index.js +0 -2
  139. package/build-module/navigable-container/index.js.map +1 -1
  140. package/build-module/navigable-container/menu.js +36 -4
  141. package/build-module/navigable-container/menu.js.map +1 -1
  142. package/build-module/navigable-container/tabbable.js +44 -3
  143. package/build-module/navigable-container/tabbable.js.map +1 -1
  144. package/build-module/navigable-container/types.js +2 -0
  145. package/build-module/navigable-container/types.js.map +1 -0
  146. package/build-module/navigator/navigator-screen/component.js +1 -1
  147. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  148. package/build-module/palette-edit/index.js +34 -13
  149. package/build-module/palette-edit/index.js.map +1 -1
  150. package/build-module/popover/index.js +1 -8
  151. package/build-module/popover/index.js.map +1 -1
  152. package/build-module/private-apis.js +3 -1
  153. package/build-module/private-apis.js.map +1 -1
  154. package/build-module/sandbox/index.native.js +10 -3
  155. package/build-module/sandbox/index.native.js.map +1 -1
  156. package/build-module/slot-fill/bubbles-virtually/fill.js +2 -1
  157. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  158. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -36
  159. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  160. package/build-module/slot-fill/bubbles-virtually/use-slot.js +12 -27
  161. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  162. package/build-module/slot-fill/fill.js +7 -31
  163. package/build-module/slot-fill/fill.js.map +1 -1
  164. package/build-module/slot-fill/index.js +17 -8
  165. package/build-module/slot-fill/index.js.map +1 -1
  166. package/build-module/slot-fill/provider.js +0 -6
  167. package/build-module/slot-fill/provider.js.map +1 -1
  168. package/build-module/slot-fill/slot.js +0 -5
  169. package/build-module/slot-fill/slot.js.map +1 -1
  170. package/build-module/spinner/styles.js +4 -4
  171. package/build-module/spinner/styles.js.map +1 -1
  172. package/build-module/tab-panel/index.js.map +1 -1
  173. package/build-module/theme/color-algorithms.js +1 -1
  174. package/build-module/theme/color-algorithms.js.map +1 -1
  175. package/build-module/toolbar/toolbar-button/index.js +1 -2
  176. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  177. package/build-module/toolbar/toolbar-item/index.js +5 -2
  178. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  179. package/build-module/tree-grid/index.js +3 -3
  180. package/build-module/tree-grid/index.js.map +1 -1
  181. package/build-module/utils/colors-values.js +3 -3
  182. package/build-module/utils/colors-values.js.map +1 -1
  183. package/build-module/utils/use-deprecated-props.js +25 -0
  184. package/build-module/utils/use-deprecated-props.js.map +1 -0
  185. package/build-module/view/component.js +1 -2
  186. package/build-module/view/component.js.map +1 -1
  187. package/build-style/style-rtl.css +83 -70
  188. package/build-style/style.css +83 -70
  189. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  190. package/build-types/autocomplete/index.d.ts.map +1 -1
  191. package/build-types/autocomplete/types.d.ts +2 -18
  192. package/build-types/autocomplete/types.d.ts.map +1 -1
  193. package/build-types/box-control/styles/box-control-styles.d.ts +1 -1
  194. package/build-types/button/deprecated.d.ts +12 -6
  195. package/build-types/button/deprecated.d.ts.map +1 -1
  196. package/build-types/button/index.d.ts.map +1 -1
  197. package/build-types/button/types.d.ts +7 -0
  198. package/build-types/button/types.d.ts.map +1 -1
  199. package/build-types/card/card-media/component.d.ts +2 -1
  200. package/build-types/card/card-media/component.d.ts.map +1 -1
  201. package/build-types/card/stories/index.d.ts +21 -1
  202. package/build-types/card/stories/index.d.ts.map +1 -1
  203. package/build-types/checkbox-control/index.d.ts.map +1 -1
  204. package/build-types/color-palette/styles.d.ts +1 -1
  205. package/build-types/color-picker/styles.d.ts +3 -3
  206. package/build-types/combobox-control/index.d.ts +1 -1
  207. package/build-types/combobox-control/index.d.ts.map +1 -1
  208. package/build-types/combobox-control/stories/index.d.ts.map +1 -1
  209. package/build-types/combobox-control/styles.d.ts +1 -1
  210. package/build-types/combobox-control/types.d.ts +8 -1
  211. package/build-types/combobox-control/types.d.ts.map +1 -1
  212. package/build-types/date-time/date/styles.d.ts +1 -1
  213. package/build-types/date-time/time/styles.d.ts +4 -4
  214. package/build-types/dimension-control/index.d.ts +1 -1
  215. package/build-types/draggable/index.d.ts +1 -1
  216. package/build-types/draggable/index.d.ts.map +1 -1
  217. package/build-types/draggable/stories/index.d.ts +8 -0
  218. package/build-types/draggable/stories/index.d.ts.map +1 -1
  219. package/build-types/draggable/types.d.ts +7 -0
  220. package/build-types/draggable/types.d.ts.map +1 -1
  221. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  222. package/build-types/form-token-field/index.d.ts.map +1 -1
  223. package/build-types/form-token-field/styles.d.ts +1 -1
  224. package/build-types/form-token-field/types.d.ts +8 -1
  225. package/build-types/form-token-field/types.d.ts.map +1 -1
  226. package/build-types/index.d.ts +1 -0
  227. package/build-types/index.d.ts.map +1 -1
  228. package/build-types/modal/index.d.ts.map +1 -1
  229. package/build-types/navigable-container/container.d.ts +20 -1
  230. package/build-types/navigable-container/container.d.ts.map +1 -1
  231. package/build-types/navigable-container/index.d.ts +5 -2
  232. package/build-types/navigable-container/index.d.ts.map +1 -1
  233. package/build-types/navigable-container/menu.d.ts +45 -11
  234. package/build-types/navigable-container/menu.d.ts.map +1 -1
  235. package/build-types/navigable-container/stories/navigable-menu.d.ts +12 -0
  236. package/build-types/navigable-container/stories/navigable-menu.d.ts.map +1 -0
  237. package/build-types/navigable-container/stories/tabbable-container.d.ts +12 -0
  238. package/build-types/navigable-container/stories/tabbable-container.d.ts.map +1 -0
  239. package/build-types/navigable-container/tabbable.d.ts +52 -9
  240. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  241. package/build-types/navigable-container/test/navigable-menu.d.ts +2 -0
  242. package/build-types/navigable-container/test/navigable-menu.d.ts.map +1 -0
  243. package/build-types/navigable-container/test/tababble-container.d.ts +2 -0
  244. package/build-types/navigable-container/test/tababble-container.d.ts.map +1 -0
  245. package/build-types/navigable-container/types.d.ts +61 -0
  246. package/build-types/navigable-container/types.d.ts.map +1 -0
  247. package/build-types/navigation/styles/navigation-styles.d.ts +1 -1
  248. package/build-types/navigator/navigator-back-button/component.d.ts +2 -1
  249. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  250. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -1
  251. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  252. package/build-types/navigator/navigator-button/component.d.ts +2 -1
  253. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  254. package/build-types/navigator/navigator-button/hook.d.ts +2 -1
  255. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  256. package/build-types/navigator/navigator-screen/component.d.ts +1 -1
  257. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  258. package/build-types/navigator/navigator-to-parent-button/component.d.ts +2 -1
  259. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  260. package/build-types/number-control/index.d.ts +1 -1
  261. package/build-types/number-control/stories/index.d.ts +1 -1
  262. package/build-types/palette-edit/index.d.ts +1 -1
  263. package/build-types/palette-edit/index.d.ts.map +1 -1
  264. package/build-types/palette-edit/stories/index.d.ts.map +1 -1
  265. package/build-types/palette-edit/styles.d.ts +16 -10
  266. package/build-types/palette-edit/styles.d.ts.map +1 -1
  267. package/build-types/palette-edit/types.d.ts +8 -0
  268. package/build-types/palette-edit/types.d.ts.map +1 -1
  269. package/build-types/popover/index.d.ts +1 -1
  270. package/build-types/popover/index.d.ts.map +1 -1
  271. package/build-types/popover/stories/e2e/index.d.ts +1 -1
  272. package/build-types/private-apis.d.ts.map +1 -1
  273. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  274. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  275. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  276. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  277. package/build-types/slot-fill/fill.d.ts +4 -2
  278. package/build-types/slot-fill/fill.d.ts.map +1 -1
  279. package/build-types/slot-fill/index.d.ts +14 -3
  280. package/build-types/slot-fill/index.d.ts.map +1 -1
  281. package/build-types/slot-fill/provider.d.ts +0 -2
  282. package/build-types/slot-fill/provider.d.ts.map +1 -1
  283. package/build-types/slot-fill/slot.d.ts.map +1 -1
  284. package/build-types/spinner/styles.d.ts.map +1 -1
  285. package/build-types/toolbar/stories/index.d.ts.map +1 -1
  286. package/build-types/toolbar/toolbar-button/index.d.ts +12 -6
  287. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  288. package/build-types/toolbar/toolbar-item/index.d.ts +6 -4
  289. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  290. package/build-types/tree-grid/index.d.ts.map +1 -1
  291. package/build-types/tree-grid/types.d.ts +7 -0
  292. package/build-types/tree-grid/types.d.ts.map +1 -1
  293. package/build-types/ui/context/wordpress-component.d.ts +1 -1
  294. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  295. package/build-types/unit-control/index.d.ts +1 -1
  296. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  297. package/build-types/utils/use-deprecated-props.d.ts +9 -0
  298. package/build-types/utils/use-deprecated-props.d.ts.map +1 -0
  299. package/build-types/view/component.d.ts +1 -1
  300. package/build-types/view/component.d.ts.map +1 -1
  301. package/package.json +21 -22
  302. package/src/autocomplete/README.md +82 -54
  303. package/src/autocomplete/autocompleter-ui.tsx +0 -2
  304. package/src/autocomplete/index.tsx +1 -2
  305. package/src/autocomplete/types.ts +3 -19
  306. package/src/button/index.tsx +2 -0
  307. package/src/button/style.scss +13 -6
  308. package/src/button/types.ts +7 -0
  309. package/src/card/card-media/README.md +1 -1
  310. package/src/card/card-media/component.tsx +2 -1
  311. package/src/card/stories/index.tsx +47 -26
  312. package/src/checkbox-control/index.tsx +6 -2
  313. package/src/checkbox-control/style.scss +1 -4
  314. package/src/color-palette/index.native.js +20 -1
  315. package/src/color-picker/test/index.tsx +99 -99
  316. package/src/combobox-control/index.tsx +24 -18
  317. package/src/combobox-control/stories/index.tsx +0 -1
  318. package/src/combobox-control/styles.ts +4 -4
  319. package/src/combobox-control/types.ts +8 -1
  320. package/src/custom-gradient-picker/index.native.js +1 -1
  321. package/src/custom-gradient-picker/style.scss +2 -2
  322. package/src/dimension-control/README.md +1 -1
  323. package/src/dimension-control/index.tsx +1 -1
  324. package/src/draggable/README.md +8 -1
  325. package/src/draggable/index.tsx +7 -10
  326. package/src/draggable/stories/index.tsx +69 -33
  327. package/src/draggable/types.ts +7 -0
  328. package/src/form-toggle/style.scss +1 -5
  329. package/src/form-token-field/index.tsx +7 -3
  330. package/src/form-token-field/styles.ts +4 -4
  331. package/src/form-token-field/types.ts +8 -1
  332. package/src/index.ts +1 -0
  333. package/src/mobile/bottom-sheet/cell.native.js +4 -5
  334. package/src/mobile/color-settings/palette.screen.native.js +0 -7
  335. package/src/mobile/global-styles-context/index.native.js +12 -1
  336. package/src/mobile/global-styles-context/utils.native.js +18 -3
  337. package/src/mobile/link-picker/link-picker-results.native.js +3 -0
  338. package/src/mobile/segmented-control/index.native.js +2 -2
  339. package/src/modal/index.tsx +6 -1
  340. package/src/modal/style.scss +21 -13
  341. package/src/navigable-container/README.md +24 -13
  342. package/src/navigable-container/{container.js → container.tsx} +57 -27
  343. package/src/navigable-container/{index.js → index.tsx} +0 -1
  344. package/src/navigable-container/menu.tsx +100 -0
  345. package/src/navigable-container/stories/{navigable-menu.js → navigable-menu.tsx} +15 -10
  346. package/src/navigable-container/stories/{tabbable-container.js → tabbable-container.tsx} +15 -6
  347. package/src/navigable-container/tabbable.tsx +92 -0
  348. package/src/navigable-container/test/{navigable-menu.js → navigable-menu.tsx} +3 -1
  349. package/src/navigable-container/test/{tababble-container.js → tababble-container.tsx} +53 -24
  350. package/src/navigable-container/types.ts +76 -0
  351. package/src/navigator/navigator-screen/component.tsx +1 -1
  352. package/src/palette-edit/index.tsx +45 -7
  353. package/src/palette-edit/stories/index.tsx +4 -0
  354. package/src/palette-edit/types.ts +11 -0
  355. package/src/popover/index.tsx +2 -15
  356. package/src/private-apis.ts +2 -0
  357. package/src/sandbox/index.native.js +12 -1
  358. package/src/slot-fill/bubbles-virtually/fill.js +2 -1
  359. package/src/slot-fill/bubbles-virtually/slot-fill-provider.js +46 -60
  360. package/src/slot-fill/bubbles-virtually/use-slot.js +14 -41
  361. package/src/slot-fill/fill.js +4 -26
  362. package/src/slot-fill/index.js +14 -8
  363. package/src/slot-fill/provider.js +0 -6
  364. package/src/slot-fill/slot.js +0 -5
  365. package/src/snackbar/style.scss +2 -1
  366. package/src/spinner/styles.ts +2 -0
  367. package/src/style.scss +6 -0
  368. package/src/tab-panel/index.tsx +1 -1
  369. package/src/theme/color-algorithms.ts +1 -1
  370. package/src/theme/stories/index.tsx +1 -1
  371. package/src/theme/test/color-algorithms.ts +2 -2
  372. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +4 -4
  373. package/src/toolbar/stories/index.tsx +26 -24
  374. package/src/toolbar/toolbar-button/index.tsx +10 -13
  375. package/src/toolbar/toolbar-item/{index.js → index.tsx} +12 -3
  376. package/src/tree-grid/README.md +18 -0
  377. package/src/tree-grid/index.tsx +7 -2
  378. package/src/tree-grid/types.ts +7 -0
  379. package/src/ui/context/wordpress-component.ts +1 -1
  380. package/src/utils/colors-values.js +3 -3
  381. package/src/utils/theme-variables.scss +4 -4
  382. package/src/utils/use-deprecated-props.ts +29 -0
  383. package/src/view/component.tsx +2 -2
  384. package/tsconfig.json +3 -2
  385. package/tsconfig.tsbuildinfo +1 -1
  386. package/src/CONTRIBUTING.md +0 -78
  387. package/src/README.md +0 -20
  388. package/src/navigable-container/menu.js +0 -62
  389. package/src/navigable-container/tabbable.js +0 -46
@@ -1,12 +1,19 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
+ import classnames from 'classnames';
4
5
  import { paramCase as kebabCase } from 'change-case';
5
6
 
6
7
  /**
7
8
  * WordPress dependencies
8
9
  */
9
- import { useState, useRef, useEffect, useCallback } from '@wordpress/element';
10
+ import {
11
+ useState,
12
+ useRef,
13
+ useEffect,
14
+ useCallback,
15
+ useMemo,
16
+ } from '@wordpress/element';
10
17
  import { __, sprintf } from '@wordpress/i18n';
11
18
  import { lineSolid, moreVertical, plus } from '@wordpress/icons';
12
19
  import {
@@ -106,15 +113,26 @@ function ColorPickerPopover< T extends Color | Gradient >( {
106
113
  isGradient,
107
114
  element,
108
115
  onChange,
116
+ popoverProps: receivedPopoverProps,
109
117
  onClose = () => {},
110
118
  }: ColorPickerPopoverProps< T > ) {
119
+ const popoverProps: ColorPickerPopoverProps< T >[ 'popoverProps' ] =
120
+ useMemo(
121
+ () => ( {
122
+ shift: true,
123
+ offset: 20,
124
+ placement: 'left-start',
125
+ ...receivedPopoverProps,
126
+ className: classnames(
127
+ 'components-palette-edit__popover',
128
+ receivedPopoverProps?.className
129
+ ),
130
+ } ),
131
+ [ receivedPopoverProps ]
132
+ );
133
+
111
134
  return (
112
- <Popover
113
- placement="left-start"
114
- offset={ 20 }
115
- className="components-palette-edit__popover"
116
- onClose={ onClose }
117
- >
135
+ <Popover { ...popoverProps } onClose={ onClose }>
118
136
  { ! isGradient && (
119
137
  <ColorPicker
120
138
  color={ element.color }
@@ -154,17 +172,31 @@ function Option< T extends Color | Gradient >( {
154
172
  onStartEditing,
155
173
  onRemove,
156
174
  onStopEditing,
175
+ popoverProps: receivedPopoverProps,
157
176
  slugPrefix,
158
177
  isGradient,
159
178
  }: OptionProps< T > ) {
160
179
  const focusOutsideProps = useFocusOutside( onStopEditing );
161
180
  const value = isGradient ? element.gradient : element.color;
162
181
 
182
+ // Use internal state instead of a ref to make sure that the component
183
+ // re-renders when the popover's anchor updates.
184
+ const [ popoverAnchor, setPopoverAnchor ] = useState( null );
185
+ const popoverProps = useMemo(
186
+ () => ( {
187
+ ...receivedPopoverProps,
188
+ // Use the custom palette color item as the popover anchor.
189
+ anchor: popoverAnchor,
190
+ } ),
191
+ [ popoverAnchor, receivedPopoverProps ]
192
+ );
193
+
163
194
  return (
164
195
  <PaletteItem
165
196
  className={ isEditing ? 'is-selected' : undefined }
166
197
  as="div"
167
198
  onClick={ onStartEditing }
199
+ ref={ setPopoverAnchor }
168
200
  { ...( isEditing
169
201
  ? { ...focusOutsideProps }
170
202
  : {
@@ -218,6 +250,7 @@ function Option< T extends Color | Gradient >( {
218
250
  isGradient={ isGradient }
219
251
  onChange={ onChange }
220
252
  element={ element }
253
+ popoverProps={ popoverProps }
221
254
  />
222
255
  ) }
223
256
  </PaletteItem>
@@ -244,6 +277,7 @@ function PaletteEditListView< T extends Color | Gradient >( {
244
277
  canOnlyChangeValues,
245
278
  slugPrefix,
246
279
  isGradient,
280
+ popoverProps,
247
281
  }: PaletteEditListViewProps< T > ) {
248
282
  // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.
249
283
  const elementsReference = useRef< typeof elements >();
@@ -317,6 +351,7 @@ function PaletteEditListView< T extends Color | Gradient >( {
317
351
  }
318
352
  } }
319
353
  slugPrefix={ slugPrefix }
354
+ popoverProps={ popoverProps }
320
355
  />
321
356
  ) ) }
322
357
  </ItemGroup>
@@ -356,6 +391,7 @@ export function PaletteEdit( {
356
391
  canOnlyChangeValues,
357
392
  canReset,
358
393
  slugPrefix = '',
394
+ popoverProps,
359
395
  }: PaletteEditProps ) {
360
396
  const isGradient = !! gradients;
361
397
  const elements = isGradient ? gradients : colors;
@@ -541,6 +577,7 @@ export function PaletteEdit( {
541
577
  setEditingElement={ setEditingElement }
542
578
  slugPrefix={ slugPrefix }
543
579
  isGradient={ isGradient }
580
+ popoverProps={ popoverProps }
544
581
  />
545
582
  ) }
546
583
  { ! isEditing && editingElement !== null && (
@@ -568,6 +605,7 @@ export function PaletteEdit( {
568
605
  );
569
606
  } }
570
607
  element={ elements[ editingElement ?? -1 ] }
608
+ popoverProps={ popoverProps }
571
609
  />
572
610
  ) }
573
611
  { ! isEditing &&
@@ -59,6 +59,10 @@ Default.args = {
59
59
  ],
60
60
  paletteLabel: 'Colors',
61
61
  emptyMessage: 'Colors are empty',
62
+ popoverProps: {
63
+ placement: 'bottom-start',
64
+ offset: 8,
65
+ },
62
66
  };
63
67
 
64
68
  export const Gradients = Template.bind( {} );
@@ -6,6 +6,7 @@ import type { Key, MouseEventHandler } from 'react';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
+ import type Popover from '../popover';
9
10
  import type { HeadingSize } from '../heading/types';
10
11
 
11
12
  export type Color = {
@@ -58,6 +59,13 @@ export type BasePaletteEdit = {
58
59
  * @default ''
59
60
  */
60
61
  slugPrefix?: string;
62
+ /**
63
+ * Props to pass through to the underlying Popover component.
64
+ */
65
+ popoverProps?: Omit<
66
+ React.ComponentPropsWithoutRef< typeof Popover >,
67
+ 'children'
68
+ >;
61
69
  };
62
70
 
63
71
  type PaletteEditColors = {
@@ -94,6 +102,7 @@ export type ColorPickerPopoverProps< T extends Color | Gradient > = {
94
102
  onChange: ( newElement: T ) => void;
95
103
  isGradient?: T extends Gradient ? true : false;
96
104
  onClose?: () => void;
105
+ popoverProps?: PaletteEditProps[ 'popoverProps' ];
97
106
  };
98
107
 
99
108
  export type NameInputProps = {
@@ -112,6 +121,7 @@ export type OptionProps< T extends Color | Gradient > = {
112
121
  onRemove: MouseEventHandler< HTMLButtonElement >;
113
122
  onStartEditing: () => void;
114
123
  onStopEditing: () => void;
124
+ popoverProps?: PaletteEditProps[ 'popoverProps' ];
115
125
  slugPrefix: string;
116
126
  };
117
127
 
@@ -121,6 +131,7 @@ export type PaletteEditListViewProps< T extends Color | Gradient > = {
121
131
  isGradient: T extends Gradient ? true : false;
122
132
  canOnlyChangeValues: PaletteEditProps[ 'canOnlyChangeValues' ];
123
133
  editingElement?: EditingElement;
134
+ popoverProps?: PaletteEditProps[ 'popoverProps' ];
124
135
  setEditingElement: ( newEditingElement?: EditingElement ) => void;
125
136
  slugPrefix: string;
126
137
  };
@@ -109,10 +109,6 @@ const AnimatedWrapper = forwardRef(
109
109
  }: HTMLMotionProps< 'div' > & AnimatedWrapperProps,
110
110
  forwardedRef: ForwardedRef< any >
111
111
  ) => {
112
- // When animating, animate only once (i.e. when the popover is opened), and
113
- // do not animate on subsequent prop changes (as it conflicts with
114
- // floating-ui's positioning updates).
115
- const [ hasAnimatedOnce, setHasAnimatedOnce ] = useState( false );
116
112
  const shouldReduceMotion = useReducedMotion();
117
113
 
118
114
  const { style: motionInlineStyles, ...otherMotionProps } = useMemo(
@@ -120,11 +116,6 @@ const AnimatedWrapper = forwardRef(
120
116
  [ placement ]
121
117
  );
122
118
 
123
- const onAnimationComplete = useCallback(
124
- () => setHasAnimatedOnce( true ),
125
- []
126
- );
127
-
128
119
  const computedAnimationProps: HTMLMotionProps< 'div' > =
129
120
  shouldAnimate && ! shouldReduceMotion
130
121
  ? {
@@ -133,10 +124,6 @@ const AnimatedWrapper = forwardRef(
133
124
  ...receivedInlineStyles,
134
125
  },
135
126
  ...otherMotionProps,
136
- onAnimationComplete,
137
- animate: hasAnimatedOnce
138
- ? false
139
- : otherMotionProps.animate,
140
127
  }
141
128
  : {
142
129
  animate: false,
@@ -160,8 +147,8 @@ const UnforwardedPopover = (
160
147
  WordPressComponentProps< PopoverProps, 'div', false >,
161
148
  // To avoid overlaps between the standard HTML attributes and the props
162
149
  // expected by `framer-motion`, omit all framer motion props from popover
163
- // props (except for `animate`, which is re-defined in `PopoverProps`).
164
- keyof Omit< MotionProps, 'animate' >
150
+ // props (except for `animate` and `children`, which are re-defined in `PopoverProps`).
151
+ keyof Omit< MotionProps, 'animate' | 'children' >
165
152
  >,
166
153
  forwardedRef: ForwardedRef< any >
167
154
  ) => {
@@ -8,6 +8,7 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
8
8
  */
9
9
  import { default as CustomSelectControl } from './custom-select-control';
10
10
  import { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';
11
+ import { createPrivateSlotFill } from './slot-fill';
11
12
 
12
13
  export const { lock, unlock } =
13
14
  __dangerousOptInToUnstableAPIsOnlyForCoreModules(
@@ -19,4 +20,5 @@ export const privateApis = {};
19
20
  lock( privateApis, {
20
21
  CustomSelectControl,
21
22
  __experimentalPopoverLegacyPositionToPlacement,
23
+ createPrivateSlotFill,
22
24
  } );
@@ -185,6 +185,9 @@ const Sandbox = forwardRef( function Sandbox(
185
185
  type,
186
186
  url,
187
187
  onWindowEvents = {},
188
+ viewportProps = '',
189
+ onLoadEnd = () => {},
190
+ testID,
188
191
  },
189
192
  ref
190
193
  ) {
@@ -213,13 +216,19 @@ const Sandbox = forwardRef( function Sandbox(
213
216
  // we can use this in the future to inject custom styles or scripts.
214
217
  // Scripts go into the body rather than the head, to support embedded content such as Instagram
215
218
  // that expect the scripts to be part of the body.
219
+
220
+ // Avoid comma issues with props.viewportProps.
221
+ const addViewportProps = viewportProps
222
+ .trim()
223
+ .replace( /(^[^,])/, ', $1' );
224
+
216
225
  const htmlDoc = (
217
226
  <html lang={ lang }>
218
227
  <head>
219
228
  <title>{ title }</title>
220
229
  <meta
221
230
  name="viewport"
222
- content="width=device-width, initial-scale=1"
231
+ content={ `width=device-width, initial-scale=1${ addViewportProps }` }
223
232
  ></meta>
224
233
  <style dangerouslySetInnerHTML={ { __html: style } } />
225
234
  { styles.map( ( rules, i ) => (
@@ -365,6 +374,8 @@ const Sandbox = forwardRef( function Sandbox(
365
374
  showsHorizontalScrollIndicator={ false }
366
375
  showsVerticalScrollIndicator={ false }
367
376
  mediaPlaybackRequiresUserAction={ false }
377
+ onLoadEnd={ onLoadEnd }
378
+ testID={ testID }
368
379
  />
369
380
  );
370
381
  } );
@@ -30,7 +30,8 @@ function useForceUpdate() {
30
30
 
31
31
  export default function Fill( { name, children } ) {
32
32
  const { registerFill, unregisterFill, ...slot } = useSlot( name );
33
- const ref = useRef( { rerender: useForceUpdate() } );
33
+ const rerender = useForceUpdate();
34
+ const ref = useRef( { rerender } );
34
35
 
35
36
  useEffect( () => {
36
37
  // We register fills so we can keep track of their existence.
@@ -8,7 +8,7 @@ import { proxyMap } from 'valtio/utils';
8
8
  /**
9
9
  * WordPress dependencies
10
10
  */
11
- import { useMemo, useCallback, useRef } from '@wordpress/element';
11
+ import { useState } from '@wordpress/element';
12
12
  import isShallowEqual from '@wordpress/is-shallow-equal';
13
13
 
14
14
  /**
@@ -16,13 +16,13 @@ import isShallowEqual from '@wordpress/is-shallow-equal';
16
16
  */
17
17
  import SlotFillContext from './slot-fill-context';
18
18
 
19
- function useSlotRegistry() {
20
- const slots = useRef( proxyMap() );
21
- const fills = useRef( proxyMap() );
19
+ function createSlotRegistry() {
20
+ const slots = proxyMap();
21
+ const fills = proxyMap();
22
22
 
23
- const registerSlot = useCallback( ( name, ref, fillProps ) => {
24
- const slot = slots.current.get( name ) || {};
25
- slots.current.set(
23
+ function registerSlot( name, ref, fillProps ) {
24
+ const slot = slots.get( name ) || {};
25
+ slots.set(
26
26
  name,
27
27
  valRef( {
28
28
  ...slot,
@@ -30,77 +30,63 @@ function useSlotRegistry() {
30
30
  fillProps: fillProps || slot.fillProps || {},
31
31
  } )
32
32
  );
33
- }, [] );
33
+ }
34
34
 
35
- const unregisterSlot = useCallback( ( name, ref ) => {
35
+ function unregisterSlot( name, ref ) {
36
36
  // Make sure we're not unregistering a slot registered by another element
37
37
  // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412
38
- if ( slots.current.get( name )?.ref === ref ) {
39
- slots.current.delete( name );
38
+ if ( slots.get( name )?.ref === ref ) {
39
+ slots.delete( name );
40
40
  }
41
- }, [] );
41
+ }
42
42
 
43
- const updateSlot = useCallback( ( name, fillProps ) => {
44
- const slot = slots.current.get( name );
43
+ function updateSlot( name, fillProps ) {
44
+ const slot = slots.get( name );
45
45
  if ( ! slot ) {
46
46
  return;
47
47
  }
48
48
 
49
- if ( ! isShallowEqual( slot.fillProps, fillProps ) ) {
50
- slot.fillProps = fillProps;
51
- const slotFills = fills.current.get( name );
52
- if ( slotFills ) {
53
- // Force update fills.
54
- slotFills.map( ( fill ) => fill.current.rerender() );
55
- }
49
+ if ( isShallowEqual( slot.fillProps, fillProps ) ) {
50
+ return;
56
51
  }
57
- }, [] );
58
52
 
59
- const registerFill = useCallback( ( name, ref ) => {
60
- fills.current.set(
61
- name,
62
- valRef( [ ...( fills.current.get( name ) || [] ), ref ] )
63
- );
64
- }, [] );
53
+ slot.fillProps = fillProps;
54
+ const slotFills = fills.get( name );
55
+ if ( slotFills ) {
56
+ // Force update fills.
57
+ slotFills.map( ( fill ) => fill.current.rerender() );
58
+ }
59
+ }
60
+
61
+ function registerFill( name, ref ) {
62
+ fills.set( name, valRef( [ ...( fills.get( name ) || [] ), ref ] ) );
63
+ }
65
64
 
66
- const unregisterFill = useCallback( ( name, ref ) => {
67
- if ( fills.current.get( name ) ) {
68
- fills.current.set(
69
- name,
70
- valRef(
71
- fills.current
72
- .get( name )
73
- .filter( ( fillRef ) => fillRef !== ref )
74
- )
75
- );
65
+ function unregisterFill( name, ref ) {
66
+ const fillsForName = fills.get( name );
67
+ if ( ! fillsForName ) {
68
+ return;
76
69
  }
77
- }, [] );
78
70
 
79
- // Memoizing the return value so it can be directly passed to Provider value
80
- const registry = useMemo(
81
- () => ( {
82
- slots: slots.current,
83
- fills: fills.current,
84
- registerSlot,
85
- updateSlot,
86
- unregisterSlot,
87
- registerFill,
88
- unregisterFill,
89
- } ),
90
- [
91
- registerSlot,
92
- updateSlot,
93
- unregisterSlot,
94
- registerFill,
95
- unregisterFill,
96
- ]
97
- );
71
+ fills.set(
72
+ name,
73
+ valRef( fillsForName.filter( ( fillRef ) => fillRef !== ref ) )
74
+ );
75
+ }
98
76
 
99
- return registry;
77
+ return {
78
+ slots,
79
+ fills,
80
+ registerSlot,
81
+ updateSlot,
82
+ unregisterSlot,
83
+ registerFill,
84
+ unregisterFill,
85
+ };
100
86
  }
101
87
 
102
88
  export default function SlotFillProvider( { children } ) {
103
- const registry = useSlotRegistry();
89
+ const [ registry ] = useState( createSlotRegistry );
104
90
  return (
105
91
  <SlotFillContext.Provider value={ registry }>
106
92
  { children }
@@ -7,7 +7,7 @@ import { useSnapshot } from 'valtio';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { useCallback, useContext } from '@wordpress/element';
10
+ import { useMemo, useContext } from '@wordpress/element';
11
11
 
12
12
  /**
13
13
  * Internal dependencies
@@ -15,52 +15,25 @@ import { useCallback, useContext } from '@wordpress/element';
15
15
  import SlotFillContext from './slot-fill-context';
16
16
 
17
17
  export default function useSlot( name ) {
18
- const {
19
- updateSlot: registryUpdateSlot,
20
- unregisterSlot: registryUnregisterSlot,
21
- registerFill: registryRegisterFill,
22
- unregisterFill: registryUnregisterFill,
23
- ...registry
24
- } = useContext( SlotFillContext );
18
+ const registry = useContext( SlotFillContext );
25
19
  const slots = useSnapshot( registry.slots, { sync: true } );
26
- // The important bit here is that this call ensures
27
- // the hook only causes a re-render if the slot
28
- // with the given name change, not any other slot.
20
+ // The important bit here is that the `useSnapshot` call ensures that the
21
+ // hook only causes a re-render if the slot with the given name changes,
22
+ // not any other slot.
29
23
  const slot = slots.get( name );
30
24
 
31
- const updateSlot = useCallback(
32
- ( fillProps ) => {
33
- registryUpdateSlot( name, fillProps );
34
- },
35
- [ name, registryUpdateSlot ]
36
- );
37
-
38
- const unregisterSlot = useCallback(
39
- ( slotRef ) => {
40
- registryUnregisterSlot( name, slotRef );
41
- },
42
- [ name, registryUnregisterSlot ]
43
- );
44
-
45
- const registerFill = useCallback(
46
- ( fillRef ) => {
47
- registryRegisterFill( name, fillRef );
48
- },
49
- [ name, registryRegisterFill ]
50
- );
51
-
52
- const unregisterFill = useCallback(
53
- ( fillRef ) => {
54
- registryUnregisterFill( name, fillRef );
55
- },
56
- [ name, registryUnregisterFill ]
25
+ const api = useMemo(
26
+ () => ( {
27
+ updateSlot: ( fillProps ) => registry.updateSlot( name, fillProps ),
28
+ unregisterSlot: ( ref ) => registry.unregisterSlot( name, ref ),
29
+ registerFill: ( ref ) => registry.registerFill( name, ref ),
30
+ unregisterFill: ( ref ) => registry.unregisterFill( name, ref ),
31
+ } ),
32
+ [ name, registry ]
57
33
  );
58
34
 
59
35
  return {
60
36
  ...slot,
61
- updateSlot,
62
- unregisterSlot,
63
- registerFill,
64
- unregisterFill,
37
+ ...api,
65
38
  };
66
39
  }
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { createPortal, useLayoutEffect, useRef } from '@wordpress/element';
6
+ import { useContext, useLayoutEffect, useRef } from '@wordpress/element';
7
7
 
8
8
  /**
9
9
  * Internal dependencies
@@ -11,7 +11,8 @@ import { createPortal, useLayoutEffect, useRef } from '@wordpress/element';
11
11
  import SlotFillContext from './context';
12
12
  import useSlot from './use-slot';
13
13
 
14
- function FillComponent( { name, children, registerFill, unregisterFill } ) {
14
+ export default function Fill( { name, children } ) {
15
+ const { registerFill, unregisterFill } = useContext( SlotFillContext );
15
16
  const slot = useSlot( name );
16
17
 
17
18
  const ref = useRef( {
@@ -51,28 +52,5 @@ function FillComponent( { name, children, registerFill, unregisterFill } ) {
51
52
  // eslint-disable-next-line react-hooks/exhaustive-deps
52
53
  }, [ name ] );
53
54
 
54
- if ( ! slot || ! slot.node ) {
55
- return null;
56
- }
57
-
58
- // If a function is passed as a child, provide it with the fillProps.
59
- if ( typeof children === 'function' ) {
60
- children = children( slot.props.fillProps );
61
- }
62
-
63
- return createPortal( children, slot.node );
55
+ return null;
64
56
  }
65
-
66
- const Fill = ( props ) => (
67
- <SlotFillContext.Consumer>
68
- { ( { registerFill, unregisterFill } ) => (
69
- <FillComponent
70
- { ...props }
71
- registerFill={ registerFill }
72
- unregisterFill={ unregisterFill }
73
- />
74
- ) }
75
- </SlotFillContext.Consumer>
76
- );
77
-
78
- export default Fill;
@@ -13,7 +13,7 @@ import BubblesVirtuallyFill from './bubbles-virtually/fill';
13
13
  import BubblesVirtuallySlot from './bubbles-virtually/slot';
14
14
  import BubblesVirtuallySlotFillProvider from './bubbles-virtually/slot-fill-provider';
15
15
  import SlotFillProvider from './provider';
16
- import useSlot from './bubbles-virtually/use-slot';
16
+ export { default as useSlot } from './bubbles-virtually/use-slot';
17
17
  export { default as useSlotFills } from './bubbles-virtually/use-slot-fills';
18
18
 
19
19
  export function Fill( props ) {
@@ -44,13 +44,14 @@ export function Provider( { children, ...props } ) {
44
44
  );
45
45
  }
46
46
 
47
- export function createSlotFill( name ) {
48
- const FillComponent = ( props ) => <Fill name={ name } { ...props } />;
49
- FillComponent.displayName = name + 'Fill';
47
+ export function createSlotFill( key ) {
48
+ const baseName = typeof key === 'symbol' ? key.description : key;
49
+ const FillComponent = ( props ) => <Fill name={ key } { ...props } />;
50
+ FillComponent.displayName = `${ baseName }Fill`;
50
51
 
51
- const SlotComponent = ( props ) => <Slot name={ name } { ...props } />;
52
- SlotComponent.displayName = name + 'Slot';
53
- SlotComponent.__unstableName = name;
52
+ const SlotComponent = ( props ) => <Slot name={ key } { ...props } />;
53
+ SlotComponent.displayName = `${ baseName }Slot`;
54
+ SlotComponent.__unstableName = key;
54
55
 
55
56
  return {
56
57
  Fill: FillComponent,
@@ -58,4 +59,9 @@ export function createSlotFill( name ) {
58
59
  };
59
60
  }
60
61
 
61
- export { useSlot };
62
+ export const createPrivateSlotFill = ( name ) => {
63
+ const privateKey = Symbol( name );
64
+ const privateSlotFill = createSlotFill( privateKey );
65
+
66
+ return { privateKey, ...privateSlotFill };
67
+ };
@@ -19,7 +19,6 @@ export default class SlotFillProvider extends Component {
19
19
  this.unregisterFill = this.unregisterFill.bind( this );
20
20
  this.getSlot = this.getSlot.bind( this );
21
21
  this.getFills = this.getFills.bind( this );
22
- this.hasFills = this.hasFills.bind( this );
23
22
  this.subscribe = this.subscribe.bind( this );
24
23
 
25
24
  this.slots = {};
@@ -32,7 +31,6 @@ export default class SlotFillProvider extends Component {
32
31
  unregisterFill: this.unregisterFill,
33
32
  getSlot: this.getSlot,
34
33
  getFills: this.getFills,
35
- hasFills: this.hasFills,
36
34
  subscribe: this.subscribe,
37
35
  };
38
36
  }
@@ -91,10 +89,6 @@ export default class SlotFillProvider extends Component {
91
89
  return this.fills[ name ];
92
90
  }
93
91
 
94
- hasFills( name ) {
95
- return this.fills[ name ] && !! this.fills[ name ].length;
96
- }
97
-
98
92
  forceUpdateSlot( name ) {
99
93
  const slot = this.getSlot( name );
100
94
 
@@ -29,7 +29,6 @@ class SlotComponent extends Component {
29
29
  super( ...arguments );
30
30
 
31
31
  this.isUnmounted = false;
32
- this.bindNode = this.bindNode.bind( this );
33
32
  }
34
33
 
35
34
  componentDidMount() {
@@ -53,10 +52,6 @@ class SlotComponent extends Component {
53
52
  }
54
53
  }
55
54
 
56
- bindNode( node ) {
57
- this.node = node;
58
- }
59
-
60
55
  forceUpdate() {
61
56
  if ( this.isUnmounted ) {
62
57
  return;
@@ -64,7 +64,8 @@
64
64
  }
65
65
 
66
66
  &:hover {
67
- color: $components-color-accent;
67
+ text-decoration: none;
68
+ color: $white;
68
69
  }
69
70
  }
70
71
  }
@@ -26,6 +26,8 @@ export const StyledSpinner = styled.svg`
26
26
  position: relative;
27
27
  color: ${ COLORS.ui.theme };
28
28
  overflow: visible;
29
+ opacity: 1;
30
+ background-color: transparent;
29
31
  `;
30
32
 
31
33
  const commonPathProps = css`
package/src/style.scss CHANGED
@@ -1,3 +1,9 @@
1
+ // Include the default WP Components color variables.
2
+ // TODO: Remove this once all admin-scheme variables are accounted for in the wp-components fallback values.
3
+ :root {
4
+ @include admin-scheme(#3858e9);
5
+ }
6
+
1
7
  // Variables
2
8
  @import "./utils/theme-variables.scss";
3
9