@ntbjs/react-components 2.0.14 → 3.0.0-rc.1

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 (343) hide show
  1. package/build/data/Alert/Alert.js +18 -33
  2. package/build/data/Alert/Alert.js.map +1 -1
  3. package/build/data/Alert/Alert.styled.js +9 -47
  4. package/build/data/Alert/Alert.styled.js.map +1 -1
  5. package/build/data/Badge/Badge.js +36 -61
  6. package/build/data/Badge/Badge.js.map +1 -1
  7. package/build/data/Badge/Badge.styled.js +21 -70
  8. package/build/data/Badge/Badge.styled.js.map +1 -1
  9. package/build/data/Popover/Popover.js +125 -71
  10. package/build/data/Popover/Popover.js.map +1 -1
  11. package/build/data/Popover/Popover.styled.js +10 -140
  12. package/build/data/Popover/Popover.styled.js.map +1 -1
  13. package/build/data/SeverityBadge/SeverityBadge.js +13 -22
  14. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  15. package/build/data/SeverityBadge/index.js +2 -0
  16. package/build/data/SeverityBadge/index.js.map +1 -0
  17. package/build/data/Tab/Tab.js +7 -13
  18. package/build/data/Tab/Tab.js.map +1 -1
  19. package/build/data/Tab/Tab.styled.js +4 -7
  20. package/build/data/Tab/Tab.styled.js.map +1 -1
  21. package/build/data/Tabs/Tabs.js +30 -32
  22. package/build/data/Tabs/Tabs.js.map +1 -1
  23. package/build/data/Tabs/Tabs.styled.js +21 -57
  24. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  25. package/build/data/Tooltip/Tooltip.js +102 -33
  26. package/build/data/Tooltip/Tooltip.js.map +1 -1
  27. package/build/data/Tooltip/Tooltip.styled.js +9 -22
  28. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  29. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
  30. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  31. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
  32. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  33. package/build/data/VerificationStatusIcon/index.js +2 -0
  34. package/build/data/VerificationStatusIcon/index.js.map +1 -0
  35. package/build/data/_shared/FloatingArrow.styled.js +30 -0
  36. package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
  37. package/build/hooks/useEventListner.js.map +1 -1
  38. package/build/hooks/useFloatingPopover.js +187 -0
  39. package/build/hooks/useFloatingPopover.js.map +1 -0
  40. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  41. package/build/hooks/useOnClickOutside.js.map +1 -1
  42. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  43. package/build/icons/arrow-back.svg.js +3 -3
  44. package/build/icons/arrow-back.svg.js.map +1 -1
  45. package/build/icons/arrow-forward.svg.js +4 -4
  46. package/build/icons/arrow-forward.svg.js.map +1 -1
  47. package/build/icons/check-rectangle-filled.svg.js +3 -3
  48. package/build/icons/check-rectangle-filled.svg.js.map +1 -1
  49. package/build/icons/close.svg.js +3 -3
  50. package/build/icons/close.svg.js.map +1 -1
  51. package/build/icons/edit-note.svg.js +3 -3
  52. package/build/icons/edit-note.svg.js.map +1 -1
  53. package/build/icons/expand-more.svg.js +3 -3
  54. package/build/icons/expand-more.svg.js.map +1 -1
  55. package/build/icons/headset.svg.js +3 -3
  56. package/build/icons/headset.svg.js.map +1 -1
  57. package/build/icons/layers.svg.js +3 -3
  58. package/build/icons/layers.svg.js.map +1 -1
  59. package/build/icons/link.svg.js +3 -3
  60. package/build/icons/link.svg.js.map +1 -1
  61. package/build/icons/play.svg.js +3 -3
  62. package/build/icons/play.svg.js.map +1 -1
  63. package/build/icons/search.svg.js +3 -3
  64. package/build/icons/search.svg.js.map +1 -1
  65. package/build/icons/star-filled.svg.js +3 -3
  66. package/build/icons/star-filled.svg.js.map +1 -1
  67. package/build/icons/star.svg.js +3 -3
  68. package/build/icons/star.svg.js.map +1 -1
  69. package/build/icons/triangle-right.svg.js +3 -3
  70. package/build/icons/triangle-right.svg.js.map +1 -1
  71. package/build/icons/verification.svg.js +3 -3
  72. package/build/icons/verification.svg.js.map +1 -1
  73. package/build/icons/warning-circle.svg.js +3 -3
  74. package/build/icons/warning-circle.svg.js.map +1 -1
  75. package/build/inputs/ActionButton/ActionButton.js +11 -22
  76. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  77. package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
  78. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  79. package/build/inputs/Button/Button.js +125 -121
  80. package/build/inputs/Button/Button.js.map +1 -1
  81. package/build/inputs/Button/Button.styled.js +42 -260
  82. package/build/inputs/Button/Button.styled.js.map +1 -1
  83. package/build/inputs/Checkbox/Checkbox.js +45 -61
  84. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  85. package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
  86. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  87. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
  88. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  89. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
  90. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  91. package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
  92. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  93. package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
  94. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  95. package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
  96. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  97. package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
  98. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  99. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
  100. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  101. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
  102. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  103. package/build/inputs/MultiLevelCheckbox/types.js +12 -12
  104. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  105. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
  106. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  107. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
  108. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  109. package/build/inputs/MultiSelect/MultiSelect.js +69 -79
  110. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  111. package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
  112. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  113. package/build/inputs/Radio/Radio.js +20 -33
  114. package/build/inputs/Radio/Radio.js.map +1 -1
  115. package/build/inputs/Radio/Radio.styled.js +15 -96
  116. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  117. package/build/inputs/Switch/Switch.js +28 -40
  118. package/build/inputs/Switch/Switch.js.map +1 -1
  119. package/build/inputs/Switch/Switch.styled.js +24 -94
  120. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  121. package/build/inputs/TextArea/TextArea.js +98 -123
  122. package/build/inputs/TextArea/TextArea.js.map +1 -1
  123. package/build/inputs/TextArea/TextArea.styled.js +64 -379
  124. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  125. package/build/inputs/TextInput/TextInput.js +59 -79
  126. package/build/inputs/TextInput/TextInput.js.map +1 -1
  127. package/build/inputs/TextInput/TextInput.styled.js +33 -224
  128. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  129. package/build/layout/InputGroup/InputGroup.js +6 -9
  130. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  131. package/build/layout/InputGroup/InputGroup.styled.js +4 -3
  132. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  133. package/build/layout/InputGroup/index.js +2 -0
  134. package/build/layout/InputGroup/index.js.map +1 -0
  135. package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
  136. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  137. package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
  138. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  139. package/build/styles/utils/colors-export.d.ts +73 -0
  140. package/build/styles/utils/colors-export.js.map +1 -1
  141. package/build/utils/dateTime.js.map +1 -1
  142. package/build/utils/defaultTheme.js +14 -28
  143. package/build/utils/defaultTheme.js.map +1 -1
  144. package/build/utils/getElementRef.js +14 -0
  145. package/build/utils/getElementRef.js.map +1 -0
  146. package/build/utils/parseTrigger.js +16 -0
  147. package/build/utils/parseTrigger.js.map +1 -0
  148. package/build/widgets/AssetAction/AssetAction.js +26 -33
  149. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  150. package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
  151. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  152. package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
  153. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  154. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
  155. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  156. package/build/widgets/AssetGallery/AssetGallery.js +15 -40
  157. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  158. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
  159. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  160. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
  161. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  162. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -122
  163. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  164. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -286
  165. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  166. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
  167. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  168. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
  169. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  170. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
  171. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  172. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
  173. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  174. package/build/widgets/ContextMenu/ContextMenu.js +12 -11
  175. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  176. package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
  177. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  178. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
  179. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  180. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
  181. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  182. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
  183. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  184. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
  185. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  186. package/build/widgets/InfoCard/InfoCard.js +26 -21
  187. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  188. package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
  189. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  190. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
  191. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  192. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
  193. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  194. package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
  195. package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
  196. package/build/widgets/Instructions/Instructions.js +53 -95
  197. package/build/widgets/Instructions/Instructions.js.map +1 -1
  198. package/build/widgets/Instructions/Instructions.styled.js +27 -26
  199. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  200. package/build/widgets/ProgressBar/ProgressBar.js +39 -37
  201. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  202. package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
  203. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  204. package/build/widgets/SummaryCard/SummaryCard.js +55 -64
  205. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  206. package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
  207. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  208. package/package.json +77 -36
  209. package/styles/utils/colors-export.d.ts +73 -0
  210. package/types/components/data/Alert/Alert.d.ts +76 -0
  211. package/types/components/data/Alert/Alert.styled.d.ts +83 -0
  212. package/types/components/data/Alert/index.d.ts +1 -0
  213. package/types/components/data/Badge/Badge.d.ts +128 -0
  214. package/types/components/data/Badge/Badge.styled.d.ts +132 -0
  215. package/types/components/data/Badge/index.d.ts +1 -0
  216. package/types/components/data/Popover/Popover.d.ts +205 -0
  217. package/types/components/data/Popover/Popover.styled.d.ts +15 -0
  218. package/types/components/data/Popover/index.d.ts +1 -0
  219. package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
  220. package/types/components/data/SeverityBadge/index.d.ts +1 -0
  221. package/types/components/data/Tab/Tab.d.ts +27 -0
  222. package/types/components/data/Tab/Tab.styled.d.ts +1 -0
  223. package/types/components/data/Tab/index.d.ts +1 -0
  224. package/types/components/data/Tabs/Tabs.d.ts +111 -0
  225. package/types/components/data/Tabs/Tabs.styled.d.ts +42 -0
  226. package/types/components/data/Tabs/index.d.ts +1 -0
  227. package/types/components/data/Tooltip/Tooltip.d.ts +134 -0
  228. package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
  229. package/types/components/data/Tooltip/index.d.ts +1 -0
  230. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
  231. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +46 -0
  232. package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
  233. package/types/components/data/_shared/FloatingArrow.styled.d.ts +129 -0
  234. package/types/components/data/index.d.ts +8 -0
  235. package/types/components/index.d.ts +3 -0
  236. package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
  237. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +34 -0
  238. package/types/components/inputs/ActionButton/index.d.ts +1 -0
  239. package/types/components/inputs/Button/Button.d.ts +82 -0
  240. package/types/components/inputs/Button/Button.styled.d.ts +102 -0
  241. package/types/components/inputs/Button/index.d.ts +1 -0
  242. package/types/components/inputs/Checkbox/Checkbox.d.ts +92 -0
  243. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +33 -0
  244. package/types/components/inputs/Checkbox/index.d.ts +1 -0
  245. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
  246. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +157 -0
  247. package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
  248. package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
  249. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +86 -0
  250. package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
  251. package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
  252. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +70 -0
  253. package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
  254. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
  255. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +21 -0
  256. package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
  257. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +72 -0
  258. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
  259. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
  260. package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
  261. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +172 -0
  262. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +99 -0
  263. package/types/components/inputs/MultiSelect/index.d.ts +1 -0
  264. package/types/components/inputs/Radio/Radio.d.ts +65 -0
  265. package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
  266. package/types/components/inputs/Radio/index.d.ts +1 -0
  267. package/types/components/inputs/Switch/Switch.d.ts +62 -0
  268. package/types/components/inputs/Switch/Switch.styled.d.ts +20 -0
  269. package/types/components/inputs/Switch/index.d.ts +1 -0
  270. package/types/components/inputs/TextArea/TextArea.d.ts +124 -0
  271. package/types/components/inputs/TextArea/TextArea.styled.d.ts +95 -0
  272. package/types/components/inputs/TextArea/index.d.ts +1 -0
  273. package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
  274. package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
  275. package/types/components/inputs/TextInput/index.d.ts +1 -0
  276. package/types/components/inputs/index.d.ts +13 -0
  277. package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
  278. package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
  279. package/types/components/layout/InputGroup/index.d.ts +1 -0
  280. package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
  281. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +14 -0
  282. package/types/components/layout/SectionSeparator/index.d.ts +1 -0
  283. package/types/components/layout/index.d.ts +2 -0
  284. package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
  285. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +20 -0
  286. package/types/components/widgets/AssetAction/index.d.ts +1 -0
  287. package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
  288. package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
  289. package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
  290. package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
  291. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +88 -0
  292. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
  293. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
  294. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +100 -0
  295. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
  296. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +85 -0
  297. package/types/components/widgets/AssetGallery/asset.types.d.ts +446 -0
  298. package/types/components/widgets/AssetGallery/index.d.ts +1 -0
  299. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
  300. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +35 -0
  301. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
  302. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +134 -0
  303. package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
  304. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
  305. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +26 -0
  306. package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
  307. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +41 -0
  308. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
  309. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
  310. package/types/components/widgets/ContextMenu/index.d.ts +1 -0
  311. package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
  312. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +45 -0
  313. package/types/components/widgets/InfoCard/index.d.ts +1 -0
  314. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
  315. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +40 -0
  316. package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
  317. package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
  318. package/types/components/widgets/Instructions/Instructions.styled.d.ts +26 -0
  319. package/types/components/widgets/Instructions/index.d.ts +1 -0
  320. package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
  321. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +78 -0
  322. package/types/components/widgets/ProgressBar/index.d.ts +1 -0
  323. package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
  324. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +68 -0
  325. package/types/components/widgets/SummaryCard/index.d.ts +1 -0
  326. package/types/components/widgets/index.d.ts +11 -0
  327. package/types/hooks/useElementSize.d.ts +25 -0
  328. package/types/hooks/useEventListner.d.ts +46 -0
  329. package/types/hooks/useFloatingPopover.d.ts +242 -0
  330. package/types/hooks/useIsomorphicLayoutEffect.d.ts +26 -0
  331. package/types/hooks/useOnClickOutside.d.ts +31 -0
  332. package/types/hooks/useTooltipAutoShow.d.ts +80 -0
  333. package/types/icons/index.d.ts +41 -0
  334. package/types/ssr/index.d.ts +1 -0
  335. package/types/styles/utils/colors-export.d.ts +73 -0
  336. package/types/utils/dateTime.d.ts +13 -0
  337. package/types/utils/defaultTheme.d.ts +174 -0
  338. package/types/utils/getElementRef.d.ts +21 -0
  339. package/types/utils/parseTrigger.d.ts +92 -0
  340. package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
  341. package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  342. package/build/widgets/AssetGallery/asset.propType.js +0 -56
  343. package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
