@payloadcms/ui 4.0.0-internal.40de3ec → 4.0.0-internal.4cbdd50

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 (562) hide show
  1. package/dist/css/colors.css +3 -0
  2. package/dist/css/design-tokens.css +5 -0
  3. package/dist/css/elevations.css +4 -0
  4. package/dist/css/radius.css +1 -3
  5. package/dist/css/theme.css +4 -0
  6. package/dist/css/utilities.css +5 -0
  7. package/dist/elements/APIKeyInput/index.css +92 -0
  8. package/dist/elements/APIKeyInput/index.d.ts +14 -0
  9. package/dist/elements/APIKeyInput/index.d.ts.map +1 -0
  10. package/dist/elements/APIKeyInput/index.js +86 -0
  11. package/dist/elements/APIKeyInput/index.js.map +1 -0
  12. package/dist/elements/AddNewRelation/index.d.ts.map +1 -1
  13. package/dist/elements/AddNewRelation/index.js +85 -103
  14. package/dist/elements/AddNewRelation/index.js.map +1 -1
  15. package/dist/elements/AppHeader/index.d.ts +3 -1
  16. package/dist/elements/AppHeader/index.d.ts.map +1 -1
  17. package/dist/elements/AppHeader/index.js +7 -27
  18. package/dist/elements/AppHeader/index.js.map +1 -1
  19. package/dist/elements/BulkUpload/ActionsBar/index.css +10 -4
  20. package/dist/elements/BulkUpload/ActionsBar/index.d.ts.map +1 -1
  21. package/dist/elements/BulkUpload/ActionsBar/index.js +43 -40
  22. package/dist/elements/BulkUpload/ActionsBar/index.js.map +1 -1
  23. package/dist/elements/BulkUpload/AddFilesView/index.js +1 -1
  24. package/dist/elements/BulkUpload/AddFilesView/index.js.map +1 -1
  25. package/dist/elements/BulkUpload/AddingFilesView/index.css +25 -0
  26. package/dist/elements/BulkUpload/AddingFilesView/index.d.ts +1 -1
  27. package/dist/elements/BulkUpload/AddingFilesView/index.d.ts.map +1 -1
  28. package/dist/elements/BulkUpload/AddingFilesView/index.js +1 -1
  29. package/dist/elements/BulkUpload/AddingFilesView/index.js.map +1 -1
  30. package/dist/elements/BulkUpload/EditForm/index.css +9 -0
  31. package/dist/elements/BulkUpload/EditForm/index.d.ts +1 -1
  32. package/dist/elements/BulkUpload/EditForm/index.d.ts.map +1 -1
  33. package/dist/elements/BulkUpload/EditForm/index.js +1 -1
  34. package/dist/elements/BulkUpload/EditForm/index.js.map +1 -1
  35. package/dist/elements/BulkUpload/EditMany/DrawerContent.d.ts +1 -1
  36. package/dist/elements/BulkUpload/EditMany/DrawerContent.d.ts.map +1 -1
  37. package/dist/elements/BulkUpload/EditMany/DrawerContent.js +59 -55
  38. package/dist/elements/BulkUpload/EditMany/DrawerContent.js.map +1 -1
  39. package/dist/elements/BulkUpload/EditMany/index.css +71 -0
  40. package/dist/elements/BulkUpload/EditMany/index.d.ts +1 -1
  41. package/dist/elements/BulkUpload/EditMany/index.d.ts.map +1 -1
  42. package/dist/elements/BulkUpload/EditMany/index.js +1 -1
  43. package/dist/elements/BulkUpload/EditMany/index.js.map +1 -1
  44. package/dist/elements/BulkUpload/FileSidebar/index.css +54 -75
  45. package/dist/elements/BulkUpload/FileSidebar/index.d.ts.map +1 -1
  46. package/dist/elements/BulkUpload/FileSidebar/index.js +60 -50
  47. package/dist/elements/BulkUpload/FileSidebar/index.js.map +1 -1
  48. package/dist/elements/BulkUpload/FormsManager/index.d.ts.map +1 -1
  49. package/dist/elements/BulkUpload/FormsManager/index.js +13 -0
  50. package/dist/elements/BulkUpload/FormsManager/index.js.map +1 -1
  51. package/dist/elements/Button/index.css +8 -0
  52. package/dist/elements/Card/index.css +1 -1
  53. package/dist/elements/CodeEditor/CodeEditor.d.ts.map +1 -1
  54. package/dist/elements/CodeEditor/CodeEditor.js +19 -0
  55. package/dist/elements/CodeEditor/CodeEditor.js.map +1 -1
  56. package/dist/elements/ColumnSelection/Popup.d.ts +12 -0
  57. package/dist/elements/ColumnSelection/Popup.d.ts.map +1 -0
  58. package/dist/elements/{ColumnSelector/index.js → ColumnSelection/Popup.js} +24 -13
  59. package/dist/elements/ColumnSelection/Popup.js.map +1 -0
  60. package/dist/elements/ColumnSelection/index.d.ts +10 -0
  61. package/dist/elements/ColumnSelection/index.d.ts.map +1 -0
  62. package/dist/elements/{ColumnsButton → ColumnSelection}/index.js +23 -17
  63. package/dist/elements/ColumnSelection/index.js.map +1 -0
  64. package/dist/elements/Combobox/index.css +1 -0
  65. package/dist/elements/ConfirmationModal/index.css +7 -0
  66. package/dist/elements/ConfirmationModal/index.d.ts +1 -0
  67. package/dist/elements/ConfirmationModal/index.d.ts.map +1 -1
  68. package/dist/elements/ConfirmationModal/index.js +7 -3
  69. package/dist/elements/ConfirmationModal/index.js.map +1 -1
  70. package/dist/elements/DeleteMany/index.d.ts +3 -26
  71. package/dist/elements/DeleteMany/index.d.ts.map +1 -1
  72. package/dist/elements/DeleteMany/index.js +1 -95
  73. package/dist/elements/DeleteMany/index.js.map +1 -1
  74. package/dist/elements/Dialog/DialogModal/index.d.ts +1 -1
  75. package/dist/elements/Dialog/DialogModal/index.d.ts.map +1 -1
  76. package/dist/elements/Dialog/DialogModal/index.js.map +1 -1
  77. package/dist/elements/Dialog/index.css +4 -0
  78. package/dist/elements/DocumentControls/index.css +17 -1
  79. package/dist/elements/DocumentControls/index.d.ts +6 -0
  80. package/dist/elements/DocumentControls/index.d.ts.map +1 -1
  81. package/dist/elements/DocumentControls/index.js +9 -8
  82. package/dist/elements/DocumentControls/index.js.map +1 -1
  83. package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
  84. package/dist/elements/DocumentDrawer/DrawerContent.js +10 -6
  85. package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
  86. package/dist/elements/DocumentDrawer/DrawerHeader/index.css +76 -4
  87. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts +7 -1
  88. package/dist/elements/DocumentDrawer/DrawerHeader/index.d.ts.map +1 -1
  89. package/dist/elements/DocumentDrawer/DrawerHeader/index.js +150 -87
  90. package/dist/elements/DocumentDrawer/DrawerHeader/index.js.map +1 -1
  91. package/dist/elements/DocumentDrawer/types.d.ts +1 -0
  92. package/dist/elements/DocumentDrawer/types.d.ts.map +1 -1
  93. package/dist/elements/DocumentDrawer/types.js.map +1 -1
  94. package/dist/elements/DocumentFields/index.css +61 -2
  95. package/dist/elements/DraggableSortable/index.js.map +1 -1
  96. package/dist/elements/Drawer/index.css +57 -26
  97. package/dist/elements/Drawer/index.d.ts +25 -0
  98. package/dist/elements/Drawer/index.d.ts.map +1 -1
  99. package/dist/elements/Drawer/index.js +133 -54
  100. package/dist/elements/Drawer/index.js.map +1 -1
  101. package/dist/elements/Drawer/types.d.ts +1 -0
  102. package/dist/elements/Drawer/types.d.ts.map +1 -1
  103. package/dist/elements/Drawer/types.js.map +1 -1
  104. package/dist/elements/EditMany/DrawerContent.d.ts +1 -1
  105. package/dist/elements/EditMany/DrawerContent.d.ts.map +1 -1
  106. package/dist/elements/EditMany/DrawerContent.js +76 -71
  107. package/dist/elements/EditMany/DrawerContent.js.map +1 -1
  108. package/dist/elements/EditMany/index.css +71 -0
  109. package/dist/elements/EditMany/index.d.ts +9 -11
  110. package/dist/elements/EditMany/index.d.ts.map +1 -1
  111. package/dist/elements/EditMany/index.js +2 -40
  112. package/dist/elements/EditMany/index.js.map +1 -1
  113. package/dist/elements/FieldSelect/index.css +3 -0
  114. package/dist/elements/FileDetails/DraggableFileDetails/index.css +32 -0
  115. package/dist/elements/FileDetails/DraggableFileDetails/index.d.ts +1 -1
  116. package/dist/elements/FileDetails/DraggableFileDetails/index.d.ts.map +1 -1
  117. package/dist/elements/FileDetails/DraggableFileDetails/index.js +19 -18
  118. package/dist/elements/FileDetails/DraggableFileDetails/index.js.map +1 -1
  119. package/dist/elements/GroupBy/Popup.d.ts +21 -0
  120. package/dist/elements/GroupBy/Popup.d.ts.map +1 -0
  121. package/dist/elements/GroupBy/Popup.js +269 -0
  122. package/dist/elements/GroupBy/Popup.js.map +1 -0
  123. package/dist/elements/GroupBy/index.d.ts +12 -0
  124. package/dist/elements/GroupBy/index.d.ts.map +1 -0
  125. package/dist/elements/GroupBy/index.js +91 -0
  126. package/dist/elements/GroupBy/index.js.map +1 -0
  127. package/dist/elements/Hierarchy/Drawer/index.css +3 -21
  128. package/dist/elements/Hierarchy/Drawer/index.d.ts.map +1 -1
  129. package/dist/elements/Hierarchy/Drawer/index.js +5 -3
  130. package/dist/elements/Hierarchy/Drawer/index.js.map +1 -1
  131. package/dist/elements/Hierarchy/Field/SelectedHierarchies.css +36 -0
  132. package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts +1 -1
  133. package/dist/elements/Hierarchy/Field/SelectedHierarchies.d.ts.map +1 -1
  134. package/dist/elements/Hierarchy/Field/SelectedHierarchies.js +1 -1
  135. package/dist/elements/Hierarchy/Field/SelectedHierarchies.js.map +1 -1
  136. package/dist/elements/Hierarchy/Field/index.client.d.ts +1 -1
  137. package/dist/elements/Hierarchy/Field/index.client.d.ts.map +1 -1
  138. package/dist/elements/Hierarchy/Field/index.client.js +5 -2
  139. package/dist/elements/Hierarchy/Field/index.client.js.map +1 -1
  140. package/dist/elements/Hierarchy/Field/index.css +37 -0
  141. package/dist/elements/Hierarchy/MoveMany/index.d.ts +0 -1
  142. package/dist/elements/Hierarchy/MoveMany/index.d.ts.map +1 -1
  143. package/dist/elements/Hierarchy/MoveMany/index.js +0 -1
  144. package/dist/elements/Hierarchy/MoveMany/index.js.map +1 -1
  145. package/dist/elements/Hierarchy/Tree/LoadMore/index.css +27 -0
  146. package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts +1 -1
  147. package/dist/elements/Hierarchy/Tree/LoadMore/index.d.ts.map +1 -1
  148. package/dist/elements/Hierarchy/Tree/LoadMore/index.js +1 -1
  149. package/dist/elements/Hierarchy/Tree/LoadMore/index.js.map +1 -1
  150. package/dist/elements/Hierarchy/Tree/TreeFocusContext.d.ts.map +1 -1
  151. package/dist/elements/Hierarchy/Tree/TreeFocusContext.js +36 -16
  152. package/dist/elements/Hierarchy/Tree/TreeFocusContext.js.map +1 -1
  153. package/dist/elements/Hierarchy/Tree/TreeNode/index.d.ts.map +1 -1
  154. package/dist/elements/Hierarchy/Tree/TreeNode/index.js +20 -15
  155. package/dist/elements/Hierarchy/Tree/TreeNode/index.js.map +1 -1
  156. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
  157. package/dist/elements/ListColumnSelectionButton/index.d.ts +11 -0
  158. package/dist/elements/ListColumnSelectionButton/index.d.ts.map +1 -0
  159. package/dist/elements/ListColumnSelectionButton/index.js +37 -0
  160. package/dist/elements/ListColumnSelectionButton/index.js.map +1 -0
  161. package/dist/elements/ListControls/index.css +5 -0
  162. package/dist/elements/ListControls/index.d.ts.map +1 -1
  163. package/dist/elements/ListControls/index.js +7 -7
  164. package/dist/elements/ListControls/index.js.map +1 -1
  165. package/dist/elements/ListDrawer/DrawerContent.d.ts.map +1 -1
  166. package/dist/elements/ListDrawer/DrawerContent.js +12 -6
  167. package/dist/elements/ListDrawer/DrawerContent.js.map +1 -1
  168. package/dist/elements/ListGroupByButton/index.d.ts +12 -0
  169. package/dist/elements/ListGroupByButton/index.d.ts.map +1 -0
  170. package/dist/elements/ListGroupByButton/index.js +55 -0
  171. package/dist/elements/ListGroupByButton/index.js.map +1 -0
  172. package/dist/elements/ListWhereBuilder/index.d.ts +16 -0
  173. package/dist/elements/ListWhereBuilder/index.d.ts.map +1 -0
  174. package/dist/elements/ListWhereBuilder/index.js +62 -0
  175. package/dist/elements/ListWhereBuilder/index.js.map +1 -0
  176. package/dist/elements/LoadMoreRow/index.css +34 -0
  177. package/dist/elements/LoadMoreRow/index.d.ts +1 -1
  178. package/dist/elements/LoadMoreRow/index.d.ts.map +1 -1
  179. package/dist/elements/LoadMoreRow/index.js +4 -8
  180. package/dist/elements/LoadMoreRow/index.js.map +1 -1
  181. package/dist/elements/Loading/index.css +28 -74
  182. package/dist/elements/Loading/index.d.ts.map +1 -1
  183. package/dist/elements/Loading/index.js +16 -60
  184. package/dist/elements/Loading/index.js.map +1 -1
  185. package/dist/elements/Localizer/index.d.ts.map +1 -1
  186. package/dist/elements/Localizer/index.js +3 -4
  187. package/dist/elements/Localizer/index.js.map +1 -1
  188. package/dist/elements/MenuSeparator/index.d.ts +4 -0
  189. package/dist/elements/MenuSeparator/index.d.ts.map +1 -0
  190. package/dist/elements/MenuSeparator/index.js +10 -0
  191. package/dist/elements/MenuSeparator/index.js.map +1 -0
  192. package/dist/elements/Nav/index.d.ts.map +1 -1
  193. package/dist/elements/Nav/index.js +4 -23
  194. package/dist/elements/Nav/index.js.map +1 -1
  195. package/dist/elements/Popup/PopupButtonList/index.css +48 -4
  196. package/dist/elements/Popup/PopupButtonList/index.d.ts.map +1 -1
  197. package/dist/elements/Popup/PopupButtonList/index.js +1 -0
  198. package/dist/elements/Popup/PopupButtonList/index.js.map +1 -1
  199. package/dist/elements/Popup/PopupGroupLabel/index.css +19 -4
  200. package/dist/elements/Popup/index.d.ts +7 -0
  201. package/dist/elements/Popup/index.d.ts.map +1 -1
  202. package/dist/elements/Popup/index.js +143 -63
  203. package/dist/elements/Popup/index.js.map +1 -1
  204. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts +13 -0
  205. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.d.ts.map +1 -0
  206. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js +41 -0
  207. package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.js.map +1 -0
  208. package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts +1 -0
  209. package/dist/elements/PublishButton/ScheduleDrawer/index.d.ts.map +1 -1
  210. package/dist/elements/PublishButton/ScheduleDrawer/index.js +9 -31
  211. package/dist/elements/PublishButton/ScheduleDrawer/index.js.map +1 -1
  212. package/dist/elements/PublishButton/index.d.ts.map +1 -1
  213. package/dist/elements/PublishButton/index.js +4 -5
  214. package/dist/elements/PublishButton/index.js.map +1 -1
  215. package/dist/elements/PublishMany/DrawerContent.d.ts +2 -1
  216. package/dist/elements/PublishMany/DrawerContent.d.ts.map +1 -1
  217. package/dist/elements/PublishMany/DrawerContent.js.map +1 -1
  218. package/dist/elements/PublishMany/index.d.ts +2 -6
  219. package/dist/elements/PublishMany/index.d.ts.map +1 -1
  220. package/dist/elements/PublishMany/index.js +0 -38
  221. package/dist/elements/PublishMany/index.js.map +1 -1
  222. package/dist/elements/QueryPresets/cells/ColumnsCell/{index.scss → index.css} +1 -3
  223. package/dist/elements/QueryPresets/cells/ColumnsCell/index.d.ts +1 -1
  224. package/dist/elements/QueryPresets/cells/ColumnsCell/index.d.ts.map +1 -1
  225. package/dist/elements/QueryPresets/cells/ColumnsCell/index.js +1 -1
  226. package/dist/elements/QueryPresets/cells/ColumnsCell/index.js.map +1 -1
  227. package/dist/elements/QueryPresets/fields/ColumnsField/index.d.ts +1 -1
  228. package/dist/elements/QueryPresets/fields/ColumnsField/index.d.ts.map +1 -1
  229. package/dist/elements/QueryPresets/fields/ColumnsField/index.js +77 -48
  230. package/dist/elements/QueryPresets/fields/ColumnsField/index.js.map +1 -1
  231. package/dist/elements/QueryPresets/fields/GroupByField/index.d.ts +1 -1
  232. package/dist/elements/QueryPresets/fields/GroupByField/index.d.ts.map +1 -1
  233. package/dist/elements/QueryPresets/fields/GroupByField/index.js +12 -21
  234. package/dist/elements/QueryPresets/fields/GroupByField/index.js.map +1 -1
  235. package/dist/elements/QueryPresets/fields/Heading/index.css +52 -0
  236. package/dist/elements/QueryPresets/fields/Heading/index.d.ts +7 -0
  237. package/dist/elements/QueryPresets/fields/Heading/index.d.ts.map +1 -0
  238. package/dist/elements/QueryPresets/fields/Heading/index.js +31 -0
  239. package/dist/elements/QueryPresets/fields/Heading/index.js.map +1 -0
  240. package/dist/elements/QueryPresets/fields/WhereField/index.d.ts +1 -1
  241. package/dist/elements/QueryPresets/fields/WhereField/index.d.ts.map +1 -1
  242. package/dist/elements/QueryPresets/fields/WhereField/index.js +24 -23
  243. package/dist/elements/QueryPresets/fields/WhereField/index.js.map +1 -1
  244. package/dist/elements/QueryPresets/fields/fields.css +23 -0
  245. package/dist/elements/ReactSelect/MultiValue/index.css +1 -1
  246. package/dist/elements/ReactSelect/getCaptureMenuScroll.d.ts +5 -0
  247. package/dist/elements/ReactSelect/getCaptureMenuScroll.d.ts.map +1 -0
  248. package/dist/elements/ReactSelect/getCaptureMenuScroll.js +10 -0
  249. package/dist/elements/ReactSelect/getCaptureMenuScroll.js.map +1 -0
  250. package/dist/elements/ReactSelect/getMenuListStyles.d.ts +6 -0
  251. package/dist/elements/ReactSelect/getMenuListStyles.d.ts.map +1 -0
  252. package/dist/elements/ReactSelect/getMenuListStyles.js +7 -0
  253. package/dist/elements/ReactSelect/getMenuListStyles.js.map +1 -0
  254. package/dist/elements/ReactSelect/index.css +0 -1
  255. package/dist/elements/ReactSelect/index.d.ts.map +1 -1
  256. package/dist/elements/ReactSelect/index.js +176 -139
  257. package/dist/elements/ReactSelect/index.js.map +1 -1
  258. package/dist/elements/ReactSelect/types.d.ts +1 -0
  259. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  260. package/dist/elements/ReactSelect/types.js.map +1 -1
  261. package/dist/elements/RelationshipTable/index.js +2 -2
  262. package/dist/elements/RelationshipTable/index.js.map +1 -1
  263. package/dist/elements/RenderTitle/index.css +10 -0
  264. package/dist/elements/RenderTitle/index.d.ts +5 -0
  265. package/dist/elements/RenderTitle/index.d.ts.map +1 -1
  266. package/dist/elements/RenderTitle/index.js +52 -27
  267. package/dist/elements/RenderTitle/index.js.map +1 -1
  268. package/dist/elements/SchedulePublishButton/index.d.ts.map +1 -1
  269. package/dist/elements/SchedulePublishButton/index.js +6 -1
  270. package/dist/elements/SchedulePublishButton/index.js.map +1 -1
  271. package/dist/elements/SelectMany/index.js +1 -1
  272. package/dist/elements/SelectMany/index.js.map +1 -1
  273. package/dist/elements/SortColumn/index.css +1 -1
  274. package/dist/elements/Spinner/index.css +16 -0
  275. package/dist/elements/Table/DefaultCell/fields/Blocks/index.d.ts.map +1 -1
  276. package/dist/elements/Table/DefaultCell/fields/Blocks/index.js.map +1 -1
  277. package/dist/elements/Table/OrderableRow.d.ts.map +1 -1
  278. package/dist/elements/Table/OrderableRow.js +1 -1
  279. package/dist/elements/Table/OrderableRow.js.map +1 -1
  280. package/dist/elements/Table/RelationshipProvider/index.d.ts.map +1 -1
  281. package/dist/elements/Table/RelationshipProvider/index.js +1 -0
  282. package/dist/elements/Table/RelationshipProvider/index.js.map +1 -1
  283. package/dist/elements/Table/index.css +39 -10
  284. package/dist/elements/Tabs/index.css +100 -0
  285. package/dist/elements/Tabs/index.d.ts +32 -0
  286. package/dist/elements/Tabs/index.d.ts.map +1 -0
  287. package/dist/elements/Tabs/index.js +62 -0
  288. package/dist/elements/Tabs/index.js.map +1 -0
  289. package/dist/elements/TimezonePicker/index.css +0 -15
  290. package/dist/elements/Toasts/fieldErrors.d.ts +1 -0
  291. package/dist/elements/Toasts/fieldErrors.d.ts.map +1 -1
  292. package/dist/elements/Toasts/fieldErrors.js +25 -9
  293. package/dist/elements/Toasts/fieldErrors.js.map +1 -1
  294. package/dist/elements/Toasts/index.css +5 -0
  295. package/dist/elements/Tooltip/index.css +20 -4
  296. package/dist/elements/Tooltip/index.d.ts.map +1 -1
  297. package/dist/elements/Tooltip/index.js +71 -3
  298. package/dist/elements/Tooltip/index.js.map +1 -1
  299. package/dist/elements/UnpublishButton/index.d.ts.map +1 -1
  300. package/dist/elements/UnpublishButton/index.js +5 -13
  301. package/dist/elements/UnpublishButton/index.js.map +1 -1
  302. package/dist/elements/UnpublishMany/DrawerContent.d.ts +2 -1
  303. package/dist/elements/UnpublishMany/DrawerContent.d.ts.map +1 -1
  304. package/dist/elements/UnpublishMany/DrawerContent.js.map +1 -1
  305. package/dist/elements/UnpublishMany/index.d.ts +2 -4
  306. package/dist/elements/UnpublishMany/index.d.ts.map +1 -1
  307. package/dist/elements/UnpublishMany/index.js +0 -38
  308. package/dist/elements/UnpublishMany/index.js.map +1 -1
  309. package/dist/elements/UserMenu/LanguageMenu/index.d.ts +6 -0
  310. package/dist/elements/UserMenu/LanguageMenu/index.d.ts.map +1 -0
  311. package/dist/elements/UserMenu/LanguageMenu/index.js +133 -0
  312. package/dist/elements/UserMenu/LanguageMenu/index.js.map +1 -0
  313. package/dist/elements/UserMenu/SettingsMenu/index.d.ts +15 -0
  314. package/dist/elements/UserMenu/SettingsMenu/index.d.ts.map +1 -0
  315. package/dist/elements/UserMenu/SettingsMenu/index.js +119 -0
  316. package/dist/elements/UserMenu/SettingsMenu/index.js.map +1 -0
  317. package/dist/elements/UserMenu/SubMenuHeader/index.d.ts +6 -0
  318. package/dist/elements/UserMenu/SubMenuHeader/index.d.ts.map +1 -0
  319. package/dist/elements/UserMenu/SubMenuHeader/index.js +34 -0
  320. package/dist/elements/UserMenu/SubMenuHeader/index.js.map +1 -0
  321. package/dist/elements/UserMenu/ThemeMenu/index.d.ts +6 -0
  322. package/dist/elements/UserMenu/ThemeMenu/index.d.ts.map +1 -0
  323. package/dist/elements/UserMenu/ThemeMenu/index.js +145 -0
  324. package/dist/elements/UserMenu/ThemeMenu/index.js.map +1 -0
  325. package/dist/elements/UserMenu/index.css +80 -0
  326. package/dist/elements/UserMenu/index.d.ts +10 -0
  327. package/dist/elements/UserMenu/index.d.ts.map +1 -0
  328. package/dist/elements/UserMenu/index.js +204 -0
  329. package/dist/elements/UserMenu/index.js.map +1 -0
  330. package/dist/elements/WhereBuilder/Condition/index.d.ts +1 -0
  331. package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
  332. package/dist/elements/WhereBuilder/Condition/index.js +17 -2
  333. package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
  334. package/dist/elements/WhereBuilder/index.d.ts +4 -3
  335. package/dist/elements/WhereBuilder/index.d.ts.map +1 -1
  336. package/dist/elements/WhereBuilder/index.js +71 -62
  337. package/dist/elements/WhereBuilder/index.js.map +1 -1
  338. package/dist/elements/WhereBuilder/types.d.ts +6 -5
  339. package/dist/elements/WhereBuilder/types.d.ts.map +1 -1
  340. package/dist/elements/WhereBuilder/types.js.map +1 -1
  341. package/dist/exports/client/index.d.ts +13 -0
  342. package/dist/exports/client/index.d.ts.map +1 -1
  343. package/dist/exports/client/index.js +2 -2
  344. package/dist/exports/client/index.js.map +3 -3
  345. package/dist/exports/shared/index.js +1 -1
  346. package/dist/exports/shared/index.js.map +1 -1
  347. package/dist/fields/Blocks/BlockSelector/BlockSearch/index.css +1 -49
  348. package/dist/fields/Blocks/BlockSelector/BlockSearch/index.d.ts.map +1 -1
  349. package/dist/fields/Blocks/BlockSelector/BlockSearch/index.js +27 -20
  350. package/dist/fields/Blocks/BlockSelector/BlockSearch/index.js.map +1 -1
  351. package/dist/fields/Blocks/BlockSelector/index.css +17 -3
  352. package/dist/fields/Blocks/BlockSelector/index.js +1 -1
  353. package/dist/fields/Blocks/BlockSelector/index.js.map +1 -1
  354. package/dist/fields/RadioGroup/index.css +6 -0
  355. package/dist/fields/Row/index.d.ts +1 -1
  356. package/dist/fields/Tabs/Tab/index.d.ts +0 -1
  357. package/dist/fields/Tabs/Tab/index.d.ts.map +1 -1
  358. package/dist/fields/Tabs/Tab/index.js +12 -23
  359. package/dist/fields/Tabs/Tab/index.js.map +1 -1
  360. package/dist/fields/Tabs/index.d.ts.map +1 -1
  361. package/dist/fields/Tabs/index.js +37 -37
  362. package/dist/fields/Tabs/index.js.map +1 -1
  363. package/dist/fields/Upload/HasMany/index.css +4 -0
  364. package/dist/forms/RenderFields/RenderField.d.ts +1 -1
  365. package/dist/forms/RenderFields/RenderField.js +2 -1
  366. package/dist/forms/RenderFields/RenderField.js.map +1 -1
  367. package/dist/forms/useField/index.js.map +1 -1
  368. package/dist/icons/Check/index.css +1 -2
  369. package/dist/icons/Check/index.js +1 -1
  370. package/dist/icons/Check/index.js.map +1 -1
  371. package/dist/icons/Gear/index.d.ts.map +1 -1
  372. package/dist/icons/Gear/index.js +8 -1
  373. package/dist/icons/Gear/index.js.map +1 -1
  374. package/dist/icons/InteractionEnter/index.css +5 -0
  375. package/dist/icons/InteractionEnter/index.d.ts +11 -0
  376. package/dist/icons/InteractionEnter/index.d.ts.map +1 -0
  377. package/dist/icons/InteractionEnter/index.js +25 -0
  378. package/dist/icons/InteractionEnter/index.js.map +1 -0
  379. package/dist/icons/{Write → Key}/index.css +1 -1
  380. package/dist/icons/Key/index.d.ts +7 -0
  381. package/dist/icons/Key/index.d.ts.map +1 -0
  382. package/dist/icons/Key/index.js +24 -0
  383. package/dist/icons/Key/index.js.map +1 -0
  384. package/dist/icons/LogOut/index.js +2 -2
  385. package/dist/icons/LogOut/index.js.map +1 -1
  386. package/dist/icons/Schedule/index.d.ts.map +1 -1
  387. package/dist/icons/Schedule/index.js +38 -39
  388. package/dist/icons/Schedule/index.js.map +1 -1
  389. package/dist/icons/VariableColor/index.css +5 -0
  390. package/dist/icons/VariableColor/index.d.ts +7 -0
  391. package/dist/icons/VariableColor/index.d.ts.map +1 -0
  392. package/dist/icons/VariableColor/index.js +23 -0
  393. package/dist/icons/VariableColor/index.js.map +1 -0
  394. package/dist/icons/Warning/index.css +1 -7
  395. package/dist/icons/Warning/index.d.ts +1 -1
  396. package/dist/icons/Warning/index.d.ts.map +1 -1
  397. package/dist/icons/Warning/index.js +11 -16
  398. package/dist/icons/Warning/index.js.map +1 -1
  399. package/dist/icons/WarningTriangle/index.css +5 -0
  400. package/dist/icons/WarningTriangle/index.d.ts +6 -0
  401. package/dist/icons/WarningTriangle/index.d.ts.map +1 -0
  402. package/dist/icons/WarningTriangle/index.js +21 -0
  403. package/dist/icons/WarningTriangle/index.js.map +1 -0
  404. package/dist/icons/Write/index.d.ts +0 -1
  405. package/dist/icons/Write/index.d.ts.map +1 -1
  406. package/dist/icons/Write/index.js +1 -2
  407. package/dist/icons/Write/index.js.map +1 -1
  408. package/dist/providers/Auth/index.d.ts +3 -1
  409. package/dist/providers/Auth/index.d.ts.map +1 -1
  410. package/dist/providers/Auth/index.js +8 -3
  411. package/dist/providers/Auth/index.js.map +1 -1
  412. package/dist/providers/Config/index.js.map +1 -1
  413. package/dist/providers/DocumentInfo/index.d.ts.map +1 -1
  414. package/dist/providers/DocumentInfo/index.js +4 -0
  415. package/dist/providers/DocumentInfo/index.js.map +1 -1
  416. package/dist/providers/DocumentInfo/types.d.ts +4 -0
  417. package/dist/providers/DocumentInfo/types.d.ts.map +1 -1
  418. package/dist/providers/DocumentInfo/types.js.map +1 -1
  419. package/dist/providers/Root/index.d.ts.map +1 -1
  420. package/dist/providers/Root/index.js +27 -24
  421. package/dist/providers/Root/index.js.map +1 -1
  422. package/dist/providers/TableColumns/RenderDefaultCell/index.css +1 -0
  423. package/dist/providers/Theme/index.d.ts.map +1 -1
  424. package/dist/providers/Theme/index.js +16 -14
  425. package/dist/providers/Theme/index.js.map +1 -1
  426. package/dist/providers/ToastContainer/index.css +208 -0
  427. package/dist/providers/ToastContainer/index.d.ts +1 -0
  428. package/dist/providers/ToastContainer/index.d.ts.map +1 -1
  429. package/dist/providers/ToastContainer/index.js +19 -6
  430. package/dist/providers/ToastContainer/index.js.map +1 -1
  431. package/dist/scss/app.scss +7 -2
  432. package/dist/styles.css +1361 -1
  433. package/dist/templates/Default/index.d.ts.map +1 -1
  434. package/dist/templates/Default/index.js +52 -2
  435. package/dist/templates/Default/index.js.map +1 -1
  436. package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +0 -1
  437. package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +1 -1
  438. package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -1
  439. package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
  440. package/dist/utilities/formatDocTitle/formatDateTitle.d.ts.map +1 -1
  441. package/dist/utilities/formatDocTitle/formatDateTitle.js +1 -1
  442. package/dist/utilities/formatDocTitle/formatDateTitle.js.map +1 -1
  443. package/dist/utilities/getHasScheduledPublish.d.ts +12 -0
  444. package/dist/utilities/getHasScheduledPublish.d.ts.map +1 -0
  445. package/dist/utilities/getHasScheduledPublish.js +38 -0
  446. package/dist/utilities/getHasScheduledPublish.js.map +1 -0
  447. package/dist/utilities/getVersions.d.ts.map +1 -1
  448. package/dist/utilities/getVersions.js +1 -21
  449. package/dist/utilities/getVersions.js.map +1 -1
  450. package/dist/utilities/reduceFieldsToOptions.js +1 -1
  451. package/dist/utilities/reduceFieldsToOptions.js.map +1 -1
  452. package/dist/views/Account/ResetPreferences/index.js +1 -0
  453. package/dist/views/Account/ResetPreferences/index.js.map +1 -1
  454. package/dist/views/Account/Settings/index.css +30 -13
  455. package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
  456. package/dist/views/Account/ToggleTheme/index.js +31 -47
  457. package/dist/views/Account/ToggleTheme/index.js.map +1 -1
  458. package/dist/views/Dashboard/Default/ModularDashboard/index.client.js.map +1 -1
  459. package/dist/views/Document/index.d.ts.map +1 -1
  460. package/dist/views/Document/index.js +10 -1
  461. package/dist/views/Document/index.js.map +1 -1
  462. package/dist/views/Edit/Auth/APIKey.d.ts.map +1 -1
  463. package/dist/views/Edit/Auth/APIKey.js +10 -32
  464. package/dist/views/Edit/Auth/APIKey.js.map +1 -1
  465. package/dist/views/Edit/Auth/index.css +0 -67
  466. package/dist/views/Edit/index.d.ts.map +1 -1
  467. package/dist/views/Edit/index.js +62 -48
  468. package/dist/views/Edit/index.js.map +1 -1
  469. package/dist/views/HierarchyList/DocumentListSelection/index.js +8 -8
  470. package/dist/views/HierarchyList/DocumentListSelection/index.js.map +1 -1
  471. package/dist/views/List/ListHeader/index.css +23 -1
  472. package/dist/views/List/ListHeader/index.d.ts.map +1 -1
  473. package/dist/views/List/ListHeader/index.js +0 -1
  474. package/dist/views/List/ListHeader/index.js.map +1 -1
  475. package/dist/views/List/ListSelection/index.d.ts.map +1 -1
  476. package/dist/views/List/ListSelection/index.js +84 -33
  477. package/dist/views/List/ListSelection/index.js.map +1 -1
  478. package/dist/views/List/handleGroupBy.d.ts.map +1 -1
  479. package/dist/views/List/handleGroupBy.js +9 -0
  480. package/dist/views/List/handleGroupBy.js.map +1 -1
  481. package/dist/views/List/index.client.d.ts.map +1 -1
  482. package/dist/views/List/index.client.js +7 -6
  483. package/dist/views/List/index.client.js.map +1 -1
  484. package/dist/views/List/index.css +15 -0
  485. package/dist/views/List/index.d.ts.map +1 -1
  486. package/dist/views/List/index.js +9 -2
  487. package/dist/views/List/index.js.map +1 -1
  488. package/dist/views/List/renderListViewSlots.d.ts.map +1 -1
  489. package/dist/views/List/renderListViewSlots.js +11 -0
  490. package/dist/views/List/renderListViewSlots.js.map +1 -1
  491. package/dist/views/Logout/LogoutClient.d.ts +14 -0
  492. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  493. package/dist/views/Logout/LogoutClient.js +39 -33
  494. package/dist/views/Logout/LogoutClient.js.map +1 -1
  495. package/dist/views/Logout/index.d.ts.map +1 -1
  496. package/dist/views/Logout/index.js +7 -2
  497. package/dist/views/Logout/index.js.map +1 -1
  498. package/dist/views/Version/Default/index.css +3 -5
  499. package/dist/views/Version/Default/index.d.ts.map +1 -1
  500. package/dist/views/Version/Default/index.js +7 -28
  501. package/dist/views/Version/Default/index.js.map +1 -1
  502. package/dist/views/Version/RenderFieldsToDiff/fields/Checkbox/index.js.map +1 -1
  503. package/dist/views/Version/Restore/index.css +2 -2
  504. package/dist/views/Version/SelectComparison/VersionDrawer/index.css +5 -0
  505. package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts +1 -1
  506. package/dist/views/Version/SelectComparison/VersionDrawer/index.d.ts.map +1 -1
  507. package/dist/views/Version/SelectComparison/VersionDrawer/index.js +1 -2
  508. package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
  509. package/dist/views/Version/SelectComparison/index.css +5 -0
  510. package/dist/views/Version/SelectComparison/index.d.ts +1 -1
  511. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
  512. package/dist/views/Version/SelectComparison/index.js +1 -1
  513. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  514. package/dist/views/Version/SelectLocales/index.d.ts +1 -2
  515. package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
  516. package/dist/views/Version/SelectLocales/index.js +83 -32
  517. package/dist/views/Version/SelectLocales/index.js.map +1 -1
  518. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
  519. package/dist/views/Versions/index.css +19 -16
  520. package/dist/views/Versions/index.d.ts +1 -1
  521. package/dist/views/Versions/index.d.ts.map +1 -1
  522. package/dist/views/Versions/index.js +3 -26
  523. package/dist/views/Versions/index.js.map +1 -1
  524. package/package.json +4 -4
  525. package/dist/elements/BulkUpload/AddingFilesView/index.scss +0 -25
  526. package/dist/elements/BulkUpload/EditForm/index.scss +0 -11
  527. package/dist/elements/BulkUpload/EditMany/index.scss +0 -171
  528. package/dist/elements/ColumnSelector/index.d.ts +0 -9
  529. package/dist/elements/ColumnSelector/index.d.ts.map +0 -1
  530. package/dist/elements/ColumnSelector/index.js.map +0 -1
  531. package/dist/elements/ColumnsButton/index.d.ts +0 -7
  532. package/dist/elements/ColumnsButton/index.d.ts.map +0 -1
  533. package/dist/elements/ColumnsButton/index.js.map +0 -1
  534. package/dist/elements/EditMany/index.scss +0 -182
  535. package/dist/elements/FileDetails/DraggableFileDetails/index.scss +0 -35
  536. package/dist/elements/GroupByBuilder/index.d.ts +0 -12
  537. package/dist/elements/GroupByBuilder/index.d.ts.map +0 -1
  538. package/dist/elements/GroupByBuilder/index.js +0 -164
  539. package/dist/elements/GroupByBuilder/index.js.map +0 -1
  540. package/dist/elements/GroupByBuilder/index.scss +0 -39
  541. package/dist/elements/GroupByControl/index.d.ts +0 -9
  542. package/dist/elements/GroupByControl/index.d.ts.map +0 -1
  543. package/dist/elements/GroupByControl/index.js +0 -258
  544. package/dist/elements/GroupByControl/index.js.map +0 -1
  545. package/dist/elements/Hierarchy/Field/SelectedHierarchies.scss +0 -78
  546. package/dist/elements/Hierarchy/Field/index.scss +0 -41
  547. package/dist/elements/Hierarchy/MoveMany/index.scss +0 -7
  548. package/dist/elements/Hierarchy/Tree/LoadMore/index.scss +0 -26
  549. package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts +0 -7
  550. package/dist/elements/Hierarchy/Tree/TreeConnector.d.ts.map +0 -1
  551. package/dist/elements/Hierarchy/Tree/TreeConnector.js +0 -23
  552. package/dist/elements/Hierarchy/Tree/TreeConnector.js.map +0 -1
  553. package/dist/elements/LoadMoreRow/index.scss +0 -45
  554. package/dist/elements/QueryPresets/fields/ColumnsField/index.scss +0 -17
  555. package/dist/elements/QueryPresets/fields/GroupByField/index.scss +0 -17
  556. package/dist/elements/QueryPresets/fields/WhereField/index.scss +0 -23
  557. package/dist/fields/Tabs/Tab/index.css +0 -82
  558. package/dist/scss/toasts.scss +0 -146
  559. package/dist/views/Version/SelectComparison/VersionDrawer/index.scss +0 -18
  560. package/dist/views/Version/SelectComparison/index.scss +0 -9
  561. /package/dist/elements/{ColumnSelector/index.css → ColumnSelection/Popup.css} +0 -0
  562. /package/dist/elements/{GroupByControl/index.css → GroupBy/Popup.css} +0 -0
