@pine-ds/core 4.7.2 → 4.9.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 (536) hide show
  1. package/components/attributes.js +1 -1
  2. package/components/floating-ui.dom.js +1 -1
  3. package/components/index.js +1 -1
  4. package/components/index2.js +1 -1
  5. package/components/keep-hydrated.js +1 -0
  6. package/components/mock-pds-modal.js +1 -1
  7. package/components/pds-alert.js +1 -1
  8. package/components/pds-avatar.js +1 -1
  9. package/components/pds-box2.js +1 -1
  10. package/components/pds-button2.js +1 -1
  11. package/components/pds-checkbox2.js +1 -1
  12. package/components/pds-chip2.js +1 -1
  13. package/components/pds-combobox.js +1 -1
  14. package/components/pds-container.js +1 -1
  15. package/components/pds-copytext.js +1 -1
  16. package/components/pds-datepicker.js +1 -1
  17. package/components/pds-divider.js +1 -1
  18. package/components/pds-drawer-content.js +1 -1
  19. package/components/pds-drawer-footer.js +1 -1
  20. package/components/pds-drawer-header.js +1 -1
  21. package/components/pds-drawer.js +1 -1
  22. package/components/pds-dropdown-menu-item.js +1 -1
  23. package/components/pds-dropdown-menu-separator.js +1 -1
  24. package/components/pds-dropdown-menu.js +1 -1
  25. package/components/pds-filter.js +1 -1
  26. package/components/pds-filters.js +1 -1
  27. package/components/pds-image.js +1 -1
  28. package/components/pds-input2.js +1 -1
  29. package/components/pds-link2.js +1 -1
  30. package/components/pds-loader2.js +1 -1
  31. package/components/pds-modal-content.js +1 -1
  32. package/components/pds-modal-footer.js +1 -1
  33. package/components/pds-modal-header.js +1 -1
  34. package/components/pds-modal2.js +1 -1
  35. package/components/pds-multiselect.js +1 -1
  36. package/components/pds-popover.js +1 -1
  37. package/components/pds-progress.js +1 -1
  38. package/components/pds-property.js +1 -1
  39. package/components/pds-radio-group.js +1 -1
  40. package/components/pds-radio.js +1 -1
  41. package/components/pds-row.js +1 -1
  42. package/components/pds-select.js +1 -1
  43. package/components/pds-sortable-item.js +1 -1
  44. package/components/pds-sortable.js +2 -2
  45. package/components/pds-switch.js +1 -1
  46. package/components/pds-table-body.js +1 -1
  47. package/components/pds-table-cell2.js +1 -1
  48. package/components/pds-table-head-cell2.js +1 -1
  49. package/components/pds-table-head.js +1 -1
  50. package/components/pds-table-row.js +1 -1
  51. package/components/pds-tabpanel.js +1 -1
  52. package/components/pds-tabs.js +1 -1
  53. package/components/pds-text2.js +1 -1
  54. package/components/pds-textarea.js +1 -1
  55. package/components/pds-toast.js +1 -1
  56. package/components/pds-tooltip.js +1 -1
  57. package/components/tabbable.js +1 -0
  58. package/components/truncation-tooltip.js +1 -1
  59. package/dist/cjs/{attributes-BJ7KBHql.js → attributes-CW49XqaL.js} +1 -1
  60. package/dist/cjs/{floating-ui.dom-Dc8Anyel.js → floating-ui.dom-Dw41zbyY.js} +1 -0
  61. package/dist/cjs/{index-jl_Q819j.js → index-BsWY_xEJ.js} +1 -1
  62. package/dist/cjs/{index-5Azb8EQG.js → index-Do70atou.js} +1 -1
  63. package/dist/cjs/index.cjs.js +1 -1
  64. package/dist/cjs/{keep-hydrated-CiXgkEYd.js → keep-hydrated-AKoh0DG4.js} +1 -0
  65. package/dist/cjs/loader.cjs.js +3 -3
  66. package/dist/cjs/mock-pds-modal.cjs.entry.js +3 -3
  67. package/dist/cjs/pds-accordion.cjs.entry.js +3 -3
  68. package/dist/cjs/pds-alert.cjs.entry.js +17 -4
  69. package/dist/cjs/pds-avatar.cjs.entry.js +23 -13
  70. package/dist/cjs/pds-box.cjs.entry.js +4 -4
  71. package/dist/cjs/pds-button.cjs.entry.js +80 -45
  72. package/dist/cjs/pds-checkbox.cjs.entry.js +16 -8
  73. package/dist/cjs/pds-chip.cjs.entry.js +8 -8
  74. package/dist/cjs/pds-combobox.cjs.entry.js +43 -13
  75. package/dist/cjs/pds-container.cjs.entry.js +3 -3
  76. package/dist/cjs/pds-copytext.cjs.entry.js +7 -7
  77. package/dist/cjs/pds-datepicker.cjs.entry.js +6 -6
  78. package/dist/cjs/pds-divider.cjs.entry.js +3 -3
  79. package/dist/cjs/pds-drawer-content.cjs.entry.js +3 -3
  80. package/dist/cjs/pds-drawer-footer.cjs.entry.js +3 -3
  81. package/dist/cjs/pds-drawer-header.cjs.entry.js +3 -3
  82. package/dist/cjs/pds-drawer.cjs.entry.js +4 -4
  83. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +34 -5
  84. package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +3 -3
  85. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +8 -8
  86. package/dist/cjs/pds-filter.cjs.entry.js +4 -4
  87. package/dist/cjs/pds-filters.cjs.entry.js +3 -3
  88. package/dist/cjs/pds-icon.cjs.entry.js +2 -2
  89. package/dist/cjs/pds-image.cjs.entry.js +4 -4
  90. package/dist/cjs/pds-input.cjs.entry.js +6 -6
  91. package/dist/cjs/pds-link.cjs.entry.js +15 -6
  92. package/dist/cjs/pds-loader.cjs.entry.js +4 -4
  93. package/dist/cjs/pds-modal-content.cjs.entry.js +34 -32
  94. package/dist/cjs/pds-modal-footer.cjs.entry.js +3 -3
  95. package/dist/cjs/pds-modal-header.cjs.entry.js +3 -3
  96. package/dist/cjs/pds-modal.cjs.entry.js +9 -89
  97. package/dist/cjs/pds-multiselect.cjs.entry.js +9 -9
  98. package/dist/cjs/pds-popover.cjs.entry.js +416 -163
  99. package/dist/cjs/pds-progress.cjs.entry.js +4 -4
  100. package/dist/cjs/pds-property.cjs.entry.js +3 -3
  101. package/dist/cjs/pds-radio-group.cjs.entry.js +6 -6
  102. package/dist/cjs/pds-radio.cjs.entry.js +24 -11
  103. package/dist/cjs/pds-row.cjs.entry.js +4 -4
  104. package/dist/cjs/pds-select.cjs.entry.js +132 -21
  105. package/dist/cjs/pds-sortable-item.cjs.entry.js +5 -5
  106. package/dist/cjs/pds-sortable.cjs.entry.js +4 -4
  107. package/dist/cjs/pds-switch.cjs.entry.js +7 -7
  108. package/dist/cjs/pds-tab.cjs.entry.js +3 -3
  109. package/dist/cjs/pds-table-body.cjs.entry.js +3 -3
  110. package/dist/cjs/pds-table-cell.cjs.entry.js +6 -6
  111. package/dist/cjs/pds-table-head-cell.cjs.entry.js +5 -5
  112. package/dist/cjs/pds-table-head.cjs.entry.js +3 -3
  113. package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
  114. package/dist/cjs/pds-table.cjs.entry.js +2 -2
  115. package/dist/cjs/pds-tabpanel.cjs.entry.js +4 -4
  116. package/dist/cjs/pds-tabs.cjs.entry.js +4 -4
  117. package/dist/cjs/pds-text.cjs.entry.js +5 -5
  118. package/dist/cjs/pds-textarea.cjs.entry.js +8 -8
  119. package/dist/cjs/pds-toast.cjs.entry.js +14 -8
  120. package/dist/cjs/pds-tooltip.cjs.entry.js +115 -44
  121. package/dist/cjs/pine-core.cjs.js +3 -3
  122. package/dist/cjs/tabbable-CddSt_Hi.js +85 -0
  123. package/dist/cjs/{truncation-tooltip-DO9xli2e.js → truncation-tooltip-O5nQmXPw.js} +32 -7
  124. package/dist/collection/components/pds-alert/pds-alert.css +13 -0
  125. package/dist/collection/components/pds-alert/pds-alert.js +36 -1
  126. package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +4 -0
  127. package/dist/collection/components/pds-avatar/pds-avatar.js +42 -10
  128. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +2 -0
  129. package/dist/collection/components/pds-box/pds-box.js +1 -1
  130. package/dist/collection/components/pds-button/pds-button.js +36 -44
  131. package/dist/collection/components/pds-button/stories/pds-button.stories.js +3 -3
  132. package/dist/collection/components/pds-checkbox/pds-checkbox.css +79 -0
  133. package/dist/collection/components/pds-checkbox/pds-checkbox.js +36 -5
  134. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +38 -0
  135. package/dist/collection/components/pds-chip/pds-chip.js +2 -2
  136. package/dist/collection/components/pds-combobox/pds-combobox.css +33 -0
  137. package/dist/collection/components/pds-combobox/pds-combobox.js +62 -9
  138. package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +44 -0
  139. package/dist/collection/components/pds-container/pds-container.js +1 -1
  140. package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
  141. package/dist/collection/components/pds-datepicker/pds-datepicker.js +2 -2
  142. package/dist/collection/components/pds-datepicker/stories/pds-datepicker.stories.js +1 -1
  143. package/dist/collection/components/pds-divider/pds-divider.js +1 -1
  144. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +1 -1
  145. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +1 -1
  146. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +1 -1
  147. package/dist/collection/components/pds-drawer/pds-drawer.js +2 -2
  148. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.css +8 -0
  149. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +81 -7
  150. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +1 -1
  151. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +4 -4
  152. package/dist/collection/components/pds-dropdown-menu/stories/pds-dropdown-menu.stories.js +39 -0
  153. package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +1 -1
  154. package/dist/collection/components/pds-filters/pds-filters.js +1 -1
  155. package/dist/collection/components/pds-image/pds-image.js +2 -2
  156. package/dist/collection/components/pds-input/pds-input.js +2 -2
  157. package/dist/collection/components/pds-input/stories/pds-input.stories.js +6 -6
  158. package/dist/collection/components/pds-link/pds-link.js +34 -3
  159. package/dist/collection/components/pds-link/stories/pds-link.stories.js +3 -2
  160. package/dist/collection/components/pds-loader/pds-loader.js +1 -1
  161. package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +32 -30
  162. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
  163. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
  164. package/dist/collection/components/pds-modal/pds-modal.js +5 -85
  165. package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
  166. package/dist/collection/components/pds-multiselect/pds-multiselect.js +5 -5
  167. package/dist/collection/components/pds-popover/pds-popover.css +6 -0
  168. package/dist/collection/components/pds-popover/pds-popover.js +465 -159
  169. package/dist/collection/components/pds-popover/stories/pds-popover.stories.js +31 -0
  170. package/dist/collection/components/pds-progress/pds-progress.js +1 -1
  171. package/dist/collection/components/pds-property/pds-property.js +1 -1
  172. package/dist/collection/components/pds-radio/pds-radio.css +57 -0
  173. package/dist/collection/components/pds-radio/pds-radio.js +45 -9
  174. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +15 -0
  175. package/dist/collection/components/pds-radio-group/pds-radio-group.js +3 -3
  176. package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +45 -0
  177. package/dist/collection/components/pds-row/pds-row.js +1 -1
  178. package/dist/collection/components/pds-select/pds-select.js +128 -17
  179. package/dist/collection/components/pds-select/stories/pds-select.stories.js +2 -2
  180. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
  181. package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
  182. package/dist/collection/components/pds-switch/pds-switch.js +3 -3
  183. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
  184. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
  185. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
  186. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
  187. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
  188. package/dist/collection/components/pds-table/stories/pds-table.stories.js +4 -4
  189. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
  190. package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
  191. package/dist/collection/components/pds-text/pds-text.js +1 -1
  192. package/dist/collection/components/pds-text/stories/pds-text.stories.js +1 -1
  193. package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
  194. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +2 -2
  195. package/dist/collection/components/pds-toast/pds-toast.css +13 -0
  196. package/dist/collection/components/pds-toast/pds-toast.js +33 -5
  197. package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +4 -1
  198. package/dist/collection/components/pds-tooltip/pds-tooltip.js +113 -41
  199. package/dist/collection/utils/aria-references.js +42 -0
  200. package/dist/collection/utils/tabbable.js +81 -0
  201. package/dist/collection/utils/truncation-tooltip.js +31 -6
  202. package/dist/docs.json +367 -13
  203. package/dist/esm/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
  204. package/dist/esm/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
  205. package/dist/esm/{index-Cw9J31qd.js → index-BFSwd-GQ.js} +1 -1
  206. package/dist/esm/{index-BJXk71tO.js → index-m3pqpeWg.js} +2 -2
  207. package/dist/esm/index.js +1 -1
  208. package/dist/esm/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
  209. package/dist/esm/loader.js +4 -4
  210. package/dist/esm/mock-pds-modal.entry.js +3 -3
  211. package/dist/esm/pds-accordion.entry.js +3 -3
  212. package/dist/esm/pds-alert.entry.js +17 -4
  213. package/dist/esm/pds-avatar.entry.js +23 -13
  214. package/dist/esm/pds-box.entry.js +4 -4
  215. package/dist/esm/pds-button.entry.js +80 -45
  216. package/dist/esm/pds-checkbox.entry.js +16 -8
  217. package/dist/esm/pds-chip.entry.js +8 -8
  218. package/dist/esm/pds-combobox.entry.js +43 -13
  219. package/dist/esm/pds-container.entry.js +3 -3
  220. package/dist/esm/pds-copytext.entry.js +7 -7
  221. package/dist/esm/pds-datepicker.entry.js +6 -6
  222. package/dist/esm/pds-divider.entry.js +3 -3
  223. package/dist/esm/pds-drawer-content.entry.js +3 -3
  224. package/dist/esm/pds-drawer-footer.entry.js +3 -3
  225. package/dist/esm/pds-drawer-header.entry.js +3 -3
  226. package/dist/esm/pds-drawer.entry.js +4 -4
  227. package/dist/esm/pds-dropdown-menu-item.entry.js +34 -5
  228. package/dist/esm/pds-dropdown-menu-separator.entry.js +3 -3
  229. package/dist/esm/pds-dropdown-menu.entry.js +8 -8
  230. package/dist/esm/pds-filter.entry.js +4 -4
  231. package/dist/esm/pds-filters.entry.js +3 -3
  232. package/dist/esm/pds-icon.entry.js +2 -2
  233. package/dist/esm/pds-image.entry.js +4 -4
  234. package/dist/esm/pds-input.entry.js +6 -6
  235. package/dist/esm/pds-link.entry.js +15 -6
  236. package/dist/esm/pds-loader.entry.js +4 -4
  237. package/dist/esm/pds-modal-content.entry.js +34 -32
  238. package/dist/esm/pds-modal-footer.entry.js +3 -3
  239. package/dist/esm/pds-modal-header.entry.js +3 -3
  240. package/dist/esm/pds-modal.entry.js +7 -87
  241. package/dist/esm/pds-multiselect.entry.js +9 -9
  242. package/dist/esm/pds-popover.entry.js +416 -163
  243. package/dist/esm/pds-progress.entry.js +4 -4
  244. package/dist/esm/pds-property.entry.js +3 -3
  245. package/dist/esm/pds-radio-group.entry.js +6 -6
  246. package/dist/esm/pds-radio.entry.js +24 -11
  247. package/dist/esm/pds-row.entry.js +4 -4
  248. package/dist/esm/pds-select.entry.js +132 -21
  249. package/dist/esm/pds-sortable-item.entry.js +5 -5
  250. package/dist/esm/pds-sortable.entry.js +4 -4
  251. package/dist/esm/pds-switch.entry.js +7 -7
  252. package/dist/esm/pds-tab.entry.js +3 -3
  253. package/dist/esm/pds-table-body.entry.js +3 -3
  254. package/dist/esm/pds-table-cell.entry.js +6 -6
  255. package/dist/esm/pds-table-head-cell.entry.js +5 -5
  256. package/dist/esm/pds-table-head.entry.js +3 -3
  257. package/dist/esm/pds-table-row.entry.js +3 -3
  258. package/dist/esm/pds-table.entry.js +2 -2
  259. package/dist/esm/pds-tabpanel.entry.js +4 -4
  260. package/dist/esm/pds-tabs.entry.js +4 -4
  261. package/dist/esm/pds-text.entry.js +5 -5
  262. package/dist/esm/pds-textarea.entry.js +8 -8
  263. package/dist/esm/pds-toast.entry.js +14 -8
  264. package/dist/esm/pds-tooltip.entry.js +115 -44
  265. package/dist/esm/pine-core.js +4 -4
  266. package/dist/esm/tabbable-DCKBKRUy.js +83 -0
  267. package/dist/esm/{truncation-tooltip-DRXsdKk1.js → truncation-tooltip-D_gvhB9r.js} +32 -7
  268. package/dist/esm-es5/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
  269. package/dist/esm-es5/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
  270. package/dist/esm-es5/{index-Cw9J31qd.js → index-BFSwd-GQ.js} +2 -2
  271. package/dist/esm-es5/{index-BJXk71tO.js → index-m3pqpeWg.js} +1 -1
  272. package/dist/esm-es5/index.js +1 -1
  273. package/dist/esm-es5/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
  274. package/dist/esm-es5/loader.js +1 -1
  275. package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
  276. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  277. package/dist/esm-es5/pds-alert.entry.js +1 -1
  278. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  279. package/dist/esm-es5/pds-box.entry.js +1 -1
  280. package/dist/esm-es5/pds-button.entry.js +1 -1
  281. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  282. package/dist/esm-es5/pds-chip.entry.js +1 -1
  283. package/dist/esm-es5/pds-combobox.entry.js +2 -2
  284. package/dist/esm-es5/pds-container.entry.js +1 -1
  285. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  286. package/dist/esm-es5/pds-datepicker.entry.js +1 -1
  287. package/dist/esm-es5/pds-divider.entry.js +1 -1
  288. package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
  289. package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
  290. package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
  291. package/dist/esm-es5/pds-drawer.entry.js +1 -1
  292. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  293. package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
  294. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  295. package/dist/esm-es5/pds-filter.entry.js +1 -1
  296. package/dist/esm-es5/pds-filters.entry.js +1 -1
  297. package/dist/esm-es5/pds-icon.entry.js +1 -1
  298. package/dist/esm-es5/pds-image.entry.js +1 -1
  299. package/dist/esm-es5/pds-input.entry.js +1 -1
  300. package/dist/esm-es5/pds-link.entry.js +1 -1
  301. package/dist/esm-es5/pds-loader.entry.js +1 -1
  302. package/dist/esm-es5/pds-modal-content.entry.js +1 -1
  303. package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
  304. package/dist/esm-es5/pds-modal-header.entry.js +1 -1
  305. package/dist/esm-es5/pds-modal.entry.js +1 -1
  306. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  307. package/dist/esm-es5/pds-popover.entry.js +1 -1
  308. package/dist/esm-es5/pds-progress.entry.js +1 -1
  309. package/dist/esm-es5/pds-property.entry.js +1 -1
  310. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  311. package/dist/esm-es5/pds-radio.entry.js +1 -1
  312. package/dist/esm-es5/pds-row.entry.js +1 -1
  313. package/dist/esm-es5/pds-select.entry.js +1 -1
  314. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  315. package/dist/esm-es5/pds-sortable.entry.js +2 -2
  316. package/dist/esm-es5/pds-switch.entry.js +1 -1
  317. package/dist/esm-es5/pds-tab.entry.js +1 -1
  318. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  319. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  320. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  321. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  322. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  323. package/dist/esm-es5/pds-table.entry.js +1 -1
  324. package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
  325. package/dist/esm-es5/pds-tabs.entry.js +1 -1
  326. package/dist/esm-es5/pds-text.entry.js +1 -1
  327. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  328. package/dist/esm-es5/pds-toast.entry.js +1 -1
  329. package/dist/esm-es5/pds-tooltip.entry.js +1 -1
  330. package/dist/esm-es5/pine-core.js +1 -1
  331. package/dist/esm-es5/tabbable-DCKBKRUy.js +1 -0
  332. package/dist/esm-es5/truncation-tooltip-D_gvhB9r.js +1 -0
  333. package/dist/pine-core/index.esm.js +1 -1
  334. package/dist/pine-core/p-001d4b86.entry.js +1 -0
  335. package/dist/pine-core/p-06279b93.system.entry.js +1 -0
  336. package/dist/pine-core/{p-b75b0d09.system.entry.js → p-0790dd0d.system.entry.js} +1 -1
  337. package/dist/pine-core/p-079c39d1.entry.js +1 -0
  338. package/dist/pine-core/p-07b4524e.entry.js +1 -0
  339. package/dist/pine-core/{p-b60ac7eb.system.entry.js → p-08bbd3e6.system.entry.js} +1 -1
  340. package/dist/pine-core/{p-c5c9ed36.system.entry.js → p-0bd61097.system.entry.js} +1 -1
  341. package/dist/pine-core/p-0c60f577.system.entry.js +1 -0
  342. package/dist/pine-core/{p-6d603d16.system.entry.js → p-110b4051.system.entry.js} +1 -1
  343. package/dist/pine-core/p-11e7d660.entry.js +1 -0
  344. package/dist/pine-core/p-14d872d3.entry.js +1 -0
  345. package/dist/pine-core/p-17fc76e7.system.entry.js +1 -0
  346. package/dist/pine-core/{p-0913f696.system.entry.js → p-1e5648bf.system.entry.js} +1 -1
  347. package/dist/pine-core/{p-e803f629.system.entry.js → p-22ae92f7.system.entry.js} +1 -1
  348. package/dist/pine-core/p-239774c9.entry.js +1 -0
  349. package/dist/pine-core/{p-0b71ecb6.system.entry.js → p-25bf2f26.system.entry.js} +2 -2
  350. package/dist/pine-core/{p-e7a95a49.system.entry.js → p-272b24ad.system.entry.js} +1 -1
  351. package/dist/pine-core/{p-d2c91e7a.entry.js → p-2c0047cd.entry.js} +1 -1
  352. package/dist/pine-core/p-2d5b1deb.entry.js +1 -0
  353. package/dist/pine-core/{p-e8cb76e8.entry.js → p-3556f6ad.entry.js} +1 -1
  354. package/dist/pine-core/{p-BGLP3keB.js → p-35s7h-dk.js} +1 -1
  355. package/dist/pine-core/{p-080cb087.system.entry.js → p-38b87aa2.system.entry.js} +1 -1
  356. package/dist/pine-core/{p-355e4cf9.entry.js → p-3afb1208.entry.js} +1 -1
  357. package/dist/pine-core/p-3b5b8f73.entry.js +1 -0
  358. package/dist/pine-core/{p-8c8cc079.system.entry.js → p-3cc19ea8.system.entry.js} +1 -1
  359. package/dist/pine-core/{p-bd67156b.system.entry.js → p-3ce7e72e.system.entry.js} +1 -1
  360. package/dist/pine-core/p-3f62581a.system.entry.js +1 -0
  361. package/dist/pine-core/p-414faecf.entry.js +1 -0
  362. package/dist/pine-core/p-463a29fa.entry.js +1 -0
  363. package/dist/pine-core/{p-f029b7da.system.entry.js → p-4ee44585.system.entry.js} +1 -1
  364. package/dist/pine-core/p-50af67ea.system.entry.js +1 -0
  365. package/dist/pine-core/p-5133e8be.system.entry.js +1 -0
  366. package/dist/pine-core/p-55fce29e.entry.js +1 -0
  367. package/dist/pine-core/{p-77395d62.system.entry.js → p-568a9a79.system.entry.js} +1 -1
  368. package/dist/pine-core/p-5967d9fa.system.entry.js +1 -0
  369. package/dist/pine-core/{p-5870b092.system.entry.js → p-5c46553f.system.entry.js} +1 -1
  370. package/dist/pine-core/{p-f0d24298.system.entry.js → p-5ce5836e.system.entry.js} +1 -1
  371. package/dist/pine-core/p-5f3242c8.system.entry.js +1 -0
  372. package/dist/pine-core/{p-80e6f3a0.system.entry.js → p-60d27247.system.entry.js} +1 -1
  373. package/dist/pine-core/{p-bd26a5e8.entry.js → p-60e3b1af.entry.js} +1 -1
  374. package/dist/pine-core/{p-ca0a8f5c.entry.js → p-64283f7b.entry.js} +1 -1
  375. package/dist/pine-core/p-6602b4d0.entry.js +1 -0
  376. package/dist/pine-core/p-6845867f.system.entry.js +1 -0
  377. package/dist/pine-core/{p-1ee86d87.system.entry.js → p-68fdfb8f.system.entry.js} +1 -1
  378. package/dist/pine-core/p-6b6ae1be.entry.js +1 -0
  379. package/dist/pine-core/{p-e5420660.entry.js → p-6d64e6c7.entry.js} +1 -1
  380. package/dist/pine-core/{p-3a959459.system.entry.js → p-6dad76cb.system.entry.js} +1 -1
  381. package/dist/pine-core/p-6f34ad9c.entry.js +1 -0
  382. package/dist/pine-core/{p-55224683.entry.js → p-7073146f.entry.js} +1 -1
  383. package/dist/pine-core/{p-f1702281.entry.js → p-735b3631.entry.js} +1 -1
  384. package/dist/pine-core/p-7a14473e.entry.js +1 -0
  385. package/dist/pine-core/{p-9880d251.system.entry.js → p-7a19477e.system.entry.js} +1 -1
  386. package/dist/pine-core/{p-88ff1604.entry.js → p-7d3a20ba.entry.js} +1 -1
  387. package/dist/pine-core/{p-a939b471.entry.js → p-7fcf3d37.entry.js} +1 -1
  388. package/dist/pine-core/{p-26642718.entry.js → p-87642228.entry.js} +1 -1
  389. package/dist/pine-core/p-89fefe36.entry.js +1 -0
  390. package/dist/pine-core/p-8b97dd57.system.entry.js +1 -0
  391. package/dist/pine-core/{p-0092444c.system.entry.js → p-9201b497.system.entry.js} +1 -1
  392. package/dist/pine-core/{p-ebd0bff2.entry.js → p-92a8cf7d.entry.js} +1 -1
  393. package/dist/pine-core/{p-e836a041.entry.js → p-94597b73.entry.js} +1 -1
  394. package/dist/pine-core/p-9713d6a5.system.entry.js +1 -0
  395. package/dist/pine-core/p-97be00f4.system.entry.js +1 -0
  396. package/dist/pine-core/{p-2ac2457b.system.entry.js → p-98843402.system.entry.js} +1 -1
  397. package/dist/pine-core/{p-b914dde8.entry.js → p-98cc327b.entry.js} +2 -2
  398. package/dist/pine-core/p-9a8971e2.system.entry.js +1 -0
  399. package/dist/pine-core/p-9a8d2985.system.entry.js +3 -0
  400. package/dist/pine-core/{p-cfc52b95.system.entry.js → p-9dbc017f.system.entry.js} +1 -1
  401. package/dist/pine-core/p-9fbcba0d.entry.js +1 -0
  402. package/dist/pine-core/p-9fe4a64a.entry.js +1 -0
  403. package/dist/pine-core/{p-COtCa1Md.system.js → p-BNTlHhoO.system.js} +1 -1
  404. package/dist/pine-core/p-BZ1l3LGl.system.js +1 -0
  405. package/dist/pine-core/p-BgNaWLoS.js +1 -0
  406. package/dist/pine-core/{p-CmSJytt1.js → p-BplEmwUQ.js} +2 -2
  407. package/dist/pine-core/{p-Cy8cvR7I.system.js → p-CANeE7Ss.system.js} +1 -1
  408. package/dist/pine-core/{p-XW4H0W6i.system.js → p-CNXspDYs.system.js} +1 -1
  409. package/dist/pine-core/{p-JtdHT_W5.js → p-CirzxZ33.js} +1 -1
  410. package/dist/pine-core/{p-CGRdQc49.system.js → p-CjRCtzPD.system.js} +2 -2
  411. package/dist/pine-core/{p-BPqJgIq6.js → p-Cuc0DYlm.js} +1 -1
  412. package/dist/pine-core/p-D52aRqFx.system.js +1 -0
  413. package/dist/pine-core/p-DCKBKRUy.js +1 -0
  414. package/dist/pine-core/p-DXO1yd32.system.js +1 -0
  415. package/dist/pine-core/{p-n3_ytl_p.system.js → p-DaCT2ssj.system.js} +1 -1
  416. package/dist/pine-core/p-a2078add.entry.js +1 -0
  417. package/dist/pine-core/{p-97d0b89e.system.entry.js → p-a48b025a.system.entry.js} +1 -1
  418. package/dist/pine-core/{p-9713fb36.entry.js → p-a7d25143.entry.js} +1 -1
  419. package/dist/pine-core/{p-9dcd2cdb.entry.js → p-ad3b1ec3.entry.js} +1 -1
  420. package/dist/pine-core/p-b017eb99.system.entry.js +1 -0
  421. package/dist/pine-core/p-b037dcbd.system.entry.js +1 -0
  422. package/dist/pine-core/{p-db17c626.system.entry.js → p-b243767b.system.entry.js} +1 -1
  423. package/dist/pine-core/{p-341c38f1.system.entry.js → p-b33ad96e.system.entry.js} +1 -1
  424. package/dist/pine-core/p-b6edfdfe.entry.js +2 -0
  425. package/dist/pine-core/{p-8191498f.system.entry.js → p-b7cbd913.system.entry.js} +1 -1
  426. package/dist/pine-core/{p-8f531063.entry.js → p-b9d71b76.entry.js} +1 -1
  427. package/dist/pine-core/p-bcf57566.entry.js +1 -0
  428. package/dist/pine-core/{p-4fd454f6.entry.js → p-bda7e3be.entry.js} +1 -1
  429. package/dist/pine-core/p-bdde1e53.entry.js +1 -0
  430. package/dist/pine-core/{p-cb6a3e4c.system.entry.js → p-be3b4f12.system.entry.js} +1 -1
  431. package/dist/pine-core/{p-b1548a20.entry.js → p-bfdfbe9f.entry.js} +1 -1
  432. package/dist/pine-core/p-c02a32ec.entry.js +1 -0
  433. package/dist/pine-core/p-c1da80e5.entry.js +1 -0
  434. package/dist/pine-core/{p-d8570b4b.system.entry.js → p-c233866c.system.entry.js} +1 -1
  435. package/dist/pine-core/{p-fc25b956.system.entry.js → p-cb560aab.system.entry.js} +1 -1
  436. package/dist/pine-core/{p-02088776.entry.js → p-ce554098.entry.js} +1 -1
  437. package/dist/pine-core/p-ced6a814.system.entry.js +1 -0
  438. package/dist/pine-core/{p-0a84d220.entry.js → p-d7930540.entry.js} +1 -1
  439. package/dist/pine-core/{p-11d98408.system.entry.js → p-d7db749a.system.entry.js} +1 -1
  440. package/dist/pine-core/{p-7a5b21d2.system.entry.js → p-d8bedb58.system.entry.js} +1 -1
  441. package/dist/pine-core/{p-1dc5a7e0.system.entry.js → p-d9243653.system.entry.js} +1 -1
  442. package/dist/pine-core/{p-9ab95438.entry.js → p-d94ebe84.entry.js} +1 -1
  443. package/dist/pine-core/{p-9109b90a.entry.js → p-de176bd9.entry.js} +1 -1
  444. package/dist/pine-core/{p-57a2f927.entry.js → p-dea2a254.entry.js} +1 -1
  445. package/dist/pine-core/p-dfadfcd1.entry.js +1 -0
  446. package/dist/pine-core/{p-1437585e.system.entry.js → p-e1fdd53a.system.entry.js} +1 -1
  447. package/dist/pine-core/{p-4435fff6.system.entry.js → p-e70cb112.system.entry.js} +1 -1
  448. package/dist/pine-core/{p-01aa382c.system.entry.js → p-e9a53a88.system.entry.js} +1 -1
  449. package/dist/pine-core/p-eb93cc6e.entry.js +1 -0
  450. package/dist/pine-core/{p-4d03d1e2.system.entry.js → p-ebf0c51b.system.entry.js} +1 -1
  451. package/dist/pine-core/p-ebf74c43.system.entry.js +1 -0
  452. package/dist/pine-core/{p-cde8eb81.entry.js → p-ee449a4b.entry.js} +1 -1
  453. package/dist/pine-core/p-ef4d8fea.entry.js +1 -0
  454. package/dist/pine-core/p-f09f27ab.system.entry.js +1 -0
  455. package/dist/pine-core/{p-ff3de72e.entry.js → p-f2c487e6.entry.js} +1 -1
  456. package/dist/pine-core/p-f549f2bc.entry.js +1 -0
  457. package/dist/pine-core/p-fc743f6e.entry.js +1 -0
  458. package/dist/pine-core/{p-BJXk71tO.js → p-m3pqpeWg.js} +1 -1
  459. package/dist/pine-core/p-wXfuz0Bd.system.js +1 -0
  460. package/dist/pine-core/pine-core.esm.js +1 -1
  461. package/dist/pine-core/pine-core.js +1 -1
  462. package/dist/types/components/pds-alert/pds-alert.d.ts +10 -0
  463. package/dist/types/components/pds-avatar/pds-avatar.d.ts +8 -0
  464. package/dist/types/components/pds-button/pds-button.d.ts +5 -6
  465. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +7 -1
  466. package/dist/types/components/pds-combobox/pds-combobox.d.ts +9 -0
  467. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +20 -3
  468. package/dist/types/components/pds-link/pds-link.d.ts +8 -0
  469. package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +2 -0
  470. package/dist/types/components/pds-popover/pds-popover.d.ts +87 -21
  471. package/dist/types/components/pds-radio/pds-radio.d.ts +9 -3
  472. package/dist/types/components/pds-select/pds-select.d.ts +32 -4
  473. package/dist/types/components/pds-toast/pds-toast.d.ts +9 -0
  474. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +31 -0
  475. package/dist/types/components.d.ts +139 -18
  476. package/dist/types/utils/aria-references.d.ts +24 -0
  477. package/dist/types/utils/tabbable.d.ts +2 -0
  478. package/dist/types/utils/truncation-tooltip.d.ts +4 -4
  479. package/dist/types/utils/types.d.ts +1 -0
  480. package/dist/vscode.html-data.json +129 -14
  481. package/hydrate/index.js +1040 -416
  482. package/hydrate/index.mjs +1040 -416
  483. package/package.json +2 -2
  484. package/dist/esm-es5/truncation-tooltip-DRXsdKk1.js +0 -1
  485. package/dist/pine-core/p-049f126a.entry.js +0 -1
  486. package/dist/pine-core/p-153ba77b.entry.js +0 -1
  487. package/dist/pine-core/p-208c7dbf.entry.js +0 -1
  488. package/dist/pine-core/p-258770cf.system.entry.js +0 -1
  489. package/dist/pine-core/p-2cb5483a.system.entry.js +0 -1
  490. package/dist/pine-core/p-432d5ec7.entry.js +0 -1
  491. package/dist/pine-core/p-5442d983.system.entry.js +0 -1
  492. package/dist/pine-core/p-576cf904.system.entry.js +0 -1
  493. package/dist/pine-core/p-5c90091e.system.entry.js +0 -1
  494. package/dist/pine-core/p-602c197f.entry.js +0 -1
  495. package/dist/pine-core/p-645a482b.system.entry.js +0 -1
  496. package/dist/pine-core/p-72865997.entry.js +0 -1
  497. package/dist/pine-core/p-75ee0403.entry.js +0 -1
  498. package/dist/pine-core/p-7a287635.system.entry.js +0 -1
  499. package/dist/pine-core/p-7bf6563a.system.entry.js +0 -1
  500. package/dist/pine-core/p-7fa66cad.entry.js +0 -1
  501. package/dist/pine-core/p-80a698ae.entry.js +0 -1
  502. package/dist/pine-core/p-82cf4ec6.entry.js +0 -1
  503. package/dist/pine-core/p-86040cac.system.entry.js +0 -1
  504. package/dist/pine-core/p-875b0436.system.entry.js +0 -1
  505. package/dist/pine-core/p-8cc302aa.system.entry.js +0 -1
  506. package/dist/pine-core/p-8d292b48.entry.js +0 -1
  507. package/dist/pine-core/p-92ae6082.entry.js +0 -1
  508. package/dist/pine-core/p-94593f20.system.entry.js +0 -1
  509. package/dist/pine-core/p-993d1043.entry.js +0 -1
  510. package/dist/pine-core/p-99459e27.entry.js +0 -1
  511. package/dist/pine-core/p-BLG6RDBt.js +0 -1
  512. package/dist/pine-core/p-BR5nujVX.system.js +0 -1
  513. package/dist/pine-core/p-CuSNnuFu.system.js +0 -1
  514. package/dist/pine-core/p-a0960b3d.system.entry.js +0 -1
  515. package/dist/pine-core/p-a1230a74.system.entry.js +0 -1
  516. package/dist/pine-core/p-a19cd59c.entry.js +0 -1
  517. package/dist/pine-core/p-a787b34a.system.entry.js +0 -1
  518. package/dist/pine-core/p-a826f290.entry.js +0 -1
  519. package/dist/pine-core/p-aa032a5e.system.entry.js +0 -1
  520. package/dist/pine-core/p-acce8eb2.entry.js +0 -1
  521. package/dist/pine-core/p-b69f04b7.entry.js +0 -1
  522. package/dist/pine-core/p-bb68431a.entry.js +0 -1
  523. package/dist/pine-core/p-bb73ad66.entry.js +0 -2
  524. package/dist/pine-core/p-beb23781.entry.js +0 -1
  525. package/dist/pine-core/p-bf30dec0.entry.js +0 -1
  526. package/dist/pine-core/p-c36b490e.entry.js +0 -1
  527. package/dist/pine-core/p-c81d8ac8.entry.js +0 -1
  528. package/dist/pine-core/p-ca0d48e8.entry.js +0 -1
  529. package/dist/pine-core/p-cfd012d4.entry.js +0 -1
  530. package/dist/pine-core/p-e0917a26.entry.js +0 -1
  531. package/dist/pine-core/p-e836f3ec.system.entry.js +0 -3
  532. package/dist/pine-core/p-ea4d4741.system.entry.js +0 -1
  533. package/dist/pine-core/p-f2c253d8.entry.js +0 -1
  534. package/dist/pine-core/p-f474d7de.entry.js +0 -1
  535. package/dist/pine-core/p-f77905aa.system.entry.js +0 -1
  536. package/dist/pine-core/p-qhdoK1Jp.system.js +0 -1
