@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 +1 @@
1
- {"version":3,"file":"Tooltip.js","sources":["../../../src/components/data/Tooltip/Tooltip.js"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport * as S from './Tooltip.styled';\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n *\n * ### Import\n *\n * ``` js\n * import { Tooltip } from '@ntbjs/react-components/data'\n * // or\n * import Tooltip from '@ntbjs/react-components/data/Tooltip'\n * ```\n */\n\nconst Tooltip = React.forwardRef(function Tooltip(\n { content, interactive, placement, duration, trigger, visible, children, ...props },\n ref\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.Tooltip\n ref={ref}\n content={content}\n interactive={interactive}\n placement={placement}\n duration={duration}\n trigger={trigger}\n visible={visible}\n animation={'shift-away-subtle'}\n {...filteredProps}\n >\n {children}\n </S.Tooltip>\n </div>\n );\n});\n\nTooltip.defaultProps = {\n content: 'Tooltip',\n interactive: false,\n placement: 'top',\n duration: 350\n};\n\n/**\n * https://atomiks.github.io/tippyjs/v6/all-props/\n * @type {{content: Validator<NonNullable<string>>}}\n */\nTooltip.propTypes = {\n /**\n * The content of the `Tooltip`.\n *\n * **NB!** If the content is a `string`, it should be [wrapped in a tag](https://github.com/atomiks/tippyjs-react/issues/283#issuecomment-1268986001), e.g.:\n *\n * `<span>{content}</span>`.\n */\n content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]).isRequired,\n\n /**\n * Determines if the tippy 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 tippy. 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 * Duration in ms of the transition animation.\n */\n duration: PropTypes.number,\n\n /**\n * Determines the events that cause the tippy 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 * `trigger: 'mouseenter'`\n *\n * --\n */\n trigger: PropTypes.oneOf([\n 'mouseenter',\n 'mouseenter focus',\n 'click',\n 'focusin',\n 'mouseenter click',\n ''\n ]),\n /**\n * Determines if the tippy is visible without trigger\n */\n visible: PropTypes.bool,\n\n children: PropTypes.node\n};\n\nexport default Tooltip;\n"],"names":["Tooltip","React","forwardRef","content","interactive","placement","duration","trigger","visible","children","props","ref","eventHandlerProps","filteredProps","Object","fromEntries","entries","filter","key","includes","createElement","S","_extends","animation","defaultProps","propTypes","process","env","NODE_ENV","PropTypes","oneOfType","string","element","isRequired","bool","oneOf","number","node"],"mappings":";;;;;AAgBMA,MAAAA,OAAO,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,OAAOA,CAC/C;EAAEG,OAAO;EAAEC,WAAW;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,OAAO;EAAEC,QAAQ;EAAE,GAAGC,KAAAA;AAAM,CAAC,EACnFC,GAAG,EACH;EACA,MAAMC,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAA;AAE7D,EAAA,MAAMC,aAAa,GAAGC,MAAM,CAACC,WAAW,CACtCD,MAAM,CAACE,OAAO,CAACN,KAAK,CAAC,CAACO,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAK,CAACN,iBAAiB,CAACO,QAAQ,CAACD,GAAG,CAAC,CAC1E,CAAC,CAAA;AAED,EAAA,OACEjB,cAAA,CAAAmB,aAAA,CAAA,KAAA,EAAA,IAAA,EACEnB,cAAA,CAAAmB,aAAA,CAACC,SAAS,EAAAC,QAAA,CAAA;AACRX,IAAAA,GAAG,EAAEA,GAAI;AACTR,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,OAAO,EAAEA,OAAQ;AACjBe,IAAAA,SAAS,EAAE,mBAAA;AAAoB,GAAA,EAC3BV,aAAa,CAAA,EAEhBJ,QACQ,CACR,CAAC,CAAA;AAEV,CAAC,EAAC;AAEFT,OAAO,CAACwB,YAAY,GAAG;AACrBrB,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,SAAS,EAAE,KAAK;AAChBC,EAAAA,QAAQ,EAAE,GAAA;AACZ,CAAC,CAAA;AAMDN,OAAO,CAACyB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAQlBzB,EAAAA,OAAO,EAAE0B,SAAS,CAACC,SAAS,CAAC,CAACD,SAAS,CAACE,MAAM,EAAEF,SAAS,CAACG,OAAO,CAAC,CAAC,CAACC,UAAU;EAM9E7B,WAAW,EAAEyB,SAAS,CAACK,IAAI;AAM3B7B,EAAAA,SAAS,EAAEwB,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;EAIF7B,QAAQ,EAAEuB,SAAS,CAACO,MAAM;AAkB1B7B,EAAAA,OAAO,EAAEsB,SAAS,CAACM,KAAK,CAAC,CACvB,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,EAAE,CACH,CAAC;EAIF3B,OAAO,EAAEqB,SAAS,CAACK,IAAI;EAEvBzB,QAAQ,EAAEoB,SAAS,CAACQ,IAAAA;AACtB,CAAC,GAAA,EAAA;;;;"}
1
+ {"version":3,"file":"Tooltip.js","sources":["../../../src/components/data/Tooltip/Tooltip.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingPortal, useMergeRefs } from '@floating-ui/react';\n\nimport useFloatingPopover from '../../../hooks/useFloatingPopover';\nimport { getElementRef } from '../../../utils/getElementRef';\nimport { SharedFloatingArrow, TOOLTIP_ARROW } from '../_shared/FloatingArrow.styled';\nimport * as S from './Tooltip.styled';\n\nimport type { OpenChangeReason } from '@floating-ui/react';\nimport type { PopoverPlacement, PopperOffset } from '../../../hooks/useFloatingPopover';\n\n/**\n * tippy's own defaults for the three props it applied unconditionally and this component\n * never mentioned. All three are OBSERVABLE — they were on every tooltip in both consumers\n * — so they are reproduced rather than dropped. Measured in `tippy.js/dist/tippy.cjs.js`:\n *\n * ```js\n * var renderProps = { …, arrow: true, maxWidth: 350, zIndex: 9999, … };\n * var defaultProps = Object.assign({ …, offset: [0, 10], trigger: 'mouseenter focus', … });\n * ```\n *\n * and applied as\n *\n * ```js\n * box.style.maxWidth = maxWidth + 'px'; // on the box\n * popper.style.zIndex = String(zIndex); // on the positioner\n * popper.style.pointerEvents = interactive ? '' : 'none';\n * ```\n *\n * `maxWidth` is the one most likely to be mistaken for dead. Plan C6 lists it among the\n * props with \"no consumer usage\", which is true of the PROP and false of its EFFECT: tippy\n * wrote `max-width: 350px` onto every box it ever rendered, so it decides where tooltip text\n * wraps. Accepting-but-ignoring it — C6's remedy for `modifiers` and `popperOptions` — would\n * have unwrapped every multi-line tooltip in both apps. It is implemented instead.\n */\nconst TIPPY_DEFAULT_ARROW = true;\nconst TIPPY_DEFAULT_MAX_WIDTH = 350;\nconst TIPPY_DEFAULT_Z_INDEX = 9999;\n\n/**\n * THE OFFSET, AND WHY `Tooltip` PASSES `arrowHeight: 0` WHILE `Popover` PASSES 15.\n *\n * `useFloatingPopover` documents its `offset` as `[skidding, tipGap]` and adds the arrow\n * height back, so that `Popover` can delete the `errorOffset = arrow ? 15 : 0` memo it\n * carried. That convention is correct FOR `Popover` and wrong here, and the difference is\n * not a matter of taste — it is what the two components actually did:\n *\n * - `Popover.tsx` computed `offset={[offset[0], offset[1] + errorOffset]}` and handed the\n * SUM to tippy. Its public `offset` was therefore a tip gap, and the hook absorbing the\n * `+15` keeps that prop meaning what it has always meant.\n * - `Tooltip.tsx` passed NOTHING. tippy's raw default `[0, 10]` applied, and Popper's\n * `offset` modifier is a distance from the reference to the FLOATING BOX with no arrow\n * term anywhere in it. So this component's offset has always been a BOX distance.\n *\n * Feeding a box distance to a hook that adds an arrow height would push every tooltip 7px\n * further out, and — worse — it would move the 6 consumer call sites that pass\n * `arrow={false}` by a DIFFERENT amount from the ones that do not, because tippy's box\n * distance does not depend on whether an arrow is drawn. `arrowHeight: 0` makes the hook's\n * main axis equal `offset[1]` exactly, for both.\n *\n * The result is that both the box and the arrow tip land where they do today: box 10px from\n * the reference, arrow 7px of protrusion (see `TOOLTIP_ARROW`), tip 3px from the reference\n * — which is exactly tippy's 10 − 7 = 3. `arrowHeight` only feeds the offset maths; passing\n * 0 does not stop the arrow being rendered or measured.\n */\nconst TOOLTIP_OFFSET: PopperOffset = [0, 10];\nconst TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY = 0;\n\n/**\n * `max-width: calc(100vw - 10px)`, which `tippy.css` applied through `[data-tippy-root]` —\n * i.e. to the positioner, on top of the box's own 350px. It only binds on a viewport\n * narrower than the tooltip, which is precisely the case it exists for, so it is carried\n * over rather than dropped as unobservable.\n */\nconst POSITIONER_MAX_WIDTH = 'calc(100vw - 10px)';\n\n/**\n * tippy's `appendTo`. `'parent'` and an implicit-parent case are real tippy behaviours, not\n * inventions — measured in `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;\n * } else {\n * parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n * }\n * ```\n *\n * ⚠️ THIS IS A CORRECTION TO PLAN §A3, WHICH RESOLVED C4 ON HALF THE EVIDENCE. §A3 quotes\n * `TIPPY_DEFAULT_APPEND_TO = () => document.body` and concludes that portalling by default\n * is behaviour-preserving. The line above is the other half: when `interactive` is true AND\n * `appendTo` is left at its default, tippy does NOT use that default — it renders INLINE,\n * into the reference's parent. So \"portal by default\" is behaviour-preserving only for\n * non-interactive instances. It is safe for `Tooltip`, whose `interactive` defaults to\n * `false` and which no consumer passes it to (measured across both apps), and it is a rule\n * `Popover` will have to honour, since `Popover` does have interactive call sites.\n */\nexport type TooltipAppendTo = 'parent' | Element | ((reference: Element) => Element);\n\ntype TooltipOwnProps = {\n /**\n * The content of the `Tooltip`.\n *\n * **NB!** If the content is a `string`, it should be wrapped in a tag, e.g.\n * `<span>{content}</span>`. The requirement outlived its original cause — it was a\n * `@tippyjs/react` quirk — but it is kept because consumers have written to it.\n */\n content: string | React.ReactElement<any>;\n /**\n * Determines if the tooltip has interactive content inside of it, so that it can be\n * hovered over and clicked inside without hiding.\n */\n interactive?: boolean;\n /**\n * The preferred placement of the tooltip. Note that the flip middleware can change this\n * to the opposite placement if it has more space.\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 tooltip to show. Multiple event names are separated\n * by spaces.\n *\n * *Example events:*\n *\n * `trigger: 'click'`\n *\n * `trigger: 'focusin'`\n *\n * `trigger: 'mouseenter click'`\n *\n * `trigger: 'mouseenter'`\n *\n * Omitting it means `'mouseenter focus'`, and `''` means no triggers at all — both are\n * relied on by consumer code. See `parseTrigger`.\n *\n * --\n */\n trigger?: 'mouseenter' | 'mouseenter focus' | 'click' | 'focusin' | 'mouseenter click' | '';\n /**\n * Determines if the tooltip is visible without trigger.\n *\n * Passing a boolean — **including `false`** — switches the tooltip to CONTROLLED mode and\n * its own triggers stop firing. `undefined` leaves it uncontrolled. `useTooltipAutoShow`\n * depends on that distinction and its `toolTipVisible` is `true | undefined` for exactly\n * this reason.\n */\n visible?: boolean;\n /**\n * Whether the arrow is rendered. Defaults to `true`, which is tippy's default and was\n * therefore already the behaviour; 6 consumer call sites pass `false`.\n */\n arrow?: boolean;\n /**\n * `z-index` of the positioned element. Defaults to 9999, tippy's default. 30 consumer call\n * sites pass this, which is why it is declared here even though it was never in the old\n * prop type — it used to typecheck only because the published `Props` widened to\n * `TippyProps`, and that widening disappears with tippy.\n */\n zIndex?: number;\n /**\n * A disabled tooltip can never open, even under a controlled `visible={true}` — tippy's\n * semantics, and what `useTooltipAutoShow`'s `toolTipDisabled` relies on.\n */\n disabled?: boolean;\n /**\n * `[skidding, distance]`, Popper's convention, where `distance` is the gap between the\n * reference and the tooltip BOX. Defaults to tippy's `[0, 10]`.\n */\n offset?: PopperOffset;\n /**\n * Cap on the box's width, in px. Defaults to 350 — tippy's default, and applied to every\n * tooltip today, so it decides where text wraps.\n */\n maxWidth?: number;\n /**\n * Where the tooltip is rendered. Defaults to `document.body`. See `TooltipAppendTo`.\n */\n appendTo?: TooltipAppendTo;\n /** Fired when a press lands outside both the reference and the tooltip. */\n onClickOutside?: (event?: Event) => void;\n /**\n * @deprecated Accepted and IGNORED. This was a Popper `modifiers` array; Floating UI has\n * middleware instead and the two are not translatable prop-for-prop. Kept so that no\n * existing call site throws — plan C6.\n */\n modifiers?: unknown;\n /**\n * @deprecated Accepted and IGNORED, for the same reason as `modifiers`.\n */\n popperOptions?: unknown;\n children?: React.ReactNode;\n};\n\n/*\n * NMB-3998 §C.2: the rest of `props` is spread onto `S.Tooltip`, 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 TooltipOwnProps`); a\n * bare `&` would INTERSECT a colliding member instead of overriding it, which narrows it or\n * empties it to `never`.\n *\n * THE BASE MOVED, AND THAT IS WHY THE PROP TYPE ABOVE GREW. It used to be\n * `styled(Tippy)`, so this widening admitted every tippy option — which is how `zIndex`,\n * `arrow`, `disabled` and `maxWidth` typechecked at 40 consumer call sites while appearing\n * nowhere in the prop type. `S.Tooltip` is now a `styled.div`, so those four would have\n * become type errors the moment the library starts publishing `.d.ts` (playbook §G.4).\n * Declaring them explicitly is what keeps that promise; the set was taken from a grep of\n * both consumers, per plan §A6's warning not to trust the old prop types.\n */\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.Tooltip>, keyof TooltipOwnProps> &\n TooltipOwnProps;\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 drops the rest, so an\n * `onClick` passed to a `Tooltip` has never fired. It is LOAD-BEARING NOW. The rest of\n * `props` lands on a real element in this implementation, so removing the filter would\n * silently activate handlers that have been dead at every call site that passes one.\n *\n * `modifiers` / `popperOptions` — plan C6. Popper concepts with no Floating UI translation\n * and no consumer usage, kept accepted-but-ignored so that no existing call site throws.\n * They are filtered here rather than destructured above because destructuring them would\n * bind names nothing reads, which is a lint error, and because \"the list of props that never\n * reach the DOM\" is worth having in exactly one place.\n */\nconst PROPS_NEVER_FORWARDED = ['onClick', 'onChange', 'onSubmit', 'modifiers', 'popperOptions'];\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n *\n * ### Import\n *\n * ``` js\n * import { Tooltip } from '@ntbjs/react-components/data'\n * // or\n * import Tooltip from '@ntbjs/react-components/data/Tooltip'\n * ```\n */\nconst Tooltip = React.forwardRef<any, Props>(function Tooltip(\n {\n content = 'Tooltip',\n interactive = false,\n placement = 'top',\n duration = 350,\n trigger,\n visible,\n children,\n arrow: hasArrow = TIPPY_DEFAULT_ARROW,\n zIndex = TIPPY_DEFAULT_Z_INDEX,\n disabled = false,\n offset = TOOLTIP_OFFSET,\n maxWidth = TIPPY_DEFAULT_MAX_WIDTH,\n appendTo,\n onClickOutside,\n ...props\n },\n ref\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 [onClickOutside]\n );\n\n const {\n refs,\n floatingStyles,\n context,\n getReferenceProps,\n getFloatingProps,\n isMounted,\n transitionStyles,\n arrowRef,\n placement: resolvedPlacement,\n pointerEvents\n } = useFloatingPopover({\n placement,\n open: visible,\n onOpenChange,\n trigger,\n offset,\n arrow: hasArrow,\n arrowHeight: TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY,\n interactive,\n disabled,\n duration\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 tooltip 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-centre every tooltip 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\" — the case that matters for a child\n * that cannot take one.\n *\n * `ref` GOES SOMEWHERE REAL FOR THE FIRST TIME. It used to be handed to `styled(Tippy)`,\n * and `Tippy` is a plain function component, so React had nowhere to put it. Plan risk #9\n * asks for `forwardRef` onto the reference and this is it; no consumer passes `ref` to a\n * `Tooltip` (measured over both apps), so 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 tooltip'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 * `onMouseEnter` keeps it. tippy did not need this — it attached native listeners straight\n * to the DOM node and never touched the child's props — so passing the child's props\n * through is what reproduces \"the child's own handlers still work\".\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 * tippy's appendTo resolution, reproduced. `'parent'`, and `interactive` with no explicit\n * `appendTo`, render INLINE; everything else portals. See `TooltipAppendTo` for the\n * measurement and for what it corrects in plan §A3.\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. Recomputing every render costs a comparison and is always right.\n *\n * ⚠️ `undefined` AND `null` ARE NOT INTERCHANGEABLE HERE, AND GETTING IT WRONG SILENTLY\n * DELETES THE TOOLTIP. `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`\n * default. Returning `null` for the ordinary no-`appendTo` case therefore produced a\n * tooltip that mounted its positioner into nothing and never appeared — caught by the\n * visual gate as the `Visible` story rendering its trigger and no tooltip, and NOT caught\n * by the render gate, whose fixture reaches the inline path instead.\n *\n * The one place `null` is right is the genuine \"not resolvable yet\" case below: a\n * function `appendTo` cannot be called until the reference exists, and `null` correctly\n * defers the 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()}\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. Under tippy those collisions resolved by being dropped entirely; keeping\n * this element's own values winning is the closest equivalent, and it still lets\n * `data-*` / `aria-*` through to the box, which is where tippy put `className` too.\n */}\n <S.Tooltip\n {...filteredProps}\n data-placement={resolvedPlacement}\n role=\"tooltip\"\n tabIndex={-1}\n style={{ ...transitionStyles, maxWidth }}\n >\n <div className=\"tippy-content\">{content}</div>\n {hasArrow && (\n <SharedFloatingArrow\n ref={arrowRef}\n context={context}\n data-arrow-surface=\"tooltip\"\n {...TOOLTIP_ARROW}\n />\n )}\n </S.Tooltip>\n </div>\n ) : null;\n\n /*\n * The bare wrapper `<div>` is preserved verbatim — plan risk #9. It carries no props and\n * no styling, and it is load-bearing for consumers only in that `TextArea` and\n * `CompactTextInput` hang an `onMouseLeave` on a div of their own immediately outside it.\n */\n return (\n <div>\n {reference}\n {renderInline ? (\n floating\n ) : (\n <FloatingPortal root={resolvePortalRoot()}>{floating}</FloatingPortal>\n )}\n </div>\n );\n});\n\nexport default Tooltip;\n"],"names":["TIPPY_DEFAULT_ARROW","TIPPY_DEFAULT_MAX_WIDTH","TIPPY_DEFAULT_Z_INDEX","TOOLTIP_OFFSET","TOOLTIP_ARROW_HEIGHT_IS_IN_THE_OFFSET_ALREADY","POSITIONER_MAX_WIDTH","PROPS_NEVER_FORWARDED","Tooltip","React","forwardRef","content","interactive","placement","duration","trigger","visible","children","arrow","hasArrow","zIndex","disabled","offset","maxWidth","appendTo","onClickOutside","props","ref","onOpenChange","useCallback","open","event","reason","refs","floatingStyles","context","getReferenceProps","getFloatingProps","isMounted","transitionStyles","arrowRef","resolvedPlacement","pointerEvents","useFloatingPopover","arrowHeight","childRef","isValidElement","getElementRef","referenceRef","useMergeRefs","setReference","filteredProps","Object","fromEntries","entries","filter","key","includes","reference","cloneElement","renderInline","undefined","resolvePortalRoot","node","current","Element","floating","_jsx","setFloating","style","_jsxs","S","role","tabIndex","className","SharedFloatingArrow","TOOLTIP_ARROW","FloatingPortal","root"],"mappings":"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"}
@@ -1,28 +1,15 @@
1
1
  import styled from 'styled-components';
2
2
  import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
- import TippyTooltip from '@tippyjs/react';
4
- import 'tippy.js/animations/shift-away-subtle.css';
5
- import 'tippy.js/dist/tippy.css';
6
3
 
7
- const Tooltip = styled(TippyTooltip).attrs(applyDefaultTheme)`
8
- font-family: ${props => props.theme.primaryFontFamily};
9
- font-size: 1rem;
10
- font-weight: 400;
11
- background: ${props => props.theme.getColor('gray-700')};
12
- border-radius: 3px;
13
- pointer-events: default !important;
14
- .tippy-content {
15
- padding: 9px 12px;
16
- }
17
-
18
- .tippy-arrow {
19
- color: ${props => props.theme.getColor('gray-700')};
20
- }
21
-
22
- a {
23
- color: inherit;
24
- }
25
- `;
4
+ const shouldForwardProp = prop => {
5
+ return prop !== 'theme' && !prop.startsWith('$');
6
+ };
7
+ const Tooltip = styled.div.withConfig({
8
+ shouldForwardProp
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "Tooltipstyled__Tooltip",
11
+ componentId: "sc-vg943j-0"
12
+ })(["position:relative;outline:0;white-space:normal;line-height:1.4;color:", ";font-family:", ";font-size:1rem;font-weight:400;background:", ";border-radius:3px;.tippy-content{position:relative;z-index:1;padding:9px 12px;}a{color:inherit;}"], props => props.theme.getColor('white'), props => props.theme.primaryFontFamily, props => props.theme.getColor('gray-700'));
26
13
 
27
14
  export { Tooltip };
28
15
  //# sourceMappingURL=Tooltip.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.styled.js","sources":["../../../src/components/data/Tooltip/Tooltip.styled.js"],"sourcesContent":["import styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport Tippy from '@tippyjs/react';\nimport 'tippy.js/animations/shift-away-subtle.css';\nimport 'tippy.js/dist/tippy.css';\n\nexport const Tooltip = styled(Tippy).attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n background: ${props => props.theme.getColor('gray-700')};\n border-radius: 3px;\n pointer-events: default !important;\n .tippy-content {\n padding: 9px 12px;\n }\n\n .tippy-arrow {\n color: ${props => props.theme.getColor('gray-700')};\n }\n\n a {\n color: inherit;\n }\n`;\n"],"names":["Tooltip","styled","Tippy","attrs","applyDefaultTheme","props","theme","primaryFontFamily","getColor"],"mappings":";;;;;;AAOO,MAAMA,OAAO,GAAGC,MAAM,CAACC,YAAK,CAAC,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC7D,eAAA,EAAiBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,CAAA;AACvD;AACA;AACA,cAAgBF,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,CAAA;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAaH,EAAAA,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACE,QAAQ,CAAC,UAAU,CAAC,CAAA;AACtD;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"Tooltip.styled.js","sources":["../../../src/components/data/Tooltip/Tooltip.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.\n *\n * ================== WHAT REPLACED WHAT, AND THE TWO THINGS THAT CAME BACK ==================\n *\n * This file used to be `styled(Tippy)`, 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, and two of its declarations were load-bearing:\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; transition-property: ... }\n *\n * - `color: #fff` is where the tooltip's WHITE TEXT came from. Nothing in the old version\n * of this file set a colour; had it been dropped silently the text would have fallen back\n * to inherited, i.e. near-black on `gray-700` in the light theme. `white` is `#ffffff`\n * in `colors-export.js`, the same colour, so it is written as the token.\n * - `position: relative` is the ARROW'S CONTAINING BLOCK. `FloatingArrow` positions its\n * `<svg>` at `[side]: 100%`, which resolves against the nearest positioned ancestor; with\n * a static box the arrow would escape to the viewport.\n *\n * `line-height: 1.4`, `white-space: normal` and `outline: 0` are carried over for the same\n * reason — they were in force and are not defaults. The three declarations that were\n * genuinely overridden (`background-color`, `border-radius`, `font-size`) keep the\n * overriding values and tippy's are simply gone.\n *\n * WHAT WAS DELIBERATELY NOT CARRIED OVER, so the next reader does not \"restore\" it:\n *\n * - `pointer-events: default !important`. `default` is not a value of `pointer-events`\n * (the valid set is auto | none | visiblePainted | visibleFill | visibleStroke | visible\n * | painted | fill | stroke | all | inherit), so the declaration was invalid and the\n * browser dropped it. It has never had any effect. The real mechanism is tippy's\n * `popper.style.pointerEvents = interactive ? '' : 'none'`, which now lives on the\n * positioner in `Tooltip.tsx` where the hook reports it.\n * - `transition-property`. `useTransitionStyles` emits its own transition shorthand inline\n * on this element, so a stylesheet declaration would be overridden on every render.\n * - `.tippy-arrow { color: … }`. tippy drew the arrow as a CSS border triangle, and\n * `border-*-color: initial` resolves to `currentColor` — which is why the arrow colour\n * was set through `color`. The arrow is now an SVG and is filled by\n * `FloatingArrow.styled.ts`'s `tooltip` surface, with the same `gray-700`.\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, so renaming it needs coordinated PRs in two\n * repos — plan C2/§A4. `Tooltip.tsx` renders exactly one such element.\n *\n * It keeps `position: relative` and `z-index: 1` as well as the padding, because\n * `tippy.css`'s own `.tippy-content` rule supplied those and that stylesheet is still in\n * the bundle (`Popover.styled.ts` imports it until Popover migrates too). Declaring them\n * here means this component does not silently change the day that import goes away.\n */\nimport styled from 'styled-components';\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 * and put `data-theme=\"[object Object]\"` on the live box. The root here is a plain\n * `styled.div`, so without this predicate that same object would be written to the DOM as\n * `theme=\"[object Object]\"` — `theme` is all-lowercase, so React 19 does NOT drop it the\n * way it drops unknown camelCase props. The fix the old header asked for is therefore not a\n * follow-up; it is a precondition of this rewrite.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The tooltip box — what `.tippy-box` was.\n *\n * `Tooltip.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 the three existing Floating UI sites use.\n */\nexport const Tooltip = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: relative;\n outline: 0;\n white-space: normal;\n line-height: 1.4;\n color: ${props => props.theme.getColor('white')};\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 1rem;\n font-weight: 400;\n background: ${props => props.theme.getColor('gray-700')};\n border-radius: 3px;\n\n .tippy-content {\n position: relative;\n z-index: 1;\n padding: 9px 12px;\n }\n\n a {\n color: inherit;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","Tooltip","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","getColor","primaryFontFamily"],"mappings":";;;AA4EA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AASM,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,uEAAA,EAAA,eAAA,EAAA,6CAAA,EAAA,mGAAA,CAAA,EAKhBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAChCF,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACE,iBAAiB,EAGvCH,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC;;;;"}
@@ -1,36 +1,29 @@
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 { VerificationIconWrapper, VerificationStatusIcon as VerificationStatusIcon$1, VerificationStatusColor } from './VerificationStatusIcon.styled.js';
5
3
  import { ReactComponent as SvgVerification } from '../../icons/verification.svg.js';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
5
 
7
6
  const VerificationStatusIcon = React__default.forwardRef(function VerificationStatusIcon({
8
7
  status,
9
- iconHeight,
10
- background,
8
+ iconHeight = 15,
9
+ background = false,
11
10
  ...props
12
11
  }, forwardedRef) {
13
- return React__default.createElement(VerificationIconWrapper, {
14
- $background: background
15
- }, React__default.createElement(VerificationStatusIcon$1, _extends({
16
- $iconHeight: iconHeight,
12
+ return jsx(VerificationIconWrapper, {
17
13
  $background: background,
18
- ref: forwardedRef
19
- }, props), React__default.createElement(SvgVerification, null), React__default.createElement(VerificationStatusColor, {
20
- $iconHeight: iconHeight,
21
- $status: status,
22
- $background: background
23
- })));
14
+ children: jsxs(VerificationStatusIcon$1, {
15
+ $iconHeight: iconHeight,
16
+ $background: background,
17
+ ref: forwardedRef,
18
+ ...props,
19
+ children: [jsx(SvgVerification, {}), jsx(VerificationStatusColor, {
20
+ $iconHeight: iconHeight,
21
+ $status: status,
22
+ $background: background
23
+ })]
24
+ })
25
+ });
24
26
  });
25
- VerificationStatusIcon.propTypes = process.env.NODE_ENV !== "production" ? {
26
- status: PropTypes.oneOf(['verified', 'pending', 'rejected', 'mixed']).isRequired,
27
- iconHeight: PropTypes.number,
28
- background: PropTypes.bool
29
- } : {};
30
- VerificationStatusIcon.defaultProps = {
31
- iconHeight: 15,
32
- background: false
33
- };
34
27
 
35
28
  export { VerificationStatusIcon as default };
36
29
  //# sourceMappingURL=VerificationStatusIcon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VerificationStatusIcon.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './VerificationStatusIcon.styled';\nimport { VerificationIcon } from '../../../icons';\n\n/**\n * A compact icon showing verification status with color coding.\n *\n * ### Import\n *\n * ``` js\n * import { VerificationStatusIcon } from '@ntbjs/react-components/data'\n * // or\n * import VerificationStatusIcon from '@ntbjs/react-components/data/VerificationStatusIcon'\n * ```\n *\n * ### Props\n * ```\n * Pass one of \"verified\", \"pending\" or \"rejected\" to `status` to display the correct verification status.\n * Pass `iconHeight={15}` to set the height of the icon in pixel\n * ```\n */\nconst VerificationStatusIcon = React.forwardRef(function VerificationStatusIcon(\n { status, iconHeight, background, ...props },\n forwardedRef\n) {\n return (\n <S.VerificationIconWrapper $background={background}>\n <S.VerificationStatusIcon\n $iconHeight={iconHeight}\n $background={background}\n ref={forwardedRef}\n {...props}\n >\n <VerificationIcon />\n <S.VerificationStatusColor\n $iconHeight={iconHeight}\n $status={status}\n $background={background}\n />\n </S.VerificationStatusIcon>\n </S.VerificationIconWrapper>\n );\n});\n\nVerificationStatusIcon.propTypes = {\n /**\n * Status of the verification\n */\n status: PropTypes.oneOf(['verified', 'pending', 'rejected', 'mixed']).isRequired,\n /**\n * Custom height of the icon\n */\n iconHeight: PropTypes.number,\n /**\n * If Icon has background\n */\n background: PropTypes.bool\n};\n\nVerificationStatusIcon.defaultProps = {\n iconHeight: 15,\n background: false\n};\n\nexport default VerificationStatusIcon;\n"],"names":["VerificationStatusIcon","React","forwardRef","status","iconHeight","background","props","forwardedRef","createElement","S","$background","_extends","$iconHeight","ref","VerificationIcon","$status","propTypes","process","env","NODE_ENV","PropTypes","oneOf","isRequired","number","bool","defaultProps"],"mappings":";;;;;;AAsBMA,MAAAA,sBAAsB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,sBAAsBA,CAC7E;EAAEG,MAAM;EAAEC,UAAU;EAAEC,UAAU;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAC5CC,YAAY,EACZ;AACA,EAAA,OACEN,cAAA,CAAAO,aAAA,CAACC,uBAAyB,EAAA;AAACC,IAAAA,WAAW,EAAEL,UAAAA;GACtCJ,EAAAA,cAAA,CAAAO,aAAA,CAACC,wBAAwB,EAAAE,QAAA,CAAA;AACvBC,IAAAA,WAAW,EAAER,UAAW;AACxBM,IAAAA,WAAW,EAAEL,UAAW;AACxBQ,IAAAA,GAAG,EAAEN,YAAAA;AAAa,GAAA,EACdD,KAAK,CAETL,EAAAA,cAAA,CAAAO,aAAA,CAACM,eAAgB,EAAA,IAAE,CAAC,EACpBb,cAAA,CAAAO,aAAA,CAACC,uBAAyB,EAAA;AACxBG,IAAAA,WAAW,EAAER,UAAW;AACxBW,IAAAA,OAAO,EAAEZ,MAAO;AAChBO,IAAAA,WAAW,EAAEL,UAAAA;GACd,CACuB,CACD,CAAC,CAAA;AAEhC,CAAC,EAAC;AAEFL,sBAAsB,CAACgB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAIjChB,EAAAA,MAAM,EAAEiB,SAAS,CAACC,KAAK,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAACC,UAAU;EAIhFlB,UAAU,EAAEgB,SAAS,CAACG,MAAM;EAI5BlB,UAAU,EAAEe,SAAS,CAACI,IAAAA;AACxB,CAAC,GAAA,EAAA,CAAA;AAEDxB,sBAAsB,CAACyB,YAAY,GAAG;AACpCrB,EAAAA,UAAU,EAAE,EAAE;AACdC,EAAAA,UAAU,EAAE,KAAA;AACd,CAAC;;;;"}
1
+ {"version":3,"file":"VerificationStatusIcon.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './VerificationStatusIcon.styled';\nimport { VerificationIcon } from '../../../icons';\n\ntype VerificationStatusIconOwnProps = {\n /**\n * Status of the verification\n */\n status: 'verified' | 'pending' | 'rejected' | 'mixed';\n /**\n * Custom height of the icon\n */\n iconHeight?: number;\n /**\n * If Icon has background\n */\n background?: boolean;\n};\n\n/*\n * NMB-3998 §C.2: `props` is spread onto `S.VerificationStatusIcon`, so the published type\n * has to admit that target's props too — a closed type here is worse than `any` for the\n * 125 consumer files. Declared members win over the base (`Omit` by `keyof VerificationStatusIconOwnProps`);\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 */\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.VerificationStatusIcon>,\n keyof VerificationStatusIconOwnProps\n> &\n VerificationStatusIconOwnProps;\n\n/**\n * A compact icon showing verification status with color coding.\n *\n * ### Import\n *\n * ``` js\n * import { VerificationStatusIcon } from '@ntbjs/react-components/data'\n * // or\n * import VerificationStatusIcon from '@ntbjs/react-components/data/VerificationStatusIcon'\n * ```\n *\n * ### Props\n * ```\n * Pass one of \"verified\", \"pending\" or \"rejected\" to `status` to display the correct verification status.\n * Pass `iconHeight={15}` to set the height of the icon in pixel\n * ```\n */\nconst VerificationStatusIcon = React.forwardRef<any, Props>(function VerificationStatusIcon(\n { status, iconHeight = 15, background = false, ...props },\n forwardedRef\n) {\n return (\n <S.VerificationIconWrapper $background={background}>\n <S.VerificationStatusIcon\n $iconHeight={iconHeight}\n $background={background}\n ref={forwardedRef}\n {...props}\n >\n <VerificationIcon />\n <S.VerificationStatusColor\n $iconHeight={iconHeight}\n $status={status}\n $background={background}\n />\n </S.VerificationStatusIcon>\n </S.VerificationIconWrapper>\n );\n});\n\nexport default VerificationStatusIcon;\n"],"names":["VerificationStatusIcon","React","forwardRef","status","iconHeight","background","props","forwardedRef","_jsx","S","$background","children","_jsxs","$iconHeight","ref","VerificationIcon","$status"],"mappings":";;;;;AAiDA,MAAMA,sBAAsB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,sBAAsBA,CACzF;EAAEG,MAAM;AAAEC,EAAAA,UAAU,GAAG,EAAE;AAAEC,EAAAA,UAAU,GAAG,KAAK;EAAE,GAAGC;AAAM,CAAC,EACzDC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAyB,EAAA;AAACC,IAAAA,WAAW,EAAEL,UAAW;AAAAM,IAAAA,QAAA,EACjDC,IAAA,CAACH,wBAAwB,EAAA;AACvBI,MAAAA,WAAW,EAAET,UAAW;AACxBM,MAAAA,WAAW,EAAEL,UAAW;AACxBS,MAAAA,GAAG,EAAEP,YAAa;AAAA,MAAA,GACdD,KAAK;MAAAK,QAAA,EAAA,CAETH,GAAA,CAACO,eAAgB,EAAA,EAAE,CAAC,EACpBP,GAAA,CAACC,uBAAyB,EAAA;AACxBI,QAAAA,WAAW,EAAET,UAAW;AACxBY,QAAAA,OAAO,EAAEb,MAAO;AAChBO,QAAAA,WAAW,EAAEL;AAAW,OACzB,CAAC;KACsB;AAAC,GACF,CAAC;AAEhC,CAAC;;;;"}
@@ -6,39 +6,22 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const VerificationIconWrapper = styled.div.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- ${props => props.$background && css`
11
- background-color: #000 !important;
12
- width: fit-content;
13
- padding: 6px 14px 6px 9px;
14
- border-radius: 15px;
15
- }
16
- `};
17
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "VerificationStatusIconstyled__VerificationIconWrapper",
11
+ componentId: "sc-10rr64t-0"
12
+ })(["", ";"], props => props.$background && css(["background-color:#000 !important;width:fit-content;padding:6px 14px 6px 9px;border-radius:15px;}"]));
18
13
  const VerificationStatusIcon = styled.div.withConfig({
19
14
  shouldForwardProp
20
- }).attrs(applyDefaultTheme)`
21
- display: flex;
22
- position: relative;
23
- font: normal normal normal 12px/16px Roboto;
24
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-700'))};
25
-
26
- ${props => props.$background && props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-100'))};
27
-
28
- svg {
29
- height: ${props => props.iconHeight ?? 15}px;
30
- }
31
- `;
15
+ }).attrs(applyDefaultTheme).withConfig({
16
+ displayName: "VerificationStatusIconstyled__VerificationStatusIcon",
17
+ componentId: "sc-10rr64t-1"
18
+ })(["display:flex;position:relative;font:normal normal normal 12px/16px Roboto;", ";", ";svg{height:", "px;}"], props => props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-700')), props => props.$background && props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-100')), props => props.iconHeight ?? 15);
32
19
  const VerificationStatusColor = styled.div.withConfig({
33
20
  shouldForwardProp
34
- }).attrs(applyDefaultTheme)`
35
- position: absolute;
36
- bottom: 0;
37
- left: ${props => (props.$iconHeight ?? 15) * 2 / 3}px;
38
- width: ${props => (props.$iconHeight ?? 15) * 2 / 3}px;
39
- height: ${props => (props.$iconHeight ?? 15) * 2 / 3}px;
40
- border-radius: 50%;
41
- ${props => {
21
+ }).attrs(applyDefaultTheme).withConfig({
22
+ displayName: "VerificationStatusIconstyled__VerificationStatusColor",
23
+ componentId: "sc-10rr64t-2"
24
+ })(["position:absolute;bottom:0;left:", "px;width:", "px;height:", "px;border-radius:50%;", ";"], props => (props.$iconHeight ?? 15) * 2 / 3, props => (props.$iconHeight ?? 15) * 2 / 3, props => (props.$iconHeight ?? 15) * 2 / 3, props => {
42
25
  let darkThemeColor = props.theme.getColor('gray-100');
43
26
  let lightThemeColor = props.theme.getColor('gray-500');
44
27
  if (props.$status === 'verified') {
@@ -55,8 +38,7 @@ const VerificationStatusColor = styled.div.withConfig({
55
38
  lightThemeColor = '#008CDB';
56
39
  }
57
40
  return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);
58
- }};
59
- `;
41
+ });
60
42
 