@@ -2,17 +2,32 @@
2
2
 
3
3
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
4
  export * as PopupList from './PopupButtonList/index.js';
5
- import React, { useCallback, useEffect, useRef, useState } from 'react';
5
+ import React, { createContext, use, useCallback, useEffect, useRef, useState } from 'react';
6
6
  import { createPortal } from 'react-dom';
7
7
  import { useEffectEvent } from '../../hooks/useEffectEvent.js';
8
8
  import { ThemeProvider } from '../../providers/Theme/index.js';
9
9
  import './index.css';
10
10
  import { PopupTrigger } from './PopupTrigger/index.js';
11
11
  const baseClass = 'popup';
12
+ const PopupContext = /*#__PURE__*/createContext(null);
12
13
  /**
13
14
  * Selector for all elements the browser considers tabbable.
14
15
  */
15
16
  const TABBABLE_SELECTOR = ['a[href]', 'button:not(:disabled)', 'input:not(:disabled):not([type="hidden"])', 'select:not(:disabled)', 'textarea:not(:disabled)', '[tabindex]', '[contenteditable]:not([contenteditable="false"])', 'audio[controls]', 'video[controls]', 'summary'].map(s => `${s}:not([tabindex="-1"])`).join(', ');
17
+ /**
18
+ * Returns whether the element has a `position: fixed` ancestor (e.g. an open Drawer).
19
+ * Such popups must be positioned with `fixed` so they don't drift when the background scrolls.
20
+ */
21
+ const hasFixedAncestor = element => {
22
+ let node = element?.parentElement;
23
+ while (node && node !== document.body) {
24
+ if (window.getComputedStyle(node).position === 'fixed') {
25
+ return true;
26
+ }
27
+ node = node.parentElement;
28
+ }
29
+ return false;
30
+ };
16
31
  /**
17
32
  * Component that renders a popup, as well as a button that triggers the popup.
18
33
  *
@@ -41,6 +56,7 @@ export const Popup = props => {
41
56
  renderButton,
42
57
  showOnHover = false,
43
58
  showScrollbar = false,
59
+ side,
44
60
  size = 'medium',
45
61
  theme = 'dark',
46
62
  verticalAlign = 'bottom'
@@ -48,11 +64,17 @@ export const Popup = props => {
48
64
  const popupRef = useRef(null);
49
65
  const triggerRef = useRef(null);
50
66
  /**
67
+ * Whether the trigger is inside a `position: fixed` ancestor (e.g. a Drawer),
68
+ * in which case the popup is positioned with `fixed` instead of `absolute`.
69
+ */
70
+ const isFixedRef = useRef(false);
71
+ /**
51
72
  * Keeps track of whether the popup was opened via keyboard.
52
73
  * This is used to determine whether to autofocus the first element in the popup.
53
74
  * If the popup was opened via mouse, we do not want to autofocus the first element.
54
75
  */
