@wordpress/ui 0.13.1-next.v.202605131032.0 → 0.15.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 (272) hide show
  1. package/CHANGELOG.md +46 -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/use-enable-wp-compat-overlay-slot.cjs +39 -0
  70. package/build/utils/use-enable-wp-compat-overlay-slot.cjs.map +7 -0
  71. package/build/utils/wp-compat-overlay-slot.cjs +177 -0
  72. package/build/utils/wp-compat-overlay-slot.cjs.map +7 -0
  73. package/build-module/alert-dialog/portal.mjs.map +2 -2
  74. package/build-module/button/button.mjs +1 -1
  75. package/build-module/button/button.mjs.map +2 -2
  76. package/build-module/card/content.mjs +1 -1
  77. package/build-module/card/content.mjs.map +2 -2
  78. package/build-module/card/full-bleed.mjs +1 -1
  79. package/build-module/card/full-bleed.mjs.map +2 -2
  80. package/build-module/card/header.mjs +1 -1
  81. package/build-module/card/header.mjs.map +2 -2
  82. package/build-module/card/root.mjs +1 -1
  83. package/build-module/card/root.mjs.map +2 -2
  84. package/build-module/collapsible-card/header.mjs.map +2 -2
  85. package/build-module/dialog/portal.mjs.map +2 -2
  86. package/build-module/drawer/portal.mjs.map +2 -2
  87. package/build-module/form/primitives/autocomplete/clear.mjs +4 -1
  88. package/build-module/form/primitives/autocomplete/clear.mjs.map +2 -2
  89. package/build-module/form/primitives/autocomplete/empty.mjs +1 -1
  90. package/build-module/form/primitives/autocomplete/empty.mjs.map +2 -2
  91. package/build-module/form/primitives/autocomplete/index.mjs +3 -1
  92. package/build-module/form/primitives/autocomplete/index.mjs.map +2 -2
  93. package/build-module/form/primitives/autocomplete/item.mjs +1 -1
  94. package/build-module/form/primitives/autocomplete/item.mjs.map +2 -2
  95. package/build-module/form/primitives/autocomplete/list-body.mjs +1 -1
  96. package/build-module/form/primitives/autocomplete/list-body.mjs.map +2 -2
  97. package/build-module/form/primitives/autocomplete/list.mjs +1 -1
  98. package/build-module/form/primitives/autocomplete/list.mjs.map +2 -2
  99. package/build-module/form/primitives/autocomplete/popup.mjs +14 -31
  100. package/build-module/form/primitives/autocomplete/popup.mjs.map +3 -3
  101. package/build-module/form/primitives/autocomplete/portal.mjs +10 -2
  102. package/build-module/form/primitives/autocomplete/portal.mjs.map +2 -2
  103. package/build-module/form/primitives/autocomplete/positioner.mjs +123 -0
  104. package/build-module/form/primitives/autocomplete/positioner.mjs.map +7 -0
  105. package/build-module/form/primitives/constants.mjs.map +2 -2
  106. package/build-module/form/primitives/select/index.mjs +3 -1
  107. package/build-module/form/primitives/select/index.mjs.map +2 -2
  108. package/build-module/form/primitives/select/item.mjs +1 -1
  109. package/build-module/form/primitives/select/item.mjs.map +2 -2
  110. package/build-module/form/primitives/select/popup.mjs +18 -36
  111. package/build-module/form/primitives/select/popup.mjs.map +3 -3
  112. package/build-module/form/primitives/select/portal.mjs +11 -5
  113. package/build-module/form/primitives/select/portal.mjs.map +2 -2
  114. package/build-module/form/primitives/select/positioner.mjs +124 -0
  115. package/build-module/form/primitives/select/positioner.mjs.map +7 -0
  116. package/build-module/icon-button/icon-button.mjs +1 -1
  117. package/build-module/icon-button/icon-button.mjs.map +2 -2
  118. package/build-module/index.mjs +5 -1
  119. package/build-module/index.mjs.map +2 -2
  120. package/build-module/popover/index.mjs +2 -0
  121. package/build-module/popover/index.mjs.map +2 -2
  122. package/build-module/popover/popup.mjs +23 -51
  123. package/build-module/popover/popup.mjs.map +3 -3
  124. package/build-module/popover/portal.mjs.map +2 -2
  125. package/build-module/popover/positioner.mjs +133 -0
  126. package/build-module/popover/positioner.mjs.map +7 -0
  127. package/build-module/popover/root.mjs.map +2 -2
  128. package/build-module/tooltip/portal.mjs +10 -2
  129. package/build-module/tooltip/portal.mjs.map +2 -2
  130. package/build-module/tooltip/positioner.mjs.map +2 -2
  131. package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs +14 -0
  132. package/build-module/utils/use-enable-wp-compat-overlay-slot.mjs.map +7 -0
  133. package/build-module/utils/wp-compat-overlay-slot.mjs +148 -0
  134. package/build-module/utils/wp-compat-overlay-slot.mjs.map +7 -0
  135. package/build-types/alert-dialog/portal.d.ts +8 -5
  136. package/build-types/alert-dialog/portal.d.ts.map +1 -1
  137. package/build-types/alert-dialog/types.d.ts +2 -2
  138. package/build-types/alert-dialog/types.d.ts.map +1 -1
  139. package/build-types/badge/stories/e2e/index.story.d.ts +7 -0
  140. package/build-types/badge/stories/e2e/index.story.d.ts.map +1 -0
  141. package/build-types/button/stories/e2e/index.story.d.ts +8 -0
  142. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -0
  143. package/build-types/card/full-bleed.d.ts +18 -0
  144. package/build-types/card/full-bleed.d.ts.map +1 -1
  145. package/build-types/card/stories/index.story.d.ts +23 -0
  146. package/build-types/card/stories/index.story.d.ts.map +1 -1
  147. package/build-types/collapsible-card/header.d.ts +2 -0
  148. package/build-types/collapsible-card/header.d.ts.map +1 -1
  149. package/build-types/collapsible-card/stories/index.story.d.ts +14 -0
  150. package/build-types/collapsible-card/stories/index.story.d.ts.map +1 -1
  151. package/build-types/dialog/portal.d.ts +8 -6
  152. package/build-types/dialog/portal.d.ts.map +1 -1
  153. package/build-types/dialog/types.d.ts +2 -2
  154. package/build-types/dialog/types.d.ts.map +1 -1
  155. package/build-types/drawer/portal.d.ts +8 -6
  156. package/build-types/drawer/portal.d.ts.map +1 -1
  157. package/build-types/drawer/types.d.ts +2 -2
  158. package/build-types/drawer/types.d.ts.map +1 -1
  159. package/build-types/form/primitives/autocomplete/clear.d.ts.map +1 -1
  160. package/build-types/form/primitives/autocomplete/index.d.ts +2 -1
  161. package/build-types/form/primitives/autocomplete/index.d.ts.map +1 -1
  162. package/build-types/form/primitives/autocomplete/popup.d.ts +1 -0
  163. package/build-types/form/primitives/autocomplete/popup.d.ts.map +1 -1
  164. package/build-types/form/primitives/autocomplete/portal.d.ts +9 -4
  165. package/build-types/form/primitives/autocomplete/portal.d.ts.map +1 -1
  166. package/build-types/form/primitives/autocomplete/positioner.d.ts +12 -0
  167. package/build-types/form/primitives/autocomplete/positioner.d.ts.map +1 -0
  168. package/build-types/form/primitives/autocomplete/stories/index.story.d.ts.map +1 -1
  169. package/build-types/form/primitives/autocomplete/types.d.ts +11 -9
  170. package/build-types/form/primitives/autocomplete/types.d.ts.map +1 -1
  171. package/build-types/form/primitives/constants.d.ts +9 -4
  172. package/build-types/form/primitives/constants.d.ts.map +1 -1
  173. package/build-types/form/primitives/select/index.d.ts +2 -1
  174. package/build-types/form/primitives/select/index.d.ts.map +1 -1
  175. package/build-types/form/primitives/select/popup.d.ts +1 -0
  176. package/build-types/form/primitives/select/popup.d.ts.map +1 -1
  177. package/build-types/form/primitives/select/portal.d.ts +9 -4
  178. package/build-types/form/primitives/select/portal.d.ts.map +1 -1
  179. package/build-types/form/primitives/select/positioner.d.ts +12 -0
  180. package/build-types/form/primitives/select/positioner.d.ts.map +1 -0
  181. package/build-types/form/primitives/select/stories/index.story.d.ts.map +1 -1
  182. package/build-types/form/primitives/select/types.d.ts +11 -2
  183. package/build-types/form/primitives/select/types.d.ts.map +1 -1
  184. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  185. package/build-types/index.d.ts +2 -0
  186. package/build-types/index.d.ts.map +1 -1
  187. package/build-types/popover/index.d.ts +2 -1
  188. package/build-types/popover/index.d.ts.map +1 -1
  189. package/build-types/popover/popup.d.ts +2 -1
  190. package/build-types/popover/popup.d.ts.map +1 -1
  191. package/build-types/popover/portal.d.ts +8 -5
  192. package/build-types/popover/portal.d.ts.map +1 -1
  193. package/build-types/popover/positioner.d.ts +12 -0
  194. package/build-types/popover/positioner.d.ts.map +1 -0
  195. package/build-types/popover/root.d.ts +5 -2
  196. package/build-types/popover/root.d.ts.map +1 -1
  197. package/build-types/popover/stories/index.story.d.ts +10 -21
  198. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  199. package/build-types/popover/types.d.ts +12 -3
  200. package/build-types/popover/types.d.ts.map +1 -1
  201. package/build-types/tooltip/portal.d.ts +9 -4
  202. package/build-types/tooltip/portal.d.ts.map +1 -1
  203. package/build-types/tooltip/positioner.d.ts +8 -5
  204. package/build-types/tooltip/positioner.d.ts.map +1 -1
  205. package/build-types/tooltip/types.d.ts +3 -3
  206. package/build-types/tooltip/types.d.ts.map +1 -1
  207. package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts +2 -0
  208. package/build-types/utils/test/use-enable-wp-compat-overlay-slot.test.d.ts.map +1 -0
  209. package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts +2 -0
  210. package/build-types/utils/test/wp-compat-overlay-slot.test.d.ts.map +1 -0
  211. package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts +17 -0
  212. package/build-types/utils/use-enable-wp-compat-overlay-slot.d.ts.map +1 -0
  213. package/build-types/utils/wp-compat-overlay-slot.d.ts +30 -0
  214. package/build-types/utils/wp-compat-overlay-slot.d.ts.map +1 -0
  215. package/package.json +12 -12
  216. package/src/alert-dialog/portal.tsx +1 -4
  217. package/src/alert-dialog/types.ts +2 -4
  218. package/src/badge/stories/e2e/index.story.tsx +20 -0
  219. package/src/button/stories/e2e/index.story.tsx +130 -0
  220. package/src/button/stories/index.story.tsx +1 -1
  221. package/src/button/style.module.css +17 -12
  222. package/src/card/full-bleed.tsx +18 -0
  223. package/src/card/stories/index.story.tsx +115 -1
  224. package/src/card/style.module.css +16 -0
  225. package/src/card/test/index.test.tsx +18 -1
  226. package/src/collapsible-card/header.tsx +2 -0
  227. package/src/collapsible-card/stories/index.story.tsx +66 -0
  228. package/src/dialog/portal.tsx +1 -5
  229. package/src/dialog/types.ts +2 -2
  230. package/src/drawer/portal.tsx +1 -5
  231. package/src/drawer/types.ts +2 -2
  232. package/src/form/primitives/autocomplete/clear.tsx +10 -4
  233. package/src/form/primitives/autocomplete/index.ts +2 -1
  234. package/src/form/primitives/autocomplete/popup.tsx +17 -21
  235. package/src/form/primitives/autocomplete/portal.tsx +11 -5
  236. package/src/form/primitives/autocomplete/positioner.tsx +29 -0
  237. package/src/form/primitives/autocomplete/stories/index.story.tsx +1 -0
  238. package/src/form/primitives/autocomplete/test/index.test.tsx +219 -0
  239. package/src/form/primitives/autocomplete/types.ts +15 -15
  240. package/src/form/primitives/constants.ts +7 -4
  241. package/src/form/primitives/select/index.ts +2 -1
  242. package/src/form/primitives/select/popup.tsx +30 -34
  243. package/src/form/primitives/select/portal.tsx +15 -8
  244. package/src/form/primitives/select/positioner.tsx +33 -0
  245. package/src/form/primitives/select/stories/index.story.tsx +1 -0
  246. package/src/form/primitives/select/test/index.test.tsx +134 -0
  247. package/src/form/primitives/select/types.ts +12 -2
  248. package/src/form/select-control/test/index.test.tsx +64 -0
  249. package/src/icon/stories/index.story.tsx +3 -2
  250. package/src/icon-button/icon-button.tsx +1 -1
  251. package/src/icon-button/test/index.test.tsx +10 -10
  252. package/src/index.ts +2 -0
  253. package/src/popover/index.ts +12 -1
  254. package/src/popover/popup.tsx +28 -45
  255. package/src/popover/portal.tsx +1 -4
  256. package/src/popover/positioner.tsx +42 -0
  257. package/src/popover/root.tsx +5 -2
  258. package/src/popover/stories/index.story.tsx +85 -138
  259. package/src/popover/test/index.test.tsx +36 -1
  260. package/src/popover/types.ts +13 -15
  261. package/src/tabs/stories/index.story.tsx +2 -2
  262. package/src/tooltip/portal.tsx +11 -5
  263. package/src/tooltip/positioner.tsx +1 -4
  264. package/src/tooltip/style.module.css +1 -1
  265. package/src/tooltip/test/index.test.tsx +110 -0
  266. package/src/tooltip/types.ts +3 -5
  267. package/src/utils/css/item-popup.module.css +7 -4
  268. package/src/utils/css/wp-compat-overlay-slot.module.css +35 -0
  269. package/src/utils/test/use-enable-wp-compat-overlay-slot.test.tsx +74 -0
  270. package/src/utils/test/wp-compat-overlay-slot.test.ts +300 -0
  271. package/src/utils/use-enable-wp-compat-overlay-slot.ts +32 -0
  272. package/src/utils/wp-compat-overlay-slot.ts +129 -0