@@ -1,8 +1,10 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-Cw9J31qd.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-BFSwd-GQ.js';
2
+ import { p as platform, a as autoUpdate, c as computePosition, o as offset, f as flip, s as shift } from './floating-ui.dom-Cuc0DYlm.js';
2
3
  import { c as containsComposed, a as closest } from './closest-DHPzKMVS.js';
3
4
  import { r as restoreReflectedDefault } from './reflected-attribute-default-t3idJwV0.js';
4
- import { s as setAttributesIfChanged } from './attributes-WXw_I_uJ.js';
5
- import { l as limitRestores } from './keep-hydrated-BLG6RDBt.js';
5
+ import { s as setAttributesIfChanged } from './attributes-DkeVeN0g.js';
6
+ import { l as limitRestores } from './keep-hydrated-BgNaWLoS.js';
7
+ import { t as tabbableIn } from './tabbable-DCKBKRUy.js';
6
8
 
7
9
  /**
8
10
  * Escapes a string so it's safe to interpolate into a CSS identifier (an id selector like `#${id}`)
@@ -46,10 +48,32 @@ const cssEscape = (value) => {
46
48
  return result;
47
49
  };
48
50
 
49
- const pdsPopoverCss = () => `:host{--sizing-max-width-default:352px;display:inline-block}:host .pds-popover__trigger-wrapper{display:inline-block}:host .pds-popover__content-slot-wrapper{display:none}`;
51
+ const pdsPopoverCss = () => `:host{--sizing-max-width-default:352px;display:inline-block}:host .pds-popover__trigger-wrapper{display:inline-block}:host .pds-popover__tab-guard{opacity:0;outline:none;pointer-events:none;position:fixed}:host .pds-popover__content-slot-wrapper{display:none}`;
50
52
 
51
- /** Open auto popovers, in the order they opened: Escape goes to the last one it applies to. */
52
- const openAutoPopovers = [];
53
+ /** Open popovers that close on Escape, in the order they opened: Escape goes to the last one it applies to. */
54
+ const popoversTakingEscape = [];
55
+ /** Hovering the trigger waits this long before opening, so a pointer passing over it doesn't open it. */
56
+ const HOVER_OPEN_DELAY_MS = 120;
57
+ /** Leaving the trigger and panel waits this long before closing, which covers the gap between them. */
58
+ const HOVER_CLOSE_DELAY_MS = 200;
59
+ /**
60
+ * floating-ui reporting viewport coordinates, as `position: fixed` uses without a containing block. Its own
61
+ * containing-block check misses a backdrop filter in WebKit, so handlePopoverPositioning corrects for one itself.
62
+ */
63
+ const viewportPlatform = Object.assign(Object.assign({}, platform), { getOffsetParent: () => window });
64
+ /**
65
+ * Where `top: 0; left: 0` puts a fixed element beside the given one. An empty probe is measured instead of the
66
+ * element, whose own transforms, such as an entrance animation, would otherwise read as part of the offset.
67
+ */
68
+ const containingBlockOrigin = (element) => {
69
+ var _a;
70
+ const probe = document.createElement('div');
71
+ probe.style.cssText = 'all: initial; position: fixed; top: 0; left: 0;';
72
+ (_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(probe, element);
73
+ const { top, left } = probe.getBoundingClientRect();
74
+ probe.remove();
75
+ return { top, left };
76
+ };
53
77
  /** The focused element, followed down through shadow roots to the control that has focus. */
54
78
  function deepActiveElement() {
55
79
  var _a;
@@ -58,6 +82,27 @@ function deepActiveElement() {
58
82
  active = active.shadowRoot.activeElement;
59
83
  return active;
60
84
  }
85
+ /** `node`, or the shadow host it sits in, lifted until it shares a tree with `other` or reaches the document. */
86
+ function liftToTreeOf(node, other) {
87
+ let current = node;
88
+ while (current.getRootNode() !== other.getRootNode() && current.getRootNode() instanceof ShadowRoot) {
89
+ current = current.getRootNode().host;
90
+ }
91
+ return current;
92
+ }
93
+ /**
94
+ * Where `node` sits relative to `ref`, as `compareDocumentPosition` reports it. Whichever of the two
95
+ * is inside a shadow root is lifted to its host first, so a control inside a component compares too.
96
+ */
97
+ function positionAcrossTrees(ref, node) {
98
+ const lifted = liftToTreeOf(node, ref);
99
+ return liftToTreeOf(ref, lifted).compareDocumentPosition(lifted);
100
+ }
101
+ const isPosition = (position, flag) => (position & Node.DOCUMENT_POSITION_DISCONNECTED) === 0 && (position & flag) !== 0;
102
+ /** The popover each panel belongs to, so a popover inside another one's panel can find it. */
103
+ const panelOwners = new WeakMap();
104
+ /** Floating layers Pine components put at the end of the page or of a dialog, as a popover does its panel. */
105
+ const FLOATING_LAYERS = '.pds-popover, .pds-datepicker-calendar-portal, .pds-combobox-dropdown-portal';
61
106
  const PdsPopover = class {
62
107
  constructor(hostRef) {
63
108
  registerInstance(this, hostRef);
@@ -93,14 +138,21 @@ const PdsPopover = class {
93
138
  */
94
139
  this.portalEl = null;
95
140
  /**
96
- * Guard to prevent repositioning loops
141
+ * Stops floating-ui's autoUpdate, which repositions the open panel as its trigger or the page moves or resizes
142
+ */
143
+ this.stopAutoUpdate = null;
144
+ /**
145
+ * Counts positioning runs, so a run that resolves after a newer one started is dropped
97
146
  */
98
- this.isRepositioning = false;
147
+ this.positioningRun = 0;
99
148
  /**
100
- * Debounce timers for performance optimization
149
+ * The latest positioning run, which pdsPopoverOpen waits for so the panel's side is set when it fires
101
150
  */
102
- this.scrollDebounceTimer = null;
103
- this.resizeDebounceTimer = null;
151
+ this.positioning = Promise.resolve();
152
+ /**
153
+ * Set while show() waits to emit pdsPopoverOpen, so a hide() in the meantime emits it first
154
+ */
155
+ this.openEventPending = false;
104
156
  /**
105
157
  * Track moved nodes and their placeholders for restoration
106
158
  */
@@ -109,11 +161,41 @@ const PdsPopover = class {
109
161
  * Timestamp when popover was opened (for preventing immediate close)
110
162
  */
111
163
  this.openTimestamp = 0;
164
+ /**
165
+ * Set while hover holds the popover open, until a click pins it or it closes
166
+ */
167
+ this.hoverOpened = false;
168
+ /**
169
+ * Set when the pointer left while focus was in the panel, so focus leaving it closes it instead
170
+ */
171
+ this.closeWhenFocusLeaves = false;
172
+ /**
173
+ * How far the pointer was from the panel at its last move after leaving the trigger
174
+ */
175
+ this.panelDistance = Infinity;
176
+ /**
177
+ * Stands in for the panel in the Tab order, right after the trigger, while the popover is open
178
+ */
179
+ this.tabGuardEl = null;
180
+ /**
181
+ * Set while focus passes through the guard on its way out of the panel
182
+ */
183
+ this.leavingPanel = false;
184
+ /**
185
+ * The direction of the Tab key being handled, until its default action has run
186
+ */
187
+ this.tabDirection = null;
112
188
  /**
113
189
  * Determines the action that triggers the popover. For manual popovers, the consumer is responsible for toggling this value.
114
190
  * @defaultValue "show"
115
191
  */
116
192
  this.popoverTargetAction = 'show';
193
+ /**
194
+ * Determines how the popover opens. With `hover`, it also opens when the pointer rests on the trigger and closes
195
+ * when the pointer leaves, until a click on the trigger keeps it open. Enter or Space on the trigger opens it either way.
196
+ * @defaultValue "click"
197
+ */
198
+ this.openOn = 'click';
117
199
  /**
118
200
  * Determines the type of popover. Auto popovers can be "light dismissed" by clicking outside of the popover.
119
201
  * Manual popovers require the consumer to handle the visibility of the popover.
@@ -124,6 +206,11 @@ const PdsPopover = class {
124
206
  * @defaultValue 352
125
207
  */
126
208
  this.maxWidth = 352;
209
+ /**
210
+ * Sets the padding of the popover content
211
+ * @defaultValue "md"
212
+ */
213
+ this.padding = 'md';
127
214
  /**
128
215
  * Determines the preferred position of the popover
129
216
  * @defaultValue "right"
@@ -138,6 +225,7 @@ const PdsPopover = class {
138
225
  // Clean up previous trigger's event listener if it exists
139
226
  if (this.triggerEl != null) {
140
227
  this.triggerEl.removeEventListener('click', this.handleTriggerClick);
228
+ this.stopListeningForHover(this.triggerEl);
141
229
  }
142
230
  if (assignedElements.length > 0) {
143
231
  // Use the first assigned element as the trigger
@@ -145,10 +233,14 @@ const PdsPopover = class {
145
233
  this.linkTriggerToPortal();
146
234
  // Attach click listener to handle popover visibility
147
235
  this.triggerEl.addEventListener('click', this.handleTriggerClick);
236
+ this.listenForHover(this.triggerEl);
148
237
  }
149
238
  else {
150
239
  this.triggerEl = null;
151
240
  }
241
+ // autoUpdate watches the trigger it started with, so an open popover starts it again on the new one.
242
+ if (this.active)
243
+ this.addScrollAndResizeListeners();
152
244
  this.observeTrigger();
153
245
  };
154
246
  /**
@@ -171,6 +263,13 @@ const PdsPopover = class {
171
263
  if (!anchorWithHref) {
172
264
  event.preventDefault();
173
265
  }
266
+ if (this.openOn === 'hover' && this.popoverTargetAction !== 'hide') {
267
+ const heldByHover = this.hoverOpened;
268
+ this.pin();
269
+ // Pinning, not toggling: the hover before a click has already opened it.
270
+ if (heldByHover)
271
+ return;
272
+ }
174
273
  // Execute the appropriate action based on popoverTargetAction prop
175
274
  switch (this.popoverTargetAction) {
176
275
  case 'show':
@@ -185,6 +284,60 @@ const PdsPopover = class {
185
284
  break;
186
285
  }
187
286
  };
287
+ // A tap sends touch pointer events and then a click, so touch takes the click path alone.
288
+ this.handleHoverEnter = (event) => {
289
+ if (event.pointerType === 'touch')
290
+ return;
291
+ this.clearHoverTimers();
292
+ if (this.active)
293
+ return;
294
+ this.hoverOpenTimer = setTimeout(() => {
295
+ this.hoverOpenTimer = undefined;
296
+ if (this.active || this.portalEl == null)
297
+ return;
298
+ this.hoverOpened = true;
299
+ this.show();
300
+ }, HOVER_OPEN_DELAY_MS);
301
+ };
302
+ this.handleHoverLeave = (event) => {
303
+ if (event.pointerType === 'touch')
304
+ return;
305
+ this.clearHoverTimers();
306
+ if (!this.hoverOpened)
307
+ return;
308
+ this.hoverCloseTimer = setTimeout(this.closeFromHover, HOVER_CLOSE_DELAY_MS);
309
+ if (event.currentTarget !== this.triggerEl)
310
+ return;
311
+ this.panelDistance = this.distanceToPanel(event);
312
+ document.addEventListener('pointermove', this.handleMoveTowardPanel);
313
+ };
314
+ // A slow diagonal from the trigger to a panel shorter than it runs beside the panel for longer
315
+ // than the close delay, so each move that brings the pointer closer starts the delay again.
316
+ this.handleMoveTowardPanel = (event) => {
317
+ const distance = this.distanceToPanel(event);
318
+ if (distance < this.panelDistance) {
319
+ clearTimeout(this.hoverCloseTimer);
320
+ this.hoverCloseTimer = setTimeout(this.closeFromHover, HOVER_CLOSE_DELAY_MS);
321
+ }
322
+ this.panelDistance = distance;
323
+ };
324
+ this.handleHoverFocusOut = (event) => {
325
+ if (!this.closeWhenFocusLeaves || containsComposed(this.portalEl, event.relatedTarget))
326
+ return;
327
+ this.closeWhenFocusLeaves = false;
328
+ this.hoverCloseTimer = setTimeout(this.closeFromHover, HOVER_CLOSE_DELAY_MS);
329
+ };
330
+ this.closeFromHover = () => {
331
+ this.clearHoverTimers();
332
+ if (!this.hoverOpened)
333
+ return;
334
+ // Content shown on hover stays while focus is in it (WCAG 1.4.13).
335
+ if (containsComposed(this.portalEl, deepActiveElement())) {
336
+ this.closeWhenFocusLeaves = true;
337
+ return;
338
+ }
339
+ this.hide();
340
+ };
188
341
  /** The focus style copied into a shadow root the panel opened in, which `document.head` can't reach. */
189
342
  this.shadowFocusStyle = null;
190
343
  /** The dialog the panel was opened in, closed along with it. */
@@ -205,6 +358,85 @@ const PdsPopover = class {
205
358
  event.stopPropagation();
206
359
  }
207
360
  };
361
+ // At the end of the body or of a dialog, the panel would come last in the Tab order. The guard
362
+ // after the trigger takes its place there, while the panel has a control for it to lead to.
363
+ this.syncTabGuard = (event) => {
364
+ if (event.key !== 'Tab')
365
+ return;
366
+ this.releasePanel();
367
+ this.tabDirection = event.shiftKey ? 'backward' : 'forward';
368
+ setTimeout(this.endTabKey);
369
+ // Read on each Tab, as the panel's content can arrive after it opens.
370
+ const guarding = this.guardedTabbables().length > 0;
371
+ if (this.tabGuardEl != null)
372
+ this.tabGuardEl.tabIndex = guarding ? 0 : -1;
373
+ // Inert for this key press, the panel is reached only through the guard, either way round. A
374
+ // control in another floating layer, such as a nested popover's panel, may move focus back into it.
375
+ const focused = deepActiveElement();
376
+ if (guarding && !containsComposed(this.portalEl, focused) && !closest(FLOATING_LAYERS, focused !== null && focused !== void 0 ? focused : document)) {
377
+ this.portalEl.inert = true;
378
+ }
379
+ };
380
+ this.endTabKey = () => {
381
+ this.tabDirection = null;
382
+ this.releasePanel();
383
+ };
384
+ this.handleTabGuardFocus = (event) => {
385
+ if (this.leavingPanel)
386
+ return;
387
+ // An inert panel's controls aren't tabbable, so the guard would find none to send focus to.
388
+ this.releasePanel();
389
+ const tabbables = this.guardedTabbables();
390
+ // A Tab press says which end of the panel focus comes in at; without one, where it came from does.
391
+ const from = event.relatedTarget;
392
+ const backward = this.tabDirection != null ? this.tabDirection === 'backward' : from != null && this.isAfterPopover(from);
393
+ const target = backward ? tabbables[tabbables.length - 1] : tabbables[0];
394
+ // Focus can reach the guard without a Tab keydown here (from a frame, or assistive tech) after
395
+ // the panel's controls are gone. The trigger is the nearest visible place for it.
396
+ if (target == null)
397
+ this.returnFocusToTrigger();
398
+ else
399
+ target.focus();
400
+ };
401
+ this.handleTabFromPanel = (event) => {
402
+ if (event.key !== 'Tab' || event.defaultPrevented || this.tabGuardEl == null)
403
+ return;
404
+ const tabbables = this.guardedTabbables();
405
+ const edge = event.shiftKey ? tabbables[0] : tabbables[tabbables.length - 1];
406
+ if (edge == null || deepActiveElement() !== edge)
407
+ return;
408
+ this.leavePanel(edge, event.shiftKey);
409
+ };
410
+ this.releasePanel = () => {
411
+ if (this.portalEl != null)
412
+ this.portalEl.inert = false;
413
+ };
414
+ }
415
+ openOnChanged() {
416
+ this.pin();
417
+ this.stopListeningForHover(this.triggerEl);
418
+ this.stopListeningForHover(this.portalEl);
419
+ // Out of the page, connectedCallback binds them when it comes back.
420
+ if (!this.isComponentMounted)
421
+ return;
422
+ this.listenForHover(this.triggerEl);
423
+ this.listenForHover(this.portalEl);
424
+ }
425
+ applyPadding() {
426
+ if (this.portalEl != null)
427
+ this.portalEl.style.padding = this.paddingToken();
428
+ }
429
+ paddingToken() {
430
+ switch (this.padding) {
431
+ case 'none':
432
+ return 'var(--pine-dimension-none)';
433
+ case 'xs':
434
+ return 'var(--pine-dimension-xs)';
435
+ case 'sm':
436
+ return 'var(--pine-dimension-sm)';
437
+ default:
438
+ return 'var(--pine-dimension-md)';
439
+ }
208
440
  }
209
441
  restorePlacementDefault(newValue) {
210
442
  this.placement = restoreReflectedDefault(this.el, 'placement', newValue, 'right');
@@ -214,8 +446,6 @@ const PdsPopover = class {
214
446
  // Bind event handlers for cleanup
215
447
  this.boundClickOutsideHandler = this.handleClickOutside.bind(this);
216
448
  this.boundEscapeKeyHandler = this.handleEscapeKey.bind(this);
217
- this.boundScrollHandler = this.handleScroll.bind(this);
218
- this.boundResizeHandler = this.handleResize.bind(this);
219
449
  // Create portal element
220
450
  this.createPortal();
221
451
  this.hasLoaded = true;
@@ -256,6 +486,48 @@ const PdsPopover = class {
256
486
  // Skips values already in place, so the trigger observer's own callback doesn't loop.
257
487
  return setAttributesIfChanged(this.triggerEl, { 'aria-expanded': String(this.active), 'aria-controls': this.portalEl.id });
258
488
  }
489
+ listenForHover(el) {
490
+ if (this.openOn !== 'hover' || el == null)
491
+ return;
492
+ el.addEventListener('pointerenter', this.handleHoverEnter);
493
+ el.addEventListener('pointerleave', this.handleHoverLeave);
494
+ el.addEventListener('focusout', this.handleHoverFocusOut);
495
+ }
496
+ stopListeningForHover(el) {
497
+ if (el == null)
498
+ return;
499
+ el.removeEventListener('pointerenter', this.handleHoverEnter);
500
+ el.removeEventListener('pointerleave', this.handleHoverLeave);
501
+ el.removeEventListener('focusout', this.handleHoverFocusOut);
502
+ }
503
+ distanceToPanel({ clientX, clientY }) {
504
+ const panel = this.portalEl.getBoundingClientRect();
505
+ return Math.hypot(Math.max(panel.left - clientX, 0, clientX - panel.right), Math.max(panel.top - clientY, 0, clientY - panel.bottom));
506
+ }
507
+ /**
508
+ * Keeps a popover that hover opened open, closing from then on as one opened by a click does. A
509
+ * manual one gives up Escape again, which it took only while hover held it.
510
+ */
511
+ pin() {
512
+ var _a;
513
+ this.clearHoverTimers();
514
+ if (!this.hoverOpened)
515
+ return;
516
+ this.hoverOpened = false;
517
+ if (this.popoverType === 'auto')
518
+ return;
519
+ this.forgetOpen();
520
+ (_a = this.portalEl) === null || _a === void 0 ? void 0 : _a.removeAttribute('data-pds-popover-open');
521
+ document.removeEventListener('keydown', this.boundEscapeKeyHandler);
522
+ }
523
+ clearHoverTimers() {
524
+ clearTimeout(this.hoverOpenTimer);
525
+ clearTimeout(this.hoverCloseTimer);
526
+ this.hoverOpenTimer = undefined;
527
+ this.hoverCloseTimer = undefined;
528
+ this.closeWhenFocusLeaves = false;
529
+ document.removeEventListener('pointermove', this.handleMoveTowardPanel);
530
+ }
259
531
  // componentDidLoad doesn't run again when a popover comes back, so rebuild whatever
260
532
  // disconnectedCallback tore down. Each step is a no-op when nothing was.
261
533
  connectedCallback() {
@@ -265,17 +537,19 @@ const PdsPopover = class {
265
537
  this.isComponentMounted = true;
266
538
  this.createPortal();
267
539
  (_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.addEventListener('click', this.handleTriggerClick);
540
+ this.listenForHover(this.triggerEl);
268
541
  this.observeTrigger();
269
542
  this.linkTriggerToPortal();
270
543
  // Still open after a move: the trigger moved, so the portal follows it, into the dialog it
271
544
  // is in now, if any.
272
545
  if (this.active) {
273
546
  this.placePortal();
274
- requestAnimationFrame(() => this.handlePopoverPositioning());
547
+ // autoUpdate listens to the scroll containers around where the trigger was, so it starts again.
548
+ this.addScrollAndResizeListeners();
275
549
  }
276
550
  }
277
551
  disconnectedCallback() {
278
- var _a;
552
+ var _a, _b;
279
553
  // Moved in one operation (a DOM morph, or a framework reparenting it), the popover is
280
554
  // already back in the page. Its portal is outside the popover, so it stays open, with focus
281
555
  // where it was; connectedCallback moves it to follow the popover.
@@ -290,6 +564,7 @@ const PdsPopover = class {
290
564
  this.restorePortalContent();
291
565
  this.active = false;
292
566
  this.linkTriggerToPortal();
567
+ this.emitOpenEvent();
293
568
  this.pdsPopoverClose.emit({
294
569
  componentId: this.componentId,
295
570
  popoverType: this.popoverType,
@@ -299,36 +574,27 @@ const PdsPopover = class {
299
574
  if (this.triggerEl != null) {
300
575
  this.triggerEl.removeEventListener('click', this.handleTriggerClick);
301
576
  }
577
+ this.stopListeningForHover(this.triggerEl);
302
578
  (_a = this.triggerObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
303
579
  this.triggerObserver = null;
304
580
  // Clean up all event listeners
305
581
  this.removeLightDismissListeners();
306
582
  this.removeScrollAndResizeListeners();
307
583
  document.removeEventListener('submit', this.handleSubmitFromPanel, true);
308
- // Clear any pending debounce timers
309
- this.clearDebounceTimers();
584
+ document.removeEventListener('keydown', this.syncTabGuard, true);
585
+ (_b = this.tabGuardEl) === null || _b === void 0 ? void 0 : _b.removeAttribute('tabindex');
586
+ this.clearHoverTimers();
587
+ this.hoverOpened = false;
310
588
  // Remove portal from DOM
311
589
  this.removePortal();
312
590
  }
313
- /**
314
- * Clears any pending debounce timers
315
- */
316
- clearDebounceTimers() {
317
- if (this.scrollDebounceTimer !== null) {
318
- clearTimeout(this.scrollDebounceTimer);
319
- this.scrollDebounceTimer = null;
320
- }
321
- if (this.resizeDebounceTimer !== null) {
322
- clearTimeout(this.resizeDebounceTimer);
323
- this.resizeDebounceTimer = null;
324
- }
325
- }
326
591
  createPortal() {
327
592
  var _a;
328
593
  if (this.portalEl !== null)
329
594
  return;
330
595
  this.portalEl = document.createElement('div');
331
596
  this.portalEl.className = 'pds-popover';
597
+ panelOwners.set(this.portalEl, this);
332
598
  // Apply all styles inline since portal is outside shadow DOM
333
599
  this.portalEl.style.position = 'fixed';
334
600
  this.portalEl.style.zIndex = 'var(--pine-z-index-raised)';
@@ -340,7 +606,7 @@ const PdsPopover = class {
340
606
  this.portalEl.style.borderRadius = 'var(--pine-dimension-125)';
341
607
  this.portalEl.style.boxShadow = 'var(--pine-box-shadow-200)';
342
608
  this.portalEl.style.margin = 'var(--pine-dimension-none)';
343
- this.portalEl.style.padding = 'var(--pine-dimension-md)';
609
+ this.portalEl.style.padding = this.paddingToken();
344
610
  // Generate unique ID
345
611
  if (!this.componentId) {
346
612
  (_a = this.generatedPortalId) !== null && _a !== void 0 ? _a : (this.generatedPortalId = `pds-popover-portal-${PdsPopover.instanceCounter++}`);
@@ -354,6 +620,8 @@ const PdsPopover = class {
354
620
  // Add global focus styles to match Pine design system
355
621
  // This is done after appending to ensure it's part of the document and can access CSS variables
356
622
  this.addPortalFocusStyles();
623
+ this.listenForHover(this.portalEl);
624
+ this.portalEl.addEventListener('keydown', this.handleTabFromPanel);
357
625
  }
358
626
  /**
359
627
  * Adds Pine design system focus styles and dark mode border to the portal element
@@ -481,27 +749,40 @@ const PdsPopover = class {
481
749
  // Update portal content with latest slot content
482
750
  this.updatePortalContent();
483
751
  // Show portal. The attribute tells a modal around it that this popover takes Escape first; only
484
- // an auto popover listens for Escape.
485
- if (this.popoverType === 'auto')
752
+ // an auto popover, or one hover opened, listens for Escape.
753
+ if (this.popoverType === 'auto' || this.hoverOpened)
486
754
  this.portalEl.setAttribute('data-pds-popover-open', '');
487
755
  this.portalEl.style.display = 'block';
488
756
  this.portalEl.style.opacity = '1';
489
757
  this.portalEl.style.visibility = 'visible';
490
- // Position the popover
491
- requestAnimationFrame(() => {
492
- if (!this.isComponentMounted)
493
- return;
494
- this.handlePopoverPositioning();
495
- });
496
- // Add scroll and resize listeners for repositioning (always)
758
+ // Position the popover now, and again whenever its trigger or the page moves or resizes
497
759
  this.addScrollAndResizeListeners();
498
760
  document.addEventListener('submit', this.handleSubmitFromPanel, true);
499
- // Add document listeners for light dismiss and escape key (auto type only)
761
+ document.addEventListener('keydown', this.syncTabGuard, true);
762
+ // Add document listeners for light dismiss and escape key (auto type only), or for the escape
763
+ // key alone while hover holds a manual popover open
500
764
  if (this.popoverType === 'auto') {
501
- openAutoPopovers.push(this);
765
+ popoversTakingEscape.push(this);
502
766
  this.addLightDismissListeners();
503
767
  }
504
- // Emit open event
768
+ else if (this.hoverOpened) {
769
+ popoversTakingEscape.push(this);
770
+ document.addEventListener('keydown', this.boundEscapeKeyHandler);
771
+ }
772
+ // Emit open event once the panel is positioned, with the side it took already on it. A reconnect, a
773
+ // trigger swap or another show() can start a newer run meanwhile, which drops this one, so wait for the latest.
774
+ this.openEventPending = true;
775
+ let positioning;
776
+ do {
777
+ positioning = this.positioning;
778
+ await positioning;
779
+ } while (positioning !== this.positioning);
780
+ this.emitOpenEvent();
781
+ }
782
+ emitOpenEvent() {
783
+ if (!this.openEventPending)
784
+ return;
785
+ this.openEventPending = false;
505
786
  this.pdsPopoverOpen.emit({
506
787
  componentId: this.componentId,
507
788
  popoverType: this.popoverType,
@@ -511,9 +792,12 @@ const PdsPopover = class {
511
792
  * Closes the popover programmatically
512
793
  */
513
794
  async hide() {
795
+ var _a;
796
+ this.clearHoverTimers();
514
797
  if (!this.active || !this.portalEl)
515
798
  return;
516
799
  this.active = false;
800
+ this.hoverOpened = false;
517
801
  this.unwatchDialogClose();
518
802
  // Restoring the content drops its focus to the body, so check where focus is first. In a
519
803
  // shadow root, document.activeElement is only its host.
@@ -524,6 +808,7 @@ const PdsPopover = class {
524
808
  // Hide portal. The dark-mode border set in a shadow root is worked out again on the next open.
525
809
  this.portalEl.style.border = '';
526
810
  this.portalEl.removeAttribute('data-pds-popover-open');
811
+ this.portalEl.removeAttribute('data-pds-popover-placement');
527
812
  this.portalEl.style.display = 'none';
528
813
  this.portalEl.style.opacity = '0';
529
814
  this.portalEl.style.visibility = 'hidden';
@@ -537,8 +822,11 @@ const PdsPopover = class {
537
822
  this.removeLightDismissListeners();
538
823
  this.removeScrollAndResizeListeners();
539
824
  document.removeEventListener('submit', this.handleSubmitFromPanel, true);
540
- // Clear any pending timers
541
- this.clearDebounceTimers();
825
+ document.removeEventListener('keydown', this.syncTabGuard, true);
826
+ (_a = this.tabGuardEl) === null || _a === void 0 ? void 0 : _a.removeAttribute('tabindex');
827
+ this.releasePanel();
828
+ // Closed before its first position resolved, it still announces the open before the close.
829
+ this.emitOpenEvent();
542
830
  // Emit close event
543
831
  this.pdsPopoverClose.emit({
544
832
  componentId: this.componentId,
@@ -550,10 +838,10 @@ const PdsPopover = class {
550
838
  */
551
839
  async toggle() {
552
840
  if (this.active) {
553
- this.hide();
841
+ await this.hide();
554
842
  }
555
843
  else {
556
- this.show();
844
+ await this.show();
557
845
  }
558
846
  }
559
847
  /**
@@ -592,9 +880,9 @@ const PdsPopover = class {
592
880
  this.portalEl.style.border = root instanceof ShadowRoot && closest('[data-theme="dark"]', this.el) ? 'var(--pine-border)' : '';
593
881
  }
594
882
  forgetOpen() {
595
- const index = openAutoPopovers.indexOf(this);
883
+ const index = popoversTakingEscape.indexOf(this);
596
884
  if (index >= 0)
597
- openAutoPopovers.splice(index, 1);
885
+ popoversTakingEscape.splice(index, 1);
598
886
  }
599
887
  /**
600
888
  * Whether an Escape is this popover's. One from a dialog the popover isn't in belongs to that
@@ -637,19 +925,62 @@ const PdsPopover = class {
637
925
  document.removeEventListener('click', this.boundClickOutsideHandler, true);
638
926
  document.removeEventListener('keydown', this.boundEscapeKeyHandler);
639
927
  }
928
+ /**
929
+ * The panel's controls that Tab reaches through the guard. None when the panel sits right after
930
+ * the popover, in a dialog, where it's already next in the Tab order.
931
+ */
932
+ guardedTabbables() {
933
+ if (this.portalEl == null || this.el.nextElementSibling === this.portalEl)
934
+ return [];
935
+ return tabbableIn(this.portalEl);
936
+ }
937
+ isAfterPopover(node) {
938
+ if (containsComposed(this.el, node))
939
+ return false;
940
+ return isPosition(positionAcrossTrees(this.el, node), Node.DOCUMENT_POSITION_FOLLOWING);
941
+ }
942
+ /**
943
+ * Moves focus to the guard without preventing the Tab, so the browser's Tab carries on from there.
944
+ * Inert until then, the panel can't be where it lands.
945
+ */
946
+ leavePanel(edge, backward) {
947
+ var _a, _b;
948
+ this.leavingPanel = true;
949
+ (_a = this.tabGuardEl) === null || _a === void 0 ? void 0 : _a.focus();
950
+ this.leavingPanel = false;
951
+ this.portalEl.inert = true;
952
+ setTimeout(() => this.finishLeavingPanel(edge));
953
+ // Last in another popover's panel, the guard hands the Tab on to that popover's own guard.
954
+ const outer = panelOwners.get(closest('.pds-popover', this.el));
955
+ const outerTabbables = (_b = outer === null || outer === void 0 ? void 0 : outer.guardedTabbables()) !== null && _b !== void 0 ? _b : [];
956
+ if (!backward && outerTabbables[outerTabbables.length - 1] === this.tabGuardEl)
957
+ outer.leavePanel(edge, false);
958
+ }
959
+ // With nowhere for the browser's Tab to go, focus would stay on the invisible guard.
960
+ finishLeavingPanel(edge) {
961
+ var _a;
962
+ this.releasePanel();
963
+ if (this.active && ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) === this.tabGuardEl)
964
+ edge.focus();
965
+ }
640
966
  /**
641
967
  * Adds scroll and resize listeners for repositioning
642
968
  */
643
969
  addScrollAndResizeListeners() {
644
- window.addEventListener('scroll', this.boundScrollHandler, true);
645
- window.addEventListener('resize', this.boundResizeHandler);
970
+ this.removeScrollAndResizeListeners();
971
+ if (this.triggerEl == null || this.portalEl == null)
972
+ return;
973
+ this.stopAutoUpdate = autoUpdate(this.triggerEl, this.portalEl, () => {
974
+ this.positioning = this.handlePopoverPositioning().catch(error => console.warn('pds-popover: failed to position the panel', error));
975
+ });
646
976
  }
647
977
  /**
648
978
  * Removes scroll and resize listeners
649
979
  */
650
980
  removeScrollAndResizeListeners() {
651
- window.removeEventListener('scroll', this.boundScrollHandler, true);
652
- window.removeEventListener('resize', this.boundResizeHandler);
981
+ var _a;
982
+ (_a = this.stopAutoUpdate) === null || _a === void 0 ? void 0 : _a.call(this);
983
+ this.stopAutoUpdate = null;
653
984
  }
654
985
  /**
655
986
  * Handles clicks outside the popover for light dismiss (auto type only)
@@ -703,7 +1034,7 @@ const PdsPopover = class {
703
1034
  return;
704
1035
  // Like the native Popover API, Escape closes only the top popover: the last one opened that
705
1036
  // it applies to. Every open popover hears it, so each checks whether it's that one.
706
- const top = [...openAutoPopovers].reverse().find(popover => popover.takesEscapeFrom(event));
1037
+ const top = [...popoversTakingEscape].reverse().find(popover => popover.takesEscapeFrom(event));
707
1038
  if (top !== this)
708
1039
  return;
709
1040
  // Take the key, so the dialog or modal around it doesn't close too.
@@ -713,125 +1044,47 @@ const PdsPopover = class {
713
1044
  this.hide();
714
1045
  }
715
1046
  /**
716
- * Handles scroll events to reposition the popover (debounced for performance)
717
- */
718
- handleScroll() {
719
- if (!this.active)
720
- return;
721
- if (this.scrollDebounceTimer !== null) {
722
- clearTimeout(this.scrollDebounceTimer);
723
- }
724
- this.scrollDebounceTimer = setTimeout(() => {
725
- this.handlePopoverPositioning();
726
- this.scrollDebounceTimer = null;
727
- }, 10); // 10ms debounce for smooth repositioning
728
- }
729
- /**
730
- * Handles resize events to reposition the popover (debounced for performance)
1047
+ * Positions the popover relative to its trigger element, flipping to the opposite side when only that side has
1048
+ * room and shifting to stay 8px inside the viewport. The side it takes goes on the panel's `data-pds-popover-placement`.
731
1049
  */
732
- handleResize() {
733
- if (!this.active)
734
- return;
735
- if (this.resizeDebounceTimer !== null) {
736
- clearTimeout(this.resizeDebounceTimer);
737
- }
738
- this.resizeDebounceTimer = setTimeout(() => {
739
- this.handlePopoverPositioning();
740
- this.resizeDebounceTimer = null;
741
- }, 100); // 100ms debounce for resize
742
- }
743
- /**
744
- * Positions the popover relative to its trigger element
745
- */
746
- handlePopoverPositioning() {
747
- // Prevent repositioning loops
748
- if (this.isRepositioning) {
749
- return;
750
- }
751
- this.isRepositioning = true;
752
- if (this.triggerEl == null || this.portalEl == null) {
753
- this.isRepositioning = false;
1050
+ async handlePopoverPositioning() {
1051
+ // Counted before the guards, so a run still in flight is dropped even when this one can't position.
1052
+ const run = ++this.positioningRun;
1053
+ if (this.triggerEl == null || this.portalEl == null)
754
1054
  return;
755
- }
756
- const triggerRect = this.triggerEl.getBoundingClientRect();
757
- const popoverRect = this.portalEl.getBoundingClientRect();
758
1055
  // Safety check: ensure trigger has valid dimensions (is rendered and visible)
759
- if (triggerRect.width === 0 || triggerRect.height === 0) {
760
- this.isRepositioning = false;
1056
+ const triggerRect = this.triggerEl.getBoundingClientRect();
1057
+ if (triggerRect.width === 0 || triggerRect.height === 0)
761
1058
  return;
762
- }
763
- let top = 0;
764
- let left = 0;
765
- const offset = 8;
766
- switch (this.placement) {
767
- case 'top':
768
- top = triggerRect.top - popoverRect.height - offset;
769
- left = triggerRect.left + (triggerRect.width - popoverRect.width) / 2;
770
- break;
771
- case 'top-start':
772
- top = triggerRect.top - popoverRect.height - offset;
773
- left = triggerRect.left;
774
- break;
775
- case 'top-end':
776
- top = triggerRect.top - popoverRect.height - offset;
777
- left = triggerRect.right - popoverRect.width;
778
- break;
779
- case 'right':
780
- top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2;
781
- left = triggerRect.right + offset;
782
- break;
783
- case 'right-start':
784
- top = triggerRect.top;
785
- left = triggerRect.right + offset;
786
- break;
787
- case 'right-end':
788
- top = triggerRect.bottom - popoverRect.height;
789
- left = triggerRect.right + offset;
790
- break;
791
- case 'bottom':
792
- top = triggerRect.bottom + offset;
793
- left = triggerRect.left + (triggerRect.width - popoverRect.width) / 2;
794
- break;
795
- case 'bottom-start':
796
- top = triggerRect.bottom + offset;
797
- left = triggerRect.left;
798
- break;
799
- case 'bottom-end':
800
- top = triggerRect.bottom + offset;
801
- left = triggerRect.right - popoverRect.width;
802
- break;
803
- case 'left':
804
- top = triggerRect.top + (triggerRect.height - popoverRect.height) / 2;
805
- left = triggerRect.left - popoverRect.width - offset;
806
- break;
807
- case 'left-start':
808
- top = triggerRect.top;
809
- left = triggerRect.left - popoverRect.width - offset;
810
- break;
811
- case 'left-end':
812
- top = triggerRect.bottom - popoverRect.height;
813
- left = triggerRect.left - popoverRect.width - offset;
814
- break;
815
- }
816
- this.portalEl.style.top = `${top}px`;
817
- this.portalEl.style.left = `${left}px`;
1059
+ const portal = this.portalEl;
1060
+ const { x: left, y: top, placement } = await computePosition(this.triggerEl, portal, {
1061
+ placement: this.placement,
1062
+ strategy: 'fixed',
1063
+ // With no room on either side, stay on the preferred side: the side that overflows less can still push
1064
+ // a tall panel's start above the viewport.
1065
+ middleware: [offset(8), flip({ fallbackStrategy: 'initialPlacement' }), shift({ padding: 8 })],
1066
+ platform: viewportPlatform,
1067
+ });
1068
+ if (!this.active || run !== this.positioningRun || portal !== this.portalEl)
1069
+ return;
1070
+ portal.setAttribute('data-pds-popover-placement', placement);
818
1071
  // `position: fixed` measures from the viewport unless an ancestor becomes its containing block,
819
- // as a modal dialog does with its backdrop filter. Shift by however far it landed from the spot.
820
- const placed = this.portalEl.getBoundingClientRect();
821
- if (Math.abs(placed.top - top) > 0.5 || Math.abs(placed.left - left) > 0.5) {
822
- this.portalEl.style.top = `${2 * top - placed.top}px`;
823
- this.portalEl.style.left = `${2 * left - placed.left}px`;
824
- }
825
- // Reset the repositioning guard after a short delay
826
- setTimeout(() => {
827
- this.isRepositioning = false;
828
- }, 16); // ~1 frame at 60fps
1072
+ // as a modal dialog does with its backdrop filter. Offset by however far that block's corner is from the viewport's.
1073
+ const origin = containingBlockOrigin(portal);
1074
+ portal.style.top = `${top - origin.top}px`;
1075
+ portal.style.left = `${left - origin.left}px`;
829
1076
  }
830
1077
  render() {
831
- return (h(Host, { key: 'da8a0c715df1199231b1265085f3f9ae0234032d', id: this.componentId }, h("span", { key: 'f35023492399420829cec2e88556462f5ac1663e', class: "pds-popover__trigger-wrapper" }, h("slot", { key: '38ebe92eebb87665467b3f92ff94dc8095450063', name: "trigger", onSlotchange: this.handleTriggerSlotChange })), h("div", { key: '8917930f4520544d14bbd68b4c7936dd60af19e3', class: "pds-popover__content-slot-wrapper" }, h("slot", { key: '28d3f9112256edd95721a79a7072a9e35a3712bf', onSlotchange: this.handleContentSlotChange }))));
1078
+ return (h(Host, { key: '85422eb7544a4795ce78b51684b7224a5d856a4e', id: this.componentId }, h("span", { key: '6fe9c827ed4d46ca723d6013f296faf80ba31366', class: "pds-popover__trigger-wrapper" }, h("slot", { key: '970d1974d2be1451e670a36e7d2ccdc5979595bb', name: "trigger", onSlotchange: this.handleTriggerSlotChange })), h("span", { key: '0c76f76286a30d8e6e948bd0abab3317b3673aa6', class: "pds-popover__tab-guard", ref: (el) => (this.tabGuardEl = el !== null && el !== void 0 ? el : null), onFocus: this.handleTabGuardFocus }), h("div", { key: '692c45e93899e74a3d5970f3a3625f6115ab63b0', class: "pds-popover__content-slot-wrapper" }, h("slot", { key: 'f1566e0eb1eb08626f2a8285447702ce96b09f4d', onSlotchange: this.handleContentSlotChange }))));
832
1079
  }
833
1080
  get el() { return getElement(this); }
834
1081
  static get watchers() { return {
1082
+ "openOn": [{
1083
+ "openOnChanged": 0
1084
+ }],
1085
+ "padding": [{
1086
+ "applyPadding": 0
1087
+ }],
835
1088
  "placement": [{
836
1089
  "restorePlacementDefault": 0
837
1090
  }]