61
43
  export { VerificationIconWrapper, VerificationStatusColor, VerificationStatusIcon };
62
44
  //# sourceMappingURL=VerificationStatusIcon.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VerificationStatusIcon.styled.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const VerificationIconWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n ${props =>\n props.$background &&\n css`\n background-color: #000 !important;\n width: fit-content;\n padding: 6px 14px 6px 9px;\n border-radius: 15px;\n}\n `};\n`;\n\nexport const VerificationStatusIcon = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n display: flex;\n position: relative;\n font: normal normal normal 12px/16px Roboto;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )};\n\n ${props =>\n props.$background &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-100')\n )};\n\n svg {\n height: ${props => props.iconHeight ?? 15}px;\n }\n`;\n\nexport const VerificationStatusColor = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n position: absolute;\n bottom: 0;\n left: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n width: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n height: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n border-radius: 50%;\n ${props => {\n let darkThemeColor = props.theme.getColor('gray-100');\n let lightThemeColor = props.theme.getColor('gray-500');\n\n if (props.$status === 'verified') {\n darkThemeColor = props.theme.getColor('emerald-500');\n lightThemeColor = props.theme.getColor('emerald-500');\n } else if (props.$status === 'pending') {\n darkThemeColor = props.theme.getColor('signal-yellow-500');\n lightThemeColor = props.theme.getColor('signal-yellow-500');\n } else if (props.$status === 'rejected') {\n darkThemeColor = props.theme.getColor('red-600');\n lightThemeColor = props.theme.getColor('red-600');\n } else if (props.$status === 'mixed') {\n darkThemeColor = '#008CDB';\n lightThemeColor = '#008CDB';\n }\n\n return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);\n }};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","VerificationIconWrapper","styled","div","withConfig","attrs","applyDefaultTheme","props","$background","css","VerificationStatusIcon","theme","themeProp","getColor","iconHeight","VerificationStatusColor","$iconHeight","darkThemeColor","lightThemeColor","$status"],"mappings":"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"}