55
76
  const openedViaKeyboardRef = useRef(false);
77
+ const parentPopup = use(PopupContext);
56
78
  const [mounted, setMounted] = useState(false);
57
79
  const [active, setActiveInternal] = useState(initActive);
58
80
  const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top');
@@ -84,52 +106,94 @@ export const Popup = props => {
84
106
  }
85
107
  const triggerRect = trigger.getBoundingClientRect();
86
108
  const popupRect = popup.getBoundingClientRect();
109
+ // Inside a fixed ancestor, use `fixed` (no scroll offset) so background scrolling
110
+ // doesn't shift the popup. Otherwise use page coordinates (absolute).
111
+ const useFixed = isFixedRef.current;
112
+ const scrollY = useFixed ? 0 : window.scrollY;
113
+ const scrollX = useFixed ? 0 : window.scrollX;
87
114
  // Gap between the popup and the trigger/viewport edges (in pixels)
88
115
  const offset = 10;
89
- // /////////////////////////////////////
90
- // Vertical Positioning
91
- // Calculates the `top` position in absolute page coordinates.
92
- // Uses `verticalAlign` prop as the preferred direction, but flips
93
- // to the opposite side if there's not enough viewport space.
94
- // /////////////////////////////////////
116
+ // Additional gap used in side mode so the child popup has breathing room from its parent
117
+ const sideOffset = 4;
95
118
  let top;