@@ -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\":\"_6ddab482b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AO;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;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,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,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Ae,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,U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1B,cAAO;AAAA,UACP;AAAA,QACD;AAAA;AAAA,IACD;AAAA,EAEF;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,MAAO;AAC5B;AAAA,EACD;AAEA,QA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lay 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,CAAC,EAAE,YAAY,CAAE,IAAI,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AAa,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"}
@@ -3,6 +3,24 @@ import type { FullBleedProps } from './types';
3
3
  * A container that breaks out of the card's padding to span edge-to-edge.
4
4
  * Useful for full-width images, dividers, or embedded content.
5
5
  *
6
+ * Additional edge-bumping behavior based on placement:
7
+ *
8
+ * - As the **first child** of `Card.Header`, it extends flush to the card's
9
+ * top edge — ideal for hero images.
10
+ * - As the **only child** of `Card.Content`, it extends flush to the card's
11
+ * top edge when `Content` is the first card section, and to the bottom edge
12
+ * when it is the last.
13
+ *
14
+ * Inter-sibling spacing inside `Card.Header` / `Card.Content` is consumer-
15
+ * managed. To add space between a hero `FullBleed` and the following
16
+ * siblings, compose the parent with `Stack` via the `render` prop:
17
+ * `<Card.Header render={ <Stack direction="column" gap="lg" /> }>`. This
18
+ * keeps `FullBleed` a direct child of `Card.Header` so the edge-bump still
19
+ * fires, while `Stack` provides the gap.
20
+ *
21
+ * Inside `CollapsibleCard`, place full-bleed media in `CollapsibleCard.Content`
22
+ * (not the header). The trigger/panel gap is preserved by design.
23
+ *
6
24
  * Must be used as a direct child of `Card.Content` or `Card.Header`.
