@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
@@ -0,0 +1,31 @@
1
+ import type { DomEventMap } from './useEventListner';
2
+ import type { RefObject } from 'react';
3
+ /**
4
+ * The event names this hook can watch for. Narrower than `DomEventName` on
5
+ * purpose — the parameter is called `mouseEvent`, and a non-pointer event name
6
+ * here would silently never fire the outside-click check.
7
+ */
8
+ export type OutsideClickEventName = 'mousedown' | 'mouseup' | 'click';
9
+ /**
10
+ * What the handler receives. DERIVED from `DomEventMap` rather than written as
11
+ * `MouseEvent`, so it follows lib.dom if a future TypeScript retypes any of
12
+ * these three names (`click` has already moved between `MouseEvent` and
13
+ * `PointerEvent` upstream).
14
+ */
15
+ export type OutsideClickEvent = DomEventMap[OutsideClickEventName];
16
+ /**
17
+ * Calls `handler` when the chosen pointer event happens anywhere outside `ref`'s
18
+ * element and its descendants.
19
+ *
20
+ * `ref` IS TYPED AS NULLABLE BECAUSE THE BODY READS `ref?.current`. That is not
21
+ * defensiveness copied from elsewhere — it is the existing runtime contract, so
22
+ * the type records it. Contrast `useElementSize`, whose body reads `ref.current`
23
+ * and whose `ref` is therefore required.
24
+ *
25
+ * @param ref the "inside" element. A click on it or on any descendant is
26
+ * ignored
27
+ * @param handler called with the originating event for outside clicks only
28
+ * @param mouseEvent which event to listen for; defaults to `'mousedown'` so the
29
+ * callback fires before a click can move focus
30
+ */
31
+ export declare function useOnClickOutside<T extends Node = HTMLElement>(ref: RefObject<T | null> | null | undefined, handler: (event: OutsideClickEvent) => void, mouseEvent?: OutsideClickEventName): void;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * What `useTooltipAutoShow` returns. Spread straight onto a `Tooltip` by
3
+ * `TextArea` and `CompactTextInput`.
4
+ */
5
+ export interface TooltipAutoShow {
6
+ /** Clears the forced-visible state. Wire to the trigger's `onMouseLeave`. */
7
+ toolTipOnMouseLeave: () => void;
8
+ /**
9
+ * The last non-empty content. Sticky on purpose, so the tooltip can animate
10
+ * out with its text intact instead of emptying mid-transition.
11
+ */
12
+ toolTipContent: string;
13
+ /** `true` while there is no content, which suppresses the tooltip entirely. */
14
+ toolTipDisabled: boolean;
15
+ /**
16
+ * `true` | `undefined` — NEVER `false`, AND THE `undefined` IS LOAD-BEARING.
17
+ * `Tooltip` treats `visible` as the switch between UNCONTROLLED and CONTROLLED
18
+ * mode: `undefined` leaves the tooltip under its own `trigger` prop
19
+ * (hover/focus), while any boolean — including `false` — hands control to us
20
+ * permanently and the tooltip stops responding to hover for the rest of its
21
+ * life. So this type is `true | undefined` rather than the `boolean` it looks
22
+ * like it wants to be. DO NOT "SIMPLIFY" IT: widening to `boolean` compiles
23
+ * fine and silently breaks every hover tooltip in `TextArea` and
24
+ * `CompactTextInput`.
25
+ *
26
+ * That rule was tippy's and is now the library's own: `useFloatingPopover`
27
+ * decides controlled-ness with `typeof open === 'boolean'`, so this contract
28
+ * survived the Floating UI migration unchanged and deliberately.
29
+ *
30
+ * ONE SEMANTIC DIFFERENCE, RECORDED BECAUSE IT IS REAL EVEN THOUGH THE
31
+ * OBSERVABLE OUTCOME IS THE SAME. Going from `true` back to `undefined` used
32
+ * to leave the tippy instance SHOWN — `@tippyjs/react` only issues an
33
+ * imperative `show()`/`hide()` while `visible !== undefined`, so dropping out
34
+ * of controlled mode issued nothing and the tooltip stayed up until the
35
+ * reference's own `mouseleave` hid it. `useFloatingPopover` instead resolves
36
+ * to its uncontrolled state, which is closed. Both end with the tooltip
37
+ * hidden, because the caller drives this from `onMouseLeave` and that same
38
+ * pointer exit is what used to hide it; the new path just does not depend on a
39
+ * second event arriving.
40
+ */
41
+ toolTipVisible: true | undefined;
42
+ }
43
+ /**
44
+ * Tracks a tooltip's content and automatically forces it to be visible when the
45
+ * content transitions from empty → non-empty, then defaults to trigger prop.
46
+ *
47
+ * ================== PLAN C8, DECIDED: THIS STAYS A SEPARATE HOOK ==================
48
+ *
49
+ * The plan asks whether `useFloatingPopover` should absorb this. It should not,
50
+ * and the premise of the question turned out to be wrong.
51
+ *
52
+ * 1. **It does not read tippy's imperative instance API.** The plan describes it
53
+ * as doing so, but measured — `grep -i tippy` over this file — the only match
54
+ * is prose. There is no `_tippy`, no instance handle, no `show()`/`hide()`,
55
+ * and no tippy import. Whatever was true when the plan was written, the
56
+ * TypeScript migration left a hook that is pure React: two refs, one
57
+ * `useState`, one `useEffect`.
58
+ * 2. **What it depends on is a CONTRACT, not an implementation**, namely the
59
+ * `undefined`-means-uncontrolled rule documented on `toolTipVisible`.
60
+ * `useFloatingPopover` preserves that rule exactly, so this file needed no
61
+ * behavioural change to survive the migration — and did not get one.
62
+ * 3. **Merging it would put the wrong responsibility in the wrong place.** This
63
+ * is a content-change detector: it compares the previous `content` string with
64
+ * the current one and force-shows on the empty → non-empty edge.
65
+ * `useFloatingPopover` owns position and interaction and never reads `content`
66
+ * at all. Absorbing this would mean giving the positioning hook a `content`
67
+ * parameter and a sticky-previous-value state machine for the benefit of the
68
+ * two call sites that want it, out of the five it is meant to serve — three of
69
+ * which (`SummaryCard`, `AssetAction`, `AssetGalleryCompactCard`) have no
70
+ * content prop to diff.
71
+ *
72
+ * So the change here is documentation only: the JSDoc used to attribute the
73
+ * controlled-mode rule to tippy, and tippy is going away.
74
+ *
75
+ * @param content the tooltip text. `string`, because both call sites declare
76
+ * `descriptionToolTip: PropTypes.string` with a `''` default —
77
+ * the sticky `displayContent` ref would not survive a `ReactNode`
78
+ */
79
+ declare function useTooltipAutoShow(content?: string): TooltipAutoShow;
80
+ export default useTooltipAutoShow;
@@ -0,0 +1,41 @@
1
+ import { ReactComponent as AddIcon } from './add.svg';
2
+ import { ReactComponent as AddCircleIcon } from './add-circle.svg';
3
+ import { ReactComponent as AlbumIcon } from './album.svg';
4
+ import { ReactComponent as ArrowBackIcon } from './arrow-back.svg';
5
+ import { ReactComponent as ArrowDropDownIcon } from './arrow-drop-down.svg';
6
+ import { ReactComponent as ArrowForwardIcon } from './arrow-forward.svg';
7
+ import { ReactComponent as AudioIcon } from './audio.svg';
8
+ import { ReactComponent as BellIcon } from './bell.svg';
9
+ import { ReactComponent as CheckCircleIcon } from './check-circle-filled.svg';
10
+ import { ReactComponent as CheckRectangleIcon } from './check-rectangle-filled.svg';
11
+ import { ReactComponent as CloseIcon } from './close.svg';
12
+ import { ReactComponent as CorporateIcon } from './corporate.svg';
13
+ import { ReactComponent as DeleteContextMenuIcon } from './delete-context-menu.svg';
14
+ import { ReactComponent as DeleteIcon } from './delete.svg';
15
+ import { ReactComponent as DesignServicesIcon } from './design-services.svg';
16
+ import { ReactComponent as DownloadIcon } from './download.svg';
17
+ import { ReactComponent as EditNoteIcon } from './edit-note.svg';
18
+ import { ReactComponent as EditIcon } from './edit.svg';
19
+ import { ReactComponent as ExpandMoreIcon } from './expand-more.svg';
20
+ import { ReactComponent as FileIcon } from './file.svg';
21
+ import { ReactComponent as FtpIcon } from './ftp.svg';
22
+ import { ReactComponent as GearIcon } from './gear.svg';
23
+ import { ReactComponent as HeadsetIcon } from './headset.svg';
24
+ import { ReactComponent as LayersIcon } from './layers.svg';
25
+ import { ReactComponent as LibraryAddIcon } from './library-add.svg';
26
+ import { ReactComponent as LinkIcon } from './link.svg';
27
+ import { ReactComponent as PdfIcon } from './pdf.svg';
28
+ import { ReactComponent as PlayIcon } from './play.svg';
29
+ import { ReactComponent as RemoveCircleIcon } from './remove-circle.svg';
30
+ import { ReactComponent as SearchIcon } from './search.svg';
31
+ import { ReactComponent as ShareIcon } from './share.svg';
32
+ import { ReactComponent as ShoppingCartAddIcon } from './shopping_cart_add.svg';
33
+ import { ReactComponent as StarFilledIcon } from './star-filled.svg';
34
+ import { ReactComponent as StarIcon } from './star.svg';
35
+ import { ReactComponent as TriangleRightIcon } from './triangle-right.svg';
36
+ import { ReactComponent as VerificationIcon } from './verification.svg';
37
+ import { ReactComponent as WarningCircleIcon } from './warning-circle.svg';
38
+ import { ReactComponent as WarningTriangleIcon } from './warning-triangle.svg';
39
+ import { ReactComponent as InfoRedIcon } from './info-red.svg';
40
+ import { ReactComponent as InfoYellowIcon } from './info-yellow.svg';
41
+ export { AddIcon, AddCircleIcon, AlbumIcon, ArrowBackIcon, ArrowDropDownIcon, ArrowForwardIcon, AudioIcon, BellIcon, CheckCircleIcon, CheckRectangleIcon, CloseIcon, CorporateIcon, DeleteContextMenuIcon, DeleteIcon, DesignServicesIcon, DownloadIcon, EditNoteIcon, EditIcon, ExpandMoreIcon, FileIcon, FtpIcon, GearIcon, HeadsetIcon, LayersIcon, LibraryAddIcon, LinkIcon, PdfIcon, PlayIcon, RemoveCircleIcon, SearchIcon, ShareIcon, ShoppingCartAddIcon, StarFilledIcon, StarIcon, TriangleRightIcon, VerificationIcon, WarningCircleIcon, WarningTriangleIcon, InfoRedIcon, InfoYellowIcon };
@@ -0,0 +1 @@
1
+ export { ServerStyleSheet } from "styled-components";
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Hand-written types for colors-export.js.
3
+ *
4
+ * ============================ WHY BY HAND ================================
5
+ * NEVER DERIVE THIS FROM THE .js WITH `keyof typeof`.
6
+ *
7
+ * It works locally, because the library compiles with `allowJs`. It collapses
8
+ * silently in the consumer, which does not: with no `allowJs`, TypeScript cannot
9
+ * read colors-export.js at all, `keyof typeof colors` degrades to
10
+ * `string | number | symbol` WITH NO DIAGNOSTIC, and `colors[name]` inside a
11
+ * template string then emits TS2731 — an error in OUR file, appearing only in
12
+ * THEIR build. A hand-written .d.ts resolves under every `moduleResolution` mode
13
+ * with or without `allowJs`.
14
+ *
15
+ * The cost is that this is a THIRD hand-maintained copy of the palette, beside
16
+ * src/styles/.config.scss and colors-export.js. That is what
17
+ * `npm run verify:palette` (scripts/ts-migration/verify-palette.cjs) is for: it
18
+ * makes drift a build failure rather than a silent `undefined` at runtime. Add a
19
+ * colour to the .js and this union without the other and the gate names it.
20
+ * =========================================================================
21
+ *
22
+ * src/styles stays .js permanently (playbook §A.1) and rollup copies the whole
23
+ * directory verbatim into the published `styles/` and `build/styles/` trees, so
24
+ * this file ships NEXT TO its .js and
25
+ * `@ntbjs/react-components/styles/utils/colors-export` gains types where it
26
+ * previously resolved none. A `.d.ts` is explicitly allowed by
27
+ * scripts/assert-no-published-typescript.cjs for exactly this reason; a `.ts`
28
+ * there would be raw TypeScript in a published package.
29
+ */
30
+
31
+ /**
32
+ * Every registered design-token colour name.
33
+ *
34
+ * `theme.getColor` takes this union, so `getColor('emerald-999')` is a compile
35
+ * error instead of a `throw` from inside a styled template at runtime.
36
+ */
37
+ export type ColorName =
38
+ | 'orange-600'
39
+ | 'orange-500'
40
+ | 'orange-400'
41
+ | 'emerald-600'
42
+ | 'emerald-500'
43
+ | 'emerald-400'
44
+ | 'emerald-300'
45
+ | 'emerald-200'
46
+ | 'gray-900'
47
+ | 'gray-800'
48
+ | 'gray-700'
49
+ | 'gray-600'
50
+ | 'gray-500'
51
+ | 'gray-400'
52
+ | 'gray-300'
53
+ | 'gray-200'
54
+ | 'gray-100'
55
+ | 'gray-50'
56
+ | 'cercise-500'
57
+ | 'cercise-400'
58
+ | 'cercise-300'
59
+ | 'cercise-200'
60
+ | 'cercise-100'
61
+ | 'red-600'
62
+ | 'red-500'
63
+ | 'red-200'
64
+ | 'brown-500'
65
+ | 'signal-yellow-500'
66
+ | 'signal-yellow-400'
67
+ | 'signal-green-500'
68
+ | 'signal-green-400'
69
+ | 'black'
70
+ | 'white';
71
+
72
+ /** The palette itself: every `ColorName` mapped to a `#rrggbb` string. */
73
+ export declare const colors: Record<ColorName, string>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Convert time given in miliseconds to a string representation of hours, minutes and seconds
3
+ * in the format HH:MM:SS
4
+ *
5
+ * The hours segment is omitted entirely for durations under an hour, so the
6
+ * result is `MM:SS` there — the `HH:` above is the maximal form, not a promise
7
+ * about width. Both call sites (`AssetGalleryGridCard`,
8
+ * `AssetGalleryCompactCard`) feed it straight into a `Badge`.
9
+ *
10
+ * @param ms duration in milliseconds. `number`, not `number | string`: the body
11
+ * divides it, and a string would produce `NaN:NaN` rather than fail
12
+ */
13
+ export declare const convertMsToHMS: (ms: number) => string;
@@ -0,0 +1,174 @@
1
+ import type { ColorName } from '../styles/utils/colors-export';
2
+ import type { Interpolation, RuleSet } from 'styled-components';
3
+ export type { ColorName };
4
+ /**
5
+ * Looks up a design-token colour.
6
+ *
7
+ * Throws at runtime for an unregistered name, which is why the parameter is the
8
+ * closed `ColorName` union rather than `string`: the error moves from a runtime
9
+ * throw inside a styled template to a compile error at the call site.
10
+ */
11
+ export type GetColor = (name: ColorName) => string;
12
+ /**
13
+ * A value `themeProp` interpolates into the generated rule. Widened to
14
+ * styled-components' own `Interpolation` because that is literally what happens
15
+ * to it — six call sites in `Badge.styled.ts` and `Tabs.styled.ts` pass a
16
+ * `() => string` callback rather than a string, and two in `TextInput.styled.ts`
17
+ * pass numbers. The guarantee this type buys is ARITY, not value narrowness.
18
+ */
19
+ export type ThemePropValue = Interpolation<object>;
20
+ /**
21
+ * Emits one declaration three times — for `body.dark-theme`, for
22
+ * `body.light-theme`, and for neither-class-set with a
23
+ * `prefers-color-scheme: dark` fallback — so a single property can differ
24
+ * between themes.
25
+ *
26
+ * TWO REPO CONVENTIONS THE TYPE SYSTEM CANNOT ENFORCE, and both cause real
27
+ * visual bugs when broken:
28
+ *
29
+ * - **Never call `themeProp()` inside an `&::after` / `&::before` block.** The
30
+ * generated `body.dark-theme &&` selector cannot address a pseudo-element from
31
+ * inside one. Write the two rules out explicitly instead:
32
+ * `body.light-theme &::after { … }` and `body.dark-theme &::after { … }`.
33
+ *
34
+ * - **Prefer static `&[data-x='state']` selectors over dynamic
35
+ * `${props => css\`…\`}` rules for per-instance state.** Interpolated rules
36
+ * share the component's `componentId`, so two instances in different states
37
+ * collide and one wins for both.
38
+ *
39
+ * @param property the CSS property, e.g. `color`, `background`, or a custom
40
+ * property like `--checkbox-black-box`
41
+ * @param darkMode the value applied under `body.dark-theme`
42
+ * @param lightMode the value applied under `body.light-theme`, and the fallback
43
+ * when neither class is present
44
+ * @param specificity how many `&` to repeat in the generated selector. A NUMBER —
45
+ * the implementation does `Array(specificity).fill('&')`, so a
46
+ * string silently produces a one-element array and specificity
47
+ * 1. Typing it `number` is deliberate: it turns the one site
48
+ * that passes `'!important'` here into a compile error rather
49
+ * than blessing it.
50
+ */
51
+ export type ThemeProp = (property: string, darkMode: ThemePropValue, lightMode: ThemePropValue, specificity?: number) => RuleSet<object>;
52
+ /**
53
+ * Spacing scale. Consumed by react-select through its own `theme` prop as well
54
+ * as by our styled templates, which is why the member names are react-select's.
55
+ */
56
+ export interface ThemeSpacing {
57
+ baseUnit: number;
58
+ controlHeight: number;
59
+ menuGutter: number;
60
+ }
61
+ /**
62
+ * react-select's colour contract, filled from our palette. These names are
63
+ * react-select's, not ours — do not rename them to design-token names.
64
+ */
65
+ export interface ThemeColors {
66
+ primary: string;
67
+ primary75: string;
68
+ primary50: string;
69
+ primary25: string;
70
+ danger: string;
71
+ neutral0: string;
72
+ neutral5: string;
73
+ neutral10: string;
74
+ neutral20: string;
75
+ neutral30: string;
76
+ neutral40: string;
77
+ neutral50: string;
78
+ neutral60: string;
79
+ neutral70: string;
80
+ neutral80: string;
81
+ neutral90: string;
82
+ }
83
+ /**
84
+ * The whole theme, as a styled template sees it.
85
+ *
86
+ * Every member is REQUIRED, which is the truth inside an interpolation
87
+ * (`props.theme.getColor` is always there) and a constraint at the
88
+ * `<ThemeProvider>` boundary. Nothing in this repo hands over a partial theme —
89
+ * the only `ThemeProvider` is `.storybook/preview.js`, with the full
90
+ * `defaultTheme`. A consumer that wants to override part of it uses
91
+ * `PartialNtbTheme` + `applyDefaultTheme`, which is what every `.styled` file
92
+ * here does.
93
+ */
94
+ export interface NtbTheme {
95
+ getColor: GetColor;
96
+ primaryFontFamily: string;
97
+ secondaryFontFamily: string;
98
+ themeProp: ThemeProp;
99
+ spacing: ThemeSpacing;
100
+ colors: ThemeColors;
101
+ }
102
+ /** A theme override: any subset of `NtbTheme`. */
103
+ export type PartialNtbTheme = Partial<NtbTheme>;
104
+ /**
105
+ * What `applyDefaultTheme` accepts.
106
+ *
107
+ * DELIBERATELY NOT `ExecutionProps & { theme?: PartialNtbTheme }`.
108
+ * `ExecutionProps['theme']` is `DefaultTheme | undefined`, and after the
109
+ * augmentation below `DefaultTheme` is `NtbTheme` with every member required —
110
+ * so intersecting makes the override required again and the function's own
111
+ * `theme = {}` default stops compiling (TS2322). Extra props still flow in
112
+ * fine: this is a parameter position, so a caller passing the full styled
113
+ * execution context is accepted and the runtime spreads the rest through
114
+ * unchanged.
115
+ */
116
+ export interface ThemedProps {
117
+ theme?: PartialNtbTheme;
118
+ }
119
+ export declare const defaultTheme: {
120
+ getColor: (name: ColorName) => string;
121
+ primaryFontFamily: string;
122
+ secondaryFontFamily: string;
123
+ themeProp: typeof themeProp;
124
+ spacing: {
125
+ baseUnit: number;
126
+ controlHeight: number;
127
+ menuGutter: number;
128
+ };
129
+ colors: {
130
+ primary: string;
131
+ primary75: string;
132
+ primary50: string;
133
+ primary25: string;
134
+ danger: string;
135
+ neutral0: string;
136
+ neutral5: string;
137
+ neutral10: string;
138
+ neutral20: string;
139
+ neutral30: string;
140
+ neutral40: string;
141
+ neutral50: string;
142
+ neutral60: string;
143
+ neutral70: string;
144
+ neutral80: string;
145
+ neutral90: string;
146
+ };
147
+ };
148
+ /**
149
+ * Applies a different css property value for dark and light mode.
150
+ *
151
+ * Read `ThemeProp` above before changing the signature — its JSDoc carries the
152
+ * two conventions that the type system cannot enforce and that cause real
153
+ * visual bugs when broken.
154
+ */
155
+ declare function themeProp(property: string, darkMode: ThemePropValue, lightMode: ThemePropValue, specificity?: number): RuleSet<object>;
156
+ /**
157
+ * `.attrs()` helper: merges a caller's partial theme over `defaultTheme` so
158
+ * every interpolation can rely on the full contract.
159
+ *
160
+ * THE RETURN TYPE IS `{ theme: NtbTheme }` AND NOT `P & { theme: NtbTheme }`,
161
+ * ON PURPOSE. `attrs` merges its result OVER the incoming props, so a declared
162
+ * type only has to describe what this function CONTRIBUTES. Saying it also
163
+ * returns the caller's props re-declares them from a position that knows nothing
164
+ * about them, which is what produced the measured 25–31 TS2345 `.attrs()`
165
+ * assignability errors. The runtime still spreads the rest through — that part
166
+ * is unchanged, and 36 `.styled` files depend on it.
167
+ */
168
+ export declare function applyDefaultTheme({ theme, ...props }: ThemedProps): {
169
+ theme: NtbTheme;
170
+ };
171
+ declare module 'styled-components' {
172
+ interface DefaultTheme extends NtbTheme {
173
+ }
174
+ }
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Reads a child element's `ref` across the peer range (`react >= 16.14`).
4
+ *
5
+ * `ref` is a regular prop only from React 19. Before that `createElement` moves it to
6
+ * `element.ref`, so reading `element.props.ref` silently returns `undefined` and the
7
+ * `cloneElement(children, { ref })` that follows destroys the child's ref.
8
+ *
9
+ * Neither location can be read unconditionally: React 19 warns on `element.ref`, React
10
+ * 18.3 warns on `props.ref`. Both warnings are `console.error`, which the stories gate
11
+ * fails on. The property SHAPE says which is live, measured on 19.2.4:
12
+ *
13
+ * React 19, ref passed props.ref data prop element.ref warning getter
14
+ * React 19, no ref props.ref absent element.ref data prop (null)
15
+ * React <19 props.ref absent element.ref data prop
16
+ * React 18.3, ref passed props.ref warning get element.ref data prop
17
+ *
18
+ * Returning early on React 19's data-property `props.ref` is what keeps every branch off
19
+ * a warning getter.
20
+ */
21
+ export declare function getElementRef(element: React.ReactElement): React.Ref<unknown> | null;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * tippy's `trigger` space-string, parsed into the three discrete Floating UI
3
+ * interaction hooks.
4
+ *
5
+ * WHY THIS EXISTS AS A SEPARATE, PURE FUNCTION. tippy takes ONE prop —
6
+ * `trigger="mouseenter focus"` — and does its own tokenising
7
+ * (`splitBySpaces(instance.props.trigger).forEach(...)` in
8
+ * `tippy.js/dist/tippy.cjs.js`). Floating UI has no equivalent: it has three
9
+ * separate Hooks (`useClick`, `useHover`, `useFocus`), each with its own
10
+ * `enabled` flag. `Popover` and `Tooltip` both publish `trigger` as a documented
11
+ * prop and 62 consumer call sites pass it, so the string has to survive — which
12
+ * means exactly one place has to own the string → flags translation. This is it,
13
+ * and it is a pure function so it can be reasoned about (and later tested)
14
+ * without mounting anything.
15
+ *
16
+ * It lives in `src/utils/` rather than `src/hooks/` deliberately: it calls no
17
+ * Hook, has no React import, and `useFloatingPopover` is not its only plausible
18
+ * caller — a `<Popover>` that needs to know "does this trigger imply hover?" for
19
+ * a styling decision can ask without pulling in a Hook.
20
+ */
21
+ /**
22
+ * Which Floating UI interaction Hooks a tippy trigger string turns on.
23
+ *
24
+ * All three are REQUIRED and always present. This is a computed result, not a
25
+ * bag of options: "the caller did not mention hover" and "hover is off" are the
26
+ * same statement here, and an optional member would let a caller write
27
+ * `if (parsed.hover === undefined)` as though there were a third state.
28
+ */
29
+ export interface ParsedTrigger {
30
+ /** `click` token present → `useClick`. */
31
+ click: boolean;
32
+ /** `mouseenter` token present → `useHover`. */
33
+ hover: boolean;
34
+ /** `focus` or `focusin` token present → `useFocus`. */
35
+ focus: boolean;
36
+ }
37
+ /**
38
+ * tippy's own default, measured — `tippy.js/dist/tippy.cjs.js`:
39
+ *
40
+ * ```js
41
+ * var defaultProps = Object.assign({
42
+ * …
43
+ * trigger: 'mouseenter focus',
44
+ * …
45
+ * }, pluginProps, renderProps);
46
+ * ```
47
+ *
48
+ * `Tooltip.tsx` declares no default for `trigger` and passes `undefined`
49
+ * straight through, so `undefined` HAS ALWAYS MEANT `'mouseenter focus'` for
50
+ * every tooltip in the library and in both consumers. `parseTrigger(undefined)`
51
+ * therefore has to return hover+focus, not nothing — see the `trigger`
52
+ * parameter's note.
53
+ *
54
+ * (`Popover.tsx` declares its own default, `'click focus'`, so it never relies
55
+ * on this one.)
56
+ */
57
+ export declare const TIPPY_DEFAULT_TRIGGER = "mouseenter focus";
58
+ /**
59
+ * Parses a tippy `trigger` prop into `{ click, hover, focus }`.
60
+ *
61
+ * THE THREE INPUTS THAT ARE EASY TO GET WRONG, all of them in use:
62
+ *
63
+ * - **`undefined`** (and `null`) means "tippy's default", i.e. hover+focus. It
64
+ * does NOT mean "no triggers". Every `<Tooltip>` in the library that does not
65
+ * pass `trigger` relies on this.
66
+ * - **`''`** means NO TRIGGERS AT ALL, and it is used. Measured, in BOTH
67
+ * consumers — `mb-main-client/src/components/assets/sales_overlay.tsx:246` and
68
+ * `ntb-dam/client/src/components/assets/sales_overlay.js:245`:
69
+ *
70
+ * ```jsx
71
+ * trigger={assetsHasAllRequiredData ? "" : "mouseenter focus"}
72
+ * ```
73
+ *
74
+ * i.e. `''` is how that call site turns the tooltip OFF conditionally. Return
75
+ * anything truthy for it and a tooltip appears where the consumer suppressed
76
+ * one. `''.split(/\s+/)` is `['']`, which is why the `filter(Boolean)`
77
+ * below is load-bearing rather than tidiness — without it `''` would be
78
+ * treated as an unrecognised token, which happens to give the same answer here
79
+ * but would stop doing so the moment a token were matched loosely.
80
+ * - **A controlled popover ignores the result entirely.** That decision is NOT
81
+ * made here: this function reports what the string says, and
82
+ * `useFloatingPopover` is what gates the Hooks off when `visible` is a
83
+ * boolean. Keeping the two apart means the parse stays testable and the
84
+ * controlled-mode rule lives in one place instead of two.
85
+ *
86
+ * Whitespace is split on `/\s+/` and not `' '`, matching tippy's
87
+ * `splitBySpaces`, so `'click\n focus'` parses the same way tippy parses it.
88
+ *
89
+ * @param trigger tippy's `trigger` prop. `undefined`/`null` → the tippy default
90
+ * (`'mouseenter focus'`); `''` → nothing enabled
91
+ */
92
+ export declare function parseTrigger(trigger?: string | null): ParsedTrigger;
@@ -1,12 +0,0 @@
1
- function _extends() {
2
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
3
- for (var e = 1; e < arguments.length; e++) {
4
- var t = arguments[e];
5
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
6
- }
7
- return n;
8
- }, _extends.apply(null, arguments);
9
- }
10
-
11
- export { _extends as extends };
12
- //# sourceMappingURL=_rollupPluginBabelHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1,56 +0,0 @@
1
- import PropTypes from 'prop-types';
2
-
3
- const assetShape = {
4
- key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
5
- previewUrl: PropTypes.string,
6
- title: PropTypes.string,
7
- note: PropTypes.shape({
8
- icon: PropTypes.element,
9
- message: PropTypes.string
10
- }),
11
- width: PropTypes.number,
12
- height: PropTypes.number,
13
- fileType: PropTypes.oneOf(['image', 'video', 'pdf', 'file', 'audio']).isRequired,
14
- fileTypeIconPosition: PropTypes.oneOf(['top-left', 'top-right']),
15
- group: PropTypes.string,
16
- actions: PropTypes.arrayOf(PropTypes.shape({
17
- title: PropTypes.string.isRequired,
18
- icon: PropTypes.element.isRequired,
19
- onClick: PropTypes.func.isRequired,
20
- className: PropTypes.shape,
21
- component: PropTypes.func
22
- })),
23
- statusIcon: PropTypes.element,
24
- overlay: PropTypes.element,
25
- completed: PropTypes.bool,
26
- hasError: PropTypes.bool,
27
- disabled: PropTypes.bool,
28
- onClick: PropTypes.func,
29
- onContextMenu: PropTypes.func,
30
- onMouseEnter: PropTypes.func,
31
- instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
32
- summary: PropTypes.shape({
33
- title: PropTypes.string,
34
- description: PropTypes.string,
35
- instructions: PropTypes.string,
36
- instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),
37
- headerLeft: PropTypes.node,
38
- headerRight: PropTypes.node,
39
- footerLeft: PropTypes.node,
40
- footerRight: PropTypes.node
41
- })
42
- };
43
- const assetShapeWithLayout = {
44
- ...assetShape,
45
- layout: PropTypes.shape({
46
- width: PropTypes.number.isRequired,
47
- height: PropTypes.number.isRequired,
48
- translateX: PropTypes.number.isRequired,
49
- translateY: PropTypes.number.isRequired,
50
- type: PropTypes.oneOf(['groupLabel', 'asset']).isRequired,
51
- hasHeightAndWidth: PropTypes.bool
52
- }).isRequired
53
- };
54
-
55
- export { assetShape, assetShapeWithLayout };
56
- //# sourceMappingURL=asset.propType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"asset.propType.js","sources":["../../../src/components/widgets/AssetGallery/asset.propType.js"],"sourcesContent":["import PropTypes from 'prop-types';\n\nexport const assetShape = {\n key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n previewUrl: PropTypes.string,\n title: PropTypes.string,\n note: PropTypes.shape({\n icon: PropTypes.element,\n message: PropTypes.string\n }),\n width: PropTypes.number,\n height: PropTypes.number,\n fileType: PropTypes.oneOf(['image', 'video', 'pdf', 'file', 'audio']).isRequired,\n fileTypeIconPosition: PropTypes.oneOf(['top-left', 'top-right']),\n group: PropTypes.string,\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string.isRequired,\n icon: PropTypes.element.isRequired,\n onClick: PropTypes.func.isRequired,\n className: PropTypes.shape,\n component: PropTypes.func\n })\n ),\n statusIcon: PropTypes.element,\n overlay: PropTypes.element,\n completed: PropTypes.bool,\n hasError: PropTypes.bool,\n disabled: PropTypes.bool,\n onClick: PropTypes.func,\n onContextMenu: PropTypes.func,\n onMouseEnter: PropTypes.func,\n instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n summary: PropTypes.shape({\n title: PropTypes.string,\n description: PropTypes.string,\n instructions: PropTypes.string,\n instructionSeverity: PropTypes.oneOf([1, 2, 3, 4, 5]),\n headerLeft: PropTypes.node,\n headerRight: PropTypes.node,\n footerLeft: PropTypes.node,\n footerRight: PropTypes.node\n })\n};\n\nexport const assetShapeWithLayout = {\n ...assetShape,\n layout: PropTypes.shape({\n width: PropTypes.number.isRequired,\n height: PropTypes.number.isRequired,\n translateX: PropTypes.number.isRequired,\n translateY: PropTypes.number.isRequired,\n type: PropTypes.oneOf(['groupLabel', 'asset']).isRequired,\n hasHeightAndWidth: PropTypes.bool\n }).isRequired\n};\n"],"names":["assetShape","key","PropTypes","oneOfType","string","number","isRequired","previewUrl","title","note","shape","icon","element","message","width","height","fileType","oneOf","fileTypeIconPosition","group","actions","arrayOf","onClick","func","className","component","statusIcon","overlay","completed","bool","hasError","disabled","onContextMenu","onMouseEnter","instructionSeverity","summary","description","instructions","headerLeft","node","headerRight","footerLeft","footerRight","assetShapeWithLayout","layout","translateX","translateY","type","hasHeightAndWidth"],"mappings":";;AAEO,MAAMA,UAAU,GAAG;AACxBC,EAAAA,GAAG,EAAEC,SAAS,CAACC,SAAS,CAAC,CAACD,SAAS,CAACE,MAAM,EAAEF,SAAS,CAACG,MAAM,CAAC,CAAC,CAACC,UAAU;EACzEC,UAAU,EAAEL,SAAS,CAACE,MAAM;EAC5BI,KAAK,EAAEN,SAAS,CAACE,MAAM;AACvBK,EAAAA,IAAI,EAAEP,SAAS,CAACQ,KAAK,CAAC;IACpBC,IAAI,EAAET,SAAS,CAACU,OAAO;IACvBC,OAAO,EAAEX,SAAS,CAACE,MAAAA;AACrB,GAAC,CAAC;EACFU,KAAK,EAAEZ,SAAS,CAACG,MAAM;EACvBU,MAAM,EAAEb,SAAS,CAACG,MAAM;AACxBW,EAAAA,QAAQ,EAAEd,SAAS,CAACe,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAACX,UAAU;EAChFY,oBAAoB,EAAEhB,SAAS,CAACe,KAAK,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;EAChEE,KAAK,EAAEjB,SAAS,CAACE,MAAM;EACvBgB,OAAO,EAAElB,SAAS,CAACmB,OAAO,CACxBnB,SAAS,CAACQ,KAAK,CAAC;AACdF,IAAAA,KAAK,EAAEN,SAAS,CAACE,MAAM,CAACE,UAAU;AAClCK,IAAAA,IAAI,EAAET,SAAS,CAACU,OAAO,CAACN,UAAU;AAClCgB,IAAAA,OAAO,EAAEpB,SAAS,CAACqB,IAAI,CAACjB,UAAU;IAClCkB,SAAS,EAAEtB,SAAS,CAACQ,KAAK;IAC1Be,SAAS,EAAEvB,SAAS,CAACqB,IAAAA;AACvB,GAAC,CACH,CAAC;EACDG,UAAU,EAAExB,SAAS,CAACU,OAAO;EAC7Be,OAAO,EAAEzB,SAAS,CAACU,OAAO;EAC1BgB,SAAS,EAAE1B,SAAS,CAAC2B,IAAI;EACzBC,QAAQ,EAAE5B,SAAS,CAAC2B,IAAI;EACxBE,QAAQ,EAAE7B,SAAS,CAAC2B,IAAI;EACxBP,OAAO,EAAEpB,SAAS,CAACqB,IAAI;EACvBS,aAAa,EAAE9B,SAAS,CAACqB,IAAI;EAC7BU,YAAY,EAAE/B,SAAS,CAACqB,IAAI;AAC5BW,EAAAA,mBAAmB,EAAEhC,SAAS,CAACe,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrDkB,EAAAA,OAAO,EAAEjC,SAAS,CAACQ,KAAK,CAAC;IACvBF,KAAK,EAAEN,SAAS,CAACE,MAAM;IACvBgC,WAAW,EAAElC,SAAS,CAACE,MAAM;IAC7BiC,YAAY,EAAEnC,SAAS,CAACE,MAAM;AAC9B8B,IAAAA,mBAAmB,EAAEhC,SAAS,CAACe,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrDqB,UAAU,EAAEpC,SAAS,CAACqC,IAAI;IAC1BC,WAAW,EAAEtC,SAAS,CAACqC,IAAI;IAC3BE,UAAU,EAAEvC,SAAS,CAACqC,IAAI;IAC1BG,WAAW,EAAExC,SAAS,CAACqC,IAAAA;GACxB,CAAA;AACH,EAAC;AAEM,MAAMI,oBAAoB,GAAG;AAClC,EAAA,GAAG3C,UAAU;AACb4C,EAAAA,MAAM,EAAE1C,SAAS,CAACQ,KAAK,CAAC;AACtBI,IAAAA,KAAK,EAAEZ,SAAS,CAACG,MAAM,CAACC,UAAU;AAClCS,IAAAA,MAAM,EAAEb,SAAS,CAACG,MAAM,CAACC,UAAU;AACnCuC,IAAAA,UAAU,EAAE3C,SAAS,CAACG,MAAM,CAACC,UAAU;AACvCwC,IAAAA,UAAU,EAAE5C,SAAS,CAACG,MAAM,CAACC,UAAU;AACvCyC,IAAAA,IAAI,EAAE7C,SAAS,CAACe,KAAK,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAACX,UAAU;IACzD0C,iBAAiB,EAAE9C,SAAS,CAAC2B,IAAAA;AAC/B,GAAC,CAAC,CAACvB,UAAAA;AACL;;;;"}