96
- let onTop = verticalAlign === 'top';
97
- if (verticalAlign === 'bottom') {
98
- top = triggerRect.bottom + window.scrollY + offset;
99
- if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {
100
- // Try to flip above — only do so if there's actually enough room
101
- const topIfAbove = triggerRect.top + window.scrollY - popupRect.height - offset;
102
- if (topIfAbove >= window.scrollY) {
103
- top = topIfAbove;
104
- onTop = true;
119
+ let left;
120
+ let caretLeft;
121
+ if (side) {
122
+ // /////////////////////////////////////
123
+ // Side Positioning
124
+ // Places the popup to the left or right of the parent popup (not just the trigger),
125
+ // top-aligned with the trigger. Flips to the opposite side if there is not enough
126
+ // viewport space.
127
+ // /////////////////////////////////////
128
+ // Top: align with trigger top, clamped to viewport
129
+ top = triggerRect.top + scrollY;
130
+ const maxTop = scrollY + window.innerHeight - popupRect.height - offset;
131
+ top = Math.max(scrollY + offset, Math.min(top, maxTop));
132
+ // Use the parent popup's bounding rect as the reference for left/right positioning
133
+ // so the child appears 4px from the parent popup edge, not just the trigger button.
134
+ const anchorRect = parentPopup?.popupRef.current ? parentPopup.popupRef.current.getBoundingClientRect() : triggerRect;
135
+ if (side === 'left') {
136
+ left = anchorRect.left - popupRect.width - sideOffset;
137
+ if (left < offset) {
138
+ // flip to right side
139
+ left = anchorRect.right + sideOffset;
140
+ }
141
+ } else {
142
+ left = anchorRect.right + sideOffset;
143
+ if (left + popupRect.width + offset > window.innerWidth) {
144
+ // flip to left side
145
+ left = anchorRect.left - popupRect.width - sideOffset;
105
146
  }
106
- // else: not enough room above either — keep below and let it overflow rather than going off-screen
107
147
  }
148
+ left = left + scrollX;
149
+ // Caret not used in side mode; set a neutral value
150
+ caretLeft = popupRect.width / 2;
151
+ setIsOnTop(false);
108
152
  } else {
109
- top = triggerRect.top + window.scrollY - popupRect.height - offset;
110
- if (triggerRect.top - popupRect.height - offset < 0) {
111
- top = triggerRect.bottom + window.scrollY + offset;
112
- onTop = false;
153
+ // /////////////////////////////////////
154
+ // Vertical Positioning
155
+ // Calculates the `top` position in absolute page coordinates.
156
+ // Uses `verticalAlign` prop as the preferred direction, but flips
157
+ // to the opposite side if there's not enough viewport space.
158
+ // /////////////////////////////////////
159
+ let onTop = verticalAlign === 'top';
160
+ if (verticalAlign === 'bottom') {
161
+ top = triggerRect.bottom + scrollY + offset;
162
+ if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {
163
+ // Try to flip above — only do so if there's actually enough room
164
+ const topIfAbove = triggerRect.top + scrollY - popupRect.height - offset;
165
+ if (topIfAbove >= scrollY) {
166
+ top = topIfAbove;
167
+ onTop = true;
168
+ }
169
+ // else: not enough room above either — keep below and let it overflow rather than going off-screen
170
+ }
171
+ } else {
172
+ top = triggerRect.top + scrollY - popupRect.height - offset;
173
+ if (triggerRect.top - popupRect.height - offset < 0) {
174
+ top = triggerRect.bottom + scrollY + offset;
175
+ onTop = false;
176
+ }
113
177
  }
178
+ setIsOnTop(onTop);
179
+ // /////////////////////////////////////
180
+ // Horizontal Positioning
181
+ // Calculates the `left` position based on `horizontalAlign` prop:
182
+ // - 'left': aligns popup's left edge with trigger's left edge
183
+ // - 'right': aligns popup's right edge with trigger's right edge
184
+ // - 'center': centers popup horizontally relative to trigger
185
+ // Then clamps to keep the popup within viewport bounds.
186
+ // /////////////////////////////////////
187
+ left = horizontalAlign === 'right' ? triggerRect.right - popupRect.width : horizontalAlign === 'center' ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2 : triggerRect.left;
188
+ left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset));
189
+ // /////////////////////////////////////
190
+ // Caret Positioning
191
+ // Positions the caret arrow to point at the trigger's horizontal center.
192
+ // Clamps between 12px from edges to prevent caret from overflowing the popup.
193
+ // /////////////////////////////////////
194
+ const triggerCenter = triggerRect.left + triggerRect.width / 2;
195
+ caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12));
114
196
  }
