@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,446 @@
1
+ import PropTypes from 'prop-types';
2
+ import type { DragEvent, MouseEvent as ReactMouseEvent, ReactElement, ReactNode } from 'react';
3
+ /**
4
+ * The asset contract — the deepest prop API in this library, and the only one a
5
+ * consumer builds objects *for* rather than passing props *to*.
6
+ *
7
+ * ================= THREE THINGS TO KNOW BEFORE EDITING THIS FILE =============
8
+ *
9
+ * 1. THE TYPES ARE THE SOURCE OF TRUTH; THE propTypes AT THE BOTTOM ARE LEGACY.
10
+ * Two descriptions of one shape live in one file on purpose, so they cannot
11
+ * drift apart in two. The `assetShape` / `assetShapeWithLayout` literals are
12
+ * still imported by four components and still evaluated at runtime on
13
+ * React 16, so they cannot be deleted yet — see the fenced block at the end
14
+ * for when they go and what to do then.
15
+ *
16
+ * 2. THIRTEEN MEMBERS HERE WERE NEVER DECLARED BY THE propTypes, AND EVERY ONE
17
+ * OF THEM IS READ AT RUNTIME. They are marked `@recovered` with the read
18
+ * site. This is why this file was hand-written instead of codemodded: a
19
+ * codemod can only reproduce what the propTypes said, and what the propTypes
20
+ * said was missing a third of the API. Generated prop types are CLOSED, so an
21
+ * omission converts silently from "undocumented" into "compile error at the
22
+ * consumer's call site". Before adding a member, grep for `asset.<name>`.
23
+ *
24
+ * 3. THE NESTED SHAPES ARE NAMED, EXPORTED INTERFACES, NOT INLINE OBJECT TYPES.
25
+ * A consumer keeping its own asset list needs to name the pieces
26
+ * (`AssetAction[]`, `AssetSummary`) in order to build them; inlining forces
27
+ * it to re-declare them or to reach for `any`. `Asset` is also meant to be
28
+ * EXTENDED — the gallery hands each asset object straight back to
29
+ * `component(asset, children)` and to every `onClick`, so consumer-only
30
+ * fields travel through the library untouched:
31
+ *
32
+ * interface MyAsset extends Asset { credit: string }
33
+ *
34
+ * Note that `AssetAction` (the interface below) and `AssetAction` (the
35
+ * component exported from `@ntbjs/react-components/widgets`) are different
36
+ * things with the same name. They never meet today, because this module is
37
+ * not re-exported from the widgets barrel. If you ever add it there, rename
38
+ * one of them.
39
+ * ============================================================================
40
+ */
41
+ /**
42
+ * An asset's identity, and one of its two required members.
43
+ *
44
+ * `AssetGalleryBase` drops any asset without one and warns; the value is also
45
+ * used as a React `key`, which is why the union is `string | number` rather than
46
+ * `unknown` — `PropTypes.oneOfType([string, number])`, verbatim.
47
+ */
48
+ export type AssetKey = string | number;
49
+ /**
50
+ * What kind of file this asset is. Only `'video'` and `'audio'` change what the
51
+ * cards render (a `<video>`, or a headset glyph); the other three fall through
52
+ * to the lazily-loaded still image.
53
+ *
54
+ * Both cards branch on `asset.fileType?.toLowerCase()`, so a consumer passing
55
+ * `'VIDEO'` gets the video preview while `renderMediaBadge` — which compares
56
+ * `=== 'video'` without lowercasing — does not show the play badge. The union is
57
+ * lowercase because that is what the propTypes always declared; widening it to
58
+ * `string` would bless that inconsistency instead of exposing it.
59
+ */
60
+ export type AssetFileType = 'image' | 'video' | 'pdf' | 'file' | 'audio';
61
+ /**
62
+ * Declared corner for the file-type glyph.
63
+ *
64
+ * NOTHING IN THE LIBRARY READS THIS. It is part of the published propTypes and
65
+ * therefore part of the published API, so it is recorded rather than dropped —
66
+ * removing it is a deliberate API change and belongs in its own commit.
67
+ */
68
+ export type AssetFileTypeIconPosition = 'top-left' | 'top-right';
69
+ /**
70
+ * Usage-restriction level, 1 (info) to 5 (highly restricted). Passed through to
71
+ * `InstructionSeverityDisplay` and `SummaryCard`, which key their badge label
72
+ * and colour off it. `PropTypes.oneOf([1, 2, 3, 4, 5])`, verbatim.
73
+ */
74
+ export type AssetInstructionSeverity = 1 | 2 | 3 | 4 | 5;
75
+ /**
76
+ * Which of the two things a computed row entry is: a real asset card, or the
77
+ * group heading `AssetGalleryBase` synthesises above the first asset of a group.
78
+ */
79
+ export type AssetLayoutType = 'groupLabel' | 'asset';
80
+ /**
81
+ * How a note is styled on the compact card. `'error'` gets a red circle; every
82
+ * other value gets the neutral grey one, because
83
+ * `AssetGalleryCompactCard.styled` only ever tests `type === 'error'`.
84
+ *
85
+ * @recovered `AssetGalleryCompactCard.tsx` reads `asset?.note?.type`; the value
86
+ * set comes from `AssetGallery.stories.tsx`.
87
+ */
88
+ export type AssetNoteType = 'error' | 'warning' | 'info';
89
+ /**
90
+ * A short note about the asset.
91
+ *
92
+ * THE propTypes AND THE RUNTIME DISAGREE ABOUT THIS SHAPE, and both halves are
93
+ * recorded because a consumer can reach both:
94
+ *
95
+ * - `title` and `type` are what `AssetGalleryCompactCard` actually reads (a
96
+ * warning glyph, coloured by `type`) and what all three note stories pass.
97
+ * - `icon` and `message` are what the propTypes declared. No component in this
98
+ * library reads either one.
99
+ *
100
+ * Deleting `icon`/`message` is an API removal and wiring them up is a feature;
101
+ * both are decisions for the per-component phase, not for a type-only commit.
102
+ * Until then this interface says what the field can contain.
103
+ */
104
+ export interface AssetNote {
105
+ /** @recovered `AssetGalleryCompactCard.tsx` — presence is what gates the glyph. */
106
+ title?: string;
107
+ /** @recovered `AssetGalleryCompactCard.tsx` — `'error'` is the only value with its own styling. */
108
+ type?: AssetNoteType;
109
+ /** Declared by the propTypes, read by nothing. */
110
+ icon?: ReactElement<any>;
111
+ /** Declared by the propTypes, read by nothing. */
112
+ message?: string;
113
+ }
114
+ /**
115
+ * One entry in an action's dropdown, rendered as a `ContextMenuItem`.
116
+ *
117
+ * NOT THE SAME CALLBACK CONTRACT AS `AssetAction`. `AssetGalleryGridCard` wires
118
+ * `onClick` straight into `ContextMenuItem`'s `onClickEffect`, which becomes a
119
+ * DOM `onClick` — so a sub-action's handler receives the CLICK EVENT, while a
120
+ * top-level action's handler receives the ASSET. The asymmetry is real,
121
+ * pre-existing, and the reason this is a separate interface rather than
122
+ * `AssetAction[]`.
123
+ *
124
+ * @recovered `AssetGalleryGridCard.tsx` reads `action?.subActions`; the
125
+ * propTypes never declared it.
126
+ */
127
+ export interface AssetSubAction {
128
+ title: string;
129
+ icon: ReactElement<any>;
130
+ /** Receives the click event, NOT the asset. See above. */
131
+ onClick: (event: ReactMouseEvent<HTMLElement>) => void;
132
+ }
133
+ /**
134
+ * A button rendered over the asset thumbnail.
135
+ *
136
+ * `title`, `icon` and `onClick` are required — `PropTypes.*.isRequired`,
137
+ * verbatim — and `title` doubles as the tooltip text and as part of the React
138
+ * key, so two actions sharing a title collide.
139
+ */
140
+ export interface AssetAction {
141
+ /** Tooltip text, and part of the action's React key. */
142
+ title: string;
143
+ icon: ReactElement<any>;
144
+ /**
145
+ * Called with the ASSET, not with the event: `AssetGalleryGridCard` stops the
146
+ * event itself and then calls `action.onClick(asset)`.
147
+ */
148
+ onClick: (asset: Asset) => void;
149
+ /**
150
+ * Forwarded to the underlying `ActionButton`'s `className`.
151
+ *
152
+ * WAS `PropTypes.shape` — the *uncalled* factory, not `PropTypes.shape({…})`.
153
+ * The fenced block at the end of this file records what that did.
154
+ */
155
+ className?: string;
156
+ /**
157
+ * Render the action yourself. Called with NO arguments and must return a valid
158
+ * element; the card then clones it with the computed props.
159
+ */
160
+ component?: () => ReactElement<any>;
161
+ /**
162
+ * `[width, height]` in px for the action button.
163
+ *
164
+ * @recovered `AssetGalleryGridCard.tsx` forwards `action.actionWidthHeight` to
165
+ * `ComputedActionButton`. `AssetAction.tsx` declares it in its own
166
+ * propTypes; `assetShape` never did.
167
+ */
168
+ actionWidthHeight?: [number, number];
169
+ /**
170
+ * Turns the action into a dropdown: a `ContextMenu` of `ContextMenuItem`s in a
171
+ * `Popover`, toggled by clicking the action.
172
+ *
173
+ * @recovered `AssetGalleryGridCard.tsx`.
174
+ */
175
+ subActions?: AssetSubAction[];
176
+ }
177
+ /**
178
+ * The hover-summary content, rendered by `AssetGalleryCompactCard` through
179
+ * `SummaryCard`, and used by `AssetGalleryGridCard` for its footer row.
180
+ *
181
+ * The four corner slots are `ReactNode`, so a fragment, a string or `null` all
182
+ * work — all three occur in `AssetGallery.stories.tsx`.
183
+ */
184
+ export interface AssetSummary {
185
+ title?: string;
186
+ description?: string;
187
+ instructions?: string;
188
+ instructionSeverity?: AssetInstructionSeverity;
189
+ headerLeft?: ReactNode;
190
+ headerRight?: ReactNode;
191
+ /** Read by BOTH cards — the grid card renders it in `CardFooter` directly. */
192
+ footerLeft?: ReactNode;
193
+ /** Read by BOTH cards — the grid card renders it in `CardFooter` directly. */
194
+ footerRight?: ReactNode;
195
+ }
196
+ /**
197
+ * Where `AssetGalleryBase` decided to put this asset. Computed, never supplied:
198
+ * the gallery clones every asset with a `layout` before handing it to a card, so
199
+ * a consumer neither sets this nor sees it — except inside a `component(asset)`
200
+ * callback, which receives the cloned object.
201
+ *
202
+ * `width` / `height` / `translateX` / `translateY` are REQUIRED because that is
203
+ * what the propTypes said and what every `type: 'asset'` entry carries. The
204
+ * synthetic `type: 'groupLabel'` entries are built with no `width`, but they are
205
+ * consumed inside `AssetGalleryBase` itself and never reach a card — and a card
206
+ * is the only place `AssetWithLayout` is used. Do not make these optional to
207
+ * accommodate the group labels; give the group labels their own type when
208
+ * `AssetGalleryBase` is typed.
209
+ */
210
+ export interface AssetLayout {
211
+ width: number;
212
+ height: number;
213
+ translateX: number;
214
+ translateY: number;
215
+ type: AssetLayoutType;
216
+ /** Whether the source asset declared both a width and a height. Compact view only. */
217
+ hasHeightAndWidth?: boolean;
218
+ /**
219
+ * Scroll-virtualisation flag: `false` unmounts the card.
220
+ *
221
+ * @recovered `AssetGalleryBase.tsx` both writes it (`calculateVisibility`) and
222
+ * reads it (the render map, and the arrow-key navigation). The propTypes
223
+ * never declared it.
224
+ */
225
+ show?: boolean;
226
+ }
227
+ /**
228
+ * One asset in an `AssetGallery`.
229
+ *
230
+ * Every member except `key` and `fileType` is optional, which matches the
231
+ * propTypes exactly. Consumers are expected to EXTEND this rather than to match
232
+ * it exactly — see point 3 in the file header.
233
+ */
234
+ export interface Asset {
235
+ /** Required. Identity, and the React key. */
236
+ key: AssetKey;
237
+ /** Required. Selects the preview branch — see {@link AssetFileType}. */
238
+ fileType: AssetFileType;
239
+ /** Image, video or audio source for the thumbnail. */
240
+ previewUrl?: string;
241
+ /** Rendered as the card title and as the `<img alt>`. */
242
+ title?: string;
243
+ /** Intrinsic pixel width; drives the compact view's row aspect ratio. Falls back to 1920. */
244
+ width?: number;
245
+ /** Intrinsic pixel height; drives the compact view's row aspect ratio. Falls back to 1080. */
246
+ height?: number;
247
+ note?: AssetNote;
248
+ /** Consecutive assets sharing a `group` get one heading row above the first of them. */
249
+ group?: string;
250
+ actions?: AssetAction[];
251
+ /** Top-right glyph on the thumbnail. When set, it suppresses the note glyph. */
252
+ statusIcon?: ReactElement<any>;
253
+ /** Rendered over everything else on the card; the consumer owns its positioning. */
254
+ overlay?: ReactElement<any>;
255
+ /** Draws the "completed" veil over the compact card. */
256
+ completed?: boolean;
257
+ /** Draws the "error" veil over the compact card. */
258
+ hasError?: boolean;
259
+ /** Dims the card. Does NOT stop `onClick` from firing. */
260
+ disabled?: boolean;
261
+ /** Declared corner for the file-type glyph. Read by nothing — see the type. */
262
+ fileTypeIconPosition?: AssetFileTypeIconPosition;
263
+ /** Severity of `imageRights`, shown as a badge on the card and in the summary. */
264
+ instructionSeverity?: AssetInstructionSeverity;
265
+ summary?: AssetSummary;
266
+ /**
267
+ * Called with the React click event AND the asset. Not called while the
268
+ * gallery is in extended-select mode, where a click selects instead.
269
+ */
270
+ onClick?: (event: ReactMouseEvent<HTMLElement>, asset: Asset) => void;
271
+ /**
272
+ * Called with the React mouse event AND the asset, after the card has started
273
+ * playing a video preview.
274
+ */
275
+ onMouseEnter?: (event: ReactMouseEvent<HTMLElement>, asset: Asset) => void;
276
+ /**
277
+ * Called with the NATIVE event, not a React one: both cards attach this with
278
+ * `addEventListener('contextmenu', …)` on the card element. The card
279
+ * default-prevents it before calling.
280
+ */
281
+ onContextMenu?: (event: MouseEvent) => void;
282
+ /**
283
+ * Duration in MILLISECONDS. Rendered as `h:mm:ss` in the media badge by
284
+ * `convertMsToHMS`, so seconds here are wrong by a factor of 1000.
285
+ *
286
+ * @recovered both cards read `asset.duration`.
287
+ */
288
+ duration?: number;
289
+ /**
290
+ * Body text under the title on the grid card, and in the summary card.
291
+ *
292
+ * @recovered both cards read `asset.description`, and both list it in their
293
+ * `React.memo` comparator, so it is one of the fields that re-renders them.
294
+ */
295
+ description?: string;
296
+ /**
297
+ * The usage-restriction text. Its presence is what makes the grid card render
298
+ * an `InstructionSeverityDisplay` at all.
299
+ *
300
+ * @recovered both cards read `asset.imageRights`.
301
+ */
302
+ imageRights?: string;
303
+ /**
304
+ * Severity level → translated label, e.g. `{ 1: 'Info', 5: 'Svært begrenset' }`.
305
+ *
306
+ * `Record<string, string>` rather than a keyed-by-severity mapped type,
307
+ * because that is `PropTypes.objectOf(PropTypes.string)` on both components
308
+ * that consume it (`InstructionSeverityDisplay`, `SummaryCard`) and it stays
309
+ * assignable in both directions once those are typed.
310
+ *
311
+ * @recovered both cards forward `asset.instructionLabels`.
312
+ */
313
+ instructionLabels?: Record<string, string>;
314
+ /**
315
+ * Number of versions, shown in the layers badge.
316
+ *
317
+ * @recovered both cards read `asset.versions`.
318
+ */
319
+ versions?: number;
320
+ /**
321
+ * A pre-rendered verification badge. A NODE, not a status string — the compact
322
+ * card returns it as-is from `renderVerificationBadge`, so the consumer owns
323
+ * the markup.
324
+ *
325
+ * @recovered `AssetGalleryCompactCard.tsx` reads `asset.verifications` for
326
+ * both `displayIcon: 'verifications'` and `displayIcon: 'dynamic'`.
327
+ */
328
+ verifications?: ReactNode;
329
+ /**
330
+ * Per-asset override of the gallery's `selectable` prop. `AssetGalleryBase`
331
+ * tests `'selectable' in asset`, so `false` here beats `true` there.
332
+ *
333
+ * @recovered `AssetGalleryBase.tsx`.
334
+ */
335
+ selectable?: boolean;
336
+ /**
337
+ * Sets the DOM `draggable` attribute on the card root.
338
+ *
339
+ * @recovered both cards pass `asset.draggable`.
340
+ */
341
+ draggable?: boolean;
342
+ /**
343
+ * Called with the NATIVE drag event: both cards attach this with
344
+ * `addEventListener('dragstart', …)`. Pair it with `draggable: true`.
345
+ *
346
+ * @recovered both cards read `asset.onDragstart`.
347
+ */
348
+ onDragstart?: (event: DragEvent) => void;
349
+ }
350
+ /**
351
+ * An asset as a CARD receives it — after `AssetGalleryBase` has computed its
352
+ * position. This is the type of `AssetGalleryGridCard`'s and
353
+ * `AssetGalleryCompactCard`'s `asset` prop; `Asset` is the type of the `assets`
354
+ * array a consumer hands to `AssetGallery`.
355
+ */
356
+ export interface AssetWithLayout extends Asset {
357
+ layout: AssetLayout;
358
+ }
359
+ export declare const assetShape: {
360
+ key: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
361
+ previewUrl: PropTypes.Requireable<string>;
362
+ title: PropTypes.Requireable<string>;
363
+ note: PropTypes.Requireable<PropTypes.InferProps<{
364
+ icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
365
+ message: PropTypes.Requireable<string>;
366
+ }>>;
367
+ width: PropTypes.Requireable<number>;
368
+ height: PropTypes.Requireable<number>;
369
+ fileType: PropTypes.Validator<string>;
370
+ fileTypeIconPosition: PropTypes.Requireable<string>;
371
+ group: PropTypes.Requireable<string>;
372
+ actions: PropTypes.Requireable<PropTypes.InferProps<{
373
+ title: PropTypes.Validator<string>;
374
+ icon: PropTypes.Validator<PropTypes.ReactElementLike>;
375
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
376
+ className: PropTypes.Requireable<string>;
377
+ component: PropTypes.Requireable<(...args: any[]) => any>;
378
+ }>[]>;
379
+ statusIcon: PropTypes.Requireable<PropTypes.ReactElementLike>;
380
+ overlay: PropTypes.Requireable<PropTypes.ReactElementLike>;
381
+ completed: PropTypes.Requireable<boolean>;
382
+ hasError: PropTypes.Requireable<boolean>;
383
+ disabled: PropTypes.Requireable<boolean>;
384
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
385
+ onContextMenu: PropTypes.Requireable<(...args: any[]) => any>;
386
+ onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
387
+ instructionSeverity: PropTypes.Requireable<number>;
388
+ summary: PropTypes.Requireable<PropTypes.InferProps<{
389
+ title: PropTypes.Requireable<string>;
390
+ description: PropTypes.Requireable<string>;
391
+ instructions: PropTypes.Requireable<string>;
392
+ instructionSeverity: PropTypes.Requireable<number>;
393
+ headerLeft: PropTypes.Requireable<PropTypes.ReactNodeLike>;
394
+ headerRight: PropTypes.Requireable<PropTypes.ReactNodeLike>;
395
+ footerLeft: PropTypes.Requireable<PropTypes.ReactNodeLike>;
396
+ footerRight: PropTypes.Requireable<PropTypes.ReactNodeLike>;
397
+ }>>;
398
+ };
399
+ export declare const assetShapeWithLayout: {
400
+ layout: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
401
+ width: PropTypes.Validator<number>;
402
+ height: PropTypes.Validator<number>;
403
+ translateX: PropTypes.Validator<number>;
404
+ translateY: PropTypes.Validator<number>;
405
+ type: PropTypes.Validator<string>;
406
+ hasHeightAndWidth: PropTypes.Requireable<boolean>;
407
+ }>>>;
408
+ key: PropTypes.Validator<NonNullable<NonNullable<string | number>>>;
409
+ previewUrl: PropTypes.Requireable<string>;
410
+ title: PropTypes.Requireable<string>;
411
+ note: PropTypes.Requireable<PropTypes.InferProps<{
412
+ icon: PropTypes.Requireable<PropTypes.ReactElementLike>;
413
+ message: PropTypes.Requireable<string>;
414
+ }>>;
415
+ width: PropTypes.Requireable<number>;
416
+ height: PropTypes.Requireable<number>;
417
+ fileType: PropTypes.Validator<string>;
418
+ fileTypeIconPosition: PropTypes.Requireable<string>;
419
+ group: PropTypes.Requireable<string>;
420
+ actions: PropTypes.Requireable<PropTypes.InferProps<{
421
+ title: PropTypes.Validator<string>;
422
+ icon: PropTypes.Validator<PropTypes.ReactElementLike>;
423
+ onClick: PropTypes.Validator<(...args: any[]) => any>;
424
+ className: PropTypes.Requireable<string>;
425
+ component: PropTypes.Requireable<(...args: any[]) => any>;
426
+ }>[]>;
427
+ statusIcon: PropTypes.Requireable<PropTypes.ReactElementLike>;
428
+ overlay: PropTypes.Requireable<PropTypes.ReactElementLike>;
429
+ completed: PropTypes.Requireable<boolean>;
430
+ hasError: PropTypes.Requireable<boolean>;
431
+ disabled: PropTypes.Requireable<boolean>;
432
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
433
+ onContextMenu: PropTypes.Requireable<(...args: any[]) => any>;
434
+ onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>;
435
+ instructionSeverity: PropTypes.Requireable<number>;
436
+ summary: PropTypes.Requireable<PropTypes.InferProps<{
437
+ title: PropTypes.Requireable<string>;
438
+ description: PropTypes.Requireable<string>;
439
+ instructions: PropTypes.Requireable<string>;
440
+ instructionSeverity: PropTypes.Requireable<number>;
441
+ headerLeft: PropTypes.Requireable<PropTypes.ReactNodeLike>;
442
+ headerRight: PropTypes.Requireable<PropTypes.ReactNodeLike>;
443
+ footerLeft: PropTypes.Requireable<PropTypes.ReactNodeLike>;
444
+ footerRight: PropTypes.Requireable<PropTypes.ReactNodeLike>;
445
+ }>>;
446
+ };
@@ -0,0 +1 @@
1
+ export { default } from './AssetGallery';
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import * as S from './AssetPreviewTopBar.styled';
3
+ type AssetPreviewTopBarOwnProps = {
4
+ /**
5
+ * On-click function for the back button
6
+ */
7
+ onBackButtonClick: (...args: any[]) => any;
8
+ /**
9
+ * Translatable text for the back button
10
+ */
11
+ backButtonText: string;
12
+ /**
13
+ * Disable the back button
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Display the back button as an X instead of an arrow
18
+ */
19
+ backButtonAsClose?: boolean;
20
+ /**
21
+ * Text to be displayed grayed out after the "Back" text – e.g. "Asset selected" in gallery
22
+ */
23
+ leftText?: string;
24
+ /**
25
+ * Add a shadow on the bottom border of the top bar – e.g. in gallery view
26
+ */
27
+ shadow?: boolean;
28
+ /**
29
+ * Add a border on the bottom of the top bar
30
+ */
31
+ border?: boolean;
32
+ /**
33
+ * `Array` of buttons to be placed on the right side of the top bar
34
+ */
35
+ buttons?: React.ReactNode[];
36
+ };
37
+ /**
38
+ * Top bar for asset preview.
39
+ *
40
+ * ### Import
41
+ *
42
+ * ``` js
43
+ * import { AssetPreviewTopBar } from '@ntbjs/react-components/widgets'
44
+ * // or
45
+ * import AssetPreviewTopBar from '@ntbjs/react-components/AssetPreview/AssetPreviewTopBar'
46
+ * ```
47
+ *
48
+ * ### Usage example
49
+ *
50
+ * ``` js
51
+ const button1 = <ActionButton key="btn1"icon={<IconAddCircle />} />;
52
+ const button2 = <Button key="btn2" secondary={true}>Edit</Button>;
53
+ const button3 = <Button key="btn3" secondary={true}>Share</Button>;
54
+ const button4 = <Button key="btn4">Download</Button>;
55
+
56
+ const topBar = <AssetPreviewTopBar backButtonText={t{"Back"}} onBackButtonClick={() => {}} buttons={[button1, button2, button3, button4]} />;
57
+ * ```
58
+ */
59
+ declare const AssetPreviewTopBar: React.ForwardRefExoticComponent<Omit<Omit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, S.AssetPreviewTopBarStyleProps>, never>, "ref">, keyof AssetPreviewTopBarOwnProps> & AssetPreviewTopBarOwnProps & React.RefAttributes<any>>;
60
+ export default AssetPreviewTopBar;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `disabled` — `PropTypes.bool`, greys out the back button.
3
+ *
4
+ * NO `$`, AND THAT IS A DEFECT THAT IS ALREADY IN THE RENDER BASELINE. React recognises
5
+ * `disabled` and renders it as a bare boolean attribute on any element, so
6
+ * `widgets/AssetPreviewTopBar#disabled` in `scripts/r19-harness/baseline.json` records
7
+ * `<div disabled="">` AND `<a disabled="">`. Renaming it `$disabled` removes both
8
+ * attributes and therefore MOVES the baseline — C10 work, §E.4.
9
+ *
10
+ * Note it also has to be DECLARED to be read at all: `disabled` is a member of neither
11
+ * `HTMLAttributes<HTMLDivElement>` nor `AnchorHTMLAttributes<HTMLAnchorElement>`. That is
12
+ * the same asymmetry §J.9 records for `CompactTextInput` — there the identical read on an
13
+ * `<input>` needs no declaration, because `InputHTMLAttributes` really does have it.
14
+ *
15
+ * Hosts: `AssetPreviewTopBar` and `BackButtonContainer`.
16
+ */
17
+ interface AssetPreviewTopBarDisabledStyleProps {
18
+ disabled?: boolean;
19
+ }
20
+ /** The top bar root, i.e. what `AssetPreviewTopBar.tsx` passes to it. */
21
+ export interface AssetPreviewTopBarStyleProps extends AssetPreviewTopBarDisabledStyleProps {
22
+ /** `border` — `PropTypes.bool`; swaps `border-bottom` between `1px solid` and `none`. */
23
+ $border?: boolean;
24
+ /** `shadow` — `PropTypes.bool`. Read as `props.$shadow && props.theme.themeProp(…)`,
25
+ * which evaluates to `false | RuleSet` — a valid `Interpolation`. A BARE
26
+ * `${props => props.$shadow}` would not be: `Interpolation` accepts `Falsy` but not
27
+ * `true`, so it would be TS2345 even with the prop correctly typed `boolean`. §J.5. */
28
+ $shadow?: boolean;
29
+ }
30
+ export declare const AssetPreviewTopBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, AssetPreviewTopBarStyleProps>, never>> & string;
31
+ export declare const BackButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>>, AssetPreviewTopBarDisabledStyleProps>, never>> & string;
32
+ export declare const BackHoverEffect: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
+ export declare const LeftText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>, never>, never>> & string;
34
+ export declare const ButtonsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
35
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './AssetPreviewTopBar';