1
+ {"version":3,"file":"VerificationStatusIcon.styled.js","sources":["../../../src/components/data/VerificationStatusIcon/VerificationStatusIcon.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 * ONE DEFERRED DEFECT AND ONE COSMETIC ODDITY, NEITHER FIXED HERE:\n *\n * - `VerificationStatusIcon` reads `props.iconHeight` for its `svg` height, but the\n * component passes `$iconHeight`. See `VerificationStatusIconStyleProps`.\n * - `VerificationIconWrapper`'s interpolated block below contains a STRAY `}` on its\n * own line, after `border-radius: 15px;`. It is a typo, it is in the recorded\n * baseline, and removing it changes the emitted css text — so it belongs to a commit\n * that re-records, not to a type-only one.\n */\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n/**\n * Shared by all three components: `VerificationStatusIcon.tsx` passes `$background` to\n * every one of them. Only `VerificationIconWrapper` and `VerificationStatusIcon` read it;\n * on `VerificationStatusColor` it is passed and never read, which is harmless because the\n * `$` means `shouldForwardProp` filters it before both the CSS and the DOM.\n */\ninterface VerificationBackgroundStyleProps {\n /** `background` — `PropTypes.bool`; swaps in the black pill and the light icon colour. */\n $background?: boolean;\n}\n\n/**\n * Props of the `VerificationStatusIcon` element.\n *\n * DEFECT, DECLARED NOT FIXED: `iconHeight` in its non-`$` form is what the `svg` rule\n * below reads, and NOTHING PASSES IT — `VerificationStatusIcon.tsx` passes `$iconHeight`,\n * which this component never reads. So the `?? 15` fallback is unconditional and the icon\n * is 15px tall no matter what a caller asks for, WHILE `VerificationStatusColor` does read\n * `$iconHeight` and scales correctly. Pass `iconHeight={30}` today and the status dot grows\n * but the icon it sits on does not.\n *\n * The fix is to repoint the read to `props.$iconHeight`, which ACTIVATES A BRANCH THAT HAS\n * NEVER FIRED and changes the emitted height for every non-default `iconHeight`. §J.8 puts\n * that in C10 with its baseline re-record.\n */\nexport interface VerificationStatusIconStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. Read, never passed; see the JSDoc above. */\n iconHeight?: number;\n}\n\n/** Props of `VerificationStatusColor`, the small status dot. */\ninterface VerificationStatusColorStyleProps extends VerificationBackgroundStyleProps {\n /** `iconHeight` — `PropTypes.number`, px. This site reads the `$` form, correctly. */\n $iconHeight?: number;\n /**\n * `status` — `PropTypes.oneOf(['verified', 'pending', 'rejected', 'mixed'])`, and\n * `.isRequired` on the component but still OPTIONAL here per §J.5.\n *\n * Closed on purpose rather than widened to `string`: the block below compares this value\n * four times, and with a closed union a mistyped status name is TS2367 instead of a\n * branch that silently never fires. §J.6.\n */\n $status?: 'verified' | 'pending' | 'rejected' | 'mixed';\n}\n\n/*\n * Single-argument, and it stays that way — peer floor `styled-components: >=5.1.0`, and\n * the two majors disagree on the second parameter. §J.4. `prop` needs the annotation\n * because `withConfig` takes this by reference, so it gets no contextual typing.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const VerificationIconWrapper = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationBackgroundStyleProps>(applyDefaultTheme)`\n ${props =>\n props.$background &&\n css`\n background-color: #000 !important;\n width: fit-content;\n padding: 6px 14px 6px 9px;\n border-radius: 15px;\n}\n `};\n`;\n\nexport const VerificationStatusIcon = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusIconStyleProps>(applyDefaultTheme)`\n display: flex;\n position: relative;\n font: normal normal normal 12px/16px Roboto;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-300'),\n props.theme.getColor('gray-700')\n )};\n\n ${props =>\n props.$background &&\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-100')\n )};\n\n svg {\n height: ${props => props.iconHeight ?? 15}px;\n }\n`;\n\nexport const VerificationStatusColor = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<VerificationStatusColorStyleProps>(applyDefaultTheme)`\n position: absolute;\n bottom: 0;\n left: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n width: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n height: ${props => ((props.$iconHeight ?? 15) * 2) / 3}px;\n border-radius: 50%;\n ${props => {\n let darkThemeColor = props.theme.getColor('gray-100');\n let lightThemeColor = props.theme.getColor('gray-500');\n\n if (props.$status === 'verified') {\n darkThemeColor = props.theme.getColor('emerald-500');\n lightThemeColor = props.theme.getColor('emerald-500');\n } else if (props.$status === 'pending') {\n darkThemeColor = props.theme.getColor('signal-yellow-500');\n lightThemeColor = props.theme.getColor('signal-yellow-500');\n } else if (props.$status === 'rejected') {\n darkThemeColor = props.theme.getColor('red-600');\n lightThemeColor = props.theme.getColor('red-600');\n } else if (props.$status === 'mixed') {\n darkThemeColor = '#008CDB';\n lightThemeColor = '#008CDB';\n }\n\n return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);\n }};\n`;\n"],"names":["shouldForwardProp","prop","startsWith","VerificationIconWrapper","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$background","css","VerificationStatusIcon","theme","themeProp","getColor","iconHeight","VerificationStatusColor","$iconHeight","darkThemeColor","lightThemeColor","$status"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ export { default } from './VerificationStatusIcon.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import styled from 'styled-components';
2
+ import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
+ import { FloatingArrow } from '@floating-ui/react';
4
+ import { DEFAULT_ARROW_HEIGHT } from '../../hooks/useFloatingPopover.js';
5
+
6
+ const POPOVER_ARROW = {
7
+ width: 26,
8
+ height: DEFAULT_ARROW_HEIGHT,
9
+ strokeWidth: 1
10
+ };
11
+ const TOOLTIP_ARROW = {
12
+ width: 14,
13
+ height: 7,
14
+ strokeWidth: 0
15
+ };
16
+ const shouldForwardProp = prop => {
17
+ return prop !== 'theme' && !prop.startsWith('$');
18
+ };
19
+ const SharedFloatingArrow = styled(FloatingArrow).withConfig({
20
+ shouldForwardProp
21
+ }).attrs(props => ({
22
+ ...applyDefaultTheme(props),
23
+ 'data-arrow-surface': props['data-arrow-surface'] ?? 'popover'
24
+ })).withConfig({
25
+ displayName: "FloatingArrowstyled__SharedFloatingArrow",
26
+ componentId: "sc-d8okt-0"
27
+ })(["body.dark-theme &[data-arrow-surface='popover']{fill:", ";stroke:", ";& > path:last-of-type{stroke:", ";}}body.light-theme &[data-arrow-surface='popover']{fill:", ";stroke:", ";& > path:last-of-type{stroke:", ";}}body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='popover']{fill:", ";stroke:", ";& > path:last-of-type{stroke:", ";}@media (prefers-color-scheme:dark){fill:", ";stroke:", ";& > path:last-of-type{stroke:", ";}}}body.dark-theme &[data-arrow-surface='tooltip'],body.light-theme &[data-arrow-surface='tooltip'],body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='tooltip']{fill:", ";stroke:none;& > path:last-of-type{stroke:", ";}}"], props => props.theme.getColor('gray-700'), props => props.theme.getColor('gray-800'), props => props.theme.getColor('gray-700'), props => props.theme.getColor('white'), props => props.theme.getColor('gray-300'), props => props.theme.getColor('white'), props => props.theme.getColor('white'), props => props.theme.getColor('gray-300'), props => props.theme.getColor('white'), props => props.theme.getColor('gray-700'), props => props.theme.getColor('gray-800'), props => props.theme.getColor('gray-700'), props => props.theme.getColor('gray-700'), props => props.theme.getColor('gray-700'));
28
+
29
+ export { POPOVER_ARROW, SharedFloatingArrow, TOOLTIP_ARROW };
30
+ //# sourceMappingURL=FloatingArrow.styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FloatingArrow.styled.js","sources":["../../../src/components/data/_shared/FloatingArrow.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 * THE ONE THEMED ARROW. It replaces four things:\n *\n * 1. `Popover.styled.ts`'s eight `.tippy-arrow::before` / `::after` blocks — a CSS\n * border-triangle drawn twice per side (an outline layer and a fill layer) for each\n * of the four sides, 8 rules and 4 `themeProp()` calls.\n * 2. `Tooltip.styled.ts`'s `.tippy-arrow { color: … }` — tippy drove the arrow colour\n * through `color`, because its triangle was a border and `border-*-color: initial`\n * resolves to `currentColor`.\n * 3. `SummaryCard.styled.ts`'s `StyledFloatingArrow`.\n * 4. `AssetAction.styled.ts`'s `StyledFloatingArrow`.\n *\n * (3) and (4) still exist: consolidating those three Floating UI sites onto this file and\n * onto `useFloatingPopover` is a DEFERRED pass. This file is written to serve them — its\n * `popover` surface is `SummaryCard`'s exact colour pair — but it does not touch them.\n *\n * ================== WHY NO `themeProp()` AND NO INTERPOLATED `css` BLOCK ==================\n *\n * Two repo conventions decide the whole shape of the template below, both recorded in\n * `ThemeProp`'s JSDoc in `src/utils/defaultTheme.ts`:\n *\n * - `themeProp()` emits `body.dark-theme && { … }`, a SELECTOR. Nesting it inside another\n * selector block (`&[data-arrow-surface='tooltip'] { ${themeProp(…)} }`) produces\n * `&[data-arrow-surface='tooltip'] body.dark-theme && { … }` — a descendant selector that\n * matches nothing. So the two surfaces cannot each carry a `themeProp()`, and the theme\n * branches are written out by hand instead. `body:not(.light-theme):not(.dark-theme)` +\n * `prefers-color-scheme` is included because that is `themeProp`'s third branch and\n * Storybook's neither-class state is a real state (see `scripts/VERIFY.md`, \"How the\n * theme is driven\").\n * - Per-instance state goes on a STATIC attribute selector, not a `${props => css…}` rule,\n * because interpolated rules share the component's `componentId` and two instances in\n * different states collide. `data-arrow-surface` is that attribute.\n *\n * A side effect worth having: because nothing here is a shared `css<A>` helper, §J.7's\n * weak-type rule never engages. The plan's addendum §A1 predicted a shared arrow would hit\n * it (\"A single shared `FloatingArrow.styled.ts` used by four call sites will hit this\");\n * it does not, and the reason is that the surfaces are static rule text rather than an\n * interpolated helper the hosts have to satisfy.\n */\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nimport { FloatingArrow } from '@floating-ui/react';\nimport { DEFAULT_ARROW_HEIGHT } from '../../../hooks/useFloatingPopover';\n\nimport type { NtbTheme } from '../../../utils/defaultTheme';\n\n/**\n * Which surface the arrow is pointing away from, i.e. which fill/border pair it uses.\n *\n * - `popover` — the `Popover` box and the summary-card overlay: `gray-700` on dark,\n * `white` on light, with a 1px border that continues the box's own.\n * - `tooltip` — the `Tooltip` box: `gray-700` in BOTH themes and no border, because\n * `Tooltip.styled.ts` sets `background: gray-700` unconditionally and has no border.\n */\nexport type FloatingArrowSurface = 'popover' | 'tooltip';\n\n/**\n * THE ARROW'S GEOMETRY, PER SURFACE — and the numbers are derived, not chosen.\n *\n * `height` is how far the arrow protrudes from the floating element, because\n * `FloatingArrow` positions its `<svg>` at `[side]: '100%'`. It is therefore the term\n * `useFloatingPopover` adds to the main-axis offset, which is why the popover height is\n * IMPORTED from there rather than written twice: the offset maths and the rendered\n * triangle must be the same number or the arrow sits at the wrong gap.\n *\n * `popover` — from `Popover.styled.ts`'s override, `border-width: 15px 13px 0`: a triangle\n * 15px tall on a 13+13 = **26px** base. The full derivation, including why the `+15` in\n * `Popover.tsx` was never a fudge, is on `DEFAULT_ARROW_HEIGHT`.\n *\n * `tooltip` — `Tooltip.styled.ts` never overrode the geometry, so the numbers come from\n * `tippy.js/dist/tippy.css`, and they are the **VISIBLE** triangle rather than the declared\n * one. THE ONE PIXEL THE FIRST DRAFT OF THIS COMMENT CALLED UNAVOIDABLE IS NOT: it\n * disappears once the hidden part of tippy's triangle is subtracted instead of being\n * carried. The measurement, from the four rules that describe a top-placed tooltip arrow:\n *\n * .tippy-arrow { width: 16px; height: 16px }\n * .tippy-box[data-placement^=top] > .tippy-arrow { bottom: 0 }\n * .tippy-box[data-placement^=top] > .tippy-arrow:before {\n * bottom: -7px; border-width: 8px 8px 0 }\n *\n * 1. The 16x16 arrow box sits with its bottom edge ON the box's bottom edge.\n * 2. The `:before` border-triangle is 8px tall on a 16px base, positioned `bottom: -7px`,\n * so its apex is 7px OUTSIDE the box and its 16px-wide base is 1px INSIDE it.\n * 3. Therefore only 7 of the 8px are ever visible, and at the box edge — 1px down from a\n * 16px base on an 8px triangle — the triangle has already narrowed to\n * 16 x (1 - 1/8) = **14px**.\n * 4. So the triangle a user sees is **14px wide at the box edge and 7px tall**, which is\n * `FloatingArrow`'s own default geometry, and `FloatingArrow` overlapping nothing is\n * exactly right: there is nothing to overlap. The 1px tippy hides is the same\n * `gray-700` as the box behind it (this surface has no border), so it was never\n * contributing a pixel.\n *\n * The offset that goes with it is tippy's own default `[0, 10]` passed straight through,\n * with `arrowHeight: 0` handed to `useFloatingPopover` — see the block comment at\n * `TOOLTIP_OFFSET` in `Tooltip.tsx`, which is where the reason that `Tooltip` does NOT add\n * the arrow height while `Popover` does is written down. Box 10px out, tip 3px out, in both\n * implementations.\n *\n * `strokeWidth` is `FloatingArrow`'s border width in px. `0` means the outline `<path>` is\n * not rendered at all, which is why the `tooltip` surface needs no `stroke` rule.\n */\nexport const POPOVER_ARROW = {\n width: 26,\n height: DEFAULT_ARROW_HEIGHT,\n strokeWidth: 1\n} as const;\n\n/**\n * See `POPOVER_ARROW` — same derivation, from tippy's unmodified default geometry, reduced\n * to the part of it that is visible. 14x7 and not 16x8; the numbers coincide with\n * `FloatingArrow`'s own defaults, which is a result rather than a shortcut and is why they\n * are written out anyway.\n */\nexport const TOOLTIP_ARROW = {\n width: 14,\n height: 7,\n strokeWidth: 0\n} as const;\n\n/**\n * Props of `SharedFloatingArrow`, i.e. what this file's `.attrs()` callback reads and what\n * a call site may set. Both optional per §J.5 — every wrapper spreads `{...props}` onto its\n * styled root, and a required transient prop manufactures TS2769 there.\n */\ninterface FloatingArrowStyleProps {\n /**\n * styled-components' theme. Declared for the same reason `Popover.styled.ts` declares\n * it — this is `styled(ThirdPartyComponent)`, so the outer props are\n * `FloatingArrowProps extends React.ComponentPropsWithRef<'svg'>` and nothing in there\n * is `theme`. `.attrs(applyDefaultTheme)` fills it in for the interpolations below.\n */\n theme?: NtbTheme;\n /**\n * Which colour pair to use. NOT `$`-prefixed on purpose: it has to REACH THE DOM,\n * because the rules below select on it. `shouldForwardProp` forwards it precisely\n * because it does not start with `$`.\n *\n * Hyphenated, so a call site could pass it without this declaration — TypeScript does\n * not excess-property-check JSX attribute names that are not valid identifiers. It is\n * declared anyway because the `.attrs()` callback READS it, and a read does need the\n * declaration.\n */\n 'data-arrow-surface'?: FloatingArrowSurface;\n}\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 * This is also the fix for the leak `AssetAction.styled.ts` has: its `StyledFloatingArrow`\n * has no `shouldForwardProp`, so `.attrs(applyDefaultTheme)`'s `theme` OBJECT is handed to\n * `FloatingArrow`, which spreads `...rest` onto the `<svg>` — `theme=\"[object Object]\"` on\n * an SVG element. Filtering it here means the shared arrow never had that defect.\n */\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\n/**\n * The themed arrow. Render it inside the floating element with `context`, `ref` and the\n * geometry from `POPOVER_ARROW` / `TOOLTIP_ARROW`:\n *\n * ```tsx\n * <S.SharedFloatingArrow ref={arrowRef} context={context} {...POPOVER_ARROW} />\n * ```\n *\n * `ref` IS REQUIRED BY `FloatingArrow` ITSELF — it warns in development without one and\n * the `arrow()` middleware has nothing to measure. `useFloatingPopover` returns the\n * matching `arrowRef`.\n *\n * ================== THE THREE-PATH STRUCTURE, WHICH THE CSS DEPENDS ON ==================\n *\n * `FloatingArrow` renders, in order (measured in\n * `@floating-ui/react/dist/floating-ui.react.esm.js`):\n *\n * 1. an OUTLINE `<path>`, ONLY when `strokeWidth > 0`, with `fill=\"none\"` and\n * `stroke-width: strokeWidth * 2 + 1`;\n * 2. the FILL `<path>`, whose `stroke` attribute it sets to the value of the `fill`\n * PROP — its way of covering the inner half of (1)'s stroke so a `strokeWidth: 1`\n * renders as a 1px border rather than 1.5px;\n * 3. a `<clipPath>`, which is not a `<path>`.\n *\n * We colour by CSS rather than by the `fill`/`stroke` PROPS because the theme is chosen by\n * a `body` class at runtime and a prop would have to be computed in JS, which cannot see\n * which class is set. That leaves (2)'s `stroke` attribute unset, so the rules below set it\n * explicitly — `& > path:last-of-type`, which is (2) whether or not (1) is present.\n * Without that rule (2) would INHERIT the CSS `stroke` and the border would read ~1.5px\n * instead of the 1px it replaces.\n */\nexport const SharedFloatingArrow = styled(FloatingArrow)\n .withConfig({\n shouldForwardProp\n })\n /*\n * A CALLBACK, so the generic on `.attrs<P>()` is MANDATORY (§J.2): the callback\n * parameter only gains `P` in this slot, so `props['data-arrow-surface']` has no legal\n * annotation position anywhere else.\n *\n * It must be a callback rather than a static object for a runtime reason too: `.attrs()`\n * merges its result OVER the incoming props, so `.attrs({ 'data-arrow-surface': 'popover' })`\n * would beat the call site's `data-arrow-surface=\"tooltip\"`. `?? 'popover'` is what makes\n * it a DEFAULT instead of an override.\n */\n .attrs<FloatingArrowStyleProps>(props => ({\n ...applyDefaultTheme(props),\n 'data-arrow-surface': props['data-arrow-surface'] ?? 'popover'\n }))`\n /* ---------------------------------------------------------------- popover surface ----\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 (measured: 17\n * TS1005/TS1443 errors from two prose backticks).\n *\n * SummaryCard.styled.ts's pair for the fill (gray-700 dark / white light), and\n * Popover.styled.ts's .tippy-arrow::before pair for the border (gray-800 dark /\n * gray-300 light) — the same pair as the popover box's own 1px border, which is the\n * point: the arrow continues it.\n */\n body.dark-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n\n body.light-theme &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n }\n\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='popover'] {\n fill: ${props => props.theme.getColor('white')};\n stroke: ${props => props.theme.getColor('gray-300')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('white')};\n }\n\n @media (prefers-color-scheme: dark) {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: ${props => props.theme.getColor('gray-800')};\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n }\n\n /* ---------------------------------------------------------------- tooltip surface ----\n * gray-700 in both themes, matching Tooltip.styled.ts's unconditional\n * \"background: gray-700\". It is still written under the three theme selectors rather\n * than as one bare rule, so that it cannot lose a specificity contest with the popover\n * branches above: a themed selector carries one type + three class simple selectors,\n * while a bare &[data-arrow-surface=...] carries two, and the bare form would be\n * overridden if the two surfaces ever overlapped.\n *\n * \"stroke: none\" is belt-and-braces — TOOLTIP_ARROW.strokeWidth is 0, so FloatingArrow\n * does not render the outline path at all.\n */\n body.dark-theme &[data-arrow-surface='tooltip'],\n body.light-theme &[data-arrow-surface='tooltip'],\n body:not(.light-theme):not(.dark-theme) &[data-arrow-surface='tooltip'] {\n fill: ${props => props.theme.getColor('gray-700')};\n stroke: none;\n\n & > path:last-of-type {\n stroke: ${props => props.theme.getColor('gray-700')};\n }\n }\n`;\n\nexport default SharedFloatingArrow;\n"],"names":["POPOVER_ARROW","width","height","DEFAULT_ARROW_HEIGHT","strokeWidth","TOOLTIP_ARROW","shouldForwardProp","prop","startsWith","SharedFloatingArrow","styled","FloatingArrow","withConfig","attrs","props","applyDefaultTheme","displayName","componentId","theme","getColor"],"mappings":";;;;;AA0GO,MAAMA,aAAa,GAAG;AAC3BC,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAEC,oBAAoB;AAC5BC,EAAAA,WAAW,EAAE;AACf;AAQO,MAAMC,aAAa,GAAG;AAC3BJ,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,CAAC;AACTE,EAAAA,WAAW,EAAE;AACf;AAqCA,MAAME,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAiCM,MAAMC,mBAAmB,GAAGC,MAAM,CAACC,aAAa,CAAC,CACrDC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CAWDO,KAAK,CAA0BC,KAAK,KAAK;EACxC,GAAGC,iBAAiB,CAACD,KAAK,CAAC;AAC3B,EAAA,oBAAoB,EAAEA,KAAK,CAAC,oBAAoB,CAAC,IAAI;AACvD,CAAC,CAAC,CAAC,CAAAF,UAAA,CAAA;EAAAI,WAAA,EAAA,0CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,uDAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,2DAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,kFAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,4CAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,oLAAA,EAAA,4CAAA,EAAA,KAAA,CAAA,EAYOH,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EACvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAK7CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EACpCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAK1CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EACpCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,OAAO,CAAC,EAIxCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EACvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAGvCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAmB/CL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC,EAIrCL,KAAK,IAAIA,KAAK,CAACI,KAAK,CAACC,QAAQ,CAAC,UAAU,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useEventListner.js","sources":["../../src/hooks/useEventListner.js"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\n\nfunction useEventListener(eventName, handler, element, options) {\n // Create a ref that stores handler\n const savedHandler = useRef(handler);\n\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n // Define the listening target\n const targetElement = element?.current ?? window;\n\n if (!(targetElement && targetElement.addEventListener)) return;\n\n // Create event listener that calls handler function stored in ref\n const listener = event => savedHandler.current(event);\n\n targetElement.addEventListener(eventName, listener, options);\n\n // Remove event listener on cleanup\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\nexport { useEventListener };\n"],"names":["useEventListener","eventName","handler","element","options","savedHandler","useRef","useIsomorphicLayoutEffect","current","useEffect","targetElement","window","addEventListener","listener","event","removeEventListener"],"mappings":";;;AAGA,SAASA,gBAAgBA,CAACC,SAAS,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAE;AAE9D,EAAA,MAAMC,YAAY,GAAGC,MAAM,CAACJ,OAAO,CAAC,CAAA;AAEpCK,EAAAA,yBAAyB,CAAC,MAAM;IAC9BF,YAAY,CAACG,OAAO,GAAGN,OAAO,CAAA;AAChC,GAAC,EAAE,CAACA,OAAO,CAAC,CAAC,CAAA;AAEbO,EAAAA,SAAS,CAAC,MAAM;AAEd,IAAA,MAAMC,aAAa,GAAGP,OAAO,EAAEK,OAAO,IAAIG,MAAM,CAAA;AAEhD,IAAA,IAAI,EAAED,aAAa,IAAIA,aAAa,CAACE,gBAAgB,CAAC,EAAE,OAAA;IAGxD,MAAMC,QAAQ,GAAGC,KAAK,IAAIT,YAAY,CAACG,OAAO,CAACM,KAAK,CAAC,CAAA;IAErDJ,aAAa,CAACE,gBAAgB,CAACX,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC,CAAA;AAG5D,IAAA,OAAO,MAAM;MACXM,aAAa,CAACK,mBAAmB,CAACd,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC,CAAA;KAChE,CAAA;GACF,EAAE,CAACH,SAAS,EAAEE,OAAO,EAAEC,OAAO,CAAC,CAAC,CAAA;AACnC;;;;"}
1
+ {"version":3,"file":"useEventListner.js","sources":["../../src/hooks/useEventListner.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport useIsomorphicLayoutEffect from './useIsomorphicLayoutEffect';\n\nimport type { RefObject } from 'react';\n\n/**\n * Every event name this hook accepts, mapped to the event object the handler\n * actually receives.\n *\n * AN INTERSECTION, NOT `interface DomEventMap extends WindowEventMap,\n * HTMLElementEventMap, DocumentEventMap {}`. The three lib.dom maps share keys\n * through `GlobalEventHandlersEventMap`, and an interface extending all three is\n * a TS2320 candidate (\"named property 'X' of types … are not identical\") as soon\n * as two of them declare a shared key with types that are equivalent rather than\n * identical — a lib.dom detail that changes between TypeScript releases. An\n * intersection has no such rule: overlapping keys become `MouseEvent &\n * MouseEvent`, `keyof` is still the union of all three key sets, and lib.dom\n * stays the single source of truth for which event class each name carries. Do\n * not \"tidy\" this into an interface.\n *\n * All three maps are needed because the target is chosen at runtime:\n * `element?.current ?? window`.\n */\nexport type DomEventMap = WindowEventMap & HTMLElementEventMap & DocumentEventMap;\n\n/** Any DOM event name this hook accepts — `keyof DomEventMap`. */\nexport type DomEventName = keyof DomEventMap;\n\n/**\n * Subscribes to a DOM event for the lifetime of the component, always calling\n * the latest `handler` without re-subscribing when it changes identity.\n *\n * `element` AND `options` ARE OPTIONAL, AND THAT IS THE ENTIRE FIX FOR THE\n * TS2554 ARITY ERRORS IN THIS DIRECTORY. In JavaScript a missing argument is\n * `undefined`; in TypeScript a parameter with neither `?` nor a default is\n * REQUIRED. Annotating the original four parameters without marking the last two\n * optional is what made every existing 2- and 3-argument call site a hard error\n * (`useOnClickOutside.ts:4`, `useElementSize.ts:22`,\n * `MultiLevelCheckboxSelect.tsx:65-67`). `element` really is optional — the hook\n * falls back to `window` — and `options` really is optional, so the declaration\n * below records what this function has always done. The body is unchanged.\n *\n * @param eventName any DOM event name; it selects the handler's event type\n * @param handler receives the event. Stored in a ref, so it may be a fresh\n * closure on every render without rebinding the listener\n * @param element ref to the target. Omit it — or pass a ref whose `current` is\n * still `null` — to listen on `window`\n * @param options forwarded verbatim to `addEventListener` and\n * `removeEventListener`\n */\nfunction useEventListener<K extends DomEventName, T extends EventTarget = HTMLElement>(\n eventName: K,\n handler: (event: DomEventMap[K]) => void,\n element?: RefObject<T | null> | null,\n options?: boolean | AddEventListenerOptions\n): void {\n // Create a ref that stores handler\n const savedHandler = useRef(handler);\n\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n /*\n * Define the listening target.\n *\n * Typed as the `EventTarget` base rather than `T | Window` deliberately: the\n * only members this hook touches are `addEventListener` /\n * `removeEventListener`, and `EventTarget` declares exactly those two with a\n * `type: string` signature. The `HTMLElement` and `Window` overloads are\n * keyed on their OWN narrower event maps, so a union target combined with a\n * `K` spanning all three maps makes overload resolution fail for every name\n * that is valid on one target but not the other. Precision belongs at the\n * public boundary above, where it is checked; here the base interface is the\n * honest description of what is used.\n */\n const targetElement: EventTarget = element?.current ?? window;\n\n if (!(targetElement && targetElement.addEventListener)) return;\n\n /*\n * Create event listener that calls handler function stored in ref.\n *\n * The cast is the inverse of the boundary check: `EventListener` hands us a\n * bare `Event` because it is the untyped base signature, while `K` — checked\n * at the call site — is what says which subclass actually arrives.\n */\n const listener: EventListener = event => savedHandler.current(event as DomEventMap[K]);\n\n targetElement.addEventListener(eventName, listener, options);\n\n // Remove event listener on cleanup\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\nexport { useEventListener };\n"],"names":["useEventListener","eventName","handler","element","options","savedHandler","useRef","useIsomorphicLayoutEffect","current","useEffect","targetElement","window","addEventListener","listener","event","removeEventListener"],"mappings":";;;AAkDA,SAASA,gBAAgBA,CACvBC,SAAY,EACZC,OAAwC,EACxCC,OAAoC,EACpCC,OAA2C,EACrC;AAEN,EAAA,MAAMC,YAAY,GAAGC,MAAM,CAACJ,OAAO,CAAC;AAEpCK,EAAAA,yBAAyB,CAAC,MAAM;IAC9BF,YAAY,CAACG,OAAO,GAAGN,OAAO;AAChC,EAAA,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;AAEbO,EAAAA,SAAS,CAAC,MAAM;AAcd,IAAA,MAAMC,aAA0B,GAAGP,OAAO,EAAEK,OAAO,IAAIG,MAAM;AAE7D,IAAA,IAAI,EAAED,aAAa,IAAIA,aAAa,CAACE,gBAAgB,CAAC,EAAE;IASxD,MAAMC,QAAuB,GAAGC,KAAK,IAAIT,YAAY,CAACG,OAAO,CAACM,KAAuB,CAAC;IAEtFJ,aAAa,CAACE,gBAAgB,CAACX,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;AAG5D,IAAA,OAAO,MAAM;MACXM,aAAa,CAACK,mBAAmB,CAACd,SAAS,EAAEY,QAAQ,EAAET,OAAO,CAAC;IACjE,CAAC;EACH,CAAC,EAAE,CAACH,SAAS,EAAEE,OAAO,EAAEC,OAAO,CAAC,CAAC;AACnC;;;;"}
@@ -0,0 +1,187 @@
1
+ import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
2
+ import { useFloating, autoUpdate, safePolygon, useClick, useHover, useFocus, useDismiss, useInteractions, useTransitionStyles, offset, autoPlacement, flip, shift, arrow, size } from '@floating-ui/react';
3
+ import { parseTrigger } from '../utils/parseTrigger.js';
4
+
5
+ const DEFAULT_ARROW_HEIGHT = 15;
6
+ const DEFAULT_MAX_HEIGHT_PADDING = 10;
7
+ const DEFAULT_COLLISION_PADDING = 5;
8
+ const SHIFT_AWAY_SUBTLE_DISTANCE = 5;
9
+ function isAutoPlacement(placement) {
10
+ return placement === 'auto' || placement === 'auto-start' || placement === 'auto-end';
11
+ }
12
+ const shiftAwaySubtle = ({
13
+ side
14
+ }) => {
15
+ const transform = {
16
+ top: `translateY(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,
17
+ bottom: `translateY(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,
18
+ left: `translateX(${SHIFT_AWAY_SUBTLE_DISTANCE}px)`,
19
+ right: `translateX(-${SHIFT_AWAY_SUBTLE_DISTANCE}px)`
20
+ }[side];
21
+ return {
22
+ opacity: 0,
23
+ transform
24
+ };
25
+ };
26
+ function buildMiddleware(options) {
27
+ const middleware = [offset({
28
+ mainAxis: options.mainAxis,
29
+ crossAxis: options.crossAxis
30
+ })];
31
+ if (isAutoPlacement(options.placement)) {
32
+ const alignment = options.placement === 'auto-start' ? 'start' : options.placement === 'auto-end' ? 'end' : undefined;
33
+ middleware.push(autoPlacement({
34
+ padding: options.collisionPadding,
35
+ ...(alignment ? {
36
+ alignment,
37
+ autoAlignment: false
38
+ } : {})
39
+ }));
40
+ } else {
41
+ middleware.push(flip({
42
+ padding: options.collisionPadding
43
+ }));
44
+ }
45
+ middleware.push(shift({
46
+ padding: options.collisionPadding
47
+ }));
48
+ if (options.arrow) {
49
+ middleware.push(arrow({
50
+ element: options.arrowRef
51
+ }));
52
+ }
53
+ if (options.constrainHeight) {
54
+ middleware.push(size({
55
+ padding: options.maxHeightPadding,
56
+ apply({
57
+ availableHeight,
58
+ elements
59
+ }) {
60
+ elements.floating.style.maxHeight = '';
61
+ const fits = elements.floating.scrollHeight <= availableHeight;
62
+ elements.floating.style.maxHeight = fits ? '' : `${Math.max(0, availableHeight)}px`;
63
+ }
64
+ }));
65
+ }
66
+ if (options.extra?.length) {
67
+ middleware.push(...options.extra);
68
+ }
69
+ return middleware;
70
+ }
71
+ function useFloatingPopover(options = {}) {
72
+ const {
73
+ placement = 'bottom',
74
+ open,
75
+ onOpenChange,
76
+ trigger,
77
+ offset: offsetProp = [0, 0],
78
+ arrow: hasArrow = false,
79
+ arrowHeight = DEFAULT_ARROW_HEIGHT,
80
+ interactive = false,
81
+ disabled = false,
82
+ duration,
83
+ transition,
84
+ dismiss: dismissProps,
85
+ hover: hoverProps,
86
+ click: clickProps,
87
+ focus: focusProps,
88
+ constrainHeight = false,
89
+ maxHeightPadding = DEFAULT_MAX_HEIGHT_PADDING,
90
+ collisionPadding = DEFAULT_COLLISION_PADDING,
91
+ nodeId,
92
+ middleware: extraMiddleware
93
+ } = options;
94
+ const arrowRef = useRef(null);
95
+ const isControlled = typeof open === 'boolean';
96
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
97
+ const isOpen = disabled ? false : isControlled ? open : uncontrolledOpen;
98
+ useEffect(() => {
99
+ if (disabled) {
100
+ setUncontrolledOpen(false);
101
+ }
102
+ }, [disabled]);
103
+ const setOpen = useCallback((next, event, reason) => {
104
+ if (!isControlled) {
105
+ setUncontrolledOpen(next);
106
+ }
107
+ onOpenChange?.(next, event, reason);
108
+ }, [isControlled, onOpenChange]);
109
+ const [skidding, distance] = offsetProp;
110
+ const middleware = useMemo(() => buildMiddleware({
111
+ placement,
112
+ mainAxis: distance + (hasArrow ? arrowHeight : 0),
113
+ crossAxis: skidding,
114
+ arrow: hasArrow,
115
+ arrowRef,
116
+ constrainHeight,
117
+ maxHeightPadding,
118
+ collisionPadding,
119
+ extra: extraMiddleware
120
+ }), [placement, distance, skidding, hasArrow, arrowHeight, constrainHeight, maxHeightPadding, collisionPadding, extraMiddleware]);
121
+ const {
122
+ refs,
123
+ floatingStyles,
124
+ context,
125
+ placement: resolvedPlacement
126
+ } = useFloating({
127
+ placement: isAutoPlacement(placement) ? undefined : placement,
128
+ open: isOpen,
129
+ onOpenChange: setOpen,
130
+ whileElementsMounted: autoUpdate,
131
+ middleware,
132
+ nodeId
133
+ });
134
+ const triggers = useMemo(() => parseTrigger(trigger), [trigger]);
135
+ const triggersEnabled = !disabled && !isControlled;
136
+ const handleClose = useMemo(() => interactive ? safePolygon() : null, [interactive]);
137
+ const click = useClick(context, {
138
+ ...clickProps,
139
+ enabled: triggersEnabled && triggers.click
140
+ });
141
+ const hover = useHover(context, {
142
+ ...hoverProps,
143
+ enabled: triggersEnabled && triggers.hover,
144
+ handleClose
145
+ });
146
+ const focus = useFocus(context, {
147
+ visibleOnly: false,
148
+ ...focusProps,
149
+ enabled: triggersEnabled && triggers.focus
150
+ });
151
+ const dismiss = useDismiss(context, {
152
+ escapeKey: false,
153
+ outsidePress: true,
154
+ referencePress: false,
155
+ ...dismissProps,
156
+ enabled: !disabled
157
+ });
158
+ const {
159
+ getReferenceProps,
160
+ getFloatingProps
161
+ } = useInteractions([click, hover, focus, dismiss]);
162
+ const {
163
+ isMounted,
164
+ styles: transitionStyles
165
+ } = useTransitionStyles(context, {
166
+ initial: shiftAwaySubtle,
167
+ ...transition,
168
+ duration
169
+ });
170
+ return {
171
+ refs,
172
+ floatingStyles,
173
+ context,
174
+ getReferenceProps,
175
+ getFloatingProps,
176
+ isMounted,
177
+ transitionStyles,
178
+ arrowRef,
179
+ isOpen,
180
+ setOpen,
181
+ placement: resolvedPlacement,
182
+ pointerEvents: interactive ? undefined : 'none'
183
+ };
184
+ }
185
+
186
+ export { DEFAULT_ARROW_HEIGHT, useFloatingPopover as default, useFloatingPopover };
187
+ //# sourceMappingURL=useFloatingPopover.js.map