115
- setIsOnTop(onTop);
116
- // /////////////////////////////////////
117
- // Horizontal Positioning
118
- // Calculates the `left` position based on `horizontalAlign` prop:
119
- // - 'left': aligns popup's left edge with trigger's left edge
120
- // - 'right': aligns popup's right edge with trigger's right edge
121
- // - 'center': centers popup horizontally relative to trigger
122
- // Then clamps to keep the popup within viewport bounds.
123
- // /////////////////////////////////////
124
- let left = horizontalAlign === 'right' ? triggerRect.right - popupRect.width : horizontalAlign === 'center' ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2 : triggerRect.left;
125
- left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset));
126
- // /////////////////////////////////////
127
- // Caret Positioning
128
- // Positions the caret arrow to point at the trigger's horizontal center.
129
- // Clamps between 12px from edges to prevent caret from overflowing the popup.
130
- // /////////////////////////////////////
131
- const triggerCenter = triggerRect.left + triggerRect.width / 2;
132
- const caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12));
133
197
  // /////////////////////////////////////
134
198
  // Apply Styles (only if changed)
135
199
  // Compares calculated position with current styles to avoid unnecessary
@@ -139,8 +203,12 @@ export const Popup = props => {
139
203
  // Values are rounded to match browser's CSS precision and avoid false updates.
140
204
  // /////////////////////////////////////
141
205
  const newTop = `${Math.round(top)}px`;
142
- const newLeft = `${Math.round(left + window.scrollX)}px`;
206
+ const newLeft = `${Math.round(left + scrollX)}px`;
143
207
  const newCaretLeft = `${Math.round(caretLeft)}px`;
208
+ const newPosition = useFixed ? 'fixed' : '';
209
+ if (popup.style.position !== newPosition) {
210
+ popup.style.position = newPosition;
211
+ }
144
212
  if (popup.style.top !== newTop) {
145
213
  popup.style.top = newTop;
146
214
  }
@@ -223,6 +291,10 @@ export const Popup = props => {
223
291
  // Check if the clicked element or any ancestor is an actionable element
224
292
  const actionable = target_0.closest('button, a[href], [role="button"], [role="menuitem"]');
225
293
  if (actionable && popupRef.current?.contains(actionable)) {
294
+ // Don't close if clicking a nested popup's trigger — it will manage its own open state
295
+ if (actionable.closest(`.${baseClass}__trigger-wrap`)) {
296
+ return;
297
+ }
226
298
  setActive(false);
227
299
  }
228
300
  });