@@ -1,10 +1,18 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { isBoolean } from 'lodash';
3
- import PropTypes from 'prop-types';
4
- import React__default, { useMemo } from 'react';
1
+ import React__default from 'react';
2
+ import { useFloatingNodeId, useMergeRefs, FloatingNode, FloatingPortal } from '@floating-ui/react';
3
+ import useFloatingPopover from '../../hooks/useFloatingPopover.js';
4
+ import { getElementRef } from '../../utils/getElementRef.js';
5
+ import { SharedFloatingArrow, POPOVER_ARROW } from '../_shared/FloatingArrow.styled.js';
5
6
  import { Popover as Popover$1 } from './Popover.styled.js';
6
- import maxSize from 'popper-max-size-modifier';
7
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
8
 
9
+ const TIPPY_DEFAULT_Z_INDEX = 9999;
10
+ const POSITIONER_MAX_WIDTH = 'calc(100vw - 10px)';
11
+ const CONTEXT_MENU_SUBLEVEL_PLACEMENT = 'right-start';
12
+ const CONTEXT_MENU_SUBLEVEL_TRIGGER = 'mouseenter click focus';
13
+ const CONTEXT_MENU_ITEM_SELECTOR = '.context-menu-item';
14
+ const CONTEXT_MENU_SUBLEVEL_OPENER_CLASS = 'opens-sublevel';
15
+ const PROPS_NEVER_FORWARDED = ['onClick', 'onChange', 'onSubmit', 'popperOptions'];
8
16
  const Popover = React__default.forwardRef(function Popover({
9
17
  content = 'Tooltip',
10
18
  interactive = true,
@@ -18,78 +26,124 @@ const Popover = React__default.forwardRef(function Popover({
18
26
  contextMenuSublevel = false,
19
27
  children,
20
28
  modifiers = [],
29
+ middleware,
21
30
  maxWidth = 'none',
31
+ zIndex = TIPPY_DEFAULT_Z_INDEX,
32
+ disabled = false,
33
+ appendTo,
34
+ onClickOutside,
35
+ onShow,
36
+ onHide,
22
37
  ...props
23
38
  }, ref) {
24
- const errorOffset = useMemo(() => arrow ? 15 : 0, [arrow]);
25
- const isControlled = useMemo(() => isBoolean(visible), [visible]);
26
- const handleContextMenuItemClick = () => {
27
- document.querySelectorAll('.context-menu-item:not(.opens-sublevel)').forEach(item => item.addEventListener('click', () => {
28
- document.querySelectorAll('[data-tippy-root]').forEach(node => {
29
- if (node._tippy) {
30
- node._tippy.hide();
31
- }
32
- });
33
- }));
39
+ void modifiers.length;
40
+ const onOpenChange = React__default.useCallback((open, event, reason) => {
41
+ if (!open && reason === 'outside-press') {
42
+ onClickOutside?.(event);
43
+ }
44
+ if (open) {
45
+ onShow?.();
46
+ } else {
47
+ onHide?.();
48
+ }
49
+ }, [onClickOutside, onShow, onHide]);
50
+ const nodeId = useFloatingNodeId();
51
+ const offsetTuple = [offset[0] ?? 0, offset[1] ?? 0];
52
+ const arrowDrivesTheOffset = arrow;
53
+ const drawsArrow = contextMenu ? false : arrow;
54
+ const {
55
+ refs,
56
+ floatingStyles,
57
+ context,
58
+ getReferenceProps,
59
+ getFloatingProps,
60
+ isMounted,
61
+ transitionStyles,
62
+ arrowRef,
63
+ setOpen,
64
+ placement: resolvedPlacement,
65
+ pointerEvents
66
+ } = useFloatingPopover({
67
+ placement: contextMenuSublevel ? CONTEXT_MENU_SUBLEVEL_PLACEMENT : placement,
68
+ open: visible,
69
+ onOpenChange,
70
+ trigger: contextMenuSublevel ? CONTEXT_MENU_SUBLEVEL_TRIGGER : trigger,
71
+ offset: offsetTuple,
72
+ arrow: arrowDrivesTheOffset,
73
+ interactive,
74
+ disabled,
75
+ duration,
76
+ constrainHeight: true,
77
+ nodeId,
78
+ middleware
79
+ });
80
+ const childRef = React__default.isValidElement(children) ? getElementRef(children) : null;
81
+ const referenceRef = useMergeRefs([ref, childRef, refs.setReference]);
82
+ const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => !PROPS_NEVER_FORWARDED.includes(key)));
83
+ const reference = React__default.isValidElement(children) ? React__default.cloneElement(children, {
84
+ ...getReferenceProps(children.props),
85
+ ref: referenceRef
86
+ }) : children;
87
+ const handleContextMenuClick = event => {
88
+ if (!contextMenu) return;
89
+ const target = event.target;
90
+ if (!(target instanceof Element)) return;
91
+ const item = target.closest(CONTEXT_MENU_ITEM_SELECTOR);
92
+ if (!item || item.classList.contains(CONTEXT_MENU_SUBLEVEL_OPENER_CLASS)) return;
93
+ setOpen(false, event.nativeEvent, 'click');
34
94
  };
35
- const eventHandlerProps = ['onClick', 'onChange', 'onSubmit'];
36
- const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => !eventHandlerProps.includes(key)));
37
- return React__default.createElement("div", null, React__default.createElement(Popover$1, _extends({
38
- ref: ref,
39
- content: content,
40
- interactive: interactive,
41
- placement: contextMenuSublevel ? 'right-start' : placement,
42
- duration: duration,
43
- animation: 'shift-away-subtle',
44
- trigger: isControlled ? undefined : contextMenuSublevel ? 'mouseenter click focus' : trigger,
45
- offset: [offset[0], offset[1] + errorOffset],
46
- arrow: contextMenu ? false : arrow,
47
- visible: visible,
48
- popperOptions: {
49
- modifiers: [{
50
- ...maxSize,
51
- options: {
52
- boundary: 'viewport',
53
- rootBoundary: 'viewport',
54
- padding: 10
55
- }
56
- }, {
57
- name: 'applyMaxSize',
58
- enabled: true,
59
- phase: 'beforeWrite',
60
- requires: ['maxSize'],
61
- fn({
62
- state
63
- }) {
64
- const {
65
- height
66
- } = state.modifiersData.maxSize;
67
- state.styles.popper = {
68
- ...state.styles.popper,
69
- maxHeight: `${height}px`
70
- };
71
- }
72
- }, ...modifiers]
95
+ const renderInline = appendTo === 'parent' || interactive && appendTo === undefined;
96
+ const resolvePortalRoot = () => {
97
+ if (renderInline || appendTo === undefined) return undefined;
98
+ if (typeof appendTo === 'function') {
99
+ const node = refs.reference.current;
100
+ return node instanceof Element ? appendTo(node) : null;
101
+ }
102
+ return appendTo;
103
+ };
104
+ const floating = isMounted ? jsx("div", {
105
+ ref: refs.setFloating,
106
+ style: {
107
+ ...floatingStyles,
108
+ zIndex,
109
+ pointerEvents,
110
+ maxWidth: POSITIONER_MAX_WIDTH
73
111
  },
74
- onShow: contextMenu ? handleContextMenuItemClick : undefined,
75
- maxWidth: maxWidth
76
- }, filteredProps), children));
112
+ ...getFloatingProps({
113
+ onClick: handleContextMenuClick
114
+ }),
115
+ children: jsxs(Popover$1, {
116
+ ...filteredProps,
117
+ "data-placement": resolvedPlacement,
118
+ "data-context-menu": contextMenu ? 'true' : undefined,
119
+ "data-context-menu-sublevel": contextMenuSublevel ? 'true' : undefined,
120
+ role: "tooltip",
121
+ tabIndex: -1,
122
+ style: {
123
+ ...transitionStyles,
124
+ maxWidth
125
+ },
126
+ children: [jsx("div", {
127
+ className: "tippy-content",
128
+ children: content
129
+ }), drawsArrow && jsx(SharedFloatingArrow, {
130
+ ref: arrowRef,
131
+ context: context,
132
+ "data-arrow-surface": "popover",
133
+ ...POPOVER_ARROW
134
+ })]
135
+ })
136
+ }) : null;
137
+ return jsxs("div", {
138
+ children: [reference, jsx(FloatingNode, {
139
+ id: nodeId,
140
+ children: renderInline ? floating : jsx(FloatingPortal, {
141
+ root: resolvePortalRoot(),
142
+ children: floating
143
+ })
144
+ })]
145
+ });
77
146
  });
78
- Popover.propTypes = process.env.NODE_ENV !== "production" ? {
79
- content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,
80
- interactive: PropTypes.bool,
81
- placement: PropTypes.oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'auto', 'auto-start', 'auto-end']),
82
- duration: PropTypes.number,
83
- trigger: PropTypes.string,
84
- offset: PropTypes.arrayOf(PropTypes.number),
85
- arrow: PropTypes.bool,
86
- visible: PropTypes.bool,
87
- modifiers: PropTypes.array,
88
- maxWidth: PropTypes.string,
89
- contextMenu: PropTypes.bool,
90
- contextMenuSublevel: PropTypes.bool,
91
- children: PropTypes.node.isRequired
92
- } : {};
93
147
 
