@wordpress/ui 0.13.1-next.v.202605131032.0 → 0.14.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 (282) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/CONTRIBUTING.md +34 -0
  3. package/README.md +15 -0
  4. package/build/alert-dialog/portal.cjs.map +2 -2
  5. package/build/alert-dialog/types.cjs.map +1 -1
  6. package/build/button/button.cjs +1 -1
  7. package/build/button/button.cjs.map +2 -2
  8. package/build/card/content.cjs +1 -1
  9. package/build/card/content.cjs.map +2 -2
  10. package/build/card/full-bleed.cjs +1 -1
  11. package/build/card/full-bleed.cjs.map +2 -2
  12. package/build/card/header.cjs +1 -1
  13. package/build/card/header.cjs.map +2 -2
  14. package/build/card/root.cjs +1 -1
  15. package/build/card/root.cjs.map +2 -2
  16. package/build/collapsible-card/header.cjs.map +2 -2
  17. package/build/dialog/portal.cjs.map +2 -2
  18. package/build/dialog/types.cjs.map +1 -1
  19. package/build/drawer/portal.cjs.map +2 -2
  20. package/build/drawer/types.cjs.map +1 -1
  21. package/build/form/primitives/autocomplete/clear.cjs +4 -1
  22. package/build/form/primitives/autocomplete/clear.cjs.map +2 -2
  23. package/build/form/primitives/autocomplete/empty.cjs +1 -1
  24. package/build/form/primitives/autocomplete/empty.cjs.map +2 -2
  25. package/build/form/primitives/autocomplete/index.cjs +4 -1
  26. package/build/form/primitives/autocomplete/index.cjs.map +2 -2
  27. package/build/form/primitives/autocomplete/item.cjs +1 -1
  28. package/build/form/primitives/autocomplete/item.cjs.map +2 -2
  29. package/build/form/primitives/autocomplete/list-body.cjs +1 -1
  30. package/build/form/primitives/autocomplete/list-body.cjs.map +2 -2
  31. package/build/form/primitives/autocomplete/list.cjs +1 -1
  32. package/build/form/primitives/autocomplete/list.cjs.map +2 -2
  33. package/build/form/primitives/autocomplete/popup.cjs +14 -31
  34. package/build/form/primitives/autocomplete/popup.cjs.map +3 -3
  35. package/build/form/primitives/autocomplete/portal.cjs +10 -2
  36. package/build/form/primitives/autocomplete/portal.cjs.map +2 -2
  37. package/build/form/primitives/autocomplete/positioner.cjs +158 -0
  38. package/build/form/primitives/autocomplete/positioner.cjs.map +7 -0
  39. package/build/form/primitives/autocomplete/types.cjs.map +1 -1
  40. package/build/form/primitives/constants.cjs.map +2 -2
  41. package/build/form/primitives/select/index.cjs +4 -1
  42. package/build/form/primitives/select/index.cjs.map +2 -2
  43. package/build/form/primitives/select/item.cjs +1 -1
  44. package/build/form/primitives/select/item.cjs.map +2 -2
  45. package/build/form/primitives/select/popup.cjs +18 -36
  46. package/build/form/primitives/select/popup.cjs.map +3 -3
  47. package/build/form/primitives/select/portal.cjs +11 -5
  48. package/build/form/primitives/select/portal.cjs.map +2 -2
  49. package/build/form/primitives/select/positioner.cjs +159 -0
  50. package/build/form/primitives/select/positioner.cjs.map +7 -0
  51. package/build/form/primitives/select/types.cjs.map +1 -1
  52. package/build/icon-button/icon-button.cjs +1 -1
  53. package/build/icon-button/icon-button.cjs.map +2 -2
  54. package/build/index.cjs +7 -1
  55. package/build/index.cjs.map +2 -2
  56. package/build/popover/index.cjs +3 -0
  57. package/build/popover/index.cjs.map +2 -2
  58. package/build/popover/popup.cjs +23 -51
  59. package/build/popover/popup.cjs.map +3 -3
  60. package/build/popover/portal.cjs.map +2 -2
  61. package/build/popover/positioner.cjs +168 -0
  62. package/build/popover/positioner.cjs.map +7 -0
  63. package/build/popover/root.cjs.map +2 -2
  64. package/build/popover/types.cjs.map +1 -1
  65. package/build/tooltip/portal.cjs +10 -2
  66. package/build/tooltip/portal.cjs.map +2 -2
  67. package/build/tooltip/positioner.cjs.map +2 -2
  68. package/build/tooltip/types.cjs.map +1 -1
  69. package/build/utils/create-overlay-title-validation.cjs.map +2 -2
  70. package/build/utils/render-slot-with-children.cjs +4 -1
  71. package/build/utils/render-slot-with-children.cjs.map +2 -2
  72. package/build/utils/use-enable-wp-compat-overlay-slot.cjs +39 -0
  73. package/build/utils/use-enable-wp-compat-overlay-slot.cjs.map +7 -0
  74. package/build/utils/wp-compat-overlay-slot.cjs +177 -0
  75. package/build/utils/wp-compat-overlay-slot.cjs.map +7 -0
  76. package/build-module/alert-dialog/portal.mjs.map +2 -2
  77. package/build-module/button/button.mjs +1 -1
  78. package/build-module/button/button.mjs.map +2 -2
  79. package/build-module/card/content.mjs +1 -1
  80. package/build-module/card/content.mjs.map +2 -2
  81. package/build-module/card/full-bleed.mjs +1 -1
  82. package/build-module/card/full-bleed.mjs.map +2 -2
  83. package/build-module/card/header.mjs +1 -1
  84. package/build-module/card/header.mjs.map +2 -2
  85. package/build-module/card/root.mjs +1 -1
  86. package/build-module/card/root.mjs.map +2 -2
  87. package/build-module/collapsible-card/header.mjs.map +2 -2
  88. package/build-module/dialog/portal.mjs.map +2 -2
  89. package/build-module/drawer/portal.mjs.map +2 -2
  90. package/build-module/form/primitives/autocomplete/clear.mjs +4 -1
  91. package/build-module/form/primitives/autocomplete/clear.mjs.map +2 -2
  92. package/build-module/form/primitives/autocomplete/empty.mjs +1 -1
  93. package/build-module/form/primitives/autocomplete/empty.mjs.map +2 -2
  94. package/build-module/form/primitives/autocomplete/index.mjs +3 -1
  95. package/build-module/form/primitives/autocomplete/index.mjs.map +2 -2
  96. package/build-module/form/primitives/autocomplete/item.mjs +1 -1
  97. package/build-module/form/primitives/autocomplete/item.mjs.map +2 -2
  98. package/build-module/form/primitives/autocomplete/list-body.mjs +1 -1
  99. package/build-module/form/primitives/autocomplete/list-body.mjs.map +2 -2
  100. package/build-module/form/primitives/autocomplete/list.mjs +1 -1
  101. package/build-module/form/primitives/autocomplete/list.mjs.map +2 -2
  102. package/build-module/form/primitives/autocomplete/popup.mjs +14 -31
  103. package/build-module/form/primitives/autocomplete/popup.mjs.map +3 -3
  104. package/build-module/form/primitives/autocomplete/portal.mjs +10 -2
  105. package/build-module/form/primitives/autocomplete/portal.mjs.map +2 -2
  106. package/build-module/form/primitives/autocomplete/positioner.mjs +123 -0
  107. package/build-module/form/primitives/autocomplete/positioner.mjs.map +7 -0
  108. package/build-module/form/primitives/constants.mjs.map +2 -2
  109. package/build-module/form/primitives/select/index.mjs +3 -1
  110. package/build-module/form/primitives/select/index.mjs.map +2 -2
  111. package/build-module/form/primitives/select/item.mjs +1 -1
  112. package/build-module/form/primitives/select/item.mjs.map +2 -2
  113. package/build-module/form/primitives/select/popup.mjs +18 -36
  114. package/build-module/form/primitives/select/popup.mjs.map +3 -3
  115. package/build-module/form/primitives/select/portal.mjs +11 -5
  116. package/build-module/form/primitives/select/portal.mjs.map +2 -2
  117. package/build-module/form/primitives/select/positioner.mjs +124 -0
  118. package/build-module/form/primitives/select/positioner.mjs.map +7 -0
  119. package/build-module/icon-button/icon-button.mjs +1 -1
  120. package/build-module/icon-button/icon-button.mjs.map +2 -2
  121. package/build-module/index.mjs +5 -1
  122. package/build-module/index.mjs.map +2 -2
  123. package/build-module/popover/index.mjs +2 -0
  124. package/build-module/popover/index.mjs.map +2 -2
  125. package/build-module/popover/popup.mjs +23 -51
  126. package/build-module/popover/popup.mjs.map +3 -3
  127. package/build-module/popover/portal.mjs.map +2 -2
  128. package/build-module/popover/positioner.mjs +133 -0
  129. package/build-module/popover/positioner.mjs.map +7 -0
  130. package/build-module/popover/root.mjs.map +2 -2
  131. package/build-module/tooltip/portal.mjs +10 -2
  132. package/build-module/tooltip/portal.mjs.map +2 -2
  133. package/build-module/tooltip/positioner.mjs.map +2 -2
  134. package/build-module/utils/create-overlay-title-validation.mjs.map +2 -2
  135. package/build-module/utils/render-slot-with-children.mjs +4 -1
  136. package/build-module/utils/render-slot-with-children.mjs.map +2 -2
  137. package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs +14 -0
  138. package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs.map +7 -0
  139. package/build-module/utils/wp-compat-overlay-slot.mjs +148 -0
  140. package/build-module/utils/wp-compat-overlay-slot.mjs.map +7 -0
  141. package/build-types/alert-dialog/portal.d.ts +8 -5
  142. package/build-types/alert-dialog/portal.d.ts.map +1 -1
  143. package/build-types/alert-dialog/types.d.ts +2 -2
  144. package/build-types/alert-dialog/types.d.ts.map +1 -1
  145. package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
  146. package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
  147. package/build-types/button/stories/e2e/index.story.d.ts +8 -0
  148. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -0
  149. package/build-types/card/full-bleed.d.ts +18 -0
  150. package/build-types/card/full-bleed.d.ts.map +1 -1
  151. package/build-types/card/stories/index.story.d.ts +23 -0
  152. package/build-types/card/stories/index.story.d.ts.map +1 -1
  153. package/build-types/collapsible-card/header.d.ts +2 -0
  154. package/build-types/collapsible-card/header.d.ts.map +1 -1
  155. package/build-types/collapsible-card/stories/index.story.d.ts +14 -0
  156. package/build-types/collapsible-card/stories/index.story.d.ts.map +1 -1
  157. package/build-types/dialog/portal.d.ts +8 -6
  158. package/build-types/dialog/portal.d.ts.map +1 -1
  159. package/build-types/dialog/types.d.ts +2 -2
  160. package/build-types/dialog/types.d.ts.map +1 -1
  161. package/build-types/drawer/portal.d.ts +8 -6
  162. package/build-types/drawer/portal.d.ts.map +1 -1
  163. package/build-types/drawer/types.d.ts +2 -2
  164. package/build-types/drawer/types.d.ts.map +1 -1
  165. package/build-types/form/primitives/autocomplete/clear.d.ts.map +1 -1
  166. package/build-types/form/primitives/autocomplete/index.d.ts +2 -1
  167. package/build-types/form/primitives/autocomplete/index.d.ts.map +1 -1
  168. package/build-types/form/primitives/autocomplete/popup.d.ts +1 -0
  169. package/build-types/form/primitives/autocomplete/popup.d.ts.map +1 -1
  170. package/build-types/form/primitives/autocomplete/portal.d.ts +9 -4
  171. package/build-types/form/primitives/autocomplete/portal.d.ts.map +1 -1
  172. package/build-types/form/primitives/autocomplete/positioner.d.ts +12 -0
  173. package/build-types/form/primitives/autocomplete/positioner.d.ts.map +1 -0
  174. package/build-types/form/primitives/autocomplete/stories/index.story.d.ts.map +1 -1
  175. package/build-types/form/primitives/autocomplete/types.d.ts +11 -9
  176. package/build-types/form/primitives/autocomplete/types.d.ts.map +1 -1
  177. package/build-types/form/primitives/constants.d.ts +9 -4
  178. package/build-types/form/primitives/constants.d.ts.map +1 -1
  179. package/build-types/form/primitives/select/index.d.ts +2 -1
  180. package/build-types/form/primitives/select/index.d.ts.map +1 -1
  181. package/build-types/form/primitives/select/popup.d.ts +1 -0
  182. package/build-types/form/primitives/select/popup.d.ts.map +1 -1
  183. package/build-types/form/primitives/select/portal.d.ts +9 -4
  184. package/build-types/form/primitives/select/portal.d.ts.map +1 -1
  185. package/build-types/form/primitives/select/positioner.d.ts +12 -0
  186. package/build-types/form/primitives/select/positioner.d.ts.map +1 -0
  187. package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
  188. package/build-types/form/primitives/select/types.d.ts +11 -2
  189. package/build-types/form/primitives/select/types.d.ts.map +1 -1
  190. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  191. package/build-types/index.d.ts +2 -0
  192. package/build-types/index.d.ts.map +1 -1
  193. package/build-types/popover/index.d.ts +2 -1
  194. package/build-types/popover/index.d.ts.map +1 -1
  195. package/build-types/popover/popup.d.ts +2 -1
  196. package/build-types/popover/popup.d.ts.map +1 -1
  197. package/build-types/popover/portal.d.ts +8 -5
  198. package/build-types/popover/portal.d.ts.map +1 -1
  199. package/build-types/popover/positioner.d.ts +12 -0
  200. package/build-types/popover/positioner.d.ts.map +1 -0
  201. package/build-types/popover/root.d.ts +5 -2
  202. package/build-types/popover/root.d.ts.map +1 -1
  203. package/build-types/popover/stories/index.story.d.ts +10 -21
  204. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  205. package/build-types/popover/types.d.ts +12 -3
  206. package/build-types/popover/types.d.ts.map +1 -1
  207. package/build-types/tooltip/portal.d.ts +9 -4
  208. package/build-types/tooltip/portal.d.ts.map +1 -1
  209. package/build-types/tooltip/positioner.d.ts +8 -5
  210. package/build-types/tooltip/positioner.d.ts.map +1 -1
  211. package/build-types/tooltip/types.d.ts +3 -3
  212. package/build-types/tooltip/types.d.ts.map +1 -1
  213. package/build-types/utils/render-slot-with-children.d.ts.map +1 -1
  214. package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts +2 -0
  215. package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts.map +1 -0
  216. package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts +2 -0
  217. package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts.map +1 -0
  218. package/build-types/utils/use-deprioritized-initial-focus.d.ts +1 -1
  219. package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts +17 -0
  220. package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts.map +1 -0
  221. package/build-types/utils/wp-compat-overlay-slot.d.ts +30 -0
  222. package/build-types/utils/wp-compat-overlay-slot.d.ts.map +1 -0
  223. package/package.json +14 -14
  224. package/src/alert-dialog/portal.tsx +1 -4
  225. package/src/alert-dialog/types.ts +2 -4
  226. package/src/badge/stories/e2e/index.story.tsx +20 -0
  227. package/src/button/stories/e2e/index.story.tsx +130 -0
  228. package/src/button/stories/index.story.tsx +1 -1
  229. package/src/button/style.module.css +17 -12
  230. package/src/card/full-bleed.tsx +18 -0
  231. package/src/card/stories/index.story.tsx +115 -1
  232. package/src/card/style.module.css +16 -0
  233. package/src/card/test/index.test.tsx +18 -1
  234. package/src/collapsible-card/header.tsx +2 -0
  235. package/src/collapsible-card/stories/index.story.tsx +66 -0
  236. package/src/dialog/portal.tsx +1 -5
  237. package/src/dialog/types.ts +2 -2
  238. package/src/drawer/portal.tsx +1 -5
  239. package/src/drawer/types.ts +2 -2
  240. package/src/form/primitives/autocomplete/clear.tsx +10 -4
  241. package/src/form/primitives/autocomplete/index.ts +2 -1
  242. package/src/form/primitives/autocomplete/popup.tsx +17 -21
  243. package/src/form/primitives/autocomplete/portal.tsx +11 -5
  244. package/src/form/primitives/autocomplete/positioner.tsx +29 -0
  245. package/src/form/primitives/autocomplete/stories/index.story.tsx +1 -0
  246. package/src/form/primitives/autocomplete/test/index.test.tsx +219 -0
  247. package/src/form/primitives/autocomplete/types.ts +15 -15
  248. package/src/form/primitives/constants.ts +7 -4
  249. package/src/form/primitives/select/index.ts +2 -1
  250. package/src/form/primitives/select/popup.tsx +30 -34
  251. package/src/form/primitives/select/portal.tsx +15 -8
  252. package/src/form/primitives/select/positioner.tsx +33 -0
  253. package/src/form/primitives/select/stories/index.story.tsx +1 -0
  254. package/src/form/primitives/select/test/index.test.tsx +134 -0
  255. package/src/form/primitives/select/types.ts +12 -2
  256. package/src/form/select-control/test/index.test.tsx +64 -0
  257. package/src/icon/stories/index.story.tsx +3 -2
  258. package/src/icon-button/icon-button.tsx +1 -1
  259. package/src/icon-button/test/index.test.tsx +10 -10
  260. package/src/index.ts +2 -0
  261. package/src/popover/index.ts +12 -1
  262. package/src/popover/popup.tsx +28 -45
  263. package/src/popover/portal.tsx +1 -4
  264. package/src/popover/positioner.tsx +42 -0
  265. package/src/popover/root.tsx +5 -2
  266. package/src/popover/stories/index.story.tsx +85 -138
  267. package/src/popover/test/index.test.tsx +36 -1
  268. package/src/popover/types.ts +13 -15
  269. package/src/tabs/stories/index.story.tsx +2 -2
  270. package/src/tooltip/portal.tsx +11 -5
  271. package/src/tooltip/positioner.tsx +1 -4
  272. package/src/tooltip/style.module.css +1 -1
  273. package/src/tooltip/test/index.test.tsx +110 -0
  274. package/src/tooltip/types.ts +3 -5
  275. package/src/utils/create-overlay-title-validation.tsx +1 -1
  276. package/src/utils/css/item-popup.module.css +7 -4
  277. package/src/utils/css/wp-compat-overlay-slot.module.css +35 -0
  278. package/src/utils/render-slot-with-children.ts +4 -1
  279. package/src/utils/test/use-enable-wp-compat-overlay-slot.test.tsx +74 -0
  280. package/src/utils/test/wp-compat-overlay-slot.test.ts +300 -0
  281. package/src/utils/use-enable-wp-compat-overlay-slot.ts +32 -0
  282. package/src/utils/wp-compat-overlay-slot.ts +129 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Used to apply custom positioning to `Popover`'s floating content.