7
25
  */
8
26
  export declare const FullBleed: import("react").ForwardRefExoticComponent<FullBleedProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"full-bleed.d.ts","sourceRoot":"","sources":["../../src/card/full-bleed.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,2GAcrB,CAAC"}
1
+ {"version":3,"file":"full-bleed.d.ts","sourceRoot":"","sources":["../../src/card/full-bleed.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,2GAcrB,CAAC"}
@@ -4,6 +4,17 @@ declare const meta: Meta<typeof Card.Root>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Card.Root>;
6
6
  export declare const Default: Story;
7
+ /**
8
+ * `Card.FullBleed` as the sole child of `Card.Content` spans edge-to-edge
9
+ * with no padding around it.
10
+ */
11
+ export declare const FullBleedCoverOnly: Story;
12
+ /**
13
+ * When `Card.FullBleed` is the sole child of `Card.Content` and a
14
+ * `Card.Header` sits above it, the image bumps against the card's side and
15
+ * bottom edges while the header retains its normal padding.
16
+ */
17
+ export declare const FullBleedCoverWithHeader: Story;
7
18
  /**
8
19
  * `Card.FullBleed` breaks out of the card's padding to span
9
20
  * edge-to-edge. Useful for images, dividers, or embedded content.
@@ -13,6 +24,18 @@ export declare const WithFullBleed: Story;
13
24
  * A minimal card with only a header.
14
25
  */
15
26
  export declare const HeaderOnly: Story;
27
+ /**
28
+ * When `Card.FullBleed` is the **first child** of `Card.Header`, it extends
29
+ * flush to the card's top and side edges — ideal for hero images. Content
30
+ * that follows inside the header is padded normally.
31
+ */
32
+ export declare const FullBleedHeroWithTitle: Story;
33
+ /**
34
+ * When `Card.FullBleed` is the **only child** of `Card.Header`, it fills the
35
+ * header entirely — top and sides flush to the card edges, no extra padding
36
+ * below.
37
+ */
38
+ export declare const FullBleedHeroOnly: Story;
16
39
  /**
17
40
  * Use the `render` prop to change the underlying HTML elements for
18
41
  * better semantics. Here, `Card.Root` renders as a `<section>` and
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,UAAU,CAAC;AAwBjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAAC,IAAI,CAgBjC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,IAAI,CAAC,IAAI,CAAE,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAsB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAc7B,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/card/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,IAAI,MAAM,UAAU,CAAC;AAwBjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,IAAI,CAAC,IAAI,CAgBjC,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,IAAI,CAAC,IAAI,CAAE,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAgBhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAqBtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAsB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAyBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAwB/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAc7B,CAAC"}
@@ -13,6 +13,8 @@ import type { HeaderProps } from './types';
13
13
  * Avoid placing interactive elements (buttons, links, inputs) inside the
14
14
  * header, since the entire area is clickable and their events will bubble
15
15
  * to trigger the collapse toggle.
16
+ *
17
+ * Place full-bleed media in `CollapsibleCard.Content`, not the header.
16
18
  */
17
19
  export declare const Header: import("react").ForwardRefExoticComponent<HeaderProps & import("react").RefAttributes<HTMLDivElement>>;
18
20
  //# sourceMappingURL=header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/collapsible-card/header.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,wGA8DlB,CAAC"}
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/collapsible-card/header.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,wGA8DlB,CAAC"}
@@ -38,4 +38,18 @@ export declare const WithHeaderDescription: Story;
38
38
  * to verify identical spacing and layout.
39
39
  */
40
40
  export declare const ComparedToCard: Story;
41
+ /**
42
+ * When `Card.FullBleed` is the sole child of `CollapsibleCard.Content` and a
43
+ * header sits above it, the media bumps against the card&apos;s side and
44
+ * bottom edges while the header retains its normal padding. (Unlike a plain
45
+ * `Card`, a header is always required here for the collapse trigger — see
46
+ * `Card` stories for a body-only `FullBleedCoverOnly` example.)
47
+ */
48
+ export declare const FullBleedCoverWithHeader: Story;
49
+ /**
50
+ * `Card.FullBleed` breaks out of the content padding to span edge-to-edge.
51
+ * Useful for images, dividers, or embedded content inside the collapsible
52
+ * region.
53
+ */
54
+ export declare const WithFullBleed: Story;
41
55
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/collapsible-card/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAyB5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAAC,IAAI,CAe5C,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,eAAe,CAAC,IAAI,CAAE,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KA6CrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KA8ChC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAuCnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KA4C5B,CAAC"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/collapsible-card/stories/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,eAAe,MAAM,UAAU,CAAC;AAyB5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,eAAe,CAAC,IAAI,CAgB5C,CAAC;eACa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,eAAe,CAAC,IAAI,CAAE,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KA6CrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,KA8ChC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAuCnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KA4C5B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAuBtC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KA0B3B,CAAC"}
@@ -1,10 +1,12 @@
1
1
  /**
2
- * Root element that portals `Dialog` overlay content (`Backdrop`, inner
3
- * `Popup`, etc.) outside the DOM hierarchy. Pass to `Dialog.Popup`'s
4
- * `portal` prop to customize `container`, `className`, `style`, and other
5
- * Base UI portal options. When `portal` is omitted, `Dialog.Popup` uses this
6
- * component with default props.
2
+ * Used to apply custom portal behavior to `Dialog`'s overlay content.
7
3
  */