94
148
  export { Popover as default };
95
149
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../src/components/data/Popover/Popover.js"],"sourcesContent":["import { isBoolean } from 'lodash';\nimport PropTypes from 'prop-types';\nimport React, { useMemo } from 'react';\nimport * as S from './Popover.styled';\nimport maxSize from 'popper-max-size-modifier';\n\n/**\n * The `Popover` is a transient view that shows on a content screen when a user clicks on a control button or within a defined area.\n * A `Popover` renders a temporary context to get user’s attention and to hide unnecessary interactions.\n *\n * This component is used with the `Button` and `ContextMenu` components to create dropdown menus and context menus.\n * See their documentation for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { Popover } from '@ntbjs/react-components/data'\n * // or\n * import Popover from '@ntbjs/react-components/data/Popover'\n * ```\n *\n * ### Usage example\n *\n * ``` js\n<Popover content={<img alt=\"Dummy content\" src={dummyImage} />}>\n <ActionButton icon={<DeleteIcon />} onClick={() => {}} />\n</Popover>\n * ```\n */\n\nconst Popover = React.forwardRef(function Popover(\n {\n content = 'Tooltip',\n interactive = true,\n placement = 'bottom-end',\n duration = 350,\n trigger = 'click focus',\n offset = [0, 8],\n arrow = true,\n visible = undefined,\n contextMenu = false,\n contextMenuSublevel = false,\n children,\n modifiers = [],\n maxWidth = 'none',\n ...props\n },\n ref\n) {\n const errorOffset = useMemo(() => (arrow ? 15 : 0), [arrow]);\n\n const isControlled = useMemo(() => isBoolean(visible), [visible]);\n\n const handleContextMenuItemClick = () => {\n document.querySelectorAll('.context-menu-item:not(.opens-sublevel)').forEach(item =>\n item.addEventListener('click', () => {\n document.querySelectorAll('[data-tippy-root]').forEach(node => {\n if (node._tippy) {\n node._tippy.hide();\n }\n });\n })\n );\n };\n\n const eventHandlerProps = ['onClick', 'onChange', 'onSubmit'];\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => !eventHandlerProps.includes(key))\n );\n\n return (\n <div>\n <S.Popover\n ref={ref}\n content={content}\n interactive={interactive}\n placement={contextMenuSublevel ? 'right-start' : placement}\n duration={duration}\n animation={'shift-away-subtle'}\n trigger={\n isControlled ? undefined : contextMenuSublevel ? 'mouseenter click focus' : trigger\n }\n offset={[offset[0], offset[1] + errorOffset]}\n arrow={contextMenu ? false : arrow}\n visible={visible}\n popperOptions={{\n modifiers: [\n {\n ...maxSize,\n options: {\n boundary: 'viewport',\n rootBoundary: 'viewport',\n padding: 10\n }\n },\n {\n name: 'applyMaxSize',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['maxSize'],\n fn({ state }) {\n // The `maxSize` modifier provides this data\n const { height } = state.modifiersData.maxSize;\n\n state.styles.popper = {\n ...state.styles.popper,\n maxHeight: `${height}px`\n };\n }\n },\n ...modifiers\n ]\n }}\n // contextMenu={contextMenu}\n // contextMenuSublevel={contextMenuSublevel}\n onShow={contextMenu ? handleContextMenuItemClick : undefined}\n maxWidth={maxWidth}\n {...filteredProps}\n >\n {children}\n </S.Popover>\n </div>\n );\n});\n\n/**\n * https://atomiks.github.io/tippyjs/v6/all-props/\n * @type {{content: Validator<NonNullable<string>>}}\n */\nPopover.propTypes = {\n /**\n * The content of the `Popover`.\n */\n content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,\n\n /**\n * Determines if the `Popover` has interactive content inside of it, so that it can be\n * hovered over and clicked inside without hiding.\n */\n interactive: PropTypes.bool,\n\n /**\n * The preferred placement of the `Popover`. Note that Popper's flip modifier can change\n * this to the opposite placement if it has more space.\n */\n placement: PropTypes.oneOf([\n 'top',\n 'top-start',\n 'top-end',\n 'right',\n 'right-start',\n 'right-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n 'auto',\n 'auto-start',\n 'auto-end'\n ]),\n\n /**\n * Duration in ms of the transition animation.\n */\n duration: PropTypes.number,\n\n /**\n * Determines the events that cause the `Popover` to show. Multiple event names are separated by\n * spaces.\n *\n * *Example events:*\n *\n * `trigger: 'click'`\n *\n * `trigger: 'focusin'`\n *\n * `trigger: 'mouseenter click'`\n *\n * --\n */\n trigger: PropTypes.string,\n\n /**\n * Displaces the popover from its reference element in pixels (skidding and distance).\n *\n * `[skidding, distance]`\n */\n offset: PropTypes.arrayOf(PropTypes.number),\n\n /**\n * Determines if the popover has an arrow.\n */\n arrow: PropTypes.bool,\n\n /**\n * Use React's state to fully control the `Popover` instead of relying on the native trigger\n * and `hideOnClick` props\n */\n visible: PropTypes.bool,\n\n /**\n * Additional Popper modifiers\n */\n modifiers: PropTypes.array,\n\n /**\n * Max-width\n */\n maxWidth: PropTypes.string,\n\n /**\n * Whether the `Popover` contains a context menu.\n * This will remove the default arrow, and apply styling.\n */\n contextMenu: PropTypes.bool,\n\n /**\n * Whether the `Popover` contains a context menu which is the sublevel of another context menu.\n * This will automatically set placement, spacing and trigger events, add a dropdown icon, etc.\n */\n contextMenuSublevel: PropTypes.bool,\n\n /**\n * Content of the `Popover`.\n */\n children: PropTypes.node.isRequired\n};\n\nexport default Popover;\n"],"names":["Popover","React","forwardRef","content","interactive","placement","duration","trigger","offset","arrow","visible","undefined","contextMenu","contextMenuSublevel","children","modifiers","maxWidth","props","ref","errorOffset","useMemo","isControlled","isBoolean","handleContextMenuItemClick","document","querySelectorAll","forEach","item","addEventListener","node","_tippy","hide","eventHandlerProps","filteredProps","Object","fromEntries","entries","filter","key","includes","createElement","S","_extends","animation","popperOptions","maxSize","options","boundary","rootBoundary","padding","name","enabled","phase","requires","fn","state","height","modifiersData","styles","popper","maxHeight","onShow","propTypes","process","env","NODE_ENV","PropTypes","oneOfType","string","element","isRequired","bool","oneOf","number","arrayOf","array"],"mappings":";;;;;;;AA8BMA,MAAAA,OAAO,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,OAAOA,CAC/C;AACEG,EAAAA,OAAO,GAAG,SAAS;AACnBC,EAAAA,WAAW,GAAG,IAAI;AAClBC,EAAAA,SAAS,GAAG,YAAY;AACxBC,EAAAA,QAAQ,GAAG,GAAG;AACdC,EAAAA,OAAO,GAAG,aAAa;AACvBC,EAAAA,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AACfC,EAAAA,KAAK,GAAG,IAAI;AACZC,EAAAA,OAAO,GAAGC,SAAS;AACnBC,EAAAA,WAAW,GAAG,KAAK;AACnBC,EAAAA,mBAAmB,GAAG,KAAK;EAC3BC,QAAQ;AACRC,EAAAA,SAAS,GAAG,EAAE;AACdC,EAAAA,QAAQ,GAAG,MAAM;EACjB,GAAGC,KAAAA;AACL,CAAC,EACDC,GAAG,EACH;AACA,EAAA,MAAMC,WAAW,GAAGC,OAAO,CA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Fd,OAAO,CAAC8D,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAIlB9D,EAAAA,OAAO,EAAE+D,SAAS,CAACC,SAAS,CAAC,CAACD,SAAS,CAACE,MAAM,EAAEF,SAAS,CAACG,OAAO,CAAC,CAAC,CAACC,UAAU;EAM9ElE,WAAW,EAAE8D,SAAS,CAACK,IAAI;AAM3BlE,EAAAA,SAAS,EAAE6D,SAAS,CAACM,KAAK,CAAC,CACzB,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,aAAa,EACb,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACV,MAAM,EACN,YAAY,EACZ,UAAU,CACX,CAAC;EAKFlE,QAAQ,EAAE4D,SAAS,CAACO,MAAM;EAgB1BlE,OAAO,EAAE2D,SAAS,CAACE,MAAM;EAOzB5D,MAAM,EAAE0D,SAAS,CAACQ,OAAO,CAACR,SAAS,CAACO,MAAM,CAAC;EAK3ChE,KAAK,EAAEyD,SAAS,CAACK,IAAI;EAMrB7D,OAAO,EAAEwD,SAAS,CAACK,IAAI;EAKvBxD,SAAS,EAAEmD,SAAS,CAACS,KAAK;EAK1B3D,QAAQ,EAAEkD,SAAS,CAACE,MAAM;EAM1BxD,WAAW,EAAEsD,SAAS,CAACK,IAAI;EAM3B1D,mBAAmB,EAAEqD,SAAS,CAACK,IAAI;AAKnCzD,EAAAA,QAAQ,EAAEoD,SAAS,CAACrC,IAAI,CAACyC,UAAAA;AAC3B,CAAC,GAAA,EAAA;;;;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../src/components/data/Popover/Popover.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingNode, FloatingPortal, useFloatingNodeId, useMergeRefs } from '@floating-ui/react';\n\nimport useFloatingPopover from '../../../hooks/useFloatingPopover';\nimport { getElementRef } from '../../../utils/getElementRef';\nimport { POPOVER_ARROW, SharedFloatingArrow } from '../_shared/FloatingArrow.styled';\nimport * as S from './Popover.styled';\n\nimport type { Middleware, OpenChangeReason } from '@floating-ui/react';\nimport type { PopoverPlacement, PopperOffset } from '../../../hooks/useFloatingPopover';\n\n/**\n * tippy's own default `zIndex`, applied unconditionally to every popper root it ever\n * created (`popper.style.zIndex = String(zIndex)`, `tippy.js/dist/tippy.cjs.js:754`, with\n * `zIndex: 9999` at line 342). 10 consumer call sites override it, up to 999999, which is\n * why it is a declared prop here even though it was never in the old prop type — it used to\n * typecheck only because the published `Props` widened to `TippyProps`, and that widening\n * disappears with tippy.\n */\nconst TIPPY_DEFAULT_Z_INDEX = 9999;\n\n/**\n * `max-width: calc(100vw - 10px)`, which `tippy.css` applied through `[data-tippy-root]` —\n * i.e. to the POSITIONER, not to the box. It only binds on a viewport narrower than the\n * popover, which is precisely the case it exists for, so it is carried over rather than\n * dropped as unobservable. The box's own cap is the public `maxWidth` prop, default\n * `'none'`, which tippy wrote inline as `box.style.maxWidth` (line 561).\n */\nconst POSITIONER_MAX_WIDTH = 'calc(100vw - 10px)';\n\n/**\n * What `contextMenuSublevel` forces, unchanged from the old implementation\n * (`placement={contextMenuSublevel ? 'right-start' : placement}` and\n * `trigger={… contextMenuSublevel ? 'mouseenter click focus' : trigger}`). Both override the\n * caller, which is the documented behaviour: \"This will automatically set placement, spacing\n * and trigger events\".\n */\nconst CONTEXT_MENU_SUBLEVEL_PLACEMENT = 'right-start' as const;\nconst CONTEXT_MENU_SUBLEVEL_TRIGGER = 'mouseenter click focus';\n\n/**\n * The class `ContextMenuItem` writes (`ContextMenuItem.tsx:81`), and the one it adds for an\n * item that opens a submenu. A click on a LEAF item closes the menu; a click on a sublevel\n * opener must not, or the submenu would close the parent it just opened.\n */\nconst CONTEXT_MENU_ITEM_SELECTOR = '.context-menu-item';\nconst CONTEXT_MENU_SUBLEVEL_OPENER_CLASS = 'opens-sublevel';\n\n/**\n * tippy's `appendTo`, and the three-way rule it implies. `'parent'` and an implicit-parent\n * case are real tippy behaviours, not inventions — measured in\n * `tippy.js/dist/tippy.cjs.js`:\n *\n * ```js\n * if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {\n * parentNode = node.parentNode; // INLINE, next to the reference\n * } else {\n * parentNode = invokeWithArgsOrReturn(appendTo, [node]); // portal\n * }\n * ```\n *\n * ⚠️ **`Popover` DEFAULTS `interactive` TO `true`, SO ITS DEFAULT IS THE INLINE BRANCH.**\n * `appendTo` appears in 6 files per consumer out of 30 `<Popover>` call sites across both,\n * so a blanket `FloatingPortal` would relocate the MAJORITY of call sites out of their\n * current DOM position — a stacking/`z-index` regression across both apps, not a\n * preservation. Plan §A3 originally resolved C4 as \"portal by default\" on half the evidence\n * and was corrected in `0ef5f71`; `Tooltip.tsx:77-97` is where the branch was first found.\n *\n * | `appendTo` | `interactive` | where it renders |\n * | --- | --- | --- |\n * | given | any | `FloatingPortal` rooted at `appendTo` |\n * | absent | `false` | `FloatingPortal` rooted at `document.body` |\n * | absent | `true` *(the default)* | **INLINE**, into the reference's parent |\n *\n * All 12 `appendTo` sites across both consumers pass `document.body`; the `'parent'` and\n * function forms are supported because tippy supported them and the render-gate fixture\n * uses `'parent'` to make an open popover capturable.\n */\nexport type PopoverAppendTo = 'parent' | Element | ((reference: Element) => Element);\n\ntype PopoverOwnProps = {\n /**\n * The content of the `Popover`.\n */\n content: string | React.ReactElement<any>;\n /**\n * Determines if the `Popover` has interactive content inside of it, so that it can be\n * hovered over and clicked inside without hiding.\n *\n * **It also decides where the popover renders** — see `PopoverAppendTo`. It defaults to\n * `true`, so a `Popover` renders INLINE unless `appendTo` or `interactive={false}` says\n * otherwise.\n */\n interactive?: boolean;\n /**\n * The preferred placement of the `Popover`. Note that the flip middleware can change this\n * to the opposite placement if it has more space.\n *\n * The 12 concrete names are spelled identically in Popper and Floating UI, so they need no\n * translation. The three `auto*` values have no Floating UI string — they select\n * `autoPlacement()` instead of `flip()`; see `useFloatingPopover`.\n */\n placement?: PopoverPlacement;\n /**\n * Duration in ms of the transition animation.\n */\n duration?: number;\n /**\n * Determines the events that cause the `Popover` to show. Multiple event names are separated by\n * spaces.\n *\n * *Example events:*\n *\n * `trigger: 'click'`\n *\n * `trigger: 'focusin'`\n *\n * `trigger: 'mouseenter click'`\n *\n * `''` means no triggers at all, and `undefined` means tippy's default\n * (`'mouseenter focus'`) — though this component overrides that with its own default of\n * `'click focus'`. See `parseTrigger`.\n *\n * --\n */\n trigger?: string;\n /**\n * Displaces the popover from its reference element in pixels (skidding and distance).\n *\n * `[skidding, distance]`\n *\n * `distance` is the gap between the reference and the ARROW TIP, not the box — which is\n * what it has always meant here, because the old implementation handed tippy\n * `offset[1] + (arrow ? 15 : 0)`. `useFloatingPopover` adds the arrow height back, so the\n * prop keeps its meaning; see `DEFAULT_ARROW_HEIGHT` for the derivation of the 15.\n */\n offset?: number[];\n /**\n * Determines if the popover has an arrow.\n *\n * ⚠️ It also moves the box even when the arrow is NOT drawn — see the block comment at\n * `arrowDrivesTheOffset` in the body. That is the existing behaviour, reproduced.\n */\n arrow?: boolean;\n /**\n * Use React's state to fully control the `Popover` instead of relying on the native trigger\n * and `hideOnClick` props\n *\n * Passing a boolean — **including `false`** — switches the popover to CONTROLLED mode and\n * its own triggers stop firing. `undefined` leaves it uncontrolled. `onClickOutside` still\n * fires in controlled mode, which is how 12 consumer call sites close a controlled\n * popover.\n */\n visible?: boolean;\n /**\n * @deprecated Accepted and IGNORED. This was a Popper `modifiers` array, appended to\n * `popperOptions.modifiers`; Floating UI has middleware instead and the two are not\n * translatable prop-for-prop. Kept so that no existing call site throws — plan C6. No\n * consumer passes it. Pass `middleware` instead.\n */\n modifiers?: any[];\n /**\n * Extra Floating UI middleware, appended after the built-in chain\n * (`offset` → `flip`/`autoPlacement` → `shift` → `arrow` → `size`). This is the honest\n * replacement for `modifiers`, and it exists because one internal caller genuinely needed\n * it: `MultiLevelCheckboxSelect` matched the popover's width to its input with a\n * hand-written Popper `sameWidth` modifier, which C6's accept-and-ignore would have\n * silently dropped.\n */\n middleware?: Middleware[];\n /**\n * Max-width of the popover box, as a CSS length. Defaults to `'none'`, which is what tippy\n * received and wrote inline on every popover in both consumers.\n */\n maxWidth?: string;\n /**\n * Whether the `Popover` contains a context menu.\n * This will remove the default arrow, and apply styling.\n *\n * It also makes a click on a `ContextMenuItem` close the menu — see\n * `handleContextMenuClick`.\n */\n contextMenu?: boolean;\n /**\n * Whether the `Popover` contains a context menu which is the sublevel of another context menu.\n * This will automatically set placement, spacing and trigger events, add a dropdown icon, etc.\n */\n contextMenuSublevel?: boolean;\n /**\n * `z-index` of the positioned element. Defaults to 9999, tippy's default. 10 consumer call\n * sites pass this.\n */\n zIndex?: number;\n /**\n * A disabled popover can never open, even under a controlled `visible={true}` — tippy's\n * semantics.\n */\n disabled?: boolean;\n /**\n * Where the popover is rendered. Omitting it means INLINE for an `interactive` popover\n * (the default) and `document.body` otherwise. See `PopoverAppendTo`.\n */\n appendTo?: PopoverAppendTo;\n /** Fired when a press lands outside both the reference and the popover. */\n onClickOutside?: (event?: Event) => void;\n /**\n * Fired when the popover opens. tippy's `onShow`, minus its instance argument.\n */\n onShow?: () => void;\n /**\n * Fired when the popover closes. tippy's `onHide`, minus its instance argument.\n *\n * ONE INTERNAL CALLER DEPENDS ON IT: `inputs/Button` passes\n * `onHide={handleDropdownClose}` to reset its `dropdown-is-active` class, so this is not a\n * courtesy re-export. It fires on every close the component decides for itself —\n * outside press, a second click on the trigger, a context-menu item click. It does NOT\n * fire when a CONTROLLED popover is closed by its owner flipping `visible` to `false`,\n * because nothing asks this component to close in that case; tippy did fire there. No\n * call site pairs `onHide` with `visible`, so the difference is currently unobservable.\n */\n onHide?: () => void;\n /**\n * Content of the `Popover`.\n */\n children: React.ReactNode;\n};\n\n/*\n * NMB-3998 §C.2: the rest of `props` is spread onto `S.Popover`, so the published type has\n * to admit that target's props too — a closed type here is worse than `any` for the 125\n * consumer files. Declared members win over the base (`Omit` by `keyof PopoverOwnProps`);\n * a bare `&` would INTERSECT a colliding member instead of overriding it, which narrows\n * it (measured: `rows?: number | string` & `rows?: number`) or empties it to `never`.\n *\n * THE BASE MOVED, AND THAT IS WHY THE PROP TYPE ABOVE GREW. It used to be\n * `styled(TippyTooltip)`, so this widening admitted every tippy option — which is how\n * `zIndex`, `disabled`, `appendTo`, `onClickOutside` and `onHide` typechecked at consumer\n * and internal call sites while appearing nowhere in the prop type. `S.Popover` is now a\n * `styled.div`, so those five would have become type errors the moment the library starts\n * publishing `.d.ts` (playbook §G.4). Declaring them explicitly is what keeps that promise;\n * the set was taken from a scan of every `<Popover>` tag in both consumers — 30 sites, 13\n * distinct props — per plan §A6's warning not to trust the old prop types.\n */\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Popover>, keyof PopoverOwnProps> &\n PopoverOwnProps;\n\n/**\n * Props that are accepted and then deliberately dropped, in two groups.\n *\n * `onClick` / `onChange` / `onSubmit` — this filter predates the migration and it used to be\n * redundant: `@tippyjs/react` destructures the props it knows and hands the rest to\n * `tippy()`, which ignores what it does not recognise, so an `onClick` passed to a `Popover`\n * has never fired. It is LOAD-BEARING NOW. The rest of `props` lands on a real element in\n * this implementation, so removing the filter would silently activate handlers that have\n * been dead at every call site that passes one — and there are two, in\n * `news_archive/na_download_options` in both consumers.\n *\n * `popperOptions` — plan C6. A Popper concept with no Floating UI translation and no\n * consumer usage, kept accepted-but-ignored so that no existing call site throws. It is\n * filtered here rather than destructured above because destructuring it would bind a name\n * nothing reads, which is a lint error, and because \"the list of props that never reach the\n * DOM\" is worth having in exactly one place. (`modifiers` and `maxWidth` ARE destructured:\n * `maxWidth` is applied, and `modifiers` is named in the prop type so its deprecation is\n * visible at the call site.)\n */\nconst PROPS_NEVER_FORWARDED = ['onClick', 'onChange', 'onSubmit', 'popperOptions'];\n\n/**\n * The `Popover` is a transient view that shows on a content screen when a user clicks on a control button or within a defined area.\n * A `Popover` renders a temporary context to get user’s attention and to hide unnecessary interactions.\n *\n * This component is used with the `Button` and `ContextMenu` components to create dropdown menus and context menus.\n * See their documentation for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { Popover } from '@ntbjs/react-components/data'\n * // or\n * import Popover from '@ntbjs/react-components/data/Popover'\n * ```\n *\n * ### Usage example\n *\n * ``` js\n<Popover content={<img alt=\"Dummy content\" src={dummyImage} />}>\n <ActionButton icon={<DeleteIcon />} onClick={() => {}} />\n</Popover>\n * ```\n */\n\nconst Popover = React.forwardRef<any, Props>(function Popover(\n {\n content = 'Tooltip',\n interactive = true,\n placement = 'bottom-end',\n duration = 350,\n trigger = 'click focus',\n offset = [0, 8],\n arrow = true,\n visible = undefined,\n contextMenu = false,\n contextMenuSublevel = false,\n children,\n modifiers = [],\n middleware,\n maxWidth = 'none',\n zIndex = TIPPY_DEFAULT_Z_INDEX,\n disabled = false,\n appendTo,\n onClickOutside,\n onShow,\n onHide,\n ...props\n },\n ref\n) {\n /*\n * `modifiers` is destructured so it cannot reach the DOM, and named here so the compiler\n * does not report an unused binding. Reading `.length` is the cheapest expression that is\n * also true of the prop's purpose: it is accepted, measured to be empty at every call site\n * in both consumers, and ignored. Plan C6.\n */\n void modifiers.length;\n\n const onOpenChange = React.useCallback(\n (open: boolean, event?: Event, reason?: OpenChangeReason) => {\n if (!open && reason === 'outside-press') {\n onClickOutside?.(event);\n }\n\n if (open) {\n onShow?.();\n } else {\n onHide?.();\n }\n },\n [onClickOutside, onShow, onHide]\n );\n\n /*\n * Registers this popover in an enclosing `FloatingTree`, if there is one, and returns an\n * id either way. Safe with NO tree present, which is the standalone case and plan C5's\n * requirement — verified in the installed 0.26.28 rather than assumed:\n * `useFloatingNodeId` does `tree == null || tree.addNode(node)`, and every tree read in\n * `useDismiss` is guarded (`const children = tree ? getChildren(…) : []`). So a `Popover`\n * with no `FloatingTree` above it behaves exactly as if `nodeId` were absent.\n *\n * The provider itself is NOT here. Plan C5: it belongs at the nesting site, so only nested\n * context menus pay for it — see `widgets/ContextMenu`, and read the note there, because\n * where it can usefully sit turned out to be narrower than C5 assumed.\n */\n const nodeId = useFloatingNodeId();\n\n /*\n * `[skidding, distance]`, normalised to a fixed-length tuple. The public prop stays\n * `number[]` and not a tuple type on purpose: consumers pass `offset={[0, 5]}` through\n * variables typed `number[]`, and narrowing the prop would turn those into type errors at\n * call sites that compile today.\n */\n const offsetTuple: PopperOffset = [offset[0] ?? 0, offset[1] ?? 0];\n\n /*\n * ⚠️ THE ARROW DRIVES THE OFFSET EVEN WHEN NO ARROW IS DRAWN, AND THAT IS DELIBERATE\n * REPRODUCTION OF EXISTING GEOMETRY RATHER THAN AN OVERSIGHT.\n *\n * The old implementation had two separate expressions:\n *\n * const errorOffset = useMemo(() => (arrow ? 15 : 0), [arrow]); // the RAW prop\n * offset={[offset[0], offset[1] + errorOffset]}\n * arrow={contextMenu ? false : arrow} // the DRAWN arrow\n *\n * so a `contextMenu` popover that leaves `arrow` at its default `true` gets the +15 in its\n * offset and no arrow on screen. That is not hypothetical: `AssetGalleryGridCard` passes\n * `contextMenu` with `offset={[0, -8]}` and no `arrow`, i.e. −8 + 15 = a box 7px from its\n * reference. Collapsing the two into one flag would move that menu 15px.\n *\n * So `arrow` (raw) goes to the hook, which adds `DEFAULT_ARROW_HEIGHT` to the main axis\n * and enables the `arrow()` middleware; `drawsArrow` decides whether an `<svg>` is\n * rendered. An enabled `arrow()` middleware with nothing attached to `arrowRef` is inert —\n * `@floating-ui/core` returns `{}` when its `element` is null — so the middleware costs a\n * null check and no behaviour.\n */\n const arrowDrivesTheOffset = arrow;\n const drawsArrow = contextMenu ? false : arrow;\n\n const {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n setOpen,\n placement: resolvedPlacement,\n pointerEvents\n } = useFloatingPopover({\n placement: contextMenuSublevel ? CONTEXT_MENU_SUBLEVEL_PLACEMENT : placement,\n open: visible,\n onOpenChange,\n trigger: contextMenuSublevel ? CONTEXT_MENU_SUBLEVEL_TRIGGER : trigger,\n offset: offsetTuple,\n arrow: arrowDrivesTheOffset,\n interactive,\n disabled,\n duration,\n /*\n * Always on, because the old implementation always passed the\n * `popper-max-size-modifier` + `applyMaxSize` pair — unconditionally, in the same\n * `popperOptions` object every popover got. The hook's `size()` improves on it in one\n * way that is a fix rather than a change: it CLEARS the cap when the content fits,\n * where `applyMaxSize` set `maxHeight` on every reposition and gave a 3-item menu a\n * scrollbar.\n *\n * `boundary` is Floating UI's default (`clippingAncestors`) where the old code passed\n * Popper `boundary: 'viewport'`. Floating UI has no `'viewport'` boundary and needs\n * none: the cap is written onto the positioner, whose clipping ancestor is the viewport\n * in the portalled cases, and in the inline case a nearer clipping ancestor is the\n * honest answer anyway.\n */\n constrainHeight: true,\n nodeId,\n middleware\n });\n\n /*\n * The reference is the CHILD, not the wrapper `<div>`, and that is a compatibility\n * requirement rather than a preference. `@tippyjs/react` does\n * `cloneElement(children, { ref })` and attaches its listeners to the resulting node, so\n * every popover in both consumers is positioned against the child's box. The wrapper is a\n * plain block `<div>`, which in most layouts is far wider than the child — anchoring to it\n * would re-align every popover that is not in a flex row.\n *\n * The ref is merged three ways: this component's own forwarded `ref`, the child's existing\n * `ref`, and `refs.setReference`. `useMergeRefs` returns `null` when every input is\n * nullish, which `cloneElement` treats as \"no ref\".\n *\n * `ref` GOES SOMEWHERE REAL FOR THE FIRST TIME. It used to be handed to\n * `styled(TippyTooltip)`, and `Tippy` is a plain function component, so React had nowhere\n * to put it. Plan risk #9 asks for `forwardRef` onto the reference and this is it; no\n * consumer passes `ref` to a `Popover` (measured over both apps — the `ref` attributes\n * near `<Popover>` in `datepicker_range` are on the calendar `<div>` inside `content`), so\n * nothing observable changes.\n *\n * The CHILD's ref is a different measurement, and it is live: `inputs/CompactTextInput`\n * renders `<S.Input ref={forwardedRef}>` as this popover's child on the `link` branch, and\n * `ntb-dam/client` passes react-hook-form's `field.ref` that way on React 16.14. Reading\n * it as `children.props.ref` yields `undefined` before React 19, so the `cloneElement`\n * below overwrote it — see `getElementRef`. tippy merged it via `preserveRef`.\n */\n const childRef = React.isValidElement(children) ? getElementRef(children) : null;\n const referenceRef = useMergeRefs([ref, childRef, refs.setReference]);\n\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => !PROPS_NEVER_FORWARDED.includes(key))\n );\n\n /*\n * `getReferenceProps(children.props)` and not `getReferenceProps()`: Floating UI COMPOSES\n * the handlers it needs with the ones already on the element, so a child that has its own\n * `onClick` keeps it. That matters more here than for `Tooltip`, because `Popover`'s\n * default trigger is `'click focus'` and the reference is usually a button with its own\n * handler — `inputs/Button` passes `onClick={handleDropdownButtonClick}` on the very\n * element that opens the popover. tippy did not need this: it attached native listeners\n * straight to the DOM node and never touched the child's props.\n */\n const reference = React.isValidElement(children)\n ? React.cloneElement(\n children as React.ReactElement<Record<string, unknown>>,\n {\n ...getReferenceProps((children as React.ReactElement<Record<string, unknown>>).props),\n ref: referenceRef\n } as never\n )\n : children;\n\n /*\n * WHAT REPLACED `_tippy.hide()` AND THE `[data-tippy-root]` SWEEP, AND HOW THE WHOLE CHAIN\n * OF MENUS STILL CLOSES.\n *\n * The old `handleContextMenuItemClick` ran on every `onShow` and, for every\n * `.context-menu-item:not(.opens-sublevel)` IN THE DOCUMENT, added a `click` listener that\n * called `.hide()` on every `[data-tippy-root]` IN THE DOCUMENT. Three things about it:\n * the listeners accumulated one set per show and were never removed; the selector was\n * global, so a menu in one corner of the app closed a popover in another; and it reached\n * for the imperative tippy instance off the DOM node.\n *\n * This is scoped instead: one delegated handler on this popover's own floating element,\n * closing only this popover. The ANCESTOR menus still close, and by a mechanism worth\n * writing down because it is not obvious — a sublevel `Popover` renders INLINE (C4: it is\n * `interactive` with no `appendTo`), so its floating element is a DOM descendant of the\n * parent menu's floating element, and the same click bubbles into the parent's identical\n * handler. Every menu in the chain closes itself. If a future change portals sublevels,\n * this stops working and a `FloatingTree` event becomes necessary.\n *\n * TWO DELIBERATE NARROWINGS, both from \"every tippy in the document\" to \"this menu\":\n *\n * - An unrelated popover elsewhere on the page no longer closes. That was a side effect of\n * a global DOM query, not a feature.\n * - The close now happens AFTER the item's own `onClickEffect` rather than before it,\n * because this is a React handler on an ancestor and tippy's was a native listener on\n * the item itself. The visible result is the same; a handler that called\n * `event.stopPropagation()` would now keep the menu open, and none does.\n */\n const handleContextMenuClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (!contextMenu) return;\n\n const target = event.target;\n if (!(target instanceof Element)) return;\n\n const item = target.closest(CONTEXT_MENU_ITEM_SELECTOR);\n if (!item || item.classList.contains(CONTEXT_MENU_SUBLEVEL_OPENER_CLASS)) return;\n\n setOpen(false, event.nativeEvent, 'click');\n };\n\n /*\n * tippy's appendTo resolution, reproduced. `'parent'`, and `interactive` with no explicit\n * `appendTo`, render INLINE; everything else portals. See `PopoverAppendTo` for the\n * measurement, and note that unlike `Tooltip` the INLINE branch is the DEFAULT here.\n */\n const renderInline = appendTo === 'parent' || (interactive && appendTo === undefined);\n\n /*\n * Deliberately NOT memoised. The function form of `appendTo` is resolved against the\n * reference node, which is populated by a callback ref and is therefore `null` on the\n * first render; a `useMemo` keyed on `refs.reference.current` would be reading a ref\n * during render to decide whether to recompute, which is the one thing a memo cannot do\n * correctly.\n *\n * ⚠️ `undefined` AND `null` ARE NOT INTERCHANGEABLE HERE, AND GETTING IT WRONG SILENTLY\n * DELETES THE POPOVER. `FloatingPortal`'s `root` is typed `HTMLElement | null | ref`,\n * which reads as though `null` were the \"no root given\" value. It is not — measured in\n * `useFloatingPortalNode`:\n *\n * ```js\n * // Wait for the root to exist before creating the portal node.\n * if (root === null) return;\n * …\n * container = container || document.body;\n * ```\n *\n * `null` means \"the root does not exist YET, do not create the portal node\", and the\n * effect simply returns. Only `undefined` falls through to the `|| document.body` default.\n * The one place `null` is right is the genuine \"not resolvable yet\" case: a function\n * `appendTo` cannot be called until the reference exists, and `null` correctly defers the\n * portal until it does rather than briefly portalling to the wrong parent.\n */\n const resolvePortalRoot = (): HTMLElement | null | undefined => {\n if (renderInline || appendTo === undefined) return undefined;\n if (typeof appendTo === 'function') {\n const node = refs.reference.current;\n return node instanceof Element ? (appendTo(node) as HTMLElement) : null;\n }\n return appendTo as HTMLElement;\n };\n\n const floating = isMounted ? (\n <div\n ref={refs.setFloating}\n style={{ ...floatingStyles, zIndex, pointerEvents, maxWidth: POSITIONER_MAX_WIDTH }}\n {...getFloatingProps({ onClick: handleContextMenuClick })}\n >\n {/*\n * `{...filteredProps}` FIRST and the explicit attributes after, so that a colliding\n * `style` or `className` cannot displace the transition styles or the placement\n * attribute. `className` still reaches this element, which is where tippy put it —\n * `@tippyjs/react`'s own `classNamePlugin` does\n * `updateClassName(instance.popper.firstElementChild, 'add', className)`, i.e. onto\n * the box and not the positioner — so `.settings-item-popover` and the other 2\n * consumer classNames land exactly where their CSS expects.\n *\n * `role=\"tooltip\"` and `tabindex=\"-1\"` are tippy's, not a choice: its `defaultProps`\n * carry `role: 'tooltip'` (`tippy.cjs.js:340`) and its renderer writes both onto the\n * box (`box.setAttribute('tabindex', '-1')`, line 528; `role`, line 564). Every popover\n * in both consumers has carried them. `role=\"menu\"` would arguably be better for a\n * context menu, but `ContextMenu` already puts `role=\"menu\"` on its own root, so adding\n * it here would nest two menus — and changing roles is an accessibility decision, not\n * a dependency swap.\n */}\n <S.Popover\n {...filteredProps}\n data-placement={resolvedPlacement}\n data-context-menu={contextMenu ? 'true' : undefined}\n data-context-menu-sublevel={contextMenuSublevel ? 'true' : undefined}\n role=\"tooltip\"\n tabIndex={-1}\n style={{ ...transitionStyles, maxWidth }}\n >\n <div className=\"tippy-content\">{content}</div>\n {drawsArrow && (\n <SharedFloatingArrow\n ref={arrowRef}\n context={context}\n data-arrow-surface=\"popover\"\n {...POPOVER_ARROW}\n />\n )}\n </S.Popover>\n </div>\n ) : null;\n\n /*\n * `FloatingNode` publishes this popover's id to anything rendered inside it, so a nested\n * `Popover` in `content` becomes its child rather than a second root when a `FloatingTree`\n * is present. It renders no DOM — it is a context provider only — so it costs nothing in\n * the standalone case.\n *\n * The bare wrapper `<div>` is preserved verbatim — plan risk #9. It carries no props and\n * no styling, and consumers position against it.\n */\n return (\n <div>\n {reference}\n <FloatingNode id={nodeId}>\n {renderInline ? (\n floating\n ) : (\n <FloatingPortal root={resolvePortalRoot()}>{floating}</FloatingPortal>\n )}\n </FloatingNode>\n </div>\n );\n});\n\nexport default Popover;\n"],"names":["TIPPY_DEFAULT_Z_INDEX","POSITIONER_MAX_WIDTH","CONTEXT_MENU_SUBLEVEL_PLACEMENT","CONTEXT_MENU_SUBLEVEL_TRIGGER","CONTEXT_MENU_ITEM_SELECTOR","CONTEXT_MENU_SUBLEVEL_OPENER_CLASS","PROPS_NEVER_FORWARDED","Popover","React","forwardRef","content","interactive","placement","duration","trigger","offset","arrow","visible","undefined","contextMenu","contextMenuSublevel","children","modifiers","middleware","maxWidth","zIndex","disabled","appendTo","onClickOutside","onShow","onHide","props","ref","length","onOpenChange","useCallback","open","event","reason","nodeId","useFloatingNodeId","offsetTuple","arrowDrivesTheOffset","drawsArrow","refs","floatingStyles","context","getReferenceProps","getFloatingProps","isMounted","transitionStyles","arrowRef","setOpen","resolvedPlacement","pointerEvents","useFloatingPopover","constrainHeight","childRef","isValidElement","getElementRef","referenceRef","useMergeRefs","setReference","filteredProps","Object","fromEntries","entries","filter","key","includes","reference","cloneElement","handleContextMenuClick","target","Element","item","closest","classList","contains","nativeEvent","renderInline","resolvePortalRoot","node","current","floating","_jsx","setFloating","style","onClick","_jsxs","S","role","tabIndex","className","SharedFloatingArrow","POPOVER_ARROW","FloatingNode","id","FloatingPortal","root"],"mappings":";;;;;;;;AAoBA,MAAMA,qBAAqB,GAAG,IAAI;AASlC,MAAMC,oBAAoB,GAAG,oBAAoB;AASjD,MAAMC,+BAA+B,GAAG,aAAsB;AAC9D,MAAMC,6BAA6B,GAAG,wBAAwB;AAO9D,MAAMC,0BAA0B,GAAG,oBAAoB;AACvD,MAAMC,kCAAkC,GAAG,gBAAgB;AA2N3D,MAAM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AG;AAAA5D,QAAAA,QAAA,EAAE+D;OAAyB;AACtE,KACW,CAAC;AAAA,GACZ,CAAC;AAEV,CAAC;;;;"}
@@ -1,146 +1,16 @@
1
- import styled, { css } from 'styled-components';
1
+ import styled from 'styled-components';
2
2
  import { rgba } from 'polished';
3
3
  import { applyDefaultTheme } from '../../utils/defaultTheme.js';
4
- import TippyTooltip from '@tippyjs/react';
5
- import 'tippy.js/dist/tippy.css';
6
- import 'tippy.js/animations/shift-away-subtle.css';
7
4
 
8
- const Popover = styled(TippyTooltip).attrs(applyDefaultTheme)`
9
- font-family: ${props => props.theme.primaryFontFamily};
10
- font-size: 1rem;
11
- font-weight: 400;
12
- color: inherit;
13
- border-radius: 0;
14
- line-height: inherit;
15
- max-height: inherit;
16
-
17
- ${props => props.maxWidth && css`
18
- max-width: ${props.maxWidth};
19
- `}
20
-
21
- ${props => props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'))}
22
-
23
- ${props => props.theme.themeProp('box-shadow', `0px 1px 6px -3px ${rgba(props.theme.getColor('black'), 0.7)}`, `0 1px 6px -4px ${props.theme.getColor('black')}`)}
24
-
25
- ${props => props.theme.themeProp('border', `1px solid ${props.theme.getColor('gray-800')}`, `1px solid ${props.theme.getColor('gray-300')}`)}
26
-
27
- ${props => props.contextMenu && css`
28
- border-radius: 4px;
29
-
30
- ${props => props.theme.themeProp('border', 'none', 'none')}
31
-
32
- ${props => props.theme.themeProp('box-shadow', `none`, `0 1px 6px ${rgba(props.theme.getColor('gray-900'), 0.3)}`)}
33
- `}
34
-
35
- ${props => props.contextMenuSublevel && css`
36
- &[data-placement^='right-start'],
37
- &[data-placement^='left-start'] {
38
- margin-top: -4px;
39
- }
40
-
41
- &[data-placement^='left'] {
42
- margin-right: -6px;
43
- }
44
-
45
- &[data-placement^='right'] {
46
- margin-left: -6px;
47
- }
48
- `}
49
-
50
- .tippy-content {
51
- padding: 0;
52
- max-height: inherit;
53
-
54
- > div {
55
- max-height: inherit;
56
- }
57
- }
58
-
59
- .tippy-arrow {
60
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-700'), props.theme.getColor('white'), 1)}
61
- }
62
-
63
- && > .tippy-arrow::before {
64
- position: absolute;
65
- border-color: transparent;
66
- border-style: solid;
67
- }
68
-
69
- & > .tippy-arrow::after {
70
- content: '';
71
- position: absolute;
72
- border-color: transparent;
73
- border-style: solid;
74
- }
75
-
76
- &[data-placement^='top'] {
77
- & > .tippy-arrow:before {
78
- bottom: -16px;
79
- left: -5px;
80
- border-width: 15px 13px 0;
81
- ${props => props.theme.themeProp('border-top-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-300'), 1)}
82
- }
83
-
84
- & > .tippy-arrow:after {
85
- bottom: -15px;
86
- left: -5px;
87
- border-width: 15px 13px 0;
88
- border-top-color: initial;
89
- transform-origin: center top;
90
- }
91
- }
92
-
93
- &[data-placement^='right'] {
94
- & > .tippy-arrow:before {
95
- bottom: -5px;
96
- left: -16px;
97
- border-width: 13px 15px 13px 0;
98
- ${props => props.theme.themeProp('border-right-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-300'), 1)}
99
- }
100
-
101
- & > .tippy-arrow:after {
102
- bottom: -5px;
103
- left: -15px;
104
- border-width: 13px 15px 13px 0;
105
- border-right-color: initial;
106
- transform-origin: center top;
107
- }
108
- }
109
-
110
- &[data-placement^='bottom'] {
111
- & > .tippy-arrow:before {
112
- top: -16px;
113
- left: -5px;
114
- border-width: 0 13px 15px 13px;
115
- ${props => props.theme.themeProp('border-bottom-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-300'), 1)}
116
- }
117
-
118
- & > .tippy-arrow:after {
119
- top: -14.5px;
120
- left: -5px;
121
- border-width: 0 13px 15px 13px;
122
- border-bottom-color: initial;
123
- transform-origin: center top;
124
- }
125
- }
126
-
127
- &[data-placement^='left'] {
128
- & > .tippy-arrow::before {
129
- bottom: -5px;
130
- right: -16px;
131
- border-width: 13px 0 13px 15px;
132
- ${props => props.theme.themeProp('border-left-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-300'), 1)}
133
- }
134
-
135
- & > .tippy-arrow::after {
136
- bottom: -5px;
137
- right: -15px;
138
- border-width: 13px 0 13px 15px;
139
- border-left-color: initial;
140
- transform-origin: center top;
141
- }
142
- }
143
- `;
5
+ const shouldForwardProp = prop => {
6
+ return prop !== 'theme' && !prop.startsWith('$');
7
+ };
8
+ const Popover = styled.div.withConfig({
9
+ shouldForwardProp
10
+ }).attrs(applyDefaultTheme).withConfig({
11
+ displayName: "Popoverstyled__Popover",
12
+ componentId: "sc-egg7l2-0"
13
+ })(["position:relative;outline:0;white-space:normal;font-family:", ";font-size:1rem;font-weight:400;color:inherit;border-radius:0;line-height:inherit;max-height:inherit;", " ", " ", " .tippy-content{position:relative;z-index:1;padding:0;max-height:inherit;> div{max-height:inherit;}}&[data-context-menu='true']{border-radius:4px;}body.dark-theme &[data-context-menu='true']{border:none;box-shadow:none;}body.light-theme &[data-context-menu='true']{border:none;box-shadow:0 1px 6px ", ";}body:not(.light-theme):not(.dark-theme) &[data-context-menu='true']{border:none;box-shadow:0 1px 6px ", ";@media (prefers-color-scheme:dark){box-shadow:none;}}&[data-context-menu-sublevel='true']{&[data-placement^='right-start'],&[data-placement^='left-start']{margin-top:-4px;}&[data-placement^='left']{margin-right:-6px;}&[data-placement^='right']{margin-left:-6px;}}"], props => props.theme.primaryFontFamily, props => props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white')), props => props.theme.themeProp('box-shadow', `0px 1px 6px -3px ${rgba(props.theme.getColor('black'), 0.7)}`, `0 1px 6px -4px ${props.theme.getColor('black')}`), props => props.theme.themeProp('border', `1px solid ${props.theme.getColor('gray-800')}`, `1px solid ${props.theme.getColor('gray-300')}`), props => rgba(props.theme.getColor('gray-900'), 0.3), props => rgba(props.theme.getColor('gray-900'), 0.3));
144
14
 
145
15
  export { Popover };
146
16
  //# sourceMappingURL=Popover.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.styled.js","sources":["../../../src/components/data/Popover/Popover.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport TippyTooltip from '@tippyjs/react';\nimport 'tippy.js/dist/tippy.css';\nimport 'tippy.js/animations/shift-away-subtle.css';\n\nexport const Popover = styled(TippyTooltip).attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n color: inherit;\n border-radius: 0;\n line-height: inherit;\n max-height: inherit;\n\n ${props =>\n props.maxWidth &&\n css`\n max-width: ${props.maxWidth};\n `}\n\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.theme.themeProp(\n 'box-shadow',\n `0px 1px 6px -3px ${rgba(props.theme.getColor('black'), 0.7)}`,\n `0 1px 6px -4px ${props.theme.getColor('black')}`\n )}\n\n ${props =>\n props.theme.themeProp(\n 'border',\n `1px solid ${props.theme.getColor('gray-800')}`,\n `1px solid ${props.theme.getColor('gray-300')}`\n )}\n\n ${props =>\n props.contextMenu &&\n css`\n border-radius: 4px;\n\n ${props => props.theme.themeProp('border', 'none', 'none')}\n\n ${props =>\n props.theme.themeProp(\n 'box-shadow',\n `none`,\n `0 1px 6px ${rgba(props.theme.getColor('gray-900'), 0.3)}`\n )}\n `}\n\n ${props =>\n props.contextMenuSublevel &&\n css`\n &[data-placement^='right-start'],\n &[data-placement^='left-start'] {\n margin-top: -4px;\n }\n\n &[data-placement^='left'] {\n margin-right: -6px;\n }\n\n &[data-placement^='right'] {\n margin-left: -6px;\n }\n `}\n\n .tippy-content {\n padding: 0;\n max-height: inherit;\n\n > div {\n max-height: inherit;\n }\n }\n\n .tippy-arrow {\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white'),\n 1\n )}\n }\n\n && > .tippy-arrow::before {\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n & > .tippy-arrow::after {\n content: '';\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n &[data-placement^='top'] {\n & > .tippy-arrow:before {\n bottom: -16px;\n left: -5px;\n border-width: 15px 13px 0;\n ${props =>\n props.theme.themeProp(\n 'border-top-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-300'),\n 1\n )}\n }\n\n & > .tippy-arrow:after {\n bottom: -15px;\n left: -5px;\n border-width: 15px 13px 0;\n border-top-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='right'] {\n & > .tippy-arrow:before {\n bottom: -5px;\n left: -16px;\n border-width: 13px 15px 13px 0;\n ${props =>\n props.theme.themeProp(\n 'border-right-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-300'),\n 1\n )}\n }\n\n & > .tippy-arrow:after {\n bottom: -5px;\n left: -15px;\n border-width: 13px 15px 13px 0;\n border-right-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='bottom'] {\n & > .tippy-arrow:before {\n top: -16px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n ${props =>\n props.theme.themeProp(\n 'border-bottom-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-300'),\n 1\n )}\n }\n\n & > .tippy-arrow:after {\n top: -14.5px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n border-bottom-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='left'] {\n & > .tippy-arrow::before {\n bottom: -5px;\n right: -16px;\n border-width: 13px 0 13px 15px;\n ${props =>\n props.theme.themeProp(\n 'border-left-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-300'),\n 1\n )}\n }\n\n & > .tippy-arrow::after {\n bottom: -5px;\n right: -15px;\n border-width: 13px 0 13px 15px;\n border-left-color: initial;\n transform-origin: center top;\n }\n }\n`;\n"],"names":["Popover","styled","TippyTooltip","attrs","applyDefaultTheme","props","theme","primaryFontFamily","maxW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K,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChC,CACF,CAAC,CAAA;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,EAAQN,KAAK,IACLA,KAAK,CAACC,KAAK,CAACI,SAAS,CACnB,qBAAqB,EACrBL,KAAK,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChC,CACF,CAAC,CAAA;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,EAAQN,KAAK,IACLA,KAAK,CAACC,KAAK,CAACI,SAAS,CACnB,mBAAmB,EACnBL,KAAK,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChCN,KAAK,CAACC,KAAK,CAACK,QAAQ,CAAC,UAAU,CAAC,EAChC,CACF,CAAC,CAAA;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Popover.styled.js","sources":["../../../src/components/data/Popover/Popover.styled.ts"],"sourcesContent":["/*\n * $-transient-prop pattern: rules in\n * `src/components/layout/SectionSeparator/SectionSeparator.styled.ts`, derivation and\n * measurements in `scripts/TS-MIGRATION-PLAYBOOK.md` §J.\n *\n * NO TRANSIENT PROP IS READ HERE — every interpolation reads only `props.theme`, which\n * `ExecutionContext` already supplies via the C6 `DefaultTheme` augmentation. The two\n * per-instance variants (`contextMenu`, `contextMenuSublevel`) are STATIC ATTRIBUTE\n * SELECTORS, not `${props => css`…`}` rules — see \"THE TWO VARIANTS\" below.\n *\n * ================== WHAT REPLACED WHAT, AND THE FOUR THINGS THAT CAME BACK ==================\n *\n * This file used to be `styled(TippyTooltip)`, so the class it generated landed on tippy's\n * `.tippy-box` and the rules below were only ever the OVERRIDES — the base came from\n * `tippy.js/dist/tippy.css`, which this file imported. Dropping tippy therefore drops a\n * base stylesheet nobody had written down. Measured, verbatim, from that file:\n *\n * .tippy-box { position: relative; background-color: #333; color: #fff;\n * border-radius: 4px; font-size: 14px; line-height: 1.4;\n * white-space: normal; outline: 0;\n * transition-property: transform, visibility, opacity }\n * .tippy-content{ position: relative; padding: 5px 9px; z-index: 1 }\n * [data-tippy-root]{ max-width: calc(100vw - 10px) }\n *\n * Five of those declarations were OVERRIDDEN by the old version of this file\n * (`background-color` by the themed `background`, `color` by `color: inherit`,\n * `border-radius` by `0`, `font-size` by `1rem`, `line-height` by `inherit`) and tippy's\n * values are simply gone. Four were IN FORCE and are carried over here, because dropping\n * them silently would change the rendering:\n *\n * - `position: relative` is the ARROW'S CONTAINING BLOCK. `FloatingArrow` positions its\n * `<svg>` at `[side]: 100%`, which resolves against the nearest positioned ancestor;\n * with a static box the arrow escapes to the viewport. This is the single most\n * load-bearing line in the file.\n * - `white-space: normal` and `outline: 0` were in force and are not initial values.\n * - `.tippy-content`'s `position: relative` and `z-index: 1`. The old file overrode only\n * its `padding`; the stacking pair came from `tippy.css` and is declared explicitly\n * below for the same reason `Tooltip.styled.ts` declares it.\n *\n * `transition-property` is deliberately NOT carried over: `useTransitionStyles` emits its\n * own transition shorthand inline on this element, so a stylesheet declaration would be\n * overridden on every render.\n *\n * `[data-tippy-root]`'s `max-width: calc(100vw - 10px)` applied to the POSITIONER, not to\n * this element, so it moved to `Popover.tsx` (`POSITIONER_MAX_WIDTH`) along with tippy's\n * `popper.style.zIndex` and `popper.style.pointerEvents`.\n *\n * The public `maxWidth` prop also moved to `Popover.tsx`. It used to be read here as\n * `${props => props.maxWidth && css`max-width: ${props.maxWidth}`}` AND written inline by\n * tippy (`box.style.maxWidth = maxWidth`), i.e. twice; it is now written once, inline,\n * which is what tippy did and what `Tooltip.tsx` does.\n *\n * ================== THE ARROW: 8 RULES AND 4 themeProp() CALLS ARE GONE ==================\n *\n * tippy drew the arrow as a CSS border triangle, so this file carried an outline layer\n * (`::before`) and a fill layer (`::after`) for each of the four sides — 8 nested blocks,\n * 4 `themeProp()` calls for the border colour, and a `.tippy-arrow { color: … }` rule that\n * existed only because `border-*-color: initial` resolves to `currentColor`.\n *\n * All of it is replaced by ONE `<svg>`: `SharedFloatingArrow` with\n * `data-arrow-surface=\"popover\"` and the geometry in `POPOVER_ARROW`\n * (`src/components/data/_shared/FloatingArrow.styled.ts`). That file's `popover` surface\n * carries the same two colour pairs this one did — `gray-700`/`white` for the fill,\n * `gray-800`/`gray-300` for the 1px border that continues the box's own — and it is where\n * the 15px/26px geometry is derived from the `border-width: 15px 13px 0` these blocks used\n * to declare.\n *\n * ================== WHY `.tippy-content` IS STILL CALLED `.tippy-content` ==================\n *\n * It is a deliberate compatibility shim, not a leftover. `src/sass/components/popover.scss`\n * in BOTH consumers targets that class name — it is the 600px notification layout — so\n * renaming it needs coordinated PRs in two repos: plan C2/§A4. `Popover.tsx` renders\n * exactly one such element.\n *\n * ================== THE TWO VARIANTS, AND THE DEAD CSS THEY REVIVE ==================\n *\n * `contextMenu` and `contextMenuSublevel` used to be `${props => props.contextMenu && css…}`\n * blocks that NOTHING COULD REACH: `Popover.tsx` destructured both props out and the two\n * lines that would have forwarded them were commented out. The old header of this file and\n * `scripts/r19-harness/fixtures.cjs`'s `data/Popover` entry both record that as a declared,\n * unfixed defect — \"~10 CSS declarations in this file are dead code, and no fixture can\n * cover them\".\n *\n * They are live now, and the plan asks for it (§Approach step 2: \"`contextMenu`: arrow off,\n * context-menu styling variant\"). Two consequences worth stating before the next reader\n * hunts for them:\n *\n * 1. **The rules are written as static attribute selectors**, `&[data-context-menu='true']`,\n * not as interpolated `css` blocks. An interpolated rule shares the component's\n * `componentId`, so two instances in different states collide and one wins for both —\n * the convention recorded in `ThemeProp`'s JSDoc in `src/utils/defaultTheme.ts`.\n * 2. **The theme branches are written out by hand** rather than through `themeProp()`, for\n * the same reason `FloatingArrow.styled.ts` does it: `themeProp()` emits a SELECTOR\n * (`body.dark-theme &&`), and nesting one inside another selector block produces a\n * descendant selector rather than a refinement. Writing them out also settles the\n * specificity question by construction — each variant rule carries the base rule's\n * `body.<theme>` prefix PLUS an attribute selector, so it wins outright instead of by\n * being later in the sheet.\n */\nimport styled from 'styled-components';\nimport { rgba } from 'polished';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and the\n * two majors disagree on the second parameter. §J.4.\n *\n * IT IS ALSO NOW MANDATORY RATHER THAN OPTIONAL, WHICH FIXES A DECLARED DEFECT. The old\n * version of this file was one of only two of the 36 styled files with no\n * `shouldForwardProp`, and its header recorded the consequence: nothing filtered props, so\n * the `theme` OBJECT that `.attrs(applyDefaultTheme)` injects was handed to\n * `@tippyjs/react`, which did `box.setAttribute('data-theme', theme)` for any truthy theme\n * (`tippy.js/dist/tippy.cjs.js:543`) and put `data-theme=\"[object Object]\"` on the live box.\n * The root here is a plain `styled.div`, so without this predicate that same object would be\n * written to the DOM as `theme=\"[object Object]\"` — `theme` is all-lowercase, so React 19\n * does NOT drop it the way it drops unknown camelCase props. The fix the old header asked\n * for is therefore not a follow-up; it is a precondition of this rewrite.\n *\n * `data-context-menu` / `data-context-menu-sublevel` are forwarded precisely because they\n * do not start with `$`: the rules below select on them, so they have to reach the DOM.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The popover box — what `.tippy-box` was.\n *\n * `Popover.tsx` puts the transition styles and the `max-width` on this element inline and\n * the POSITION on its parent, matching the split tippy used (animated box inside a\n * Popper-positioned root) and the one `Tooltip` and the three existing Floating UI sites\n * use.\n *\n * `max-height: inherit` is not decorative and neither is the `.tippy-content` chain below\n * it. `size()` writes its cap onto the POSITIONER (`elements.floating`), exactly where\n * `popper-max-size-modifier` + `applyMaxSize` used to write `state.styles.popper.maxHeight`,\n * so the cap has to be inherited down box → `.tippy-content` → its child to reach the\n * element that actually scrolls.\n */\nexport const Popover = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n outline: 0;\n white-space: normal;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n color: inherit;\n border-radius: 0;\n line-height: inherit;\n max-height: inherit;\n\n ${props =>\n props.theme.themeProp(\n 'background',\n props.theme.getColor('gray-700'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.theme.themeProp(\n 'box-shadow',\n `0px 1px 6px -3px ${rgba(props.theme.getColor('black'), 0.7)}`,\n `0 1px 6px -4px ${props.theme.getColor('black')}`\n )}\n\n ${props =>\n props.theme.themeProp(\n 'border',\n `1px solid ${props.theme.getColor('gray-800')}`,\n `1px solid ${props.theme.getColor('gray-300')}`\n )}\n\n .tippy-content {\n position: relative;\n z-index: 1;\n padding: 0;\n max-height: inherit;\n\n > div {\n max-height: inherit;\n }\n }\n\n /* ------------------------------------------------------------- context-menu variant ----\n * NO BACKTICKS ANYWHERE BELOW: this is the inside of a tagged template literal, so a\n * backtick in a comment ends the template and the file stops parsing.\n *\n * border-radius is not themed, so it needs no theme prefix; border and box-shadow are,\n * and both override a themeProp() rule above, so each theme branch is spelled out.\n * \"border: none\" is the same in both themes (the old code passed themeProp('border',\n * 'none', 'none')) but still needs the prefix to outrank the base border rule.\n */\n &[data-context-menu='true'] {\n border-radius: 4px;\n }\n\n body.dark-theme &[data-context-menu='true'] {\n border: none;\n box-shadow: none;\n }\n\n body.light-theme &[data-context-menu='true'] {\n border: none;\n box-shadow: 0 1px 6px ${props => rgba(props.theme.getColor('gray-900'), 0.3)};\n }\n\n body:not(.light-theme):not(.dark-theme) &[data-context-menu='true'] {\n border: none;\n box-shadow: 0 1px 6px ${props => rgba(props.theme.getColor('gray-900'), 0.3)};\n\n @media (prefers-color-scheme: dark) {\n box-shadow: none;\n }\n }\n\n /* ---------------------------------------------------------------- sublevel variant ----\n * The margins that pull a submenu back onto its parent item. Not themed, so one block.\n * data-placement is written by Popover.tsx from the placement the middleware RESOLVED,\n * which is what tippy put on the box, so a submenu that has flipped from right to left\n * still gets the correction for the side it ended up on.\n */\n &[data-context-menu-sublevel='true'] {\n &[data-placement^='right-start'],\n &[data-placement^='left-start'] {\n margin-top: -4px;\n }\n\n &[data-placement^='left'] {\n margin-right: -6px;\n }\n\n &[data-placement^='right'] {\n margin-left: -6px;\n }\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Popover","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","themeProp","getColor","rgba"],"mappings":";;;;AAyHA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAgBM,MAAMC,OAAO,GAAGC,MAAM,CAACC,GAAG,CAC9BC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wBAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6DAAA,EAAA,uGAAA,EAAA,GAAA,EAAA,GAAA,EAAA,4SAAA,EAAA,yGAAA,EAAA,0QAAA,CAAA,EAIVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,EAQnDF,KAAK,IACLA,KAAK,CAACC,KAAK,CAACE,SAAS,CACnB,YAAY,EACZH,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCJ,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAC9B,CAAC,EAEDJ,KAAK,IACLA,KAAK,CAACC,KAAK,CAACE,SAAS,CACnB,YAAY,EACZ,CAAA,iBAAA,EAAoBE,IAAI,CAACL,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAA,CAAE,EAC9D,CAAA,eAAA,EAAkBJ,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,OAAO,CAAC,CAAA,CACjD,CAAC,EAEDJ,KAAK,IACLA,KAAK,CAACC,KAAK,CAACE,SAAS,CACnB,QAAQ,EACR,CAAA,UAAA,EAAaH,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,CAAA,CAAE,EAC/C,CAAA,UAAA,EAAaJ,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,CAAA,CAC/C,CAAC,EAiCuBJ,KAAK,IAAIK,IAAI,CAACL,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,EAKpDJ,KAAK,IAAIK,IAAI,CAACL,KAAK,CAACC,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC;;;;"}
@@ -1,18 +1,18 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
2
  import Badge from '../Badge/Badge.js';
3
+ import { jsx } from 'react/jsx-runtime';
5
4
 
6
- const InformationIcon = () => React__default.createElement("svg", {
5
+ const InformationIcon = () => jsx("svg", {
7
6
  width: "12",
8
7
  height: "12",
9
8
  viewBox: "0 0 12 12",
10
9
  fill: "none",
11
- xmlns: "http://www.w3.org/2000/svg"
12
- }, React__default.createElement("path", {
13
- d: "M6 11C3.2385 11 1 8.7615 1 6C1 3.2385 3.2385 1 6 1C8.7615 1 11 3.2385 11 6C11 8.7615 8.7615 11 6 11ZM6 10C7.06087 10 8.07828 9.57857 8.82843 8.82843C9.57857 8.07828 10 7.06087 10 6C10 4.93913 9.57857 3.92172 8.82843 3.17157C8.07828 2.42143 7.06087 2 6 2C4.93913 2 3.92172 2.42143 3.17157 3.17157C2.42143 3.92172 2 4.93913 2 6C2 7.06087 2.42143 8.07828 3.17157 8.82843C3.92172 9.57857 4.93913 10 6 10ZM5.5 3.5H6.5V4.5H5.5V3.5ZM5.5 5.5H6.5V8.5H5.5V5.5Z",
14
- fill: "currentColor"
15
- }));
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ children: jsx("path", {
12
+ d: "M6 11C3.2385 11 1 8.7615 1 6C1 3.2385 3.2385 1 6 1C8.7615 1 11 3.2385 11 6C11 8.7615 8.7615 11 6 11ZM6 10C7.06087 10 8.07828 9.57857 8.82843 8.82843C9.57857 8.07828 10 7.06087 10 6C10 4.93913 9.57857 3.92172 8.82843 3.17157C8.07828 2.42143 7.06087 2 6 2C4.93913 2 3.92172 2.42143 3.17157 3.17157C2.42143 3.92172 2 4.93913 2 6C2 7.06087 2.42143 8.07828 3.17157 8.82843C3.92172 9.57857 4.93913 10 6 10ZM5.5 3.5H6.5V4.5H5.5V3.5ZM5.5 5.5H6.5V8.5H5.5V5.5Z",
13
+ fill: "currentColor"
14
+ })
15
+ });
16
16
  const SEVERITY_BADGE_STYLES = {
17
17
  1: {
18
18
  backgroundColors: ['#272727', '#ffffff'],
@@ -49,9 +49,9 @@ const SeverityBadge = React__default.forwardRef(function SeverityBadge({
49
49
  ...rest
50
50
  }, forwardedRef) {
51
51
  const style = SEVERITY_BADGE_STYLES[severity] || SEVERITY_BADGE_STYLES[1];
52
- return React__default.createElement(Badge, _extends({
52
+ return jsx(Badge, {
53
53
  ref: forwardedRef,
54
- badgeIcon: icon === undefined ? React__default.createElement(InformationIcon, null) : icon,
54
+ badgeIcon: icon === undefined ? jsx(InformationIcon, {}) : icon,
55
55
  badgeContent: label,
56
56
  backgroundColors: style.backgroundColors,
57
57
  colors: style.colors,
@@ -60,19 +60,10 @@ const SeverityBadge = React__default.forwardRef(function SeverityBadge({
60
60
  fontWeight: fontWeight,
61
61
  height: height,
62
62
  horizontalPadding: horizontalPadding,
63
- verticalPadding: verticalPadding
64
- }, rest));
63
+ verticalPadding: verticalPadding,
64
+ ...rest
65
+ });
65
66
  });
66
- SeverityBadge.propTypes = process.env.NODE_ENV !== "production" ? {
67
- severity: PropTypes.oneOf([1, 2, 3, 4, 5]).isRequired,
68
- label: PropTypes.node.isRequired,
69
- icon: PropTypes.node,
70
- fontSize: PropTypes.number,
71
- fontWeight: PropTypes.number,
72
- height: PropTypes.number,
73
- horizontalPadding: PropTypes.number,
74
- verticalPadding: PropTypes.number
75
- } : {};
76
67
 
77
68
  export { SeverityBadge as default };
78
69
  //# sourceMappingURL=SeverityBadge.js.map