@wordpress/ui 0.13.1-next.v.202605131006.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,133 @@
1
+ // packages/ui/src/popover/positioner.tsx
2
+ import clsx from "clsx";
3
+ import { Popover as _Popover } from "@base-ui/react/popover";
4
+ import { forwardRef } from "@wordpress/element";
5
+
6
+ // packages/style-runtime/src/index.ts
7
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
8
+ function getRuntime() {
9
+ const globalScope = globalThis;
10
+ if (globalScope.__wpStyleRuntime) {
11
+ return globalScope.__wpStyleRuntime;
12
+ }
13
+ globalScope.__wpStyleRuntime = {
14
+ documents: /* @__PURE__ */ new Map(),
15
+ styles: /* @__PURE__ */ new Map(),
16
+ injectedStyles: /* @__PURE__ */ new WeakMap()
17
+ };
18
+ if (typeof document !== "undefined") {
19
+ registerDocument(document);
20
+ }
21
+ return globalScope.__wpStyleRuntime;
22
+ }
23
+ function documentContainsStyleHash(targetDocument, hash) {
24
+ if (!targetDocument.head) {
25
+ return false;
26
+ }
27
+ for (const style of targetDocument.head.querySelectorAll(
28
+ `style[${STYLE_HASH_ATTRIBUTE}]`
29
+ )) {
30
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
31
+ return true;
32
+ }
33
+ }
34
+ return false;
35
+ }
36
+ function injectStyle(targetDocument, hash, css) {
37
+ if (!targetDocument.head) {
38
+ return;
39
+ }
40
+ const runtime = getRuntime();
41
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
42
+ if (!injectedStyles) {
43
+ injectedStyles = /* @__PURE__ */ new Set();
44
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
45
+ }
46
+ if (injectedStyles.has(hash)) {
47
+ return;
48
+ }
49
+ if (documentContainsStyleHash(targetDocument, hash)) {
50
+ injectedStyles.add(hash);
51
+ return;
52
+ }
53
+ const style = targetDocument.createElement("style");
54
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
55
+ style.appendChild(targetDocument.createTextNode(css));
56
+ targetDocument.head.appendChild(style);
57
+ injectedStyles.add(hash);
58
+ }
59
+ function registerDocument(targetDocument) {
60
+ const runtime = getRuntime();
61
+ runtime.documents.set(
62
+ targetDocument,
63
+ (runtime.documents.get(targetDocument) ?? 0) + 1
64
+ );
65
+ for (const [hash, css] of runtime.styles) {
66
+ injectStyle(targetDocument, hash, css);
67
+ }
68
+ return () => {
69
+ const count = runtime.documents.get(targetDocument);
70
+ if (count === void 0) {
71
+ return;
72
+ }
73
+ if (count <= 1) {
74
+ runtime.documents.delete(targetDocument);
75
+ return;
76
+ }
77
+ runtime.documents.set(targetDocument, count - 1);
78
+ };
79
+ }
80
+ function registerStyle(hash, css) {
81
+ const runtime = getRuntime();
82
+ runtime.styles.set(hash, css);
83
+ for (const targetDocument of runtime.documents.keys()) {
84
+ injectStyle(targetDocument, hash, css);
85
+ }
86
+ }
87
+
88
+ // packages/ui/src/utils/css/resets.module.css
89
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
90
+ registerStyle("e3ae230cea", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}");
91
+ }
92
+ var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
93
+
94
+ // packages/ui/src/popover/style.module.css
95
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
96
+ registerStyle("cc851ac208", '@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}');
97
+ }
98
+ var style_default = { "positioner": "_10450722b9676f78__positioner", "popup": "_84e8f597bcf683b8__popup", "backdrop": "e4d544aa033f05c6__backdrop", "arrow": "ca05d3eb89321fcd__arrow", "arrow-fill": "_12d8edd9eb946b5f__arrow-fill", "arrow-stroke": "_6ddab482bd929dad__arrow-stroke", "title": "_6d7e4729cd96960e__title" };
99
+
100
+ // packages/ui/src/popover/positioner.tsx
101
+ import { jsx } from "react/jsx-runtime";
102
+ var Positioner = forwardRef(
103
+ function PopoverPositioner({
104
+ align = "center",
105
+ // Matches the popup's border-radius (--wpds-border-radius-md).
106
+ arrowPadding = 8,
107
+ className,
108
+ side = "bottom",
109
+ sideOffset = 8,
110
+ ...props
111
+ }, ref) {
112
+ return /* @__PURE__ */ jsx(
113
+ _Popover.Positioner,
114
+ {
115
+ ref,
116
+ align,
117
+ arrowPadding,
118
+ side,
119
+ sideOffset,
120
+ ...props,
121
+ className: clsx(
122
+ resets_default["box-sizing"],
123
+ style_default.positioner,
124
+ className
125
+ )
126
+ }
127
+ );
128
+ }
129
+ );
130
+ export {
131
+ Positioner
132
+ };
133
+ //# sourceMappingURL=positioner.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/popover/positioner.tsx", "../../../style-runtime/src/index.ts", "../../src/utils/css/resets.module.css", "../../src/popover/style.module.css"],
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Popover as _Popover } from '@base-ui/react/popover';\nimport { forwardRef } from '@wordpress/element';\nimport type { PositionerProps } from './types';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\n/**\n * Used to apply custom positioning to `Popover`'s floating content.\n */\nconst Positioner = forwardRef< HTMLDivElement, PositionerProps >(\n\tfunction PopoverPositioner(\n\t\t{\n\t\t\talign = 'center',\n\t\t\t// Matches the popup's border-radius (--wpds-border-radius-md).\n\t\t\tarrowPadding = 8,\n\t\t\tclassName,\n\t\t\tside = 'bottom',\n\t\t\tsideOffset = 8,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) {\n\t\treturn (\n\t\t\t<_Popover.Positioner\n\t\t\t\tref={ ref }\n\t\t\t\talign={ align }\n\t\t\t\tarrowPadding={ arrowPadding }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tstyles.positioner,\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Positioner };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e3ae230cea\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\");\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"cc851ac208\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._10450722b9676f78__positioner{z-index:var(--wp-ui-popover-z-index,initial)}._84e8f597bcf683b8__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--wpds-elevation-md,0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-md,24px);outline:0;padding:var(--wpds-dimension-padding-lg,16px)}.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:#0000}@media (forced-colors:active){._84e8f597bcf683b8__popup,.e4d544aa033f05c6__backdrop~* ._84e8f597bcf683b8__popup{border-color:CanvasText}}.ca05d3eb89321fcd__arrow{display:flex;&[data-side=top]{bottom:-8px;rotate:180deg}&[data-side=bottom]{rotate:0deg;top:-8px}&[data-side=left]{inset-inline-end:-13px;rotate:90deg}&[data-side=right]{inset-inline-start:-13px;rotate:-90deg}}._12d8edd9eb946b5f__arrow-fill{fill:var(--wpds-color-bg-surface-neutral-strong,#fff)}._6ddab482bd929dad__arrow-stroke{fill:var(--wpds-color-stroke-surface-neutral,#dbdbdb)}._6d7e4729cd96960e__title{--_gcd-heading-color:var(--wpds-color-fg-content-neutral,#1e1e1e);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.e4d544aa033f05c6__backdrop{background-color:#00000026;inset:0;position:fixed;z-index:var(--wp-ui-popover-z-index,initial)}}\");\n}\nexport default {\"positioner\":\"_10450722b9676f78__positioner\",\"popup\":\"_84e8f597bcf683b8__popup\",\"backdrop\":\"e4d544aa033f05c6__backdrop\",\"arrow\":\"ca05d3eb89321fcd__arrow\",\"arrow-fill\":\"_12d8edd9eb946b5f__arrow-fill\",\"arrow-stroke\":\"_6ddab482bd929dad__arrow-stroke\",\"title\":\"_6d7e4729cd96960e__title\"};\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;;;ACQ3B,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAA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c;AAC1D,QAAM,UAAU,WAAW;AAE3B,UAAQ,OAAO,IAAK,MAAM,GAAI;AAE9B,aAAY,kBAAkB,QAAQ,UAAU,KAAK,GAAI;AACxD,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AACD;;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,kMAAkM;AAC/N;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACH5D,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,uwDAAmxD;AAChzD;AACA,IAAO,gBAAQ,EAAC,cAAa,iCAAgC,SAAQ,4BAA2B,YAAW,8BAA6B,SAAQ,2BAA0B,cAAa,iCAAgC,gBAAe,mCAAkC,SAAQ,2BAA0B;;;AHoBvS;AAdH,IAAM,aAAa;AAAA,EAClB,SAAS,kBACR;AAAA,IACC,QAAQ;AAAA;AAAA,IAER,eAAe;AAAA,IACf;AAAA,IACA,OAAO;AAAA,IACP,aAAa;AAAA,IACb,GAAG;AAAA,EACJ,GACA,KACC;AACD,WACC;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACE,GAAG;AAAA,QACL,WAAY;AAAA,UACX,eAAa,YAAa;AAAA,UAC1B,cAAO;AAAA,UACP;AAAA,QACD;AAAA;AAAA,IACD;AAAA,EAEF;AACD;",
6
+ "names": []
7
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/popover/root.tsx"],
4
- "sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport type { RootProps } from './types';\n\n/**\n * An accessible popup anchored to a trigger element.\n *\n * Popover renders ARIA-compliant floating content that appears next to its\n * trigger. It can contain interactive content such as form controls, menus,\n * and rich descriptions.\n *\n * Compose the compound components to build a popover:\n *\n * - `Popover.Root` \u2014 provides open state and context to all sub-components.\n * - `Popover.Trigger` \u2014 the button that toggles the popup.\n * - `Popover.Popup` \u2014 the floating container (positioning, collision\n * avoidance); portals by default or via `portal={ <Popover.Portal /> }`.\n * - `Popover.Arrow` \u2014 an optional arrow pointing toward the anchor.\n * - `Popover.Title` \u2014 **required** heading that labels the popover for\n * accessibility (can be visually hidden).\n * - `Popover.Description` \u2014 optional paragraph linked via `aria-describedby`.\n * - `Popover.Close` \u2014 a button that closes the popover when clicked.\n * **Required** when `modal` is `true` or `'trap-focus'` so that focus\n * can cycle correctly and the user can dismiss the popover.\n *\n * ```jsx\n * <Popover.Root>\n * <Popover.Trigger>Open</Popover.Trigger>\n * <Popover.Popup>\n * <Popover.Arrow />\n * <Popover.Title>Popover title</Popover.Title>\n * <Popover.Description>Popover description</Popover.Description>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Popup>\n * </Popover.Root>\n * ```\n */\nfunction Root( props: RootProps ) {\n\treturn <_Popover.Root { ...props } />;\n}\n\nexport { Root };\n"],
5
- "mappings": ";AAAA,SAAS,WAAW,gBAAgB;AAqC5B;AADR,SAAS,KAAM,OAAmB;AACjC,SAAO,oBAAC,SAAS,MAAT,EAAgB,GAAG,OAAQ;AACpC;",
4
+ "sourcesContent": ["import { Popover as _Popover } from '@base-ui/react/popover';\nimport type { RootProps } from './types';\n\n/**\n * An accessible popup anchored to a trigger element.\n *\n * Popover renders ARIA-compliant floating content that appears next to its\n * trigger. It can contain interactive content such as form controls, menus,\n * and rich descriptions.\n *\n * Compose the compound components to build a popover:\n *\n * - `Popover.Root` \u2014 provides open state and context to all sub-components.\n * - `Popover.Trigger` \u2014 the button that toggles the popup.\n * - `Popover.Popup` \u2014 the floating container. Portals by default or via\n * `portal={ <Popover.Portal /> }`, and is positioned by default or via\n * `positioner={ <Popover.Positioner /> }`.\n * - `Popover.Positioner` \u2014 controls placement, alignment, offset, collision\n * behavior, and anchor for the floating content.\n * - `Popover.Arrow` \u2014 an optional arrow pointing toward the anchor.\n * - `Popover.Title` \u2014 **required** heading that labels the popover for\n * accessibility (can be visually hidden).\n * - `Popover.Description` \u2014 optional paragraph linked via `aria-describedby`.\n * - `Popover.Close` \u2014 a button that closes the popover when clicked.\n * **Required** when `modal` is `true` or `'trap-focus'` so that focus\n * can cycle correctly and the user can dismiss the popover.\n *\n * ```jsx\n * <Popover.Root>\n * <Popover.Trigger>Open</Popover.Trigger>\n * <Popover.Popup>\n * <Popover.Arrow />\n * <Popover.Title>Popover title</Popover.Title>\n * <Popover.Description>Popover description</Popover.Description>\n * <Popover.Close>Close</Popover.Close>\n * </Popover.Popup>\n * </Popover.Root>\n * ```\n */\nfunction Root( props: RootProps ) {\n\treturn <_Popover.Root { ...props } />;\n}\n\nexport { Root };\n"],
5
+ "mappings": ";AAAA,SAAS,WAAW,gBAAgB;AAwC5B;AADR,SAAS,KAAM,OAAmB;AACjC,SAAO,oBAAC,SAAS,MAAT,EAAgB,GAAG,OAAQ;AACpC;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,18 @@
1
1
  // packages/ui/src/tooltip/portal.tsx
2
2
  import { Tooltip as _Tooltip } from "@base-ui/react/tooltip";
3
3
  import { forwardRef } from "@wordpress/element";
4
+ import { getWpCompatOverlaySlot } from "../utils/wp-compat-overlay-slot.mjs";
4
5
  import { jsx } from "react/jsx-runtime";
5
6
  var Portal = forwardRef(
6
- function TooltipPortal(props, ref) {
7
- return /* @__PURE__ */ jsx(_Tooltip.Portal, { ref, ...props });
7
+ function TooltipPortal({ container, ...restProps }, ref) {
8
+ return /* @__PURE__ */ jsx(
9
+ _Tooltip.Portal,
10
+ {
11
+ container: container ?? getWpCompatOverlaySlot(),
12
+ ...restProps,
13
+ ref
14
+ }
15
+ );
8
16
  }
9
17
  );
10
18
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tooltip/portal.tsx"],
4
- "sourcesContent": ["import { Tooltip as _Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport type { PortalProps } from './types';\n\n/**\n * Root element that portals `Tooltip` floating content. Pass to\n * `Tooltip.Popup`'s `portal` prop. When `portal` is omitted, `Tooltip.Popup`\n * uses this component with default props.\n */\nconst Portal = forwardRef< HTMLDivElement, PortalProps >(\n\tfunction TooltipPortal( props, ref ) {\n\t\treturn <_Tooltip.Portal ref={ ref } { ...props } />;\n\t}\n);\n\nexport { Portal };\n"],
5
- "mappings": ";AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;AAUlB;AAFT,IAAM,SAAS;AAAA,EACd,SAAS,cAAe,OAAO,KAAM;AACpC,WAAO,oBAAC,SAAS,QAAT,EAAgB,KAAc,GAAG,OAAQ;AAAA,EAClD;AACD;",
4
+ "sourcesContent": ["import { Tooltip as _Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport type { PortalProps } from './types';\nimport { getWpCompatOverlaySlot } from '../utils/wp-compat-overlay-slot';\n\n/**\n * Used to apply custom portal behavior to `Tooltip`'s floating content.\n * `container` defaults to the `@wordpress/ui` compat overlay slot.\n */\nconst Portal = forwardRef< HTMLDivElement, PortalProps >(\n\tfunction TooltipPortal( { container, ...restProps }, ref ) {\n\t\treturn (\n\t\t\t<_Tooltip.Portal\n\t\t\t\tcontainer={ container ?? getWpCompatOverlaySlot() }\n\t\t\t\t{ ...restProps }\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Portal };\n"],
5
+ "mappings": ";AAAA,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;AAE3B,SAAS,8BAA8B;AASpC;AAHH,IAAM,SAAS;AAAA,EACd,SAAS,cAAe,EAAE,WAAW,GAAG,UAAU,GAAG,KAAM;AAC1D,WACC;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACA,WAAY,aAAa,uBAAuB;AAAA,QAC9C,GAAG;AAAA,QACL;AAAA;AAAA,IACD;AAAA,EAEF;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/tooltip/positioner.tsx", "../../../style-runtime/src/index.ts", "../../src/utils/css/resets.module.css", "../../src/tooltip/style.module.css"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport { Tooltip as _Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport type { PositionerProps } from './types';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\n/**\n * Positions the floating tooltip content relative to the trigger. Pass to\n * `Tooltip.Popup`'s `positioner` prop to customize `side`, `align`,\n * `sideOffset`, collision behavior, etc. When `positioner` is omitted,\n * `Tooltip.Popup` uses this component with default props.\n */\nconst Positioner = forwardRef< HTMLDivElement, PositionerProps >(\n\tfunction TooltipPositioner(\n\t\t{ align = 'center', className, side = 'top', sideOffset = 4, ...props },\n\t\tref\n\t) {\n\t\treturn (\n\t\t\t<_Tooltip.Positioner\n\t\t\t\tref={ ref }\n\t\t\t\talign={ align }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tstyles.positioner,\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Positioner };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e3ae230cea\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\");\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"8293efbb49\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-sm,2px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}\");\n}\nexport default {\"positioner\":\"_480b748dd3510e64__positioner\",\"popup\":\"_50096b232db7709d__popup\"};\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;;;ACQ3B,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;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AC7C,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AAEA,SAAO,MAAM;AACZ,UAAM,QAAQ,QAAQ,UAAU,IAAK,cAAe;AAEpD,QAAK,UAAU,QAAY;AAC1B;AAAA,IACD;AAEA,QAAK,SAAS,GAAI;AACjB,cAAQ,UAAU,OAAQ,cAAe;AACzC;AAAA,IACD;AAEA,YAAQ,UAAU,IAAK,gBAAgB,QAAQ,CAAE;AAAA,EAClD;AACD;AAaO,SAAS,cAAe,MAAc,KAAc;AAC1D,QAAM,UAAU,WAAW;AAE3B,UAAQ,OAAO,IAAK,MAAM,GAAI;AAE9B,aAAY,kBAAkB,QAAQ,UAAU,KAAK,GAAI;AACxD,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AACD;;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,kMAAkM;AAC/N;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACH5D,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,onCAAgoC;AAC7pC;AACA,IAAO,gBAAQ,EAAC,cAAa,iCAAgC,SAAQ,2BAA0B;;;AHe5F;AANH,IAAM,aAAa;AAAA,EAClB,SAAS,kBACR,EAAE,QAAQ,UAAU,WAAW,OAAO,OAAO,aAAa,GAAG,GAAG,MAAM,GACtE,KACC;AACD,WACC;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACE,GAAG;AAAA,QACL,WAAY;AAAA,UACX,eAAa,YAAa;AAAA,UAC1B,cAAO;AAAA,UACP;AAAA,QACD;AAAA;AAAA,IACD;AAAA,EAEF;AACD;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport { Tooltip as _Tooltip } from '@base-ui/react/tooltip';\nimport { forwardRef } from '@wordpress/element';\nimport type { PositionerProps } from './types';\nimport resetStyles from '../utils/css/resets.module.css';\nimport styles from './style.module.css';\n\n/**\n * Used to apply custom positioning to `Tooltip`'s floating content.\n */\nconst Positioner = forwardRef< HTMLDivElement, PositionerProps >(\n\tfunction TooltipPositioner(\n\t\t{ align = 'center', className, side = 'top', sideOffset = 4, ...props },\n\t\tref\n\t) {\n\t\treturn (\n\t\t\t<_Tooltip.Positioner\n\t\t\t\tref={ ref }\n\t\t\t\talign={ align }\n\t\t\t\tside={ side }\n\t\t\t\tsideOffset={ sideOffset }\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tresetStyles[ 'box-sizing' ],\n\t\t\t\t\tstyles.positioner,\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t/>\n\t\t);\n\t}\n);\n\nexport { Positioner };\n", "type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"e3ae230cea\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}\");\n}\nexport default {\"box-sizing\":\"_336cd3e4e743482f__box-sizing\"};\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"8293efbb49\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-sm,2px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}\");\n}\nexport default {\"positioner\":\"_480b748dd3510e64__positioner\",\"popup\":\"_50096b232db7709d__popup\"};\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,WAAW,gBAAgB;AACpC,SAAS,kBAAkB;;;ACQ3B,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,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,kBAAkB,QAAQ,UAAU,KAAK,GAAI;AACxD,gBAAa,gBAAgB,MAAM,GAAI;AAAA,EACxC;AACD;;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,kMAAkM;AAC/N;AACA,IAAO,iBAAQ,EAAC,cAAa,gCAA+B;;;ACH5D,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,onCAAgoC;AAC7pC;AACA,IAAO,gBAAQ,EAAC,cAAa,iCAAgC,SAAQ,2BAA0B;;;AHY5F;AANH,IAAM,aAAa;AAAA,EAClB,SAAS,kBACR,EAAE,QAAQ,UAAU,WAAW,OAAO,OAAO,aAAa,GAAG,GAAG,MAAM,GACtE,KACC;AACD,WACC;AAAA,MAAC,SAAS;AAAA,MAAT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACE,GAAG;AAAA,QACL,WAAY;AAAA,UACX,eAAa,YAAa;AAAA,UAC1B,cAAO;AAAA,UACP;AAAA,QACD;AAAA;AAAA,IACD;AAAA,EAEF;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/create-overlay-title-validation.tsx"],
4
- "sourcesContent": ["import {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useScheduleValidation } from './use-schedule-validation';\n\n/**\n * Whether validation is enabled. This is a build-time constant that allows\n * bundlers to tree-shake all validation code in production builds.\n */\nconst VALIDATION_ENABLED = process.env.NODE_ENV !== 'production';\n\ntype OverlayValidationContextType = {\n\tregisterTitle: ( element: HTMLElement | null ) => () => void;\n};\n\ntype OverlayValidationProviderProps = {\n\tchildren: React.ReactNode;\n};\n\n/**\n * Creates development-only title validation helpers for overlay primitives.\n */\nexport function createOverlayTitleValidation( componentName: string ) {\n\tconst componentNameLowerCase = componentName.toLowerCase();\n\tconst OverlayValidationContext = VALIDATION_ENABLED\n\t\t? createContext< OverlayValidationContextType | null >( null )\n\t\t: ( null as unknown as React.Context< OverlayValidationContextType | null > );\n\n\tfunction useValidationContextDev() {\n\t\treturn useContext( OverlayValidationContext );\n\t}\n\n\tfunction useValidationContextProd() {\n\t\treturn null;\n\t}\n\n\tconst useValidationContext = VALIDATION_ENABLED\n\t\t? useValidationContextDev\n\t\t: useValidationContextProd;\n\n\tfunction ValidationProviderDev( {\n\t\tchildren,\n\t}: OverlayValidationProviderProps ) {\n\t\tconst titleElementRef = useRef< HTMLElement | null >( null );\n\n\t\tconst scheduleValidation = useScheduleValidation( () => {\n\t\t\tconst titleElement = titleElementRef.current;\n\n\t\t\tif ( ! titleElement ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${ componentName }: Missing <${ componentName }.Title>. ` +\n\t\t\t\t\t\t`For accessibility, every ${ componentNameLowerCase } requires a title. ` +\n\t\t\t\t\t\t'If needed, the title can be visually hidden but must not be omitted.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst textContent = titleElement.textContent?.trim();\n\t\t\tif ( ! textContent ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${ componentName }: <${ componentName }.Title> cannot be empty. ` +\n\t\t\t\t\t\t`Provide meaningful text content for the ${ componentNameLowerCase } title.`\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\tconst registerTitle = useCallback(\n\t\t\t( element: HTMLElement | null ) => {\n\t\t\t\ttitleElementRef.current = element;\n\t\t\t\tscheduleValidation();\n\n\t\t\t\treturn () => {\n\t\t\t\t\ttitleElementRef.current = null;\n\t\t\t\t\tscheduleValidation();\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ scheduleValidation ]\n\t\t);\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( { registerTitle } ),\n\t\t\t[ registerTitle ]\n\t\t);\n\n\t\t// Schedule an initial validation on mount to catch missing titles\n\t\t// (when no Title component is rendered, registerTitle is never called).\n\t\tuseEffect( () => {\n\t\t\tscheduleValidation();\n\t\t}, [ scheduleValidation ] );\n\n\t\treturn (\n\t\t\t<OverlayValidationContext.Provider value={ contextValue }>\n\t\t\t\t{ children }\n\t\t\t</OverlayValidationContext.Provider>\n\t\t);\n\t}\n\n\tfunction ValidationProviderProd( {\n\t\tchildren,\n\t}: OverlayValidationProviderProps ) {\n\t\treturn <>{ children }</>;\n\t}\n\n\tconst ValidationProvider = VALIDATION_ENABLED\n\t\t? ValidationProviderDev\n\t\t: ValidationProviderProd;\n\n\treturn {\n\t\tValidationProvider,\n\t\tuseValidationContext,\n\t};\n}\n"],
5
- "mappings": ";AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AAuFnC,SASM,UATN;AAjFH,IAAM,qBAAqB,QAAQ,IAAI,aAAa;AAa7C,SAAS,6BAA8B,eAAwB;AACrE,QAAM,yBAAyB,cAAc,YAAY;AACzD,QAAM,2BAA2B,qBAC9B,cAAsD,IAAK,IACzD;AAEL,WAAS,0BAA0B;AAClC,WAAO,WAAY,wBAAyB;AAAA,EAC7C;AAEA,WAAS,2BAA2B;AACnC,WAAO;AAAA,EACR;AAEA,QAAM,uBAAuB,qBAC1B,0BACA;AAEH,WAAS,sBAAuB;AAAA,IAC/B;AAAA,EACD,GAAoC;AACnC,UAAM,kBAAkB,OAA8B,IAAK;AAE3D,UAAM,qBAAqB,sBAAuB,MAAM;AACvD,YAAM,eAAe,gBAAgB;AAErC,UAAK,CAAE,cAAe;AACrB,cAAM,IAAI;AAAA,UACT,GAAI,aAAc,cAAe,aAAc,qCACjB,sBAAuB;AAAA,QAEtD;AAAA,MACD;AAEA,YAAM,cAAc,aAAa,aAAa,KAAK;AACnD,UAAK,CAAE,aAAc;AACpB,cAAM,IAAI;AAAA,UACT,GAAI,aAAc,MAAO,aAAc,oEACM,sBAAuB;AAAA,QACrE;AAAA,MACD;AAAA,IACD,CAAE;AAEF,UAAM,gBAAgB;AAAA,MACrB,CAAE,YAAiC;AAClC,wBAAgB,UAAU;AAC1B,2BAAmB;AAEnB,eAAO,MAAM;AACZ,0BAAgB,UAAU;AAC1B,6BAAmB;AAAA,QACpB;AAAA,MACD;AAAA,MACA,CAAE,kBAAmB;AAAA,IACtB;AAEA,UAAM,eAAe;AAAA,MACpB,OAAQ,EAAE,cAAc;AAAA,MACxB,CAAE,aAAc;AAAA,IACjB;AAIA,cAAW,MAAM;AAChB,yBAAmB;AAAA,IACpB,GAAG,CAAE,kBAAmB,CAAE;AAE1B,WACC,oBAAC,yBAAyB,UAAzB,EAAkC,OAAQ,cACxC,UACH;AAAA,EAEF;AAEA,WAAS,uBAAwB;AAAA,IAChC;AAAA,EACD,GAAoC;AACnC,WAAO,gCAAI,UAAU;AAAA,EACtB;AAEA,QAAM,qBAAqB,qBACxB,wBACA;AAEH,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["import {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useScheduleValidation } from './use-schedule-validation';\n\n/**\n * Whether validation is enabled. This is a build-time constant that allows\n * bundlers to tree-shake all validation code in production builds.\n */\nconst VALIDATION_ENABLED = process.env.NODE_ENV !== 'production';\n\ntype OverlayValidationContextType = {\n\tregisterTitle: ( element: HTMLElement | null ) => () => void;\n};\n\ntype OverlayValidationProviderProps = {\n\tchildren: React.ReactNode;\n};\n\n/**\n * Creates development-only title validation helpers for overlay primitives.\n */\nexport function createOverlayTitleValidation( componentName: string ) {\n\tconst componentNameLowerCase = componentName.toLowerCase();\n\tconst OverlayValidationContext = VALIDATION_ENABLED\n\t\t? createContext< OverlayValidationContextType | null >( null )\n\t\t: ( null as unknown as React.Context< OverlayValidationContextType | null > );\n\n\tfunction useValidationContextDev() {\n\t\treturn useContext( OverlayValidationContext );\n\t}\n\n\tfunction useValidationContextProd() {\n\t\treturn null;\n\t}\n\n\tconst useValidationContext = VALIDATION_ENABLED\n\t\t? useValidationContextDev\n\t\t: useValidationContextProd;\n\n\tfunction ValidationProviderDev( {\n\t\tchildren,\n\t}: OverlayValidationProviderProps ) {\n\t\tconst titleElementRef = useRef< HTMLElement >( null );\n\n\t\tconst scheduleValidation = useScheduleValidation( () => {\n\t\t\tconst titleElement = titleElementRef.current;\n\n\t\t\tif ( ! titleElement ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${ componentName }: Missing <${ componentName }.Title>. ` +\n\t\t\t\t\t\t`For accessibility, every ${ componentNameLowerCase } requires a title. ` +\n\t\t\t\t\t\t'If needed, the title can be visually hidden but must not be omitted.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst textContent = titleElement.textContent?.trim();\n\t\t\tif ( ! textContent ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`${ componentName }: <${ componentName }.Title> cannot be empty. ` +\n\t\t\t\t\t\t`Provide meaningful text content for the ${ componentNameLowerCase } title.`\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\tconst registerTitle = useCallback(\n\t\t\t( element: HTMLElement | null ) => {\n\t\t\t\ttitleElementRef.current = element;\n\t\t\t\tscheduleValidation();\n\n\t\t\t\treturn () => {\n\t\t\t\t\ttitleElementRef.current = null;\n\t\t\t\t\tscheduleValidation();\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ scheduleValidation ]\n\t\t);\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( { registerTitle } ),\n\t\t\t[ registerTitle ]\n\t\t);\n\n\t\t// Schedule an initial validation on mount to catch missing titles\n\t\t// (when no Title component is rendered, registerTitle is never called).\n\t\tuseEffect( () => {\n\t\t\tscheduleValidation();\n\t\t}, [ scheduleValidation ] );\n\n\t\treturn (\n\t\t\t<OverlayValidationContext.Provider value={ contextValue }>\n\t\t\t\t{ children }\n\t\t\t</OverlayValidationContext.Provider>\n\t\t);\n\t}\n\n\tfunction ValidationProviderProd( {\n\t\tchildren,\n\t}: OverlayValidationProviderProps ) {\n\t\treturn <>{ children }</>;\n\t}\n\n\tconst ValidationProvider = VALIDATION_ENABLED\n\t\t? ValidationProviderDev\n\t\t: ValidationProviderProd;\n\n\treturn {\n\t\tValidationProvider,\n\t\tuseValidationContext,\n\t};\n}\n"],
5
+ "mappings": ";AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AAuFnC,SASM,UATN;AAjFH,IAAM,qBAAqB,QAAQ,IAAI,aAAa;AAa7C,SAAS,6BAA8B,eAAwB;AACrE,QAAM,yBAAyB,cAAc,YAAY;AACzD,QAAM,2BAA2B,qBAC9B,cAAsD,IAAK,IACzD;AAEL,WAAS,0BAA0B;AAClC,WAAO,WAAY,wBAAyB;AAAA,EAC7C;AAEA,WAAS,2BAA2B;AACnC,WAAO;AAAA,EACR;AAEA,QAAM,uBAAuB,qBAC1B,0BACA;AAEH,WAAS,sBAAuB;AAAA,IAC/B;AAAA,EACD,GAAoC;AACnC,UAAM,kBAAkB,OAAuB,IAAK;AAEpD,UAAM,qBAAqB,sBAAuB,MAAM;AACvD,YAAM,eAAe,gBAAgB;AAErC,UAAK,CAAE,cAAe;AACrB,cAAM,IAAI;AAAA,UACT,GAAI,aAAc,cAAe,aAAc,qCACjB,sBAAuB;AAAA,QAEtD;AAAA,MACD;AAEA,YAAM,cAAc,aAAa,aAAa,KAAK;AACnD,UAAK,CAAE,aAAc;AACpB,cAAM,IAAI;AAAA,UACT,GAAI,aAAc,MAAO,aAAc,oEACM,sBAAuB;AAAA,QACrE;AAAA,MACD;AAAA,IACD,CAAE;AAEF,UAAM,gBAAgB;AAAA,MACrB,CAAE,YAAiC;AAClC,wBAAgB,UAAU;AAC1B,2BAAmB;AAEnB,eAAO,MAAM;AACZ,0BAAgB,UAAU;AAC1B,6BAAmB;AAAA,QACpB;AAAA,MACD;AAAA,MACA,CAAE,kBAAmB;AAAA,IACtB;AAEA,UAAM,eAAe;AAAA,MACpB,OAAQ,EAAE,cAAc;AAAA,MACxB,CAAE,aAAc;AAAA,IACjB;AAIA,cAAW,MAAM;AAChB,yBAAmB;AAAA,IACpB,GAAG,CAAE,kBAAmB,CAAE;AAE1B,WACC,oBAAC,yBAAyB,UAAzB,EAAkC,OAAQ,cACxC,UACH;AAAA,EAEF;AAEA,WAAS,uBAAwB;AAAA,IAChC;AAAA,EACD,GAAoC;AACnC,WAAO,gCAAI,UAAU;AAAA,EACtB;AAEA,QAAM,qBAAqB,qBACxB,wBACA;AAEH,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,10 @@
1
1
  // packages/ui/src/utils/render-slot-with-children.ts
2
2
  import { cloneElement } from "@wordpress/element";
3
3
  function renderSlotWithChildren(slot, defaultSlot, children) {
4
- return cloneElement(slot ?? defaultSlot, { children });
4
+ return cloneElement(
5
+ slot ?? defaultSlot,
6
+ { children }
7
+ );
5
8
  }
6
9
  export {
7
10
  renderSlotWithChildren
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/render-slot-with-children.ts"],
4
- "sourcesContent": ["import { cloneElement } from '@wordpress/element';\nimport type { ReactElement, ReactNode } from 'react';\n\n/**\n * Fills an optional \"slot\" element prop with content by cloning it and\n * injecting the given `children`. When `slot` is undefined, the provided\n * `defaultSlot` is used in its place.\n *\n * Shared by overlay `Popup` components for their slot-shaped customization\n * props (e.g. `portal`, `positioner`), so the merge behavior \u2014 defaults,\n * children injection \u2014 stays consistent across all of them.\n *\n * Callers should type the slot prop as `ReactElement<Omit<Props, 'children'>>`:\n * any subtree passed on the slot element is overwritten by `children`.\n *\n * @param slot Optional element from the slot prop (e.g. `<Tooltip.Portal \u2026 />`\n * or `<Tooltip.Positioner \u2026 />`). When omitted, `defaultSlot`\n * is used. Injected `children` replace any subtree the caller\n * may have passed on the slot element.\n * @param defaultSlot Unpopulated default element used when `slot` is omitted\n * (e.g. `<Tooltip.Portal />`).\n * @param children Content to inject as the slot's children (backdrop,\n * positioner, popup subtree, etc.).\n */\nexport function renderSlotWithChildren(\n\tslot: ReactElement | undefined,\n\tdefaultSlot: ReactElement,\n\tchildren: ReactNode\n): ReactElement {\n\treturn cloneElement( slot ?? defaultSlot, { children } );\n}\n"],
5
- "mappings": ";AAAA,SAAS,oBAAoB;AAwBtB,SAAS,uBACf,MACA,aACA,UACe;AACf,SAAO,aAAc,QAAQ,aAAa,EAAE,SAAS,CAAE;AACxD;",
4
+ "sourcesContent": ["import { cloneElement } from '@wordpress/element';\nimport type { ReactElement, ReactNode } from 'react';\n\n/**\n * Fills an optional \"slot\" element prop with content by cloning it and\n * injecting the given `children`. When `slot` is undefined, the provided\n * `defaultSlot` is used in its place.\n *\n * Shared by overlay `Popup` components for their slot-shaped customization\n * props (e.g. `portal`, `positioner`), so the merge behavior \u2014 defaults,\n * children injection \u2014 stays consistent across all of them.\n *\n * Callers should type the slot prop as `ReactElement<Omit<Props, 'children'>>`:\n * any subtree passed on the slot element is overwritten by `children`.\n *\n * @param slot Optional element from the slot prop (e.g. `<Tooltip.Portal \u2026 />`\n * or `<Tooltip.Positioner \u2026 />`). When omitted, `defaultSlot`\n * is used. Injected `children` replace any subtree the caller\n * may have passed on the slot element.\n * @param defaultSlot Unpopulated default element used when `slot` is omitted\n * (e.g. `<Tooltip.Portal />`).\n * @param children Content to inject as the slot's children (backdrop,\n * positioner, popup subtree, etc.).\n */\nexport function renderSlotWithChildren(\n\tslot: ReactElement | undefined,\n\tdefaultSlot: ReactElement,\n\tchildren: ReactNode\n): ReactElement {\n\treturn cloneElement(\n\t\t( slot ?? defaultSlot ) as ReactElement< { children?: ReactNode } >,\n\t\t{ children }\n\t);\n}\n"],
5
+ "mappings": ";AAAA,SAAS,oBAAoB;AAwBtB,SAAS,uBACf,MACA,aACA,UACe;AACf,SAAO;AAAA,IACJ,QAAQ;AAAA,IACV,EAAE,SAAS;AAAA,EACZ;AACD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,14 @@
1
+ // packages/ui/src/utils/use-enable-wp-compat-overlay-slot.ts
2
+ function useEnableWpCompatOverlaySlot() {
3
+ if (typeof window === "undefined") {
4
+ return;
5
+ }
6
+ const internalWindow = window;
7
+ if (internalWindow.__wpUiCompatOverlaySlotEnabled !== true) {
8
+ internalWindow.__wpUiCompatOverlaySlotEnabled = true;
9
+ }
10
+ }
11
+ export {
12
+ useEnableWpCompatOverlaySlot
13
+ };
14
+ //# sourceMappingURL=use-enable-wp-compat-overlay-slot.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/use-enable-wp-compat-overlay-slot.ts"],
4
+ "sourcesContent": ["/**\n * Opts the host application into the `@wordpress/ui` compat overlay slot \u2014\n * a body-level container into which `@wordpress/ui` overlays portal so they\n * reliably stack above `@wordpress/components` overlays in mixed-library\n * compositions.\n *\n * Call once from a component that mounts for the lifetime of the app\n * (typically the root). Idempotent and one-way: a single caller should not\n * be able to turn off shared infrastructure for everyone else; if the slot\n * isn't wanted, simply don't call this hook.\n *\n * Where `window.wp.components` is on the global \u2014 the typical setup for\n * plugins enqueueing `wp-components` through WordPress's script-loader \u2014\n * the slot auto-enables and this hook is a no-op.\n */\nexport function useEnableWpCompatOverlaySlot(): void {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn;\n\t}\n\n\t// Applied during render (not in `useLayoutEffect`) so descendants in\n\t// the same render pass \u2014 e.g. `Tooltip.Portal`, which reads\n\t// `getWpCompatOverlaySlot()` on every render \u2014 see the gate open on\n\t// first mount. Safe to write during render: the value is an idempotent\n\t// boolean.\n\tconst internalWindow = window as {\n\t\t__wpUiCompatOverlaySlotEnabled?: boolean;\n\t};\n\tif ( internalWindow.__wpUiCompatOverlaySlotEnabled !== true ) {\n\t\tinternalWindow.__wpUiCompatOverlaySlotEnabled = true;\n\t}\n}\n"],
5
+ "mappings": ";AAeO,SAAS,+BAAqC;AACpD,MAAK,OAAO,WAAW,aAAc;AACpC;AAAA,EACD;AAOA,QAAM,iBAAiB;AAGvB,MAAK,eAAe,mCAAmC,MAAO;AAC7D,mBAAe,iCAAiC;AAAA,EACjD;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,148 @@
1
+ // packages/style-runtime/src/index.ts
2
+ var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
3
+ function getRuntime() {
4
+ const globalScope = globalThis;
5
+ if (globalScope.__wpStyleRuntime) {
6
+ return globalScope.__wpStyleRuntime;
7
+ }
8
+ globalScope.__wpStyleRuntime = {
9
+ documents: /* @__PURE__ */ new Map(),
10
+ styles: /* @__PURE__ */ new Map(),
11
+ injectedStyles: /* @__PURE__ */ new WeakMap()
12
+ };
13
+ if (typeof document !== "undefined") {
14
+ registerDocument(document);
15
+ }
16
+ return globalScope.__wpStyleRuntime;
17
+ }
18
+ function documentContainsStyleHash(targetDocument, hash) {
19
+ if (!targetDocument.head) {
20
+ return false;
21
+ }
22
+ for (const style of targetDocument.head.querySelectorAll(
23
+ `style[${STYLE_HASH_ATTRIBUTE}]`
24
+ )) {
25
+ if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
26
+ return true;
27
+ }
28
+ }
29
+ return false;
30
+ }
31
+ function injectStyle(targetDocument, hash, css) {
32
+ if (!targetDocument.head) {
33
+ return;
34
+ }
35
+ const runtime = getRuntime();
36
+ let injectedStyles = runtime.injectedStyles.get(targetDocument);
37
+ if (!injectedStyles) {
38
+ injectedStyles = /* @__PURE__ */ new Set();
39
+ runtime.injectedStyles.set(targetDocument, injectedStyles);
40
+ }
41
+ if (injectedStyles.has(hash)) {
42
+ return;
43
+ }
44
+ if (documentContainsStyleHash(targetDocument, hash)) {
45
+ injectedStyles.add(hash);
46
+ return;
47
+ }
48
+ const style = targetDocument.createElement("style");
49
+ style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
50
+ style.appendChild(targetDocument.createTextNode(css));
51
+ targetDocument.head.appendChild(style);
52
+ injectedStyles.add(hash);
53
+ }
54
+ function registerDocument(targetDocument) {
55
+ const runtime = getRuntime();
56
+ runtime.documents.set(
57
+ targetDocument,
58
+ (runtime.documents.get(targetDocument) ?? 0) + 1
59
+ );
60
+ for (const [hash, css] of runtime.styles) {
61
+ injectStyle(targetDocument, hash, css);
62
+ }
63
+ return () => {
64
+ const count = runtime.documents.get(targetDocument);
65
+ if (count === void 0) {
66
+ return;
67
+ }
68
+ if (count <= 1) {
69
+ runtime.documents.delete(targetDocument);
70
+ return;
71
+ }
72
+ runtime.documents.set(targetDocument, count - 1);
73
+ };
74
+ }
75
+ function registerStyle(hash, css) {
76
+ const runtime = getRuntime();
77
+ runtime.styles.set(hash, css);
78
+ for (const targetDocument of runtime.documents.keys()) {
79
+ injectStyle(targetDocument, hash, css);
80
+ }
81
+ }
82
+
83
+ // packages/ui/src/utils/css/wp-compat-overlay-slot.module.css
84
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
85
+ registerStyle("45eb1fe20f", "@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui-utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}");
86
+ }
87
+ var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" };
88
+
89
+ // packages/ui/src/utils/wp-compat-overlay-slot.ts
90
+ var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
91
+ function resolveOwnerDocument() {
92
+ return typeof document === "undefined" ? null : document;
93
+ }
94
+ function isInWordPressEnvironment() {
95
+ let topWp;
96
+ try {
97
+ topWp = window.top?.wp;
98
+ } catch {
99
+ }
100
+ const wp = topWp ?? window.wp;
101
+ return typeof wp?.components === "object" && wp.components !== null;
102
+ }
103
+ var cachedSlot = null;
104
+ function createSlot(ownerDocument) {
105
+ const element = ownerDocument.createElement("div");
106
+ element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, "");
107
+ if (wp_compat_overlay_slot_default.slot) {
108
+ element.classList.add(wp_compat_overlay_slot_default.slot);
109
+ }
110
+ ownerDocument.body.appendChild(element);
111
+ return element;
112
+ }
113
+ function getWpCompatOverlaySlot() {
114
+ if (typeof window === "undefined") {
115
+ return void 0;
116
+ }
117
+ if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) {
118
+ return void 0;
119
+ }
120
+ const ownerDocument = resolveOwnerDocument();
121
+ if (!ownerDocument || !ownerDocument.body) {
122
+ return void 0;
123
+ }
124
+ if (cachedSlot && cachedSlot.ownerDocument === ownerDocument && cachedSlot.isConnected) {
125
+ return cachedSlot;
126
+ }
127
+ const existing = ownerDocument.querySelector(
128
+ `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]`
129
+ );
130
+ if (existing instanceof HTMLDivElement) {
131
+ cachedSlot = existing;
132
+ return existing;
133
+ }
134
+ if (cachedSlot?.isConnected) {
135
+ cachedSlot.remove();
136
+ }
137
+ cachedSlot = createSlot(ownerDocument);
138
+ return cachedSlot;
139
+ }
140
+ function __resetWpCompatOverlaySlotCacheForTests() {
141
+ cachedSlot = null;
142
+ }
143
+ export {
144
+ WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE,
145
+ __resetWpCompatOverlaySlotCacheForTests,
146
+ getWpCompatOverlaySlot
147
+ };
148
+ //# sourceMappingURL=wp-compat-overlay-slot.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../style-runtime/src/index.ts", "../../src/utils/css/wp-compat-overlay-slot.module.css", "../../src/utils/wp-compat-overlay-slot.ts"],
4
+ "sourcesContent": ["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"45eb1fe20f\", \"@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui-utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}\");\n}\nexport default {\"slot\":\"_11fc52b637ff8a7e__slot\"};\n", "import styles from './css/wp-compat-overlay-slot.module.css';\n\n// Local casts for the auto-detect heuristic and the shared opt-in flag,\n// kept off the global `Window` interface so this package's `.d.ts` doesn't\n// leak `Window.wp` / `Window.__wpUiCompatOverlaySlotEnabled` augmentations.\ntype WpEnvironmentWindow = {\n\twp?: {\n\t\tcomponents?: unknown;\n\t};\n};\ntype CompatOverlaySlotInternalWindow = {\n\t__wpUiCompatOverlaySlotEnabled?: boolean;\n};\n\n/**\n * Marker attribute on the compat overlay slot element.\n */\nexport const WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = 'data-wp-compat-overlay-slot';\n\nfunction resolveOwnerDocument(): Document | null {\n\t// Always the local document \u2014 not `window.top?.document`, which would\n\t// put the slot in a document where this bundle's CSS modules aren't\n\t// loaded (e.g. Storybook's preview iframe).\n\treturn typeof document === 'undefined' ? null : document;\n}\n\nfunction isInWordPressEnvironment(): boolean {\n\tlet topWp: WpEnvironmentWindow[ 'wp' ];\n\ttry {\n\t\t// Try the top window first so an iframe (e.g. the editor canvas)\n\t\t// inherits the parent's WP environment.\n\t\ttopWp = ( window.top as WpEnvironmentWindow | undefined )?.wp;\n\t} catch {\n\t\t// Cross-origin top window \u2014 fall through to the local window.\n\t}\n\tconst wp = topWp ?? ( window as WpEnvironmentWindow ).wp;\n\t// Stricter than `!== undefined` so a stray non-object `components`\n\t// doesn't trigger auto-enable. Explicit null check covers\n\t// `typeof null === 'object'`.\n\treturn typeof wp?.components === 'object' && wp.components !== null;\n}\n\n// Revalidated on each call against the current owner document and the\n// slot's connection state.\nlet cachedSlot: HTMLDivElement | null = null;\n\nfunction createSlot( ownerDocument: Document ): HTMLDivElement {\n\tconst element = ownerDocument.createElement( 'div' );\n\telement.setAttribute( WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, '' );\n\tif ( styles.slot ) {\n\t\telement.classList.add( styles.slot );\n\t}\n\townerDocument.body.appendChild( element );\n\treturn element;\n}\n\n/**\n * Returns the body-level compat overlay slot when the runtime opts in,\n * lazily creating it on first call. Returns `undefined` otherwise \u2014 so the\n * return value can be forwarded straight to a `container` prop, leaving the\n * default portal container in effect.\n *\n * Two opt-in paths:\n *\n * - Auto-detected when `window.wp.components` is on the global \u2014 the\n * typical script-loader setup for WordPress plugins and admin screens.\n * - Explicit, via `useEnableWpCompatOverlaySlot()` \u2014 for hosts that bundle\n * `@wordpress/components` (or only `@wordpress/ui`) directly rather than\n * relying on the global.\n *\n * The slot is a single `<div data-wp-compat-overlay-slot>` appended to the\n * local document's body. Subsequent calls return the same element; if it's\n * been removed it's recreated, and a slot created by another\n * `@wordpress/ui` instance in the same document is adopted rather than\n * duplicated.\n */\nexport function getWpCompatOverlaySlot(): HTMLDivElement | undefined {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn undefined;\n\t}\n\n\tif (\n\t\t! isInWordPressEnvironment() &&\n\t\t( window as CompatOverlaySlotInternalWindow )\n\t\t\t.__wpUiCompatOverlaySlotEnabled !== true\n\t) {\n\t\treturn undefined;\n\t}\n\n\tconst ownerDocument = resolveOwnerDocument();\n\t// `document.body` can be null if this runs before `<body>` is parsed\n\t// (e.g. a `<script>` in `<head>`). Bail rather than throw in `createSlot`.\n\tif ( ! ownerDocument || ! ownerDocument.body ) {\n\t\treturn undefined;\n\t}\n\n\tif (\n\t\tcachedSlot &&\n\t\tcachedSlot.ownerDocument === ownerDocument &&\n\t\tcachedSlot.isConnected\n\t) {\n\t\treturn cachedSlot;\n\t}\n\n\t// Prefer an existing slot in the document over creating a duplicate \u2014\n\t// this is how multiple `@wordpress/ui` instances share one slot.\n\tconst existing = ownerDocument.querySelector< HTMLDivElement >(\n\t\t`[${ WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE }]`\n\t);\n\tif ( existing instanceof HTMLDivElement ) {\n\t\tcachedSlot = existing;\n\t\treturn existing;\n\t}\n\n\t// Don't orphan a cached slot still attached to a foreign document.\n\tif ( cachedSlot?.isConnected ) {\n\t\tcachedSlot.remove();\n\t}\n\n\tcachedSlot = createSlot( ownerDocument );\n\treturn cachedSlot;\n}\n\n/**\n * Test-only escape hatch that drops the cached singleton.\n */\nexport function __resetWpCompatOverlaySlotCacheForTests(): void {\n\tcachedSlot = null;\n}\n"],
5
+ "mappings": ";AAUA,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,M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
1
  /**
2
- * Root element that portals `AlertDialog` overlay content. Pass to
3
- * `AlertDialog.Popup`'s `portal` prop to customize the portal target and
4
- * wrapper. When `portal` is omitted, `AlertDialog.Popup` uses this component
5
- * with default props.
2
+ * Used to apply custom portal behavior to `AlertDialog`'s overlay content.
6
3
  */
7
- declare const Portal: import("react").ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogPortalProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
4
+ declare const Portal: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("@base-ui/react").DialogPortalProps, "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 { Portal };
9
12
  //# sourceMappingURL=portal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/alert-dialog/portal.tsx"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,QAAA,MAAM,MAAM,iNAIX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/alert-dialog/portal.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,QAAA,MAAM,MAAM;;;;;;kDAIX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,7 +1,7 @@
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
  import type { ComponentProps } from '../utils/types';
4
- export type PortalProps = ComponentPropsWithoutRef<typeof _AlertDialog.Portal>;
4
+ export type PortalProps = ComponentProps<typeof _AlertDialog.Portal>;
5
5
  /**
6
6
  * The return type of `onConfirm`. Return `void` (or nothing) to auto-close
7
7
  * the dialog after the confirm handler completes. Return `{ close: false }`
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/alert-dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CACjD,OAAO,YAAY,CAAC,MAAM,CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,WAAW,SAChB,SAAQ,IAAI,CACX,YAAY,CAAC,IAAI,CAAC,KAAK,EACvB,MAAM,GAAG,cAAc,GAAG,aAAa,CACvC;IACD;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,SAAS,CAAC,EAAE,MAAM,aAAa,GAAG,OAAO,CAAE,aAAa,CAAE,CAAC;CAC3D;AAED,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAE,QAAQ,CAAE;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,UAChB,SAAQ,cAAc,CAAE,KAAK,CAAE,EAC9B,IAAI,CAAE,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAAE;IAChE;;;;;;;;OAQG;IACH,MAAM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MAAM,aAAa,GAAG,OAAO,CAAE,aAAa,CAAE,CAAC;CAC3D;AAED,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAE,QAAQ,CAAE;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,UAChB,SAAQ,cAAc,CAAE,KAAK,CAAE,EAC9B,IAAI,CAAE,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAAE;IAChE;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,YAAY,CAAE,IAAI,CAAE,WAAW,EAAE,UAAU,CAAE,CAAE,CAAC;IAEzD;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAEpC;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { Badge } from '../..';
3
+ declare const meta: Meta<typeof Badge>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Badge>;
6
+ export declare const TextOverflow: Story;
7
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/badge/stories/e2e/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,KAAK,CAG7B,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,KAAK,CAAE,CAAC;AAEtC,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
2
+ import { Button } from '../..';
3
+ declare const meta: Meta<typeof Button>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Button>;
6
+ export declare const VariantStates: StoryFn<typeof Button>;
7
+ export declare const TextOverflow: Story;
8
+ //# sourceMappingURL=index.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../../src/button/stories/e2e/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,MAAM,CAG9B,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,MAAM,CAAE,CAAC;AASvC,eAAO,MAAM,aAAa,EAAE,OAAO,CAAE,OAAO,MAAM,CAiGjD,CAAC;AAKF,eAAO,MAAM,YAAY,EAAE,KAQ1B,CAAC"}