@@ -237,6 +309,7 @@ export const Popup = props => {
237
309
  // `.popup__hidden-content` takes effect. Without this, the inline
238
310
  // styles set during positioning would win over the CSS rule, keeping
239
311
  // portaled children (e.g. a ReactSelect menu) visually on-screen.
312
+ popup_1.style.position = '';
240
313
  popup_1.style.top = '';
241
314
  popup_1.style.left = '';
242
315
  }
@@ -257,9 +330,11 @@ export const Popup = props => {
257
330
  // after the browser has finished laying out the newly-visible popup
258
331
  // content. The rAF call is the authoritative one — it catches cases
259
332
  // where the popup height wasn't stable yet during the first call
260
- // (e.g. ColumnSelector content rendering after hidden → visible
333
+ // (e.g. ColumnSelection popup content rendering after hidden → visible
261
334
  // class switch), which was causing incorrect flip-to-top decisions.
262
335
  // /////////////////////////////////////
336
+ // Decide the positioning strategy once per open.
337
+ isFixedRef.current = hasFixedAncestor(triggerRef.current);
263
338
  updatePosition();
264
339
  const rafId = requestAnimationFrame(() => {
265
340
  updatePosition();
@@ -336,28 +411,33 @@ export const Popup = props => {
336
411
  // Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since
337
412
  // that closes the popup due to the click outside handler.
338
413
  /*#__PURE__*/
339
- createPortal(/*#__PURE__*/_jsxs("div", {
340
- className: active ? [`${baseClass}__content`, `${baseClass}--size-${size}`, isOnTop ? `${baseClass}--v-top` : `${baseClass}--v-bottom`, portalClassName].filter(Boolean).join(' ') :
341
- // tests do not accidentally target inactive popups.
342
- `${baseClass}__hidden-content`,
343
- "data-popup-id": id || undefined,
344
- "data-theme": theme === 'auto' ? undefined : theme,
345
- ref: popupRef,
346
- children: [/*#__PURE__*/_jsx("div", {
347
- className: `${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`,
348
- children: theme === 'auto' ? /*#__PURE__*/_jsxs(_Fragment, {
349
- children: [render?.({
350
- close: () => setActive(false)
351
- }), children]
352
- }) : /*#__PURE__*/_jsxs(ThemeProvider, {
353
- theme: theme,
354
- children: [render?.({
355
- close: () => setActive(false)
356
- }), children]
357
- })
358
- }), caret && /*#__PURE__*/_jsx("div", {
359
- className: `${baseClass}__caret`
360
- })]
414
+ createPortal(/*#__PURE__*/_jsx(PopupContext, {
415
+ value: {
416
+ popupRef
417
+ },
418
+ children: /*#__PURE__*/_jsxs("div", {
419
+ className: active ? [`${baseClass}__content`, `${baseClass}--size-${size}`, side ? `${baseClass}--side-${side}` : isOnTop ? `${baseClass}--v-top` : `${baseClass}--v-bottom`, portalClassName].filter(Boolean).join(' ') :
420
+ // tests do not accidentally target inactive popups.
421
+ `${baseClass}__hidden-content`,
422
+ "data-popup-id": id || undefined,
423
+ "data-theme": theme === 'auto' ? undefined : theme,
424
+ ref: popupRef,
425
+ children: [/*#__PURE__*/_jsx("div", {
426
+ className: `${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`,
427
+ children: theme === 'auto' ? /*#__PURE__*/_jsxs(_Fragment, {
428
+ children: [render?.({
429
+ close: () => setActive(false)
430
+ }), children]
431
+ }) : /*#__PURE__*/_jsxs(ThemeProvider, {
432
+ theme: theme,
433
+ children: [render?.({
434
+ close: () => setActive(false)
435
+ }), children]
436
+ })
437
+ }), caret && !side && /*#__PURE__*/_jsx("div", {
438
+ className: `${baseClass}__caret`
439
+ })]
440
+ })
361
441
  }), document.body) : null]
362
442
  });
363
443
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["PopupList","React","useCallback","useEffect","useRef","useState","createPortal","useEffectEvent","ThemeProvider","PopupTrigger","baseClass","TABBABLE_SELECTOR","map","s","join","Popup","props","id","button","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","initActive","noBackground","onToggleClose","onToggleOpen","portalClassName","render","renderButton","showOnHover","showScrollbar","size","theme","verticalAlign","popupRef","triggerRef","openedViaKeyboardRef","mounted","setMounted","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","current","updatePosition","trigger","popup","triggerRect","getBoundingClientRect","popupRect","offset","top","onTop","bottom","window","scrollY","height","innerHeight","topIfAbove","left","right","width","Math","max","min","innerWidth","triggerCenter","caretLeft","newTop","round","newLeft","scrollX","newCaretLeft","style","getPropertyValue","setProperty","handleClickOutside","e","target","isOutsidePopup","contains","isOutsideTrigger","clickedPopupContent","closest","isInsideChildPopup","handleKeyDown","key","preventDefault","querySelector","focus","focusable","Array","from","querySelectorAll","length","currentIndex","findIndex","el","document","activeElement","goBackward","shiftKey","nextIndex","handleActionableClick","actionable","rafId","requestAnimationFrame","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","undefined","Trigger","_jsx","_jsxs","filter","Boolean","ref","onMouseEnter","onMouseLeave","role","tabIndex","_Fragment","close","body"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { PopupTrigger } from './PopupTrigger/index.js'\n\nconst baseClass = 'popup'\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n /**\n * The class name to apply to the button that triggers the popup.\n */\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n /**\n * The class name to apply to the popup container containing the trigger.\n * This does not wrap the actual popup content, which is rendered in a portal.\n */\n className?: string\n disabled?: boolean\n /**\n * Force control the open state of the popup, regardless of the trigger.\n */\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n /**\n * Class name to apply to the portal container.\n */\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: {\n active: boolean\n 'aria-expanded': boolean\n 'aria-haspopup': true\n onClick: React.MouseEventHandler\n onKeyDown: React.KeyboardEventHandler\n }) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n size?: 'fit-content' | 'large' | 'medium' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered in a portal, and is automatically positioned above / below the trigger,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign = 'left',\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n size = 'medium',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const [mounted, setMounted] = useState(false)\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n // Track when component is mounted to avoid SSR/client hydration mismatch\n useEffect(() => {\n setMounted(true)\n }, [])\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n }\n setActiveInternal(isActive)\n },\n [onToggleClose, onToggleOpen],\n )\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 10\n\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let top: number\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + window.scrollY + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top + window.scrollY - popupRect.height - offset\n if (topIfAbove >= window.scrollY) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top + window.scrollY - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + window.scrollY + offset\n onTop = false\n }\n }\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n let left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n const caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left + window.scrollX)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: cycles through focusable items with wrapping\n // - ArrowUp/ArrowDown: same as Shift+Tab/Tab for menu-style navigation\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n setActive(false)\n triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]')?.focus()\n return\n }\n\n if (e.key === 'Tab' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelector content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n document.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n document.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonType={buttonType}\n className={buttonClassName}\n disabled={disabled}\n noBackground={noBackground}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n {mounted\n ? // We need to make sure the popup is part of the DOM (although invisible), even if it's not active.\n // This ensures that components within the popup, like modals, do not unmount when the popup closes.\n // Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since\n // that closes the popup due to the click outside handler.\n createPortal(\n <div\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n isOnTop ? `${baseClass}--v-top` : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n ref={popupRef}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close: () => setActive(false) })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close: () => setActive(false) })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && <div className={`${baseClass}__caret`} />}\n </div>,\n document.body,\n )\n : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM;AAE3B,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAChE,SAASC,YAAY,QAAQ;AAE7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9B,OAAO;AACP,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAElB;;;AAGA,MAAMC,iBAAA,GAAoB,CACxB,WACA,yBACA,6CACA,yBACA,2BACA,cACA,oDACA,mBACA,mBACA,UACD,CACEC,GAAG,CAAEC,CAAA,IAAM,GAAGA,CAAA,uBAAw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pF,KAAA,KAAU,SAASoF,SAAA,GAAYpF,KAAA;MAC3C0F,GAAA,EAAKxF,QAAA;8BAELoF,IAAA,CAAC;QACCpG,SAAA,EAAW,GAAGd,SAAA,qBAA8B0B,aAAA,GAAgB,IAAI1B,SAAA,oCAA6C,GAAG,IAAI;kBAEnH4B,KAAA,KAAU,sBACTuF,KAAA,CAAAQ,SAAA;qBACGpG,MAAA,GAAS;YAAEqG,KAAA,EAAOA,CAAA,KAAMrF,SAAA,CAAU;UAAO,IACzC1B,QAAA;0BAGHsG,KAAA,CAACrH,aAAA;UAAc8B,KAAA,EAAOA,KAAA;qBACnBL,MAAA,GAAS;YAAEqG,KAAA,EAAOA,CAAA,KAAMrF,SAAA,CAAU;UAAO,IACzC1B,QAAA;;UAIND,KAAA,iBAASsG,IAAA,CAAC;QAAIpG,SAAA,EAAW,GAAGd,SAAA;;QAE/BiG,QAAA,CAAS4B,IAAI,IAEf;;AAGV","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["PopupList","React","createContext","use","useCallback","useEffect","useRef","useState","createPortal","useEffectEvent","ThemeProvider","PopupTrigger","baseClass","PopupContext","TABBABLE_SELECTOR","map","s","join","hasFixedAncestor","element","node","parentElement","document","body","window","getComputedStyle","position","Popup","props","id","button","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","initActive","noBackground","onToggleClose","onToggleOpen","portalClassName","render","renderButton","showOnHover","showScrollbar","side","size","theme","verticalAlign","popupRef","triggerRef","isFixedRef","openedViaKeyboardRef","parentPopup","mounted","setMounted","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","current","updatePosition","trigger","popup","triggerRect","getBoundingClientRect","popupRect","useFixed","scrollY","scrollX","offset","sideOffset","top","left","caretLeft","maxTop","innerHeight","height","Math","max","min","anchorRect","width","right","innerWidth","onTop","bottom","topIfAbove","triggerCenter","newTop","round","newLeft","newCaretLeft","newPosition","style","getPropertyValue","setProperty","handleClickOutside","e","target","isOutsidePopup","contains","isOutsideTrigger","clickedPopupContent","closest","isInsideChildPopup","handleKeyDown","key","preventDefault","querySelector","focus","focusable","Array","from","querySelectorAll","length","currentIndex","findIndex","el","activeElement","goBackward","shiftKey","nextIndex","handleActionableClick","actionable","rafId","requestAnimationFrame","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","undefined","Trigger","_jsx","_jsxs","filter","Boolean","ref","onMouseEnter","onMouseLeave","role","tabIndex","value","_Fragment","close"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, { createContext, use, useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { PopupTrigger } from './PopupTrigger/index.js'\n\nconst baseClass = 'popup'\n\ntype PopupContextValue = {\n popupRef: React.RefObject<HTMLDivElement | null>\n}\n\nconst PopupContext = createContext<null | PopupContextValue>(null)\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\n/**\n * Returns whether the element has a `position: fixed` ancestor (e.g. an open Drawer).\n * Such popups must be positioned with `fixed` so they don't drift when the background scrolls.\n */\nconst hasFixedAncestor = (element: HTMLElement | null): boolean => {\n let node = element?.parentElement\n while (node && node !== document.body) {\n if (window.getComputedStyle(node).position === 'fixed') {\n return true\n }\n node = node.parentElement\n }\n return false\n}\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n /**\n * The class name to apply to the button that triggers the popup.\n */\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n /**\n * The class name to apply to the popup container containing the trigger.\n * This does not wrap the actual popup content, which is rendered in a portal.\n */\n className?: string\n disabled?: boolean\n /**\n * Force control the open state of the popup, regardless of the trigger.\n */\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n /**\n * Class name to apply to the portal container.\n */\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: {\n active: boolean\n 'aria-expanded': boolean\n 'aria-haspopup': true\n onClick: React.MouseEventHandler\n onKeyDown: React.KeyboardEventHandler\n }) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n /**\n * Position the popup to the side of the trigger instead of above/below.\n * The popup's top edge aligns with the trigger's top edge (with viewport clamping).\n * Automatically flips to the opposite side if there is not enough space.\n * When set, `verticalAlign`, `horizontalAlign`, and the caret are ignored.\n */\n side?: 'left' | 'right'\n size?: 'fit-content' | 'large' | 'medium' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered in a portal, and is automatically positioned above / below the trigger,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign = 'left',\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n side,\n size = 'medium',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n\n /**\n * Whether the trigger is inside a `position: fixed` ancestor (e.g. a Drawer),\n * in which case the popup is positioned with `fixed` instead of `absolute`.\n */\n const isFixedRef = useRef(false)\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const parentPopup = use(PopupContext)\n\n const [mounted, setMounted] = useState(false)\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n // Track when component is mounted to avoid SSR/client hydration mismatch\n useEffect(() => {\n setMounted(true)\n }, [])\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n }\n setActiveInternal(isActive)\n },\n [onToggleClose, onToggleOpen],\n )\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Inside a fixed ancestor, use `fixed` (no scroll offset) so background scrolling\n // doesn't shift the popup. Otherwise use page coordinates (absolute).\n const useFixed = isFixedRef.current\n const scrollY = useFixed ? 0 : window.scrollY\n const scrollX = useFixed ? 0 : window.scrollX\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 10\n // Additional gap used in side mode so the child popup has breathing room from its parent\n const sideOffset = 4\n\n let top: number\n let left: number\n let caretLeft: number\n\n if (side) {\n // /////////////////////////////////////\n // Side Positioning\n // Places the popup to the left or right of the parent popup (not just the trigger),\n // top-aligned with the trigger. Flips to the opposite side if there is not enough\n // viewport space.\n // /////////////////////////////////////\n\n // Top: align with trigger top, clamped to viewport\n top = triggerRect.top + scrollY\n const maxTop = scrollY + window.innerHeight - popupRect.height - offset\n top = Math.max(scrollY + offset, Math.min(top, maxTop))\n\n // Use the parent popup's bounding rect as the reference for left/right positioning\n // so the child appears 4px from the parent popup edge, not just the trigger button.\n const anchorRect = parentPopup?.popupRef.current\n ? parentPopup.popupRef.current.getBoundingClientRect()\n : triggerRect\n\n if (side === 'left') {\n left = anchorRect.left - popupRect.width - sideOffset\n if (left < offset) {\n // flip to right side\n left = anchorRect.right + sideOffset\n }\n } else {\n left = anchorRect.right + sideOffset\n if (left + popupRect.width + offset > window.innerWidth) {\n // flip to left side\n left = anchorRect.left - popupRect.width - sideOffset\n }\n }\n\n left = left + scrollX\n // Caret not used in side mode; set a neutral value\n caretLeft = popupRect.width / 2\n\n setIsOnTop(false)\n } else {\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + scrollY + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top + scrollY - popupRect.height - offset\n if (topIfAbove >= scrollY) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top + scrollY - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + scrollY + offset\n onTop = false\n }\n }\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n }\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left + scrollX)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n const newPosition = useFixed ? 'fixed' : ''\n\n if (popup.style.position !== newPosition) {\n popup.style.position = newPosition\n }\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: cycles through focusable items with wrapping\n // - ArrowUp/ArrowDown: same as Shift+Tab/Tab for menu-style navigation\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n setActive(false)\n triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]')?.focus()\n return\n }\n\n if (e.key === 'Tab' || e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp' || (e.key === 'Tab' && e.shiftKey)\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n // Don't close if clicking a nested popup's trigger — it will manage its own open state\n if (actionable.closest(`.${baseClass}__trigger-wrap`)) {\n return\n }\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.position = ''\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelection popup content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n // Decide the positioning strategy once per open.\n isFixedRef.current = hasFixedAncestor(triggerRef.current)\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n document.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n document.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonType={buttonType}\n className={buttonClassName}\n disabled={disabled}\n noBackground={noBackground}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n {mounted\n ? // We need to make sure the popup is part of the DOM (although invisible), even if it's not active.\n // This ensures that components within the popup, like modals, do not unmount when the popup closes.\n // Otherwise, modals opened from the popup will close unexpectedly when clicking within the modal, since\n // that closes the popup due to the click outside handler.\n createPortal(\n <PopupContext value={{ popupRef }}>\n <div\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n side\n ? `${baseClass}--side-${side}`\n : isOnTop\n ? `${baseClass}--v-top`\n : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n ref={popupRef}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close: () => setActive(false) })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close: () => setActive(false) })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && !side && <div className={`${baseClass}__caret`} />}\n </div>\n </PopupContext>,\n document.body,\n )\n : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM;AAE3B,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACpF,SAASC,YAAY,QAAQ;AAE7B,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9B,OAAO;AACP,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAMlB,MAAMC,YAAA,gBAAeX,aAAA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AA,EAAK7F,QAAA;gCAELyF,IAAA,CAAC;UACC1G,SAAA,EAAW,GAAGxB,SAAA,qBAA8BoC,aAAA,GAAgB,IAAIpC,SAAA,oCAA6C,GAAG,IAAI;oBAEnHuC,KAAA,KAAU,sBACT4F,KAAA,CAAAS,SAAA;uBACG3G,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;4BAGH4G,KAAA,CAACrI,aAAA;YAAcyC,KAAA,EAAOA,KAAA;uBACnBN,MAAA,GAAS;cAAE4G,KAAA,EAAOA,CAAA,KAAMzF,SAAA,CAAU;YAAO,IACzC7B,QAAA;;YAIND,KAAA,IAAS,CAACe,IAAA,iBAAQ6F,IAAA,CAAC;UAAI1G,SAAA,EAAW,GAAGxB,SAAA;;;QAG1CU,QAAA,CAASC,IAAI,IAEf;;AAGV","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ import type { Where } from 'payload';
2
+ type Args = {
3
+ collectionSlug?: string;
4
+ globalSlug?: string;
5
+ id?: number | string;
6
+ };
7
+ /**
8
+ * Builds the `where` query used to find upcoming scheduled
9
+ * publish/unpublish jobs for a given document or global.
10
+ */
11
+ export declare const buildUpcomingScheduleWhere: ({ id, collectionSlug, globalSlug }: Args) => Where;
12
+ export {};
13
+ //# sourceMappingURL=buildUpcomingScheduleWhere.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildUpcomingScheduleWhere.d.ts","sourceRoot":"","sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,KAAK,IAAI,GAAG;IACV,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GAAI,oCAAoC,IAAI,KAAG,KAsCrF,CAAA"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Builds the `where` query used to find upcoming scheduled
3
+ * publish/unpublish jobs for a given document or global.
4
+ */export const buildUpcomingScheduleWhere = ({
5
+ id,
6
+ collectionSlug,
7
+ globalSlug
8
+ }) => {
9
+ const where = {
10
+ and: [{
11
+ taskSlug: {
12
+ equals: 'schedulePublish'
13
+ }
14
+ }, {
15
+ waitUntil: {
16
+ greater_than: new Date()
17
+ }
18
+ }]
19
+ };
20
+ if (collectionSlug) {
21
+ where.and.push({
22
+ 'input.doc.value': {
23
+ equals: String(id)
24
+ }
25
+ });
26
+ where.and.push({
27
+ 'input.doc.relationTo': {
28
+ equals: collectionSlug
29
+ }
30
+ });
31
+ }
32
+ if (globalSlug) {
33
+ where.and.push({
34
+ 'input.global': {
35
+ equals: globalSlug
36
+ }
37
+ });
38
+ }
39
+ return where;
40
+ };
41
+ //# sourceMappingURL=buildUpcomingScheduleWhere.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildUpcomingScheduleWhere.js","names":["buildUpcomingScheduleWhere","id","collectionSlug","globalSlug","where","and","taskSlug","equals","waitUntil","greater_than","Date","push","String"],"sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingScheduleWhere.ts"],"sourcesContent":["import type { Where } from 'payload'\n\ntype Args = {\n collectionSlug?: string\n globalSlug?: string\n id?: number | string\n}\n\n/**\n * Builds the `where` query used to find upcoming scheduled\n * publish/unpublish jobs for a given document or global.\n */\nexport const buildUpcomingScheduleWhere = ({ id, collectionSlug, globalSlug }: Args): Where => {\n const where: Where = {\n and: [\n {\n taskSlug: {\n equals: 'schedulePublish',\n },\n },\n {\n waitUntil: {\n greater_than: new Date(),\n },\n },\n ],\n }\n\n if (collectionSlug) {\n where.and.push({\n 'input.doc.value': {\n equals: String(id),\n },\n })\n where.and.push({\n 'input.doc.relationTo': {\n equals: collectionSlug,\n },\n })\n }\n\n if (globalSlug) {\n where.and.push({\n 'input.global': {\n equals: globalSlug,\n },\n })\n }\n\n return where\n}\n"],"mappings":"AAQA;;;GAIA,OAAO,MAAMA,0BAAA,GAA6BA,CAAC;EAAEC,EAAE;EAAEC,cAAc;EAAEC;AAAU,CAAQ;EACjF,MAAMC,KAAA,GAAe;IACnBC,GAAA,EAAK,CACH;MACEC,QAAA,EAAU;QACRC,MAAA,EAAQ;MACV;IACF,GACA;MACEC,SAAA,EAAW;QACTC,YAAA,EAAc,IAAIC,IAAA;MACpB;IACF;EAEJ;EAEA,IAAIR,cAAA,EAAgB;IAClBE,KAAA,CAAMC,GAAG,CAACM,IAAI,CAAC;MACb,mBAAmB;QACjBJ,MAAA,EAAQK,MAAA,CAAOX,EAAA;MACjB;IACF;IACAG,KAAA,CAAMC,GAAG,CAACM,IAAI,CAAC;MACb,wBAAwB;QACtBJ,MAAA,EAAQL;MACV;IACF;EACF;EAEA,IAAIC,UAAA,EAAY;IACdC,KAAA,CAAMC,GAAG,CAACM,IAAI,CAAC;MACb,gBAAgB;QACdJ,MAAA,EAAQJ;MACV;IACF;EACF;EAEA,OAAOC,KAAA;AACT","ignoreList":[]}
@@ -4,6 +4,7 @@ import type { PublishType } from './types.js';
4
4
  import './index.css';
5
5
  type Props = {
6
6
  defaultType?: PublishType;
7
+ onUpcomingChange?: (hasUpcoming: boolean) => void;
7
8
  schedulePublishConfig?: SchedulePublish;
8
9
  slug: string;
9
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/PublishButton/ScheduleDrawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAU,eAAe,EAAS,MAAM,SAAS,CAAA;AAQ7D,OAAO,KAA+B,MAAM,OAAO,CAAA;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAA;AAe5D,OAAO,aAAa,CAAA;AASpB,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,qBAAqB,CAAC,EAAE,eAAe,CAAA;IACvC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAOD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAkU1C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/elements/PublishButton/ScheduleDrawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAU,eAAe,EAAS,MAAM,SAAS,CAAA;AAQ7D,OAAO,KAA+B,MAAM,OAAO,CAAA;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,YAAY,CAAA;AAe5D,OAAO,aAAa,CAAA;AAUpB,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IACjD,qBAAqB,CAAC,EAAE,eAAe,CAAA;IACvC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAOD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiT1C,CAAA"}