3
+ */
4
+ declare const Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").PopoverPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className" | "render" | "style"> & {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ render?: ((props: import("react").HTMLAttributes<any> & {
8
+ ref?: import("react").Ref<any> | undefined;
9
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
10
+ } & import("react").RefAttributes<HTMLDivElement>>;
11
+ export { Positioner };
12
+ //# sourceMappingURL=positioner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positioner.d.ts","sourceRoot":"","sources":["../../src/popover/positioner.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,QAAA,MAAM,UAAU;;;;;;kDA6Bf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -10,8 +10,11 @@ import type { RootProps } from './types';
10
10
  *
11
11
  * - `Popover.Root` — provides open state and context to all sub-components.
12
12
  * - `Popover.Trigger` — the button that toggles the popup.
13
- * - `Popover.Popup` — the floating container (positioning, collision
14
- * avoidance); portals by default or via `portal={ <Popover.Portal /> }`.
13
+ * - `Popover.Popup` — the floating container. Portals by default or via
14
+ * `portal={ <Popover.Portal /> }`, and is positioned by default or via
15
+ * `positioner={ <Popover.Positioner /> }`.
16
+ * - `Popover.Positioner` — controls placement, alignment, offset, collision
17
+ * behavior, and anchor for the floating content.
15
18
  * - `Popover.Arrow` — an optional arrow pointing toward the anchor.
16
19
  * - `Popover.Title` — **required** heading that labels the popover for
17
20
  * accessibility (can be visually hidden).
@@ -1 +1 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/popover/root.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,iBAAS,IAAI,CAAE,KAAK,EAAE,SAAS,+BAE9B;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/popover/root.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,IAAI,CAAE,KAAK,EAAE,SAAS,+BAE9B;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -10,7 +10,7 @@ export declare const Default: Story;
10
10
  */
11
11
  export declare const NoArrow: Story;
12
12
  /**
13
- * All combinations of `side` and `align` props on `Popover.Popup`.
13
+ * All combinations of `side` and `align` props on `Popover.Positioner`.
14
14
  *
15
15
  * Each row shows a side (`top`, `right`, `bottom`, `left`), and each column
16
16
  * shows an alignment (`start`, `center`, `end`).
@@ -96,16 +96,6 @@ export declare const CollisionAvoidance: Story;
96
96
  * position across document boundaries.
97
97
  */
98
98
  export declare const CrossIframe: Story;
99
- /**
100
- * Same cross-iframe scenario, but using `SlotFillProvider` and `Slot` from
101
- * `@wordpress/components` as the render target.
102
- *
103
- * The `Slot` renders a `div` in the parent document, and its forwarded ref
104
- * is passed to `Popover.Portal`'s `container` prop (via `Popover.Popup`'s
105
- * `portal` prop) so the popup portals into the slot element. This mirrors the
106
- * legacy Popover's `WithSlotOutsideIframe` pattern.
107
- */
108
- export declare const CrossIframeWithSlotFill: Story;
109
99
  /**
110
100
  * Popovers in Gutenberg are managed with explicit z-index values, which can
111
101
  * create situations where a popover renders below another popover when you
@@ -124,9 +114,9 @@ export declare const CrossIframeWithSlotFill: Story;
124
114
  */
125
115
  export declare const WithCustomZIndex: Story;
126
116
  /**
127
- * Use the `anchor` prop on `Popover.Popup` to position the popover against an
128
- * arbitrary element instead of the built-in trigger. Base UI accepts four
129
- * anchor types:
117
+ * Pass an `anchor` to `Popover.Positioner` (via `Popover.Popup`'s `positioner`
118
+ * slot) to position the popover against an arbitrary element instead of the
119
+ * built-in trigger. `anchor` accepts four types:
130
120
  *
131
121
  * 1. **Element** — a direct DOM element reference.
132
122
  * 2. **VirtualElement** — an object with a `getBoundingClientRect()` method.
@@ -147,13 +137,12 @@ export declare const Anchor: Story;
147
137
  */
148
138
  export declare const ToolbarVariant: Story;
149
139
  /**
150
- * Base UI's Positioner exposes `--available-height` and
151
- * `--available-width` CSS variables representing the space
152
- * between the anchor and the viewport edge. Apply them as `max-height` /
153
- * `max-width` via the `style` prop (which targets the positioner) to
154
- * constrain the popup size. Then add `overflow: auto` on an inner wrapper
155
- * so scrolling happens inside the popup content area — this replaces the
156
- * legacy Popover's `resize` prop.
140
+ * `Popover.Positioner` exposes `--available-height` and `--available-width`
141
+ * CSS variables representing the space between the anchor and the viewport
142
+ * edge. These cascade down to `Popover.Popup`, where applying them as
143
+ * `max-height` / `max-width` via the `style` prop constrains the popup size.
144
+ * Then add `overflow: auto` on an inner wrapper so scrolling happens inside
145
+ * the popup content area — this replaces the legacy Popover's `resize` prop.
157
146
  *
158
147
  * Open the popover and resize or scroll the container to see the popup shrink
159
148
  * to fit.
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/popover/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,KAAK,OAAO,MAAM,KAAK,CAAC;AAM/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAAC,IAAI,CAsBpC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAC,IAAI,CAAE,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAC;AAEF;;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Ac,EAAE,KA4B5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAkDrC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAoDjC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,KAiE1B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,EAAE,KAiDvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,KAyB1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,EAAE,KA6CrB,CAAC"}
@@ -1,7 +1,8 @@
1
- import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
1
+ import type { ReactElement, ReactNode } from 'react';
2
2
  import type { Popover as _Popover } from '@base-ui/react/popover';
3
3
  import type { ComponentProps } from '../utils/types';
4
- export type PortalProps = ComponentPropsWithoutRef<typeof _Popover.Portal>;
4
+ export type PortalProps = ComponentProps<typeof _Popover.Portal>;
5
+ export type PositionerProps = ComponentProps<typeof _Popover.Positioner>;
5
6
  export interface RootProps extends Pick<_Popover.Root.Props, 'open' | 'onOpenChange' | 'defaultOpen' | 'modal'> {
6
7
  /**
7
8
  * The popover sub-components (`Popover.Trigger`, `Popover.Popup`, etc.).
@@ -14,7 +15,7 @@ export interface TriggerProps extends ComponentProps<'button'>, Pick<_Popover.Tr
14
15
  */
15
16
  children?: ReactNode;
16
17
  }
17
- export interface PopupProps extends ComponentProps<'div'>, Pick<_Popover.Positioner.Props, 'align' | 'alignOffset' | 'anchor' | 'arrowPadding' | 'collisionAvoidance' | 'collisionBoundary' | 'collisionPadding' | 'side' | 'sideOffset' | 'sticky'>, Pick<_Popover.Popup.Props, 'initialFocus' | 'finalFocus'> {
18
+ export interface PopupProps extends ComponentProps<'div'>, Pick<_Popover.Popup.Props, 'initialFocus' | 'finalFocus'> {
18
19
  /**
19
20
  * Whether to render a backdrop overlay behind the popover.
20
21
  *
@@ -37,6 +38,14 @@ export interface PopupProps extends ComponentProps<'div'>, Pick<_Popover.Positio
37
38
  * When omitted, `Popover.Popup` uses `Popover.Portal` with default props.
38
39
  */
39
40
  portal?: ReactElement<Omit<PortalProps, 'children'>>;
41
+ /**
42
+ * Optional positioner element, typically `<Popover.Positioner />` with
43
+ * custom positioning props (`side`, `align`, `sideOffset`, collision
44
+ * settings, anchor, etc.). When omitted, `Popover.Popup` uses
45
+ * `Popover.Positioner` with default props. Do not pass `children` on
46
+ * the positioner element; they would be ignored.
47
+ */
48
+ positioner?: ReactElement<Omit<PositionerProps, 'children'>>;
40
49
  /**
41
50
  * The visual style variant of the popup.
42
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAE,OAAO,QAAQ,CAAC,MAAM,CAAE,CAAC;AAE7E,MAAM,WAAW,SAChB,SAAQ,IAAI,CACX,QAAQ,CAAC,IAAI,CAAC,KAAK,EACnB,MAAM,GAAG,cAAc,GAAG,aAAa,GAAG,OAAO,CACjD;IACD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,YAChB,SAAQ,cAAc,CAAE,QAAQ,CAAE,EACjC,IAAI,CAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,GAAG,YAAY,CAAE;IACvE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,UAChB,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AAM,WAAW,UAAW,SAAQ,cAAc,CAAE,IAAI,CAAE;IACzD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAE,GAAG,CAAE;IAC9D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAE,QAAQ,CAAE;IAC7D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"}
@@ -1,8 +1,13 @@
1
1
  /**
2
- * Root element that portals `Tooltip` floating content. Pass to
3
- * `Tooltip.Popup`'s `portal` prop. When `portal` is omitted, `Tooltip.Popup`
4
- * uses this component with default props.
2
+ * Used to apply custom portal behavior to `Tooltip`'s floating content.
3
+ * `container` defaults to the `@wordpress/ui` compat overlay slot.
5
4
  */
6
- declare const Portal: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
5
+ declare const Portal: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className" | "render" | "style"> & {
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ render?: ((props: import("react").HTMLAttributes<any> & {
9
+ ref?: import("react").Ref<any> | undefined;
10
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
11
+ } & import("react").RefAttributes<HTMLDivElement>>;
7
12
  export { Portal };
8
13
  //# sourceMappingURL=portal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/tooltip/portal.tsx"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,QAAA,MAAM,MAAM,kNAIX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/tooltip/portal.tsx"],"names":[],"mappings":"AAKA;;;GAGG;AACH,QAAA,MAAM,MAAM;;;;;;kDAUX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,9 +1,12 @@
1
1
  /**
2
- * Positions the floating tooltip content relative to the trigger. Pass to
3
- * `Tooltip.Popup`'s `positioner` prop to customize `side`, `align`,
4
- * `sideOffset`, collision behavior, etc. When `positioner` is omitted,
5
- * `Tooltip.Popup` uses this component with default props.
2
+ * Used to apply custom positioning to `Tooltip`'s floating content.
6
3
  */
7
- declare const Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").TooltipPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
4
+ declare const Positioner: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").TooltipPositionerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref">, "children" | "className" | "render" | "style"> & {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ render?: ((props: import("react").HTMLAttributes<any> & {
8
+ ref?: import("react").Ref<any> | undefined;
9
+ }) => React.ReactElement<unknown>) | React.ReactElement<Record<string, unknown>>;
10
+ } & import("react").RefAttributes<HTMLDivElement>>;
8
11
  export { Positioner };
9
12
  //# sourceMappingURL=positioner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"positioner.d.ts","sourceRoot":"","sources":["../../src/tooltip/positioner.tsx"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,QAAA,MAAM,UAAU,sNAoBf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"positioner.d.ts","sourceRoot":"","sources":["../../src/tooltip/positioner.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,QAAA,MAAM,UAAU;;;;;;kDAoBf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
- import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
1
+ import type { ReactElement, ReactNode } from 'react';
2
2
  import type { Tooltip as _Tooltip } from '@base-ui/react/tooltip';
3
3
  import type { ComponentProps } from '../utils/types';
4
- export type PortalProps = ComponentPropsWithoutRef<typeof _Tooltip.Portal>;
5
- export type PositionerProps = ComponentPropsWithoutRef<typeof _Tooltip.Positioner>;
4
+ export type PortalProps = ComponentProps<typeof _Tooltip.Portal>;
5
+ export type PositionerProps = ComponentProps<typeof _Tooltip.Positioner>;
6
6
  export type RootProps = Pick<_Tooltip.Root.Props, 'disabled' | 'children'>;
7
7
  export type ProviderProps = Pick<_Tooltip.Provider.Props, 'delay' | 'children'>;
8
8
  export interface TriggerProps extends ComponentProps<'button'> {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tooltip/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAE,OAAO,QAAQ,CAAC,MAAM,CAAE,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,wBAAwB,CACrD,OAAO,QAAQ,CAAC,UAAU,CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,IAAI,CAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAE,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,IAAI,CAC/B,QAAQ,CAAC,QAAQ,CAAC,KAAK,EACvB,OAAO,GAAG,UAAU,CACpB,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAE,QAAQ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,SAAS,CAAC;IAErB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,CAAE,IAAI,CAAE,WAAW,EAAE,UAAU,CAAE,CAAE,CAAC;IAEzD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,YAAY,CAAE,IAAI,CAAE,eAAe,EAAE,UAAU,CAAE,CAAE,CAAC;CACjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-slot-with-children.d.ts","sourceRoot":"","sources":["../../src/utils/render-slot-with-children.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,GACjB,YAAY,CAEd"}
1
+ {"version":3,"file":"render-slot-with-children.d.ts","sourceRoot":"","sources":["../../src/utils/render-slot-with-children.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,SAAS,GACjB,YAAY,CAKd"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=use-enable-wp-compat-overlay-slot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-enable-wp-compat-overlay-slot.test.d.ts","sourceRoot":"","sources":["../../../src/utils/test/use-enable-wp-compat-overlay-slot.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=wp-compat-overlay-slot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp-compat-overlay-slot.test.d.ts","sourceRoot":"","sources":["../../../src/utils/test/wp-compat-overlay-slot.test.ts"],"names":[],"mappings":""}
@@ -31,7 +31,7 @@ export declare function useDeprioritizedInitialFocus({ initialFocus, deprioritiz
31
31
  deprioritizedAttributes: string[];
32
32
  }): {
33
33
  resolvedInitialFocus: boolean | import("react").RefObject<HTMLElement | null> | ((openType: import("@base-ui/utils/useEnhancedClickHandler").InteractionType) => void | boolean | HTMLElement | null) | undefined;
34
- popupRef: import("react").RefObject<HTMLDivElement>;
34
+ popupRef: import("react").RefObject<HTMLDivElement | null>;
35
35
  };
36
36
  export {};
37
37
  //# sourceMappingURL=use-deprioritized-initial-focus.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Opts the host application into the `@wordpress/ui` compat overlay slot —
3
+ * a body-level container into which `@wordpress/ui` overlays portal so they
4
+ * reliably stack above `@wordpress/components` overlays in mixed-library
5
+ * compositions.
6
+ *
7
+ * Call once from a component that mounts for the lifetime of the app
8
+ * (typically the root). Idempotent and one-way: a single caller should not
9
+ * be able to turn off shared infrastructure for everyone else; if the slot
10
+ * isn't wanted, simply don't call this hook.
11
+ *
12
+ * Where `window.wp.components` is on the global — the typical setup for
13
+ * plugins enqueueing `wp-components` through WordPress's script-loader —
14
+ * the slot auto-enables and this hook is a no-op.
15
+ */
16
+ export declare function useEnableWpCompatOverlaySlot(): void;
17
+ //# sourceMappingURL=use-enable-wp-compat-overlay-slot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-enable-wp-compat-overlay-slot.d.ts","sourceRoot":"","sources":["../../src/utils/use-enable-wp-compat-overlay-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAgBnD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Marker attribute on the compat overlay slot element.
3
+ */
4
+ export declare const WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
5
+ /**
6
+ * Returns the body-level compat overlay slot when the runtime opts in,
7
+ * lazily creating it on first call. Returns `undefined` otherwise — so the
8
+ * return value can be forwarded straight to a `container` prop, leaving the
9
+ * default portal container in effect.
10
+ *
11
+ * Two opt-in paths:
12
+ *
13
+ * - Auto-detected when `window.wp.components` is on the global — the
14
+ * typical script-loader setup for WordPress plugins and admin screens.
15
+ * - Explicit, via `useEnableWpCompatOverlaySlot()` — for hosts that bundle
16
+ * `@wordpress/components` (or only `@wordpress/ui`) directly rather than
17
+ * relying on the global.
18
+ *
19
+ * The slot is a single `<div data-wp-compat-overlay-slot>` appended to the
20
+ * local document's body. Subsequent calls return the same element; if it's
21
+ * been removed it's recreated, and a slot created by another
22
+ * `@wordpress/ui` instance in the same document is adopted rather than
23
+ * duplicated.
24
+ */
25
+ export declare function getWpCompatOverlaySlot(): HTMLDivElement | undefined;
26
+ /**
27
+ * Test-only escape hatch that drops the cached singleton.
28
+ */
29
+ export declare function __resetWpCompatOverlaySlotCacheForTests(): void;
30
+ //# sourceMappingURL=wp-compat-overlay-slot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wp-compat-overlay-slot.d.ts","sourceRoot":"","sources":["../../src/utils/wp-compat-overlay-slot.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,eAAO,MAAM,gCAAgC,gCAAgC,CAAC;AAuC9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,IAAI,cAAc,GAAG,SAAS,CA6CnE;AAED;;GAEG;AACH,wBAAgB,uCAAuC,IAAI,IAAI,CAE9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/ui",
3
- "version": "0.13.1-next.v.202605131032.0+f6d6e7149",
3
+ "version": "0.14.0",
4
4
  "description": "Themeable React UI components for the WordPress Design System.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -44,16 +44,16 @@
44
44
  "sideEffects": false,
45
45
  "dependencies": {
46
46
  "@base-ui/react": "^1.4.1",
47
- "@wordpress/a11y": "^4.45.1-next.v.202605131032.0+f6d6e7149",
48
- "@wordpress/compose": "^7.45.1-next.v.202605131032.0+f6d6e7149",
49
- "@wordpress/element": "^6.45.1-next.v.202605131032.0+f6d6e7149",
50
- "@wordpress/i18n": "^6.18.1-next.v.202605131032.0+f6d6e7149",
51
- "@wordpress/icons": "^13.0.1-next.v.202605131032.0+f6d6e7149",
52
- "@wordpress/keycodes": "^4.45.1-next.v.202605131032.0+f6d6e7149",
53
- "@wordpress/primitives": "^4.45.1-next.v.202605131032.0+f6d6e7149",
54
- "@wordpress/private-apis": "^1.45.1-next.v.202605131032.0+f6d6e7149",
55
- "@wordpress/style-runtime": "^0.1.2-next.v.202605131032.0+f6d6e7149",
56
- "@wordpress/theme": "^0.13.1-next.v.202605131032.0+f6d6e7149",
47
+ "@wordpress/a11y": "^4.47.0",
48
+ "@wordpress/compose": "^8.0.0",
49
+ "@wordpress/element": "^7.0.0",
50
+ "@wordpress/i18n": "^6.20.0",
51
+ "@wordpress/icons": "^13.2.0",
52
+ "@wordpress/keycodes": "^4.47.0",
53
+ "@wordpress/primitives": "^4.47.0",
54
+ "@wordpress/private-apis": "^1.47.0",
55
+ "@wordpress/style-runtime": "^0.3.0",
56
+ "@wordpress/theme": "^0.14.0",
57
57
  "clsx": "^2.1.1",
58
58
  "tabbable": "^6.4.0"
59
59
  },
@@ -66,11 +66,11 @@
66
66
  "storybook": "^10.2.8"
67
67
  },
68
68
  "peerDependencies": {
69
- "react": "^18.0.0",
70
- "react-dom": "^18.0.0"
69
+ "react": "^19.2.4",
70
+ "react-dom": "^19.2.4"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "0e198c7ac7ca634e73ded9220ce048c0302174dd"
75
+ "gitHead": "d653c5fd6161571a0c2ebde28553d6e25624eacc"
76
76
  }
@@ -3,10 +3,7 @@ import { forwardRef } from '@wordpress/element';
3
3
  import type { PortalProps } from './types';
4
4
 
5
5
  /**
6
- * Root element that portals `AlertDialog` overlay content. Pass to
7
- * `AlertDialog.Popup`'s `portal` prop to customize the portal target and
8
- * wrapper. When `portal` is omitted, `AlertDialog.Popup` uses this component
9
- * with default props.
6
+ * Used to apply custom portal behavior to `AlertDialog`'s overlay content.
10
7
  */
11
8
  const Portal = forwardRef< HTMLDivElement, PortalProps >(
12
9
  function AlertDialogPortal( props, ref ) {
@@ -1,11 +1,9 @@
1
1
  import type { AlertDialog as _AlertDialog } from '@base-ui/react/alert-dialog';
2
- import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
2
+ import type { ReactElement, ReactNode } from 'react';
3
3
 
4
4
  import type { ComponentProps } from '../utils/types';
5
5
 
6
- export type PortalProps = ComponentPropsWithoutRef<
7
- typeof _AlertDialog.Portal
8
- >;
6
+ export type PortalProps = ComponentProps< typeof _AlertDialog.Portal >;
9
7
 
10
8
  /**
11
9
  * The return type of `onConfirm`. Return `void` (or nothing) to auto-close
@@ -0,0 +1,20 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Badge } from '../..';
3
+
4
+ const meta: Meta< typeof Badge > = {
5
+ title: 'Design System/Components/Badge',
6
+ component: Badge,
7
+ };
8
+ export default meta;
9
+
10
+ type Story = StoryObj< typeof Badge >;
11
+
12
+ export const TextOverflow: Story = {
13
+ args: {
14
+ children:
15
+ 'This is an extremely long label thatshoulddemonstratetextoverflow behavior',
16
+ },
17
+ parameters: {
18
+ textOverflowContainers: true,
19
+ },
20
+ };
@@ -0,0 +1,130 @@
1
+ import type { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
2
+ import { Button } from '../..';
3
+ import type { ButtonProps } from '../../types';
4
+
5
+ const meta: Meta< typeof Button > = {
6
+ title: 'Design System/Components/Button',
7
+ component: Button,
8
+ };
9
+ export default meta;
10
+
11
+ type Story = StoryObj< typeof Button >;
12
+
13
+ const variants: NonNullable< ButtonProps[ 'variant' ] >[] = [
14
+ 'solid',
15
+ 'outline',
16
+ 'minimal',
17
+ 'unstyled',
18
+ ];
19
+
20
+ export const VariantStates: StoryFn< typeof Button > = (
21
+ props: ButtonProps
22
+ ) => {
23
+ const VariantsRow = ( {
24
+ buttonProps,
25
+ name,
26
+ }: {
27
+ buttonProps?: ButtonProps;
28
+ name: string;
29
+ } ) => {
30
+ return (
31
+ <tr>
32
+ <th
33
+ style={ {
34
+ fontSize: 13,
35
+ fontWeight: 'normal',
36
+ padding: 8,
37
+ background: '#f3f4f5',
38
+ } }
39
+ >
40
+ { name }
41
+ </th>
42
+ { variants.map( ( variant ) => (
43
+ <td key={ variant } style={ { padding: 4 } }>
44
+ <Button
45
+ { ...props }
46
+ variant={ variant }
47
+ { ...buttonProps }
48
+ />
49
+ </td>
50
+ ) ) }
51
+ </tr>
52
+ );
53
+ };
54
+
55
+ return (
56
+ <table>
57
+ <thead>
58
+ <tr style={ { background: '#f3f4f5' } }>
59
+ <th />
60
+ { variants.map( ( variant ) => (
61
+ <th key={ variant } style={ { padding: 8 } }>
62
+ { variant }
63
+ </th>
64
+ ) ) }
65
+ </tr>
66
+ </thead>
67
+ <tbody>
68
+ <VariantsRow name="(default)" />
69
+ <VariantsRow
70
+ name="disabled"
71
+ buttonProps={ { disabled: true } }
72
+ />
73
+ <VariantsRow
74
+ name="disabled unfocusable"
75
+ buttonProps={ {
76
+ focusableWhenDisabled: false,
77
+ disabled: true,
78
+ } }
79
+ />
80
+ <VariantsRow
81
+ name="loading"
82
+ buttonProps={ {
83
+ loading: true,
84
+ } }
85
+ />
86
+ <VariantsRow
87
+ name="loading disabled"
88
+ buttonProps={ {
89
+ loading: true,
90
+ disabled: true,
91
+ } }
92
+ />
93
+ <VariantsRow
94
+ name="neutral"
95
+ buttonProps={ {
96
+ tone: 'neutral',
97
+ } }
98
+ />
99
+ <VariantsRow
100
+ name="pressed"
101
+ buttonProps={ {
102
+ tone: 'neutral',
103
+ 'aria-pressed': true,
104
+ } }
105
+ />
106
+ <VariantsRow
107
+ name="pressed disabled"
108
+ buttonProps={ {
109
+ tone: 'neutral',
110
+ 'aria-pressed': true,
111
+ disabled: true,
112
+ } }
113
+ />
114
+ </tbody>
115
+ </table>
116
+ );
117
+ };
118
+ VariantStates.args = {
119
+ children: 'Code is poetry',
120
+ };
121
+
122
+ export const TextOverflow: Story = {
123
+ args: {
124
+ children:
125
+ 'This is an extremely long label thatshoulddemonstratetextoverflow behavior',
126
+ },
127
+ parameters: {
128
+ textOverflowContainers: true,
129
+ },
130
+ };
@@ -95,7 +95,7 @@ export const AllTonesAndVariants: Story = {
95
95
  <div
96
96
  style={ {
97
97
  display: 'grid',
98
- gridTemplateColumns: 'max-content repeat(2, min-content)',
98
+ gridTemplateColumns: 'max-content repeat(2, max-content)',
99
99
  color: 'var(--wpds-color-fg-content-neutral)',
100
100
  } }
101
101
  >
@@ -17,6 +17,7 @@
17
17
  --wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-brand-strong);
18
18
  --wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-brand-strong-active);
19
19
  --wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);
20
+ --wp-ui-button-padding-block: var(--wpds-dimension-padding-xs);
20
21
  --wp-ui-button-padding-inline: var(--wpds-dimension-padding-md);
21
22
  --wp-ui-button-height: 40px;
22
23
  --wp-ui-button-aspect-ratio: auto; /* Useful for overrides such as icon buttons */
@@ -40,7 +41,9 @@
40
41
  gap: var(--wpds-dimension-gap-sm);
41
42
  aspect-ratio: var(--wp-ui-button-aspect-ratio);
42
43
  min-width: var(--wp-ui-button-min-width);
43
- height: var(--wp-ui-button-height);
44
+ max-width: 100%;
45
+ min-height: var(--wp-ui-button-height);
46
+ padding-block: var(--wp-ui-button-padding-block);
44
47
  padding-inline: var(--wp-ui-button-padding-inline);
45
48
  border-style: solid;
46
49
  border-width: 1px;
@@ -52,9 +55,14 @@
52
55
  font-size: var(--wp-ui-button-font-size);
53
56
  font-weight: var(--wp-ui-button-font-weight);
54
57
  line-height: var(--wpds-typography-line-height-sm);
58
+ text-align: center;
55
59
  text-decoration: none;
56
60
  color: var(--wp-ui-button-foreground-color);
57
- cursor: var(--wpds-cursor-control);
61
+ overflow-wrap: anywhere;
62
+
63
+ &:not([data-disabled]) {
64
+ cursor: var(--wpds-cursor-control);
65
+ }
58
66
 
59
67
  @media not ( prefers-reduced-motion ) {
60
68
  transition: color 0.1s ease-out;
@@ -129,6 +137,7 @@
129
137
  }
130
138
 
131
139
  .is-small {
140
+ --wp-ui-button-padding-block: 0;
132
141
  --wp-ui-button-padding-inline: var(--wpds-dimension-padding-sm);
133
142
  --wp-ui-button-height: 24px;
134
143
  }
@@ -164,7 +173,9 @@
164
173
  }
165
174
 
166
175
  .is-neutral {
167
- &.is-solid {
176
+ /* Solid and pressed minimal share the strong appearance */
177
+ &.is-solid,
178
+ &.is-minimal[aria-pressed="true"] {
168
179
  --wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);
169
180
  --wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong-active);
170
181
  --wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-strong-disabled);
@@ -173,9 +184,9 @@
173
184
  --wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-strong-disabled);
174
185
  }
175
186
 
176
- /* Outline and minimal buttons use the same foreground color */
187
+ /* Outline and unpressed minimal buttons use the same foreground color */
177
188
  &.is-outline,
178
- &.is-minimal {
189
+ &.is-minimal:not([aria-pressed="true"]) {
179
190
  --wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral);
180
191
  --wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-active);
181
192
  --wp-ui-button-foreground-color-disabled: var(--wpds-color-fg-interactive-neutral-disabled);
@@ -190,7 +201,7 @@
190
201
  --wp-ui-button-border-color-disabled: var(--wpds-color-stroke-interactive-neutral-disabled);
191
202
  }
192
203
 
193
- &.is-minimal {
204
+ &.is-minimal:not([aria-pressed="true"]) {
194
205
  --wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-weak);
195
206
  --wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-weak-active);
196
207
  --wp-ui-button-background-color-disabled: var(--wpds-color-bg-interactive-neutral-weak-disabled);
@@ -230,12 +241,6 @@
230
241
  }
231
242
  }
232
243
 
233
- [aria-pressed="true"].is-minimal.is-neutral {
234
- --wp-ui-button-background-color: var(--wpds-color-bg-interactive-neutral-strong);
235
- --wp-ui-button-background-color-active: var(--wpds-color-bg-interactive-neutral-strong);
236
- --wp-ui-button-foreground-color: var(--wpds-color-fg-interactive-neutral-strong);
237
- --wp-ui-button-foreground-color-active: var(--wpds-color-fg-interactive-neutral-strong);
238
- }
239
244
  }
240
245
 
241
246
  @keyframes loading-animation {