8
- 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>>;
9
11
  export { Portal };
10
12
  //# sourceMappingURL=portal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/dialog/portal.tsx"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,iNAIX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../src/dialog/portal.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,QAAA,MAAM,MAAM;;;;;;kDAIX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import type { Dialog as _Dialog } from '@base-ui/react/dialog';
2
- import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
2
+ import type { ReactElement, ReactNode } from 'react';
3
3
  import type { Button } from '../button';
4
4
  import type { IconButton } from '../icon-button';
5
5
  import type { ComponentProps } from '../utils/types';
6
- export type PortalProps = ComponentPropsWithoutRef<typeof _Dialog.Portal>;
6
+ export type PortalProps = ComponentProps<typeof _Dialog.Portal>;
7
7
  export interface RootProps extends Pick<_Dialog.Root.Props, 'open' | 'onOpenChange' | 'onOpenChangeComplete' | 'defaultOpen' | 'modal' | 'disablePointerDismissal'> {
8
8
  /**
9
9
  * The content to be rendered inside the component.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dialog/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAE,OAAO,OAAO,CAAC,MAAM,CAAE,CAAC;AAE5E,MAAM,WAAW,SAChB,SAAQ,IAAI,CACX,OAAO,CAAC,IAAI,CAAC,KAAK,EAChB,MAAM,GACN,cAAc,GACd,sBAAsB,GACtB,aAAa,GACb,OAAO,GACP,yBAAyB,CAC3B;IACD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;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,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAAE;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,YAAY,CAAE,IAAI,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