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

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 (344) hide show
  1. package/README.md +34 -0
  2. package/build/data/Alert/Alert.js +18 -33
  3. package/build/data/Alert/Alert.js.map +1 -1
  4. package/build/data/Alert/Alert.styled.js +9 -47
  5. package/build/data/Alert/Alert.styled.js.map +1 -1
  6. package/build/data/Badge/Badge.js +36 -61
  7. package/build/data/Badge/Badge.js.map +1 -1
  8. package/build/data/Badge/Badge.styled.js +21 -70
  9. package/build/data/Badge/Badge.styled.js.map +1 -1
  10. package/build/data/Popover/Popover.js +125 -71
  11. package/build/data/Popover/Popover.js.map +1 -1
  12. package/build/data/Popover/Popover.styled.js +10 -140
  13. package/build/data/Popover/Popover.styled.js.map +1 -1
  14. package/build/data/SeverityBadge/SeverityBadge.js +13 -22
  15. package/build/data/SeverityBadge/SeverityBadge.js.map +1 -1
  16. package/build/data/SeverityBadge/index.js +2 -0
  17. package/build/data/SeverityBadge/index.js.map +1 -0
  18. package/build/data/Tab/Tab.js +7 -13
  19. package/build/data/Tab/Tab.js.map +1 -1
  20. package/build/data/Tab/Tab.styled.js +4 -7
  21. package/build/data/Tab/Tab.styled.js.map +1 -1
  22. package/build/data/Tabs/Tabs.js +30 -32
  23. package/build/data/Tabs/Tabs.js.map +1 -1
  24. package/build/data/Tabs/Tabs.styled.js +21 -57
  25. package/build/data/Tabs/Tabs.styled.js.map +1 -1
  26. package/build/data/Tooltip/Tooltip.js +102 -33
  27. package/build/data/Tooltip/Tooltip.js.map +1 -1
  28. package/build/data/Tooltip/Tooltip.styled.js +9 -22
  29. package/build/data/Tooltip/Tooltip.styled.js.map +1 -1
  30. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js +16 -23
  31. package/build/data/VerificationStatusIcon/VerificationStatusIcon.js.map +1 -1
  32. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js +13 -31
  33. package/build/data/VerificationStatusIcon/VerificationStatusIcon.styled.js.map +1 -1
  34. package/build/data/VerificationStatusIcon/index.js +2 -0
  35. package/build/data/VerificationStatusIcon/index.js.map +1 -0
  36. package/build/data/_shared/FloatingArrow.styled.js +30 -0
  37. package/build/data/_shared/FloatingArrow.styled.js.map +1 -0
  38. package/build/hooks/useEventListner.js.map +1 -1
  39. package/build/hooks/useFloatingPopover.js +187 -0
  40. package/build/hooks/useFloatingPopover.js.map +1 -0
  41. package/build/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  42. package/build/hooks/useOnClickOutside.js.map +1 -1
  43. package/build/hooks/useTooltipAutoShow.js.map +1 -1
  44. package/build/icons/arrow-back.svg.js +3 -3
  45. package/build/icons/arrow-back.svg.js.map +1 -1
  46. package/build/icons/arrow-forward.svg.js +4 -4
  47. package/build/icons/arrow-forward.svg.js.map +1 -1
  48. package/build/icons/check-rectangle-filled.svg.js +3 -3
  49. package/build/icons/check-rectangle-filled.svg.js.map +1 -1
  50. package/build/icons/close.svg.js +3 -3
  51. package/build/icons/close.svg.js.map +1 -1
  52. package/build/icons/edit-note.svg.js +3 -3
  53. package/build/icons/edit-note.svg.js.map +1 -1
  54. package/build/icons/expand-more.svg.js +3 -3
  55. package/build/icons/expand-more.svg.js.map +1 -1
  56. package/build/icons/headset.svg.js +3 -3
  57. package/build/icons/headset.svg.js.map +1 -1
  58. package/build/icons/layers.svg.js +3 -3
  59. package/build/icons/layers.svg.js.map +1 -1
  60. package/build/icons/link.svg.js +3 -3
  61. package/build/icons/link.svg.js.map +1 -1
  62. package/build/icons/play.svg.js +3 -3
  63. package/build/icons/play.svg.js.map +1 -1
  64. package/build/icons/search.svg.js +3 -3
  65. package/build/icons/search.svg.js.map +1 -1
  66. package/build/icons/star-filled.svg.js +3 -3
  67. package/build/icons/star-filled.svg.js.map +1 -1
  68. package/build/icons/star.svg.js +3 -3
  69. package/build/icons/star.svg.js.map +1 -1
  70. package/build/icons/triangle-right.svg.js +3 -3
  71. package/build/icons/triangle-right.svg.js.map +1 -1
  72. package/build/icons/verification.svg.js +3 -3
  73. package/build/icons/verification.svg.js.map +1 -1
  74. package/build/icons/warning-circle.svg.js +3 -3
  75. package/build/icons/warning-circle.svg.js.map +1 -1
  76. package/build/inputs/ActionButton/ActionButton.js +11 -22
  77. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  78. package/build/inputs/ActionButton/ActionButton.styled.js +5 -54
  79. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  80. package/build/inputs/Button/Button.js +125 -121
  81. package/build/inputs/Button/Button.js.map +1 -1
  82. package/build/inputs/Button/Button.styled.js +42 -260
  83. package/build/inputs/Button/Button.styled.js.map +1 -1
  84. package/build/inputs/Checkbox/Checkbox.js +45 -61
  85. package/build/inputs/Checkbox/Checkbox.js.map +1 -1
  86. package/build/inputs/Checkbox/Checkbox.styled.js +24 -153
  87. package/build/inputs/Checkbox/Checkbox.styled.js.map +1 -1
  88. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js +106 -111
  89. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.js.map +1 -1
  90. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js +88 -273
  91. package/build/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.js.map +1 -1
  92. package/build/inputs/CompactStarRating/CompactStarRating.js +56 -77
  93. package/build/inputs/CompactStarRating/CompactStarRating.js.map +1 -1
  94. package/build/inputs/CompactStarRating/CompactStarRating.styled.js +32 -211
  95. package/build/inputs/CompactStarRating/CompactStarRating.styled.js.map +1 -1
  96. package/build/inputs/CompactTextInput/CompactTextInput.js +86 -105
  97. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  98. package/build/inputs/CompactTextInput/CompactTextInput.styled.js +55 -258
  99. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  100. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js +70 -77
  101. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.js.map +1 -1
  102. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js +28 -60
  103. package/build/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.js.map +1 -1
  104. package/build/inputs/MultiLevelCheckbox/types.js +12 -12
  105. package/build/inputs/MultiLevelCheckbox/types.js.map +1 -1
  106. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +69 -73
  107. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js.map +1 -1
  108. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js +44 -87
  109. package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.js.map +1 -1
  110. package/build/inputs/MultiSelect/MultiSelect.js +69 -79
  111. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  112. package/build/inputs/MultiSelect/MultiSelect.styled.js +70 -76
  113. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  114. package/build/inputs/Radio/Radio.js +20 -33
  115. package/build/inputs/Radio/Radio.js.map +1 -1
  116. package/build/inputs/Radio/Radio.styled.js +15 -96
  117. package/build/inputs/Radio/Radio.styled.js.map +1 -1
  118. package/build/inputs/Switch/Switch.js +28 -40
  119. package/build/inputs/Switch/Switch.js.map +1 -1
  120. package/build/inputs/Switch/Switch.styled.js +24 -94
  121. package/build/inputs/Switch/Switch.styled.js.map +1 -1
  122. package/build/inputs/TextArea/TextArea.js +98 -123
  123. package/build/inputs/TextArea/TextArea.js.map +1 -1
  124. package/build/inputs/TextArea/TextArea.styled.js +64 -379
  125. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  126. package/build/inputs/TextInput/TextInput.js +59 -79
  127. package/build/inputs/TextInput/TextInput.js.map +1 -1
  128. package/build/inputs/TextInput/TextInput.styled.js +33 -224
  129. package/build/inputs/TextInput/TextInput.styled.js.map +1 -1
  130. package/build/layout/InputGroup/InputGroup.js +6 -9
  131. package/build/layout/InputGroup/InputGroup.js.map +1 -1
  132. package/build/layout/InputGroup/InputGroup.styled.js +4 -3
  133. package/build/layout/InputGroup/InputGroup.styled.js.map +1 -1
  134. package/build/layout/InputGroup/index.js +2 -0
  135. package/build/layout/InputGroup/index.js.map +1 -0
  136. package/build/layout/SectionSeparator/SectionSeparator.js +5 -9
  137. package/build/layout/SectionSeparator/SectionSeparator.js.map +1 -1
  138. package/build/layout/SectionSeparator/SectionSeparator.styled.js +4 -8
  139. package/build/layout/SectionSeparator/SectionSeparator.styled.js.map +1 -1
  140. package/build/styles/utils/colors-export.d.ts +54 -0
  141. package/build/styles/utils/colors-export.js.map +1 -1
  142. package/build/utils/dateTime.js.map +1 -1
  143. package/build/utils/defaultTheme.js +14 -28
  144. package/build/utils/defaultTheme.js.map +1 -1
  145. package/build/utils/getElementRef.js +14 -0
  146. package/build/utils/getElementRef.js.map +1 -0
  147. package/build/utils/parseTrigger.js +16 -0
  148. package/build/utils/parseTrigger.js.map +1 -0
  149. package/build/widgets/AssetAction/AssetAction.js +26 -33
  150. package/build/widgets/AssetAction/AssetAction.js.map +1 -1
  151. package/build/widgets/AssetAction/AssetAction.styled.js +20 -34
  152. package/build/widgets/AssetAction/AssetAction.styled.js.map +1 -1
  153. package/build/widgets/AssetActionsBase/AssetActionsBase.js +8 -13
  154. package/build/widgets/AssetActionsBase/AssetActionsBase.js.map +1 -1
  155. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js +4 -9
  156. package/build/widgets/AssetActionsBase/AssetActionsBase.styled.js.map +1 -1
  157. package/build/widgets/AssetGallery/AssetGallery.js +15 -40
  158. package/build/widgets/AssetGallery/AssetGallery.js.map +1 -1
  159. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js +55 -70
  160. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.js.map +1 -1
  161. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js +12 -24
  162. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.js.map +1 -1
  163. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +146 -122
  164. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  165. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +99 -286
  166. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  167. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +170 -125
  168. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  169. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +135 -364
  170. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  171. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +20 -21
  172. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js.map +1 -1
  173. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js +20 -71
  174. package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js.map +1 -1
  175. package/build/widgets/ContextMenu/ContextMenu.js +12 -11
  176. package/build/widgets/ContextMenu/ContextMenu.js.map +1 -1
  177. package/build/widgets/ContextMenu/ContextMenu.styled.js +4 -4
  178. package/build/widgets/ContextMenu/ContextMenu.styled.js.map +1 -1
  179. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js +17 -25
  180. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js.map +1 -1
  181. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js +16 -71
  182. package/build/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js.map +1 -1
  183. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +7 -11
  184. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js.map +1 -1
  185. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js +4 -11
  186. package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.js.map +1 -1
  187. package/build/widgets/InfoCard/InfoCard.js +26 -21
  188. package/build/widgets/InfoCard/InfoCard.js.map +1 -1
  189. package/build/widgets/InfoCard/InfoCard.styled.js +36 -84
  190. package/build/widgets/InfoCard/InfoCard.styled.js.map +1 -1
  191. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js +28 -34
  192. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.js.map +1 -1
  193. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js +21 -57
  194. package/build/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.js.map +1 -1
  195. package/build/widgets/InstructionSeverityDisplay/index.js +2 -0
  196. package/build/widgets/InstructionSeverityDisplay/index.js.map +1 -0
  197. package/build/widgets/Instructions/Instructions.js +53 -95
  198. package/build/widgets/Instructions/Instructions.js.map +1 -1
  199. package/build/widgets/Instructions/Instructions.styled.js +27 -26
  200. package/build/widgets/Instructions/Instructions.styled.js.map +1 -1
  201. package/build/widgets/ProgressBar/ProgressBar.js +39 -37
  202. package/build/widgets/ProgressBar/ProgressBar.js.map +1 -1
  203. package/build/widgets/ProgressBar/ProgressBar.styled.js +56 -125
  204. package/build/widgets/ProgressBar/ProgressBar.styled.js.map +1 -1
  205. package/build/widgets/SummaryCard/SummaryCard.js +55 -64
  206. package/build/widgets/SummaryCard/SummaryCard.js.map +1 -1
  207. package/build/widgets/SummaryCard/SummaryCard.styled.js +51 -106
  208. package/build/widgets/SummaryCard/SummaryCard.styled.js.map +1 -1
  209. package/package.json +84 -36
  210. package/styles/utils/colors-export.d.ts +54 -0
  211. package/types/components/data/Alert/Alert.d.ts +76 -0
  212. package/types/components/data/Alert/Alert.styled.d.ts +52 -0
  213. package/types/components/data/Alert/index.d.ts +1 -0
  214. package/types/components/data/Badge/Badge.d.ts +120 -0
  215. package/types/components/data/Badge/Badge.styled.d.ts +33 -0
  216. package/types/components/data/Badge/index.d.ts +1 -0
  217. package/types/components/data/Popover/Popover.d.ts +116 -0
  218. package/types/components/data/Popover/Popover.styled.d.ts +15 -0
  219. package/types/components/data/Popover/index.d.ts +1 -0
  220. package/types/components/data/SeverityBadge/SeverityBadge.d.ts +72 -0
  221. package/types/components/data/SeverityBadge/index.d.ts +1 -0
  222. package/types/components/data/Tab/Tab.d.ts +14 -0
  223. package/types/components/data/Tab/Tab.styled.d.ts +1 -0
  224. package/types/components/data/Tab/index.d.ts +1 -0
  225. package/types/components/data/Tabs/Tabs.d.ts +111 -0
  226. package/types/components/data/Tabs/Tabs.styled.d.ts +26 -0
  227. package/types/components/data/Tabs/index.d.ts +1 -0
  228. package/types/components/data/Tooltip/Tooltip.d.ts +88 -0
  229. package/types/components/data/Tooltip/Tooltip.styled.d.ts +8 -0
  230. package/types/components/data/Tooltip/index.d.ts +1 -0
  231. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.d.ts +35 -0
  232. package/types/components/data/VerificationStatusIcon/VerificationStatusIcon.styled.d.ts +27 -0
  233. package/types/components/data/VerificationStatusIcon/index.d.ts +1 -0
  234. package/types/components/data/_shared/FloatingArrow.styled.d.ts +29 -0
  235. package/types/components/data/index.d.ts +8 -0
  236. package/types/components/index.d.ts +3 -0
  237. package/types/components/inputs/ActionButton/ActionButton.d.ts +55 -0
  238. package/types/components/inputs/ActionButton/ActionButton.styled.d.ts +16 -0
  239. package/types/components/inputs/ActionButton/index.d.ts +1 -0
  240. package/types/components/inputs/Button/Button.d.ts +82 -0
  241. package/types/components/inputs/Button/Button.styled.d.ts +60 -0
  242. package/types/components/inputs/Button/index.d.ts +1 -0
  243. package/types/components/inputs/Checkbox/Checkbox.d.ts +83 -0
  244. package/types/components/inputs/Checkbox/Checkbox.styled.d.ts +29 -0
  245. package/types/components/inputs/Checkbox/index.d.ts +1 -0
  246. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.d.ts +242 -0
  247. package/types/components/inputs/CompactAutocompleteSelect/CompactAutocompleteSelect.styled.d.ts +104 -0
  248. package/types/components/inputs/CompactAutocompleteSelect/index.d.ts +1 -0
  249. package/types/components/inputs/CompactStarRating/CompactStarRating.d.ts +96 -0
  250. package/types/components/inputs/CompactStarRating/CompactStarRating.styled.d.ts +34 -0
  251. package/types/components/inputs/CompactStarRating/index.d.ts +1 -0
  252. package/types/components/inputs/CompactTextInput/CompactTextInput.d.ts +116 -0
  253. package/types/components/inputs/CompactTextInput/CompactTextInput.styled.d.ts +42 -0
  254. package/types/components/inputs/CompactTextInput/index.d.ts +1 -0
  255. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.d.ts +41 -0
  256. package/types/components/inputs/MultiLevelCheckbox/MultiLevelCheckbox.styled.d.ts +13 -0
  257. package/types/components/inputs/MultiLevelCheckbox/index.d.ts +2 -0
  258. package/types/components/inputs/MultiLevelCheckbox/types.d.ts +29 -0
  259. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.d.ts +44 -0
  260. package/types/components/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.styled.d.ts +11 -0
  261. package/types/components/inputs/MultiLevelCheckboxSelect/index.d.ts +1 -0
  262. package/types/components/inputs/MultiSelect/MultiSelect.d.ts +115 -0
  263. package/types/components/inputs/MultiSelect/MultiSelect.styled.d.ts +34 -0
  264. package/types/components/inputs/MultiSelect/index.d.ts +1 -0
  265. package/types/components/inputs/Radio/Radio.d.ts +65 -0
  266. package/types/components/inputs/Radio/Radio.styled.d.ts +11 -0
  267. package/types/components/inputs/Radio/index.d.ts +1 -0
  268. package/types/components/inputs/Switch/Switch.d.ts +62 -0
  269. package/types/components/inputs/Switch/Switch.styled.d.ts +16 -0
  270. package/types/components/inputs/Switch/index.d.ts +1 -0
  271. package/types/components/inputs/TextArea/TextArea.d.ts +120 -0
  272. package/types/components/inputs/TextArea/TextArea.styled.d.ts +93 -0
  273. package/types/components/inputs/TextArea/index.d.ts +1 -0
  274. package/types/components/inputs/TextInput/TextInput.d.ts +109 -0
  275. package/types/components/inputs/TextInput/TextInput.styled.d.ts +43 -0
  276. package/types/components/inputs/TextInput/index.d.ts +1 -0
  277. package/types/components/inputs/index.d.ts +13 -0
  278. package/types/components/layout/InputGroup/InputGroup.d.ts +31 -0
  279. package/types/components/layout/InputGroup/InputGroup.styled.d.ts +1 -0
  280. package/types/components/layout/InputGroup/index.d.ts +1 -0
  281. package/types/components/layout/SectionSeparator/SectionSeparator.d.ts +28 -0
  282. package/types/components/layout/SectionSeparator/SectionSeparator.styled.d.ts +7 -0
  283. package/types/components/layout/SectionSeparator/index.d.ts +1 -0
  284. package/types/components/layout/index.d.ts +2 -0
  285. package/types/components/widgets/AssetAction/AssetAction.d.ts +16 -0
  286. package/types/components/widgets/AssetAction/AssetAction.styled.d.ts +15 -0
  287. package/types/components/widgets/AssetAction/index.d.ts +1 -0
  288. package/types/components/widgets/AssetActionsBase/AssetActionsBase.d.ts +25 -0
  289. package/types/components/widgets/AssetActionsBase/AssetActionsBase.styled.d.ts +1 -0
  290. package/types/components/widgets/AssetActionsBase/index.d.ts +1 -0
  291. package/types/components/widgets/AssetGallery/AssetGallery.d.ts +170 -0
  292. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.d.ts +76 -0
  293. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryBase.styled.d.ts +3 -0
  294. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.d.ts +3 -0
  295. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.d.ts +52 -0
  296. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.d.ts +2 -0
  297. package/types/components/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.d.ts +49 -0
  298. package/types/components/widgets/AssetGallery/asset.types.d.ts +329 -0
  299. package/types/components/widgets/AssetGallery/index.d.ts +1 -0
  300. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.d.ts +60 -0
  301. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.d.ts +21 -0
  302. package/types/components/widgets/AssetPreview/AssetPreviewTopBar/index.d.ts +1 -0
  303. package/types/components/widgets/ContextMenu/ContextMenu.d.ts +118 -0
  304. package/types/components/widgets/ContextMenu/ContextMenu.styled.d.ts +1 -0
  305. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.d.ts +45 -0
  306. package/types/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.d.ts +18 -0
  307. package/types/components/widgets/ContextMenu/ContextMenuItem/index.d.ts +1 -0
  308. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.d.ts +23 -0
  309. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.styled.d.ts +1 -0
  310. package/types/components/widgets/ContextMenu/ContextMenuItemsGroup/index.d.ts +1 -0
  311. package/types/components/widgets/ContextMenu/index.d.ts +1 -0
  312. package/types/components/widgets/InfoCard/InfoCard.d.ts +33 -0
  313. package/types/components/widgets/InfoCard/InfoCard.styled.d.ts +28 -0
  314. package/types/components/widgets/InfoCard/index.d.ts +1 -0
  315. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.d.ts +46 -0
  316. package/types/components/widgets/InstructionSeverityDisplay/InstructionSeverityDisplay.styled.d.ts +30 -0
  317. package/types/components/widgets/InstructionSeverityDisplay/index.d.ts +1 -0
  318. package/types/components/widgets/Instructions/Instructions.d.ts +156 -0
  319. package/types/components/widgets/Instructions/Instructions.styled.d.ts +14 -0
  320. package/types/components/widgets/Instructions/index.d.ts +1 -0
  321. package/types/components/widgets/ProgressBar/ProgressBar.d.ts +30 -0
  322. package/types/components/widgets/ProgressBar/ProgressBar.styled.d.ts +41 -0
  323. package/types/components/widgets/ProgressBar/index.d.ts +1 -0
  324. package/types/components/widgets/SummaryCard/SummaryCard.d.ts +83 -0
  325. package/types/components/widgets/SummaryCard/SummaryCard.styled.d.ts +29 -0
  326. package/types/components/widgets/SummaryCard/index.d.ts +1 -0
  327. package/types/components/widgets/index.d.ts +11 -0
  328. package/types/hooks/useElementSize.d.ts +14 -0
  329. package/types/hooks/useEventListner.d.ts +14 -0
  330. package/types/hooks/useFloatingPopover.d.ts +161 -0
  331. package/types/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  332. package/types/hooks/useOnClickOutside.d.ts +13 -0
  333. package/types/hooks/useTooltipAutoShow.d.ts +31 -0
  334. package/types/icons/index.d.ts +41 -0
  335. package/types/ssr/index.d.ts +1 -0
  336. package/types/styles/utils/colors-export.d.ts +54 -0
  337. package/types/utils/dateTime.d.ts +8 -0
  338. package/types/utils/defaultTheme.d.ts +95 -0
  339. package/types/utils/getElementRef.d.ts +2 -0
  340. package/types/utils/parseTrigger.d.ts +22 -0
  341. package/build/_virtual/_rollupPluginBabelHelpers.js +0 -12
  342. package/build/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  343. package/build/widgets/AssetGallery/asset.propType.js +0 -56
  344. package/build/widgets/AssetGallery/asset.propType.js.map +0 -1
@@ -1,9 +1,8 @@
1
- import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
2
  import { AssetPreviewTopBar as AssetPreviewTopBar$1, BackButtonContainer, BackHoverEffect, LeftText, ButtonsContainer } from './AssetPreviewTopBar.styled.js';
5
3
  import { ReactComponent as SvgArrowBack } from '../../../icons/arrow-back.svg.js';
6
4
  import { ReactComponent as SvgClose } from '../../../icons/close.svg.js';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
6
 
8
7
  const AssetPreviewTopBar = React__default.forwardRef(function AssetPreviewTopBar({
9
8
  onBackButtonClick,
@@ -16,29 +15,29 @@ const AssetPreviewTopBar = React__default.forwardRef(function AssetPreviewTopBar
16
15
  disabled,
17
16
  ...props
18
17
  }, forwardedRef) {
19
- return React__default.createElement(AssetPreviewTopBar$1, _extends({
18
+ return jsxs(AssetPreviewTopBar$1, {
20
19
  ref: forwardedRef,
21
20
  $shadow: shadow,
22
21
  $border: border,
23
- disabled: disabled
24
- }, props), React__default.createElement(BackButtonContainer, {
25
- onClick: onBackButtonClick,
26
- disabled: disabled
27
- }, backButtonAsClose ? React__default.createElement(React__default.Fragment, null, React__default.createElement(SvgClose, null), backButtonText) : React__default.createElement(BackHoverEffect, null, React__default.createElement(SvgArrowBack, null), backButtonText)), leftText && React__default.createElement(LeftText, null, leftText), Array.isArray(buttons) && React__default.createElement(ButtonsContainer, null, buttons.map((button, index) => React__default.createElement("span", {
28
- key: 'topBarButton-' + index
29
- }, button))));
22
+ disabled: disabled,
23
+ ...props,
24
+ children: [jsx(BackButtonContainer, {
25
+ onClick: onBackButtonClick,
26
+ disabled: disabled,
27
+ children: backButtonAsClose ? jsxs(Fragment, {
28
+ children: [jsx(SvgClose, {}), backButtonText]
29
+ }) : jsxs(BackHoverEffect, {
30
+ children: [jsx(SvgArrowBack, {}), backButtonText]
31
+ })
32
+ }), leftText && jsx(LeftText, {
33
+ children: leftText
34
+ }), Array.isArray(buttons) && jsx(ButtonsContainer, {
35
+ children: buttons.map((button, index) => jsx("span", {
36
+ children: button
37
+ }, 'topBarButton-' + index))
38
+ })]
39
+ });
30
40
  });
31
- AssetPreviewTopBar.propTypes = process.env.NODE_ENV !== "production" ? {
32
- onBackButtonClick: PropTypes.func.isRequired,
33
- backButtonText: PropTypes.string.isRequired,
34
- disabled: PropTypes.bool,
35
- backButtonAsClose: PropTypes.bool,
36
- leftText: PropTypes.string,
37
- shadow: PropTypes.bool,
38
- border: PropTypes.bool,
39
- buttons: PropTypes.arrayOf(PropTypes.node)
40
- } : {};
41
- AssetPreviewTopBar.defaultProps = {};
42
41
 
43
42
  export { AssetPreviewTopBar as default };
44
43
  //# sourceMappingURL=AssetPreviewTopBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetPreviewTopBar.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './AssetPreviewTopBar.styled';\n\nimport { ReactComponent as IconArrowBack } from '../../../../icons/arrow-back.svg';\nimport { ReactComponent as IconClose } from '../../../../icons/close.svg';\n\n/**\n * Top bar for asset preview.\n *\n * ### Import\n *\n * ``` js\n * import { AssetPreviewTopBar } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetPreviewTopBar from '@ntbjs/react-components/AssetPreview/AssetPreviewTopBar'\n * ```\n * \n * ### Usage example\n * \n * ``` js\nconst button1 = <ActionButton key=\"btn1\"icon={<IconAddCircle />} />;\nconst button2 = <Button key=\"btn2\" secondary={true}>Edit</Button>;\nconst button3 = <Button key=\"btn3\" secondary={true}>Share</Button>;\nconst button4 = <Button key=\"btn4\">Download</Button>;\n\nconst topBar = <AssetPreviewTopBar backButtonText={t{\"Back\"}} onBackButtonClick={() => {}} buttons={[button1, button2, button3, button4]} />;\n * ```\n */\nconst AssetPreviewTopBar = React.forwardRef(function AssetPreviewTopBar(\n {\n onBackButtonClick,\n backButtonText,\n backButtonAsClose,\n leftText,\n buttons,\n shadow,\n border,\n disabled,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.AssetPreviewTopBar\n ref={forwardedRef}\n $shadow={shadow}\n $border={border}\n disabled={disabled}\n {...props}\n >\n <S.BackButtonContainer onClick={onBackButtonClick} disabled={disabled}>\n {backButtonAsClose ? (\n <>\n <IconClose />\n {backButtonText}\n </>\n ) : (\n <S.BackHoverEffect>\n <IconArrowBack />\n {backButtonText}\n </S.BackHoverEffect>\n )}\n </S.BackButtonContainer>\n {leftText && <S.LeftText>{leftText}</S.LeftText>}\n {Array.isArray(buttons) && (\n <S.ButtonsContainer>\n {buttons.map((button, index) => (\n <span key={'topBarButton-' + index}>{button}</span>\n ))}\n </S.ButtonsContainer>\n )}\n </S.AssetPreviewTopBar>\n );\n});\n\nAssetPreviewTopBar.propTypes = {\n /**\n * On-click function for the back button\n */\n onBackButtonClick: PropTypes.func.isRequired,\n\n /**\n * Translatable text for the back button\n */\n backButtonText: PropTypes.string.isRequired,\n\n /**\n * Disable the back button\n */\n disabled: PropTypes.bool,\n\n /**\n * Display the back button as an X instead of an arrow\n */\n backButtonAsClose: PropTypes.bool,\n\n /**\n * Text to be displayed grayed out after the \"Back\" text – e.g. \"Asset selected\" in gallery\n */\n leftText: PropTypes.string,\n\n /**\n * Add a shadow on the bottom border of the top bar – e.g. in gallery view\n */\n shadow: PropTypes.bool,\n /**\n * Add a border on the bottom of the top bar\n */\n border: PropTypes.bool,\n\n /**\n * `Array` of buttons to be placed on the right side of the top bar\n */\n buttons: PropTypes.arrayOf(PropTypes.node)\n};\n\nAssetPreviewTopBar.defaultProps = {};\n\nexport default AssetPreviewTopBar;\n"],"names":["AssetPreviewTopBar","React","forwardRef","onBackButtonClick","backButtonText","backButtonAsClose","leftText","buttons","shadow","border","disabled","props","forwardedRef","createElement","S","_extends","ref","$shadow","$border","onClick","Fragment","IconClose","IconArrowBack","Array","isArray","map","button","index","key","propTypes","process","env","NODE_ENV","PropTypes","func","isRequired","string","bool","arrayOf","node","defaultProps"],"mappings":";;;;;;;AA6BMA,MAAAA,kBAAkB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,kBAAkBA,CACrE;EACEG,iBAAiB;EACjBC,cAAc;EACdC,iBAAiB;EACjBC,QAAQ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,iBAAiB,EAAE8B,SAAS,CAACC,IAAI,CAACC,UAAU;AAK5C/B,EAAAA,cAAc,EAAE6B,SAAS,CAACG,MAAM,CAACD,UAAU;EAK3CzB,QAAQ,EAAEuB,SAAS,CAACI,IAAI;EAKxBhC,iBAAiB,EAAE4B,SAAS,CAACI,IAAI;EAKjC/B,QAAQ,EAAE2B,SAAS,CAACG,MAAM;EAK1B5B,MAAM,EAAEyB,SAAS,CAACI,IAAI;EAItB5B,MAAM,EAAEwB,SAAS,CAACI,IAAI;AAKtB9B,EAAAA,OAAO,EAAE0B,SAAS,CAACK,OAAO,CAACL,SAAS,CAACM,IAAI,CAAA;AAC3C,CAAC,GAAA,EAAA,CAAA;AAEDvC,kBAAkB,CAACwC,YAAY,GAAG,EAAE;;;;"}
1
+ {"version":3,"file":"AssetPreviewTopBar.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './AssetPreviewTopBar.styled';\n\nimport { ReactComponent as IconArrowBack } from '../../../../icons/arrow-back.svg';\nimport { ReactComponent as IconClose } from '../../../../icons/close.svg';\n\ntype AssetPreviewTopBarOwnProps = {\n /**\n * On-click function for the back button\n */\n onBackButtonClick: (...args: any[]) => any;\n /**\n * Translatable text for the back button\n */\n backButtonText: string;\n /**\n * Disable the back button\n */\n disabled?: boolean;\n /**\n * Display the back button as an X instead of an arrow\n */\n backButtonAsClose?: boolean;\n /**\n * Text to be displayed grayed out after the \"Back\" text – e.g. \"Asset selected\" in gallery\n */\n leftText?: string;\n /**\n * Add a shadow on the bottom border of the top bar – e.g. in gallery view\n */\n shadow?: boolean;\n /**\n * Add a border on the bottom of the top bar\n */\n border?: boolean;\n /**\n * `Array` of buttons to be placed on the right side of the top bar\n */\n buttons?: React.ReactNode[];\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.AssetPreviewTopBar>,\n keyof AssetPreviewTopBarOwnProps\n> &\n AssetPreviewTopBarOwnProps;\n\n/**\n * Top bar for asset preview.\n *\n * ### Import\n *\n * ``` js\n * import { AssetPreviewTopBar } from '@ntbjs/react-components/widgets'\n * // or\n * import AssetPreviewTopBar from '@ntbjs/react-components/AssetPreview/AssetPreviewTopBar'\n * ```\n * \n * ### Usage example\n * \n * ``` js\nconst button1 = <ActionButton key=\"btn1\"icon={<IconAddCircle />} />;\nconst button2 = <Button key=\"btn2\" secondary={true}>Edit</Button>;\nconst button3 = <Button key=\"btn3\" secondary={true}>Share</Button>;\nconst button4 = <Button key=\"btn4\">Download</Button>;\n\nconst topBar = <AssetPreviewTopBar backButtonText={t{\"Back\"}} onBackButtonClick={() => {}} buttons={[button1, button2, button3, button4]} />;\n * ```\n */\nconst AssetPreviewTopBar = React.forwardRef<any, Props>(function AssetPreviewTopBar(\n {\n onBackButtonClick,\n backButtonText,\n backButtonAsClose,\n leftText,\n buttons,\n shadow,\n border,\n disabled,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.AssetPreviewTopBar\n ref={forwardedRef}\n $shadow={shadow}\n $border={border}\n disabled={disabled}\n {...props}\n >\n <S.BackButtonContainer onClick={onBackButtonClick} disabled={disabled}>\n {backButtonAsClose ? (\n <>\n <IconClose />\n {backButtonText}\n </>\n ) : (\n <S.BackHoverEffect>\n <IconArrowBack />\n {backButtonText}\n </S.BackHoverEffect>\n )}\n </S.BackButtonContainer>\n {leftText && <S.LeftText>{leftText}</S.LeftText>}\n {Array.isArray(buttons) && (\n <S.ButtonsContainer>\n {buttons.map((button, index) => (\n <span key={'topBarButton-' + index}>{button}</span>\n ))}\n </S.ButtonsContainer>\n )}\n </S.AssetPreviewTopBar>\n );\n});\n\nexport default AssetPreviewTopBar;\n"],"names":["AssetPreviewTopBar","React","forwardRef","onBackButtonClick","backButtonText","backButtonAsClose","leftText","buttons","shadow","border","disabled","props","forwardedRef","_jsxs","S","ref","$shadow","$border","children","_jsx","onClick","_Fragment","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nD;AAAC,KACgB,CACrB;AAAA,GACmB,CAAC;AAE3B,CAAC;;;;"}
@@ -6,83 +6,32 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const AssetPreviewTopBar = styled.div.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- box-sizing: border-box;
11
- align-items: center;
12
- border-bottom: ${props => props.$border ? `1px solid` : `none`};
13
- color: inherit;
14
- display: flex;
15
- font-family: ${props => props.theme.primaryFontFamily};
16
- font-weight: 400;
17
- min-height: 72px;
18
- padding: 0 24px;
19
- width: 100%;
20
-
21
- ${props => props.theme.themeProp('border-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-200'))}
22
-
23
- ${props => props.$shadow && props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9')}
24
-
25
- ${props => props.disabled && css`
26
- cursor: not-allowed;
27
- `}
28
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "AssetPreviewTopBarstyled__AssetPreviewTopBar",
11
+ componentId: "sc-176gs3e-0"
12
+ })(["box-sizing:border-box;align-items:center;border-bottom:", ";color:inherit;display:flex;font-family:", ";font-weight:400;min-height:72px;padding:0 24px;width:100%;", " ", " ", ""], props => props.$border ? `1px solid` : `none`, props => props.theme.primaryFontFamily, props => props.theme.themeProp('border-color', props.theme.getColor('gray-800'), props.theme.getColor('gray-200')), props => props.$shadow && props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9'), props => props.disabled && css(["cursor:not-allowed;"]));
29
13
  const BackButtonContainer = styled.a.withConfig({
30
14
  shouldForwardProp
31
- }).attrs(applyDefaultTheme)`
32
- align-items: center;
33
- display: flex;
34
- font-size: 1.125rem;
35
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))};
36
-
37
- ${props => props.disabled && css`
38
- opacity: 0.5;
39
- pointer-events: none;
40
- `}
41
-
42
- &:hover {
43
- cursor: pointer;
44
- }
45
-
46
- > svg {
47
- height: 24px;
48
- margin-right: 16px;
49
- width: 24px;
50
- }
51
- `;
52
- const BackHoverEffect = styled.div`
53
- display: inline-flex;
54
- align-items: center;
55
-
56
- > svg {
57
- height: 24px;
58
- margin-right: 16px;
59
- width: 24px;
60
- transition: transform 0.3s ease-in-out;
61
- }
62
-
63
- &:hover > svg {
64
- transform: translateX(-2px);
65
- }
66
- `;
15
+ }).attrs(applyDefaultTheme).withConfig({
16
+ displayName: "AssetPreviewTopBarstyled__BackButtonContainer",
17
+ componentId: "sc-176gs3e-1"
18
+ })(["align-items:center;display:flex;font-size:1.125rem;", ";", " &:hover{cursor:pointer;}> svg{height:24px;margin-right:16px;width:24px;}"], props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900')), props => props.disabled && css(["opacity:0.5;pointer-events:none;"]));
19
+ const BackHoverEffect = styled.div.withConfig({
20
+ displayName: "AssetPreviewTopBarstyled__BackHoverEffect",
21
+ componentId: "sc-176gs3e-2"
22
+ })(["display:inline-flex;align-items:center;> svg{height:24px;margin-right:16px;width:24px;transition:transform 0.3s ease-in-out;}&:hover > svg{transform:translateX(-2px);}"]);
67
23
  const LeftText = styled.span.withConfig({
68
24
  shouldForwardProp
69
- }).attrs(applyDefaultTheme)`
70
- font-size: 1.125rem;
71
- margin-left: 16px;
72
-
73
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'))};
74
- `;
25
+ }).attrs(applyDefaultTheme).withConfig({
26
+ displayName: "AssetPreviewTopBarstyled__LeftText",
27
+ componentId: "sc-176gs3e-3"
28
+ })(["font-size:1.125rem;margin-left:16px;", ";"], props => props.theme.themeProp('color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400')));
75
29
  const ButtonsContainer = styled.div.withConfig({
76
30
  shouldForwardProp
77
- }).attrs(applyDefaultTheme)`
78
- align-items: center;
79
- display: flex;
80
- margin-left: auto;
81
-
82
- > span {
83
- margin-left: 16px;
84
- }
85
- `;
31
+ }).attrs(applyDefaultTheme).withConfig({
32
+ displayName: "AssetPreviewTopBarstyled__ButtonsContainer",
33
+ componentId: "sc-176gs3e-4"
34
+ })(["align-items:center;display:flex;margin-left:auto;> span{margin-left:16px;}"]);
86
35
 
87
36
  export { AssetPreviewTopBar, BackButtonContainer, BackHoverEffect, ButtonsContainer, LeftText };
88
37
  //# sourceMappingURL=AssetPreviewTopBar.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetPreviewTopBar.styled.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetPreviewTopBar = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n box-sizing: border-box;\n align-items: center;\n border-bottom: ${props => (props.$border ? `1px solid` : `none`)};\n color: inherit;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-weight: 400;\n min-height: 72px;\n padding: 0 24px;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-200')\n )}\n\n ${props =>\n props.$shadow &&\n props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9')}\n\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const BackButtonContainer = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n font-size: 1.125rem;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n }\n`;\n\nexport const BackHoverEffect = styled.div`\n display: inline-flex;\n align-items: center;\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n transition: transform 0.3s ease-in-out;\n }\n\n &:hover > svg {\n transform: translateX(-2px);\n }\n`;\n\nexport const LeftText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.125rem;\n margin-left: 16px;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )};\n`;\n\nexport const ButtonsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n margin-left: auto;\n\n > span {\n margin-left: 16px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetPreviewTopBar","styled","div","withConfig","attrs","applyDefaultTheme","props","$border","theme","primaryFontFamily","themeProp","getColor","$shadow","disabled","css","BackButtonContainer","a","BackHoverEffect","LeftText","span","ButtonsContainer"],"mappings":";;;AAGA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,GAAG,CACzCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA,iBAAmBC,EAAAA,KAAK,IAAKA,KAAK,CAACC,OAAO,GAAG,CAAA,SAAA,CAAW,GAAG,CAAO,IAAA,CAAA,CAAA;AAClE;AACA;AACA,eAAA,EAAiBD,KAAK,IAAIA,KAAK,CAACE,KAAK,CAACC,iBAAiB,CAAA;AACvD;AACA;AACA;AACA;AACA;AACA,EAAIH,EAAAA,KAAK,IACLA,KAAK,CAACE,KAAK,CAACE,S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K,IACLA,KAAK,CAACE,KAAK,CAACE,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CACjC,CAAC,CAAA;AACL,EAAC;AAEM,MAAMS,gBAAgB,GAAGnB,MAAM,CAACC,GAAG,CACvCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"AssetPreviewTopBar.styled.js","sources":["../../../../src/components/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.styled.ts"],"sourcesContent":["// $-prefixed props are transient and never reach the DOM.\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\n/**\n * `disabled` — greys out the back button. Not transient; present in baseline as bare boolean attribute.\n */\ninterface AssetPreviewTopBarDisabledStyleProps {\n disabled?: boolean;\n}\n\n/**\n * Props passed by `AssetPreviewTopBar.tsx` to `<S.AssetPreviewTopBar>`.\n */\nexport interface AssetPreviewTopBarStyleProps extends AssetPreviewTopBarDisabledStyleProps {\n /** Swaps `border-bottom` between `1px solid` and `none`. */\n $border?: boolean;\n /** Shadow; evaluated as `props.$shadow && props.theme.themeProp(…)` to produce valid Interpolation. */\n $shadow?: boolean;\n}\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const AssetPreviewTopBar = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarStyleProps>(applyDefaultTheme)`\n box-sizing: border-box;\n align-items: center;\n border-bottom: ${props => (props.$border ? `1px solid` : `none`)};\n color: inherit;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-weight: 400;\n min-height: 72px;\n padding: 0 24px;\n width: 100%;\n\n ${props =>\n props.theme.themeProp(\n 'border-color',\n props.theme.getColor('gray-800'),\n props.theme.getColor('gray-200')\n )}\n\n ${props =>\n props.$shadow &&\n props.theme.themeProp('box-shadow', '0 -2px 12px #505050', '0 -3px 12px #b0b6b9')}\n\n ${props =>\n props.disabled &&\n css`\n cursor: not-allowed;\n `}\n`;\n\nexport const BackButtonContainer = styled.a\n .withConfig({\n shouldForwardProp\n })\n .attrs<AssetPreviewTopBarDisabledStyleProps>(applyDefaultTheme)`\n align-items: center;\n display: flex;\n font-size: 1.125rem;\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )};\n\n ${props =>\n props.disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n }\n`;\n\nexport const BackHoverEffect = styled.div`\n display: inline-flex;\n align-items: center;\n\n > svg {\n height: 24px;\n margin-right: 16px;\n width: 24px;\n transition: transform 0.3s ease-in-out;\n }\n\n &:hover > svg {\n transform: translateX(-2px);\n }\n`;\n\nexport const LeftText = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-size: 1.125rem;\n margin-left: 16px;\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-400')\n )};\n`;\n\nexport const ButtonsContainer = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n margin-left: auto;\n\n > span {\n margin-left: 16px;\n }\n`;\n"],"names":["shouldForwardProp","prop","startsWith","AssetPreviewTopBar","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","$border","theme","primaryFontFamily","themeProp","getColor","$shadow","disabled","css","BackButtonContainer","a","BackHoverEffect","LeftText","span","Buttons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AAK,IACLA,KAAK,CAACE,KAAK,CAACE,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDL,KAAK,IACLA,KAAK,CAACO,QAAQ,IACdC,GAAG,sCAGF;MAaQG,eAAe,GAAGlB,MAAM,CAACC,GAAG,CAAAC,UAAA,CAAA;EAAAG,WAAA,EAAA,2CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,yKAAA,CAAA;AAgBlC,MAAMa,QAAQ,GAAGnB,MAAM,CAACoB,IAAI,CAChClB,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,oCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,sCAAA,EAAA,GAAA,CAAA,EAIvBC,KAAK,IACLA,KAAK,CAACE,KAAK,CAACE,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACE,KAAK,CAACG,QAAQ,CAAC,UAAU,CACjC,CAAC;AAGE,MAAMS,gBAAgB,GAAGrB,MAAM,CAACC,GAAG,CACvCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,4CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,4EAAA,CAAA;;;;"}
@@ -1,23 +1,24 @@
1
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
2
+ import { useFloatingTree, FloatingTree } from '@floating-ui/react';
4
3
  import { ContextMenu as ContextMenu$1 } from './ContextMenu.styled.js';
4
+ import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
  const ContextMenu = React__default.forwardRef(function ContextMenu({
7
7
  children,
8
8
  ...props
9
9
  }, forwardedRef) {
10
10
  const filteredProps = Object.fromEntries(Object.entries(props).filter(([key]) => key !== 'sublevel'));
11
- return React__default.createElement(ContextMenu$1, _extends({
12
- ref: forwardedRef
13
- }, filteredProps, {
14
- role: "menu"
15
- }), children);
11
+ const hasTree = useFloatingTree() !== null;
12
+ const menu = jsx(ContextMenu$1, {
13
+ ref: forwardedRef,
14
+ ...filteredProps,
15
+ role: "menu",
16
+ children: children
17
+ });
18
+ return hasTree ? menu : jsx(FloatingTree, {
19
+ children: menu
20
+ });
16
21
  });
17
- ContextMenu.propTypes = process.env.NODE_ENV !== "production" ? {
18
- children: PropTypes.any
19
- } : {};
20
- ContextMenu.defaultProps = {};
21
22
 
22
23
  export { ContextMenu as default };
23
24
  //# sourceMappingURL=ContextMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './ContextMenu.styled';\n\n/**\n * This component wraps around an array of `ContextMenuItems` to display a context menu.\n *\n * In most use-cases, the `ContextMenu` will be wrapped in a `Popover` to provide the functionality for opening/closing and placing the menu.\n * In such cases, send the `ContextMenu` to the `Popover` as its `content` prop.\n *\n * The context menu and sublevels will automatically adjust their placement in relation to the element that opens it\n * based on available space if the provided placement doesn't work. See the `Popover` documentation for further instructions on placement.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenu } from '@ntbjs/react-components/widgets'\n * // or\n * import ContextMenu from '@ntbjs/react-components/widgets/ContextMenu'\n * ```\n * \n * ### Usage examples \n * #### Plain context menu\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with grouped items\n * Use the `ContextMenuItemsGroup` component to group menu items together. Grouped items will not show borders\n * between themselves, indicating that their actions are related.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\nconst groupItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-1\" />:\nconst groupItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-2\" />;\nconst groupItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-3\" />;\n\nconst itemGroup1 = <ContextMenuItemsGroup key=\"item-group-1\">{[groupItem1, groupItem2, groupItem3]}</ContextMenuItemsGroup>;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with sublevels\n * Wrap a `ContextMenuItem` in a `Popover` and pass it a `ContextMenu` as child to create a sublevel/submenu. \n * A sublevel will by default be placed adjacent and aligned with the `ContextMenuItem` which opens it,\n * and adjust automatically based on available space.\n * \n * Set the `contextMenu` and `contextMenuSublevel` props of the `Popover` containing the sublevel to `true`.\n * \n * Set the `opensSublevel` prop of the `ContextMenuItem` containing the sublevel to `true`.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} hoverBackgroundColors={['#fbeae6', '#fbeae6']} key=\"item-2\" />;\n\nconst subItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-1\" />\nconst subItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-2\" />\nconst subItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-3\" />\n\nconst itemWithSublevel = (\n <Popover\n content={\n <ContextMenu sublevel={true}>\n {[subItem1, subItem2, subItem3, subItem4, subItem5]}\n </ContextMenu>\n }\n contextMenu={true}\n contextMenuSublevel={true}\n key=\"item-3\"\n >\n <ContextMenuItem title=\"Open level 2\" opensSublevel={true} />\n </Popover>\n);\n\n<Popover content={<ContextMenu {...args}>{[item1, item2, itemWithSublevel]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * \n * #### Context menu from a dropdown button\n * When used with a dropdown button, the `Button` component takes care of wrapping the menu items in a `Popover`.\n * Just pass the array of `ContextMenuItems` directly into the `Button` as its children.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-2\" />;\nconst item3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-3\" />;\n\n<Button onClick={onClickEffect} dropdownItems={<ContextMenu {...args}>{[item1, item2, item3, item4, item5]}</ContextMenu>}>\n Button text\n</Button>\n```\n *\n */\nconst ContextMenu = React.forwardRef(function ContextMenu({ children, ...props }, forwardedRef) {\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'sublevel')\n );\n\n return (\n <S.ContextMenu ref={forwardedRef} {...filteredProps} role=\"menu\">\n {children}\n </S.ContextMenu>\n );\n});\n\nContextMenu.propTypes = {\n /**\n * An array containing nodes of the `ContextMenuItem` component\n */\n children: PropTypes.any\n};\n\nContextMenu.defaultProps = {};\n\nexport default ContextMenu;\n"],"names":["ContextMenu","React","forwardRef","children","props","forwardedRef","filteredProps","Object","fromEntries","entries","filter","key","createElement","S","_extends","ref","role","propTypes","process","env","NODE_ENV","PropTypes","any","defaultProps"],"mappings":";;;;;AA6GMA,MAAAA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,WAAWA,CAAC;EAAEG,QAAQ;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAAEC,YAAY,EAAE;EAC9F,MAAMC,aAAa,GAAGC,MAAM,CAACC,WAAW,CACtCD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAKA,GAAG,KAAK,UAAU,CAC5D,CAAC,CAAA;EAED,OACEV,cAAA,CAAAW,aAAA,CAACC,aAAa,EAAAC,QAAA,CAAA;AAACC,IAAAA,GAAG,EAAEV,YAAAA;AAAa,GAAA,EAAKC,aAAa,EAAA;AAAEU,IAAAA,IAAI,EAAC,MAAA;AAAM,GAAA,CAAA,EAC7Db,QACY,CAAC,CAAA;AAEpB,CAAC,EAAC;AAEFH,WAAW,CAACiB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;EAItBjB,QAAQ,EAAEkB,SAAS,CAACC,GAAAA;AACtB,CAAC,GAAA,EAAA,CAAA;AAEDtB,WAAW,CAACuB,YAAY,GAAG,EAAE;;;;"}
1
+ {"version":3,"file":"ContextMenu.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import React from 'react';\n\nimport { FloatingTree, useFloatingTree } from '@floating-ui/react';\n\nimport * as S from './ContextMenu.styled';\n\ntype ContextMenuOwnProps = {\n /**\n * An array containing nodes of the `ContextMenuItem` component\n */\n children?: any;\n /**\n * Marks this menu as the sublevel/submenu of another context menu. This is a documented public prop that is currently a no-op; removing it is an API break.\n */\n sublevel?: boolean;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<React.ComponentPropsWithoutRef<typeof S.ContextMenu>, keyof ContextMenuOwnProps> &\n ContextMenuOwnProps;\n\n/**\n * This component wraps around an array of `ContextMenuItems` to display a context menu.\n *\n * In most use-cases, the `ContextMenu` will be wrapped in a `Popover` to provide the functionality for opening/closing and placing the menu.\n * In such cases, send the `ContextMenu` to the `Popover` as its `content` prop.\n *\n * The context menu and sublevels will automatically adjust their placement in relation to the element that opens it\n * based on available space if the provided placement doesn't work. See the `Popover` documentation for further instructions on placement.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenu } from '@ntbjs/react-components/widgets'\n * // or\n * import ContextMenu from '@ntbjs/react-components/widgets/ContextMenu'\n * ```\n * \n * ### Usage examples \n * #### Plain context menu\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with grouped items\n * Use the `ContextMenuItemsGroup` component to group menu items together. Grouped items will not show borders\n * between themselves, indicating that their actions are related.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} key=\"item-2\" />;\n\nconst groupItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-1\" />:\nconst groupItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-2\" />;\nconst groupItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"group-item-3\" />;\n\nconst itemGroup1 = <ContextMenuItemsGroup key=\"item-group-1\">{[groupItem1, groupItem2, groupItem3]}</ContextMenuItemsGroup>;\n\n<Popover content={<ContextMenu {...args}>{[item1, itemGroup1, item2]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * #### Context menu with sublevels\n * Wrap a `ContextMenuItem` in a `Popover` and pass it a `ContextMenu` as child to create a sublevel/submenu. \n * A sublevel will by default be placed adjacent and aligned with the `ContextMenuItem` which opens it,\n * and adjust automatically based on available space.\n * \n * Set the `contextMenu` and `contextMenuSublevel` props of the `Popover` containing the sublevel to `true`.\n * \n * Set the `opensSublevel` prop of the `ContextMenuItem` containing the sublevel to `true`.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Download\" onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Delete\" icon={<IconDelete />} onClick={onClickEffect} hoverBackgroundColors={['#fbeae6', '#fbeae6']} key=\"item-2\" />;\n\nconst subItem1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-1\" />\nconst subItem2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-2\" />\nconst subItem3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"sub-item-3\" />\n\nconst itemWithSublevel = (\n <Popover\n content={\n <ContextMenu sublevel={true}>\n {[subItem1, subItem2, subItem3, subItem4, subItem5]}\n </ContextMenu>\n }\n contextMenu={true}\n contextMenuSublevel={true}\n key=\"item-3\"\n >\n <ContextMenuItem title=\"Open level 2\" opensSublevel={true} />\n </Popover>\n);\n\n<Popover content={<ContextMenu {...args}>{[item1, item2, itemWithSublevel]}</ContextMenu>} contextMenu={true}>\n Click here to open\n</Popover>\n```\n * \n * \n * #### Context menu from a dropdown button\n * When used with a dropdown button, the `Button` component takes care of wrapping the menu items in a `Popover`.\n * Just pass the array of `ContextMenuItems` directly into the `Button` as its children.\n * \n * ``` js\n\nconst item1 = <ContextMenuItem title=\"Edit in Mediebank\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-1\" />;\nconst item2 = <ContextMenuItem title=\"Edit in Photoshop\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-2\" />;\nconst item3 = <ContextMenuItem title=\"Edit in Illustrator\" icon={<IconDesignServices />} onClick={onClickEffect} key=\"item-3\" />;\n\n<Button onClick={onClickEffect} dropdownItems={<ContextMenu {...args}>{[item1, item2, item3, item4, item5]}</ContextMenu>}>\n Button text\n</Button>\n```\n *\n */\nconst ContextMenu = React.forwardRef<any, Props>(function ContextMenu(\n { children, ...props },\n forwardedRef\n) {\n const filteredProps = Object.fromEntries(\n Object.entries(props).filter(([key]) => key !== 'sublevel')\n );\n\n // Only root menu creates FloatingTree; submenus reuse ancestor's tree. With 3+ levels it prevents closing submenu children; with 2 levels (all current usage) it's inert.\n const hasTree = useFloatingTree() !== null;\n\n const menu = (\n <S.ContextMenu ref={forwardedRef} {...filteredProps} role=\"menu\">\n {children}\n </S.ContextMenu>\n );\n\n return hasTree ? menu : <FloatingTree>{menu}</FloatingTree>;\n});\n\nexport default ContextMenu;\n"],"names":["ContextMenu","React","forwardRef","children","props","forwardedRef","filteredProps","Object","fromEntries","entries","filter","key","hasTree","useFloatingTree","menu","_jsx","S","ref","role","FloatingTree"],"mappings":";;;;;AA8HA,MAAMA,WAAW,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,WAAWA,CACnE;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;EACA,MAAMC,aAAa,GAAGC,MAAM,CAACC,WAAW,CACtCD,MAAM,CAACE,OAAO,CAACL,KAAK,CAAC,CAACM,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,KAAKA,GAAG,KAAK,UAAU,CAC5D,CAAC;AAGD,EAAA,MAAMC,OAAO,GAAGC,eAAe,EAAE,KAAK,IAAI;AAE1C,EAAA,MAAMC,IAAI,GACRC,GAAA,CAACC,aAAa,EAAA;AAACC,IAAAA,GAAG,EAAEZ,YAAa;AAAA,IAAA,GAAKC,aAAa;AAAEY,IAAAA,IAAI,EAAC,MAAM;AAAAf,IAAAA,QAAA,EAC7DA;AAAQ,GACI,CAChB;AAED,EAAA,OAAOS,OAAO,GAAGE,IAAI,GAAGC,GAAA,CAACI,YAAY,EAAA;AAAAhB,IAAAA,QAAA,EAAEW;AAAI,GAAe,CAAC;AAC7D,CAAC;;;;"}
@@ -6,10 +6,10 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const ContextMenu = styled.div.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- font-family: ${props => props.theme.primaryFontFamily};
11
- padding: 3px 0;
12
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "ContextMenustyled__ContextMenu",
11
+ componentId: "sc-11pdycr-0"
12
+ })(["font-family:", ";padding:3px 0;"], props => props.theme.primaryFontFamily);
13
13
 
14
14
  export { ContextMenu };
15
15
  //# sourceMappingURL=ContextMenu.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenu.styled.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.styled.js"],"sourcesContent":["import styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenu = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n padding: 3px 0;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenu","styled","div","withConfig","attrs","applyDefaultTheme","props","theme","primaryFontFamily"],"mappings":";;;AAGA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B,eAAA,EAAiBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,CAAA;AACvD;AACA;;;;"}
1
+ {"version":3,"file":"ContextMenu.styled.js","sources":["../../../src/components/widgets/ContextMenu/ContextMenu.styled.ts"],"sourcesContent":["// No components read props, so no transient-prop types to declare.\nimport styled from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenu = styled.div\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n font-family: ${props => props.theme.primaryFontFamily};\n padding: 3px 0;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenu","styled","div","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily"],"mappings":";;;AAKA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,WAAW,GAAGC,MAAM,CAACC,GAAG,CAClCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,gCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,EACVC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB;;;;"}
@@ -1,44 +1,36 @@
1
- import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
2
  import { ContextMenuItem as ContextMenuItem$1, IconContainer, Label, SublevelIconContainer } from './ContextMenuItem.styled.js';
5
3
  import { ReactComponent as SvgTriangleRight } from '../../../icons/triangle-right.svg.js';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
5
 
7
6
  const ContextMenuItem = React__default.forwardRef(function ContextMenuItem({
8
7
  title,
9
- icon,
8
+ icon = undefined,
10
9
  onClickEffect,
11
- opensSublevel,
12
- hoverColors,
13
- hoverBackgroundColors,
10
+ opensSublevel = false,
11
+ hoverColors = undefined,
12
+ hoverBackgroundColors = undefined,
14
13
  ...props
15
14
  }, forwardedRef) {
16
- return React__default.createElement(ContextMenuItem$1, _extends({
15
+ return jsxs(ContextMenuItem$1, {
17
16
  ref: forwardedRef,
18
17
  $icon: icon,
19
18
  onClick: onClickEffect,
20
19
  $hoverColors: hoverColors,
21
20
  $hoverBackgroundColors: hoverBackgroundColors,
22
21
  $openssublevel: opensSublevel,
23
- className: opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'
24
- }, props, {
25
- role: "menuitem"
26
- }), icon && React__default.createElement(IconContainer, null, icon), React__default.createElement(Label, null, title), opensSublevel && React__default.createElement(SublevelIconContainer, null, React__default.createElement(SvgTriangleRight, null)));
22
+ className: opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item',
23
+ ...props,
24
+ role: "menuitem",
25
+ children: [icon && jsx(IconContainer, {
26
+ children: icon
27
+ }), jsx(Label, {
28
+ children: title
29
+ }), opensSublevel && jsx(SublevelIconContainer, {
30
+ children: jsx(SvgTriangleRight, {})
31
+ })]
32
+ });
27
33
  });
28
- ContextMenuItem.propTypes = process.env.NODE_ENV !== "production" ? {
29
- title: PropTypes.string.isRequired,
30
- icon: PropTypes.element,
31
- onClickEffect: PropTypes.func,
32
- opensSublevel: PropTypes.bool,
33
- hoverColors: PropTypes.arrayOf(PropTypes.string),
34
- hoverBackgroundColors: PropTypes.arrayOf(PropTypes.string)
35
- } : {};
36
- ContextMenuItem.defaultProps = {
37
- icon: undefined,
38
- hoverColors: undefined,
39
- hoverBackgroundColors: undefined,
40
- opensSublevel: false
41
- };
42
34
 
43
35
  export { ContextMenuItem as default };
44
36
  //# sourceMappingURL=ContextMenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItem.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './ContextMenuItem.styled';\n\nimport { ReactComponent as TriangleRightIcon } from '../../../../icons/triangle-right.svg';\n\n/**\n * Single context menu item.\n *\n * See the documentation for `ContextMenu` for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItem } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItem from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItem'\n * ```\n */\nconst ContextMenuItem = React.forwardRef(function ContextMenuItem(\n { title, icon, onClickEffect, opensSublevel, hoverColors, hoverBackgroundColors, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItem\n ref={forwardedRef}\n $icon={icon}\n onClick={onClickEffect}\n $hoverColors={hoverColors}\n $hoverBackgroundColors={hoverBackgroundColors}\n $openssublevel={opensSublevel}\n className={opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'}\n {...props}\n role=\"menuitem\"\n >\n {icon && <S.IconContainer>{icon}</S.IconContainer>}\n <S.Label>{title}</S.Label>\n {opensSublevel && (\n <S.SublevelIconContainer>\n <TriangleRightIcon />\n </S.SublevelIconContainer>\n )}\n </S.ContextMenuItem>\n );\n});\n\nContextMenuItem.propTypes = {\n /**\n * Menu item text\n */\n title: PropTypes.string.isRequired,\n\n /**\n * Optional icon (left side)\n */\n icon: PropTypes.element,\n\n /**\n * Function to trigger when the item is clicked\n */\n onClickEffect: PropTypes.func,\n\n /**\n * Whether the `ContextMenuItem` opens another `ContextMenu`\n */\n opensSublevel: PropTypes.bool,\n\n /**\n * Array of custom hover text/icon color in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverColors: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * Array of custom hover background colors in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverBackgroundColors: PropTypes.arrayOf(PropTypes.string)\n};\n\nContextMenuItem.defaultProps = {\n icon: undefined,\n hoverColors: undefined,\n hoverBackgroundColors: undefined,\n opensSublevel: false\n};\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","React","forwardRef","title","icon","onClickEffect","opensSublevel","hoverColors","hoverBackgroundColors","props","forwardedRef","createElement","S","_extends","ref","$icon","onClick","$hoverColors","$hoverBackgroundColors","$openssublevel","className","role","TriangleRightIcon","propTypes","process","env","NODE_ENV","PropTypes","string","isRequired","element","func","bool","arrayOf","defaultProps","undefined"],"mappings":";;;;;;AAmBMA,MAAAA,eAAe,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,eAAeA,CAC/D;EAAEG,KAAK;EAAEC,IAAI;EAAEC,aAAa;EAAEC,aAAa;EAAEC,WAAW;EAAEC,qBAAqB;EAAE,GAAGC,KAAAA;AAAM,CAAC,EAC3FC,YAAY,EACZ;EACA,OACET,cAAA,CAAAU,aAAA,CAACC,iBAAiB,EAAAC,QAAA,CAAA;AAChBC,IAAAA,GAAG,EAAEJ,YAAa;AAClBK,IAAAA,KAAK,EAAEX,IAAK;AACZY,IAAAA,OAAO,EAAEX,aAAc;AACvBY,IAAAA,YAAY,EAAEV,WAAY;AAC1BW,IAAAA,sBAAsB,EAAEV,qBAAsB;AAC9CW,IAAAA,cAAc,EAAEb,aAAc;AAC9Bc,IAAAA,SAAS,EAAEd,aAAa,GAAG,kCAAkC,GAAG,mBAAA;AAAoB,GAAA,EAChFG,KAAK,EAAA;AACTY,IAAAA,IAAI,EAAC,UAAA;AAAU,GAAA,CAAA,EAEdjB,IAAI,IAAIH,cAAA,CAAAU,aAAA,CAACC,aAAe,QAAER,IAAsB,CAAC,EAClDH,cAAA,CAAAU,aAAA,CAACC,KAAO,EAAA,IAAA,EAAET,KAAe,CAAC,EACzBG,aAAa,IACZL,cAAA,CAAAU,aAAA,CAACC,qBAAuB,EACtBX,IAAAA,EAAAA,cAAA,CAAAU,aAAA,CAACW,gBAAiB,EAAE,IAAA,CACG,CAEV,CAAC,CAAA;AAExB,CAAC,EAAC;AAEFtB,eAAe,CAACuB,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAI1BvB,EAAAA,KAAK,EAAEwB,SAAS,CAACC,MAAM,CAACC,UAAU;EAKlCzB,IAAI,EAAEuB,SAAS,CAACG,OAAO;EAKvBzB,aAAa,EAAEsB,SAAS,CAACI,IAAI;EAK7BzB,aAAa,EAAEqB,SAAS,CAACK,IAAI;EAM7BzB,WAAW,EAAEoB,SAAS,CAACM,OAAO,CAACN,SAAS,CAACC,MAAM,CAAC;AAMhDpB,EAAAA,qBAAqB,EAAEmB,SAAS,CAACM,OAAO,CAACN,SAAS,CAACC,MAAM,CAAA;AAC3D,CAAC,GAAA,EAAA,CAAA;AAED5B,eAAe,CAACkC,YAAY,GAAG;AAC7B9B,EAAAA,IAAI,EAAE+B,SAAS;AACf5B,EAAAA,WAAW,EAAE4B,SAAS;AACtB3B,EAAAA,qBAAqB,EAAE2B,SAAS;AAChC7B,EAAAA,aAAa,EAAE,KAAA;AACjB,CAAC;;;;"}
1
+ {"version":3,"file":"ContextMenuItem.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItem.styled';\n\nimport { ReactComponent as TriangleRightIcon } from '../../../../icons/triangle-right.svg';\n\ntype ContextMenuItemOwnProps = {\n /**\n * Menu item text\n */\n title: string;\n /**\n * Optional icon (left side)\n */\n icon?: React.ReactElement<any>;\n /**\n * Function to trigger when the item is clicked\n */\n onClickEffect?: (...args: any[]) => any;\n /**\n * Whether the `ContextMenuItem` opens another `ContextMenu`\n */\n opensSublevel?: boolean;\n /**\n * Array of custom hover text/icon color in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverColors?: string[];\n /**\n * Array of custom hover background colors in the form of hex-strings (e.g. `'#FFFFFF'`).\n * Must contain two colors, where the first is for dark-mode and the second is for light-mode.\n */\n hoverBackgroundColors?: string[];\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItem>,\n keyof ContextMenuItemOwnProps\n> &\n ContextMenuItemOwnProps;\n\n/**\n * Single context menu item.\n *\n * See the documentation for `ContextMenu` for usage examples.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItem } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItem from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItem'\n * ```\n */\nconst ContextMenuItem = React.forwardRef<any, Props>(function ContextMenuItem(\n {\n title,\n icon = undefined,\n onClickEffect,\n opensSublevel = false,\n hoverColors = undefined,\n hoverBackgroundColors = undefined,\n ...props\n },\n forwardedRef\n) {\n return (\n <S.ContextMenuItem\n ref={forwardedRef}\n $icon={icon}\n onClick={onClickEffect}\n $hoverColors={hoverColors}\n $hoverBackgroundColors={hoverBackgroundColors}\n $openssublevel={opensSublevel}\n className={opensSublevel ? 'context-menu-item opens-sublevel' : 'context-menu-item'}\n {...props}\n role=\"menuitem\"\n >\n {icon && <S.IconContainer>{icon}</S.IconContainer>}\n <S.Label>{title}</S.Label>\n {opensSublevel && (\n <S.SublevelIconContainer>\n <TriangleRightIcon />\n </S.SublevelIconContainer>\n )}\n </S.ContextMenuItem>\n );\n});\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","React","forwardRef","title","icon","undefined","onClickEffect","opensSublevel","hoverColors","hoverBackgroundColors","props","forwardedRef","_jsxs","S","ref","$icon","onClick","$hoverColors","$hoverBackgroundColors","$openssublevel","className","role","children","_jsx","TriangleRightIcon"],"mappings":";;;;;AAsDA,MAAMA,eAAe,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,eAAeA,CAC3E;EACEG,KAAK;AACLC,EAAAA,IAAI,GAAGC,SAAS;EAChBC,aAAa;AACbC,EAAAA,aAAa,GAAG,KAAK;AACrBC,EAAAA,WAAW,GAAGH,SAAS;AACvBI,EAAAA,qBAAqB,GAAGJ,SAAS;EACjC,GAAGK;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,OACEC,IAAA,CAACC,iBAAiB,EAAA;AAChBC,IAAAA,GAAG,EAAEH,YAAa;AAClBI,IAAAA,KAAK,EAAEX,IAAK;AACZY,IAAAA,OAAO,EAAEV,aAAc;AACvBW,IAAAA,YAAY,EAAET,WAAY;AAC1BU,IAAAA,sBAAsB,EAAET,qBAAsB;AAC9CU,IAAAA,cAAc,EAAEZ,aAAc;AAC9Ba,IAAAA,SAAS,EAAEb,aAAa,GAAG,kCAAkC,GAAG,mBAAoB;AAAA,IAAA,GAChFG,KAAK;AACTW,IAAAA,IAAI,EAAC,UAAU;AAAAC,IAAAA,QAAA,GAEdlB,IAAI,IAAImB,GAAA,CAACV,aAAe,EAAA;AAAAS,MAAAA,QAAA,EAAElB;AAAI,KAAkB,CAAC,EAClDmB,GAAA,CAACV,KAAO,EAAA;AAAAS,MAAAA,QAAA,EAAEnB;KAAe,CAAC,EACzBI,aAAa,IACZgB,GAAA,CAACV,qBAAuB,EAAA;AAAAS,MAAAA,QAAA,EACtBC,GAAA,CAACC,gBAAiB,EAAA,EAAE;AAAC,KACE,CAC1B;AAAA,GACgB,CAAC;AAExB,CAAC;;;;"}
@@ -6,81 +6,26 @@ const shouldForwardProp = prop => {
6
6
  };
7
7
  const ContextMenuItem = styled.span.withConfig({
8
8
  shouldForwardProp
9
- }).attrs(applyDefaultTheme)`
10
- align-items: center;
11
- cursor: pointer;
12
- display: flex;
13
- font-family: ${props => props.theme.primaryFontFamily};
14
- font-size: 0.875rem;
15
- font-weight: normal;
16
- height: 31px;
17
- min-width: 160px;
18
- padding: ${props => props.$openssublevel ? '0 8px' : '0 28px 0 8px'};
19
-
20
- ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700'))}
21
-
22
- ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}
23
-
24
- ${props => !props.$icon && css`
25
- padding-left: 28px;
26
- `}
27
-
28
-
29
- :last-of-type {
30
- height: 32px;
31
- }
32
-
33
- &:hover {
34
- cursor: pointer;
35
-
36
- ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200'))}
37
- }
38
-
39
- ${props => props.$openssublevelhoverColors && props.$hoverColors[0] && props.$hoverColors[1] && css`
40
- &&:hover {
41
- ${props => props.theme.themeProp('color', props.hoverColors[0], props.hoverColors[1])}
42
- }
43
- `}
44
-
45
- ${props => props.$hoverBackgroundColors && props.$hoverBackgroundColors[0] && props.$hoverBackgroundColors[1] && css`
46
- &&:hover {
47
- ${props => props.theme.themeProp('background-color', props.$hoverBackgroundColors[0], props.$hoverBackgroundColors[1])}
48
- }
49
- `}
50
- `;
9
+ }).attrs(applyDefaultTheme).withConfig({
10
+ displayName: "ContextMenuItemstyled__ContextMenuItem",
11
+ componentId: "sc-8s6zvg-0"
12
+ })(["align-items:center;cursor:pointer;display:flex;font-family:", ";font-size:0.875rem;font-weight:normal;height:31px;min-width:160px;padding:", ";", " ", " ", " :last-of-type{height:32px;}&:hover{cursor:pointer;", "}", " ", ""], props => props.theme.primaryFontFamily, props => props.$openssublevel ? '0 8px' : '0 28px 0 8px', props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-700')), props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE'), props => !props.$icon && css(["padding-left:28px;"]), props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-200')), props => props.$hoverColors && props.$hoverColors[0] && props.$hoverColors[1] && css(["&&:hover{", "}"], props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])), props => props.$hoverBackgroundColors && props.$hoverBackgroundColors[0] && props.$hoverBackgroundColors[1] && css(["&&:hover{", "}"], props => props.theme.themeProp('background-color', props.$hoverBackgroundColors[0], props.$hoverBackgroundColors[1])));
51
13
  const IconContainer = styled.span.withConfig({
52
14
  shouldForwardProp
53
- }).attrs(applyDefaultTheme)`
54
- align-items: center;
55
- display: flex;
56
- height: fit-content;
57
- max-width: 12px;
58
- margin-right: 8px;
59
-
60
- svg {
61
- height: 12px;
62
- }
63
- `;
15
+ }).attrs(applyDefaultTheme).withConfig({
16
+ displayName: "ContextMenuItemstyled__IconContainer",
17
+ componentId: "sc-8s6zvg-1"
18
+ })(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-right:8px;svg{height:12px;}"]);
64
19
  const SublevelIconContainer = styled.span.withConfig({
65
20
  shouldForwardProp
66
- }).attrs(applyDefaultTheme)`
67
- align-items: center;
68
- display: flex;
69
- height: fit-content;
70
- max-width: 12px;
71
- margin-left: auto;
72
- margin-right: 8px;
73
- padding-left: 24px;
74
-
75
- svg {
76
- height: 6px;
77
- width: 6px;
78
- }
79
- `;
80
- const Label = styled.span`
81
- align-items: center;
82
- display: flex;
83
- `;
21
+ }).attrs(applyDefaultTheme).withConfig({
22
+ displayName: "ContextMenuItemstyled__SublevelIconContainer",
23
+ componentId: "sc-8s6zvg-2"
24
+ })(["align-items:center;display:flex;height:fit-content;max-width:12px;margin-left:auto;margin-right:8px;padding-left:24px;svg{height:6px;width:6px;}"]);
25
+ const Label = styled.span.withConfig({
26
+ displayName: "ContextMenuItemstyled__Label",
27
+ componentId: "sc-8s6zvg-3"
28
+ })(["align-items:center;display:flex;"]);
84
29
 
85
30
  export { ContextMenuItem, IconContainer, Label, SublevelIconContainer };
86
31
  //# sourceMappingURL=ContextMenuItem.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItem.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nconst shouldForwardProp = prop => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItem = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n font-weight: normal;\n height: 31px;\n min-width: 160px;\n padding: ${props => (props.$openssublevel ? '0 8px' : '0 28px 0 8px')};\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n\n ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}\n\n ${props =>\n !props.$icon &&\n css`\n padding-left: 28px;\n `}\n\n\n :last-of-type {\n height: 32px;\n }\n\n &:hover {\n cursor: pointer;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-200')\n )}\n }\n\n ${props =>\n props.$openssublevelhoverColors &&\n props.$hoverColors[0] &&\n props.$hoverColors[1] &&\n css`\n &&:hover {\n ${props => props.theme.themeProp('color', props.hoverColors[0], props.hoverColors[1])}\n }\n `}\n\n ${props =>\n props.$hoverBackgroundColors &&\n props.$hoverBackgroundColors[0] &&\n props.$hoverBackgroundColors[1] &&\n css`\n &&:hover {\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.$hoverBackgroundColors[0],\n props.$hoverBackgroundColors[1]\n )}\n }\n `}\n`;\n\nexport const IconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-right: 8px;\n\n svg {\n height: 12px;\n }\n`;\n\nexport const SublevelIconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-left: auto;\n margin-right: 8px;\n padding-left: 24px;\n\n svg {\n height: 6px;\n width: 6px;\n }\n`;\n\nexport const Label = styled.span`\n align-items: center;\n display: flex;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItem","styled","span","withConfig","attrs","applyDefaultTheme","props","theme","primaryFontFamily","$openssublevel","themeProp","getColor","$icon","css","$openssublevelhoverColors","$hoverColors","hoverColors","$hoverBackgroundColors","IconContainer","SublevelIconContainer","Label"],"mappings":";;;AAGA,MAAMA,iBAAiB,GAAGC,IAAI,IAAI;EAChC,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAEM,MAAMC,eAAe,GAAGC,MAAM,CAACC,IAAI,CACvCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA,eAAA,EAAiBC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,CAAA;AACvD;AACA;AACA;AACA;AACA,WAAaF,EAAAA,KAAK,IAAKA,KAAK,CAACG,cAAc,GAAG,OAAO,GAAG,cAAe,CAAA;AACvE;AACA,EAAIH,EAAAA,KAAK,IACLA,KAAK,CAACC,KAAK,CAACG,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,C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AAsB,CAAC,CAAC,CAChC,CAAC,CAAA;AACX;AACA,IAAK,CAAA,CAAA;AACL,EAAC;AAEM,MAAMC,aAAa,GAAGjB,MAAM,CAACC,IAAI,CACrCC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AAEM,MAAMc,qBAAqB,GAAGlB,MAAM,CAACC,IAAI,CAC7CC,UAAU,CAAC;AACVN,EAAAA,iBAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AAEYe,MAAAA,KAAK,GAAGnB,MAAM,CAACC,IAAI,CAAA;AAChC;AACA;AACA;;;;"}
1
+ {"version":3,"file":"ContextMenuItem.styled.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItem/ContextMenuItem.styled.ts"],"sourcesContent":["// Fixed defect: guard and rule both now read $hoverColors (was run-together $openssublevelhoverColors and props.hoverColors).\nimport styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../../utils/defaultTheme';\n\nimport type { ReactElement } from 'react';\n\n/**\n * Props passed by `ContextMenuItem.tsx` to `<S.ContextMenuItem>`.\n */\nexport interface ContextMenuItemStyleProps {\n /** React element, read for presence only. */\n $icon?: ReactElement<any>;\n /** Selects right-hand padding (sublevel items have their own chevron). */\n $openssublevel?: boolean;\n /** `[darkModeColor, lightModeColor]` hex strings. */\n $hoverColors?: string[];\n /** Same shape as `$hoverColors`. */\n $hoverBackgroundColors?: string[];\n}\n\n// Single-argument to stay compatible with styled-components v5.1 and v6. Annotation required despite noImplicitAny being off.\nconst shouldForwardProp = (prop: string): boolean => {\n return prop !== 'theme' && !prop.startsWith('$');\n};\n\nexport const ContextMenuItem = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs<ContextMenuItemStyleProps>(applyDefaultTheme)`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 0.875rem;\n font-weight: normal;\n height: 31px;\n min-width: 160px;\n padding: ${props => (props.$openssublevel ? '0 8px' : '0 28px 0 8px')};\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-700')\n )}\n\n ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-700'), '#FEFEFE')}\n\n ${props =>\n !props.$icon &&\n css`\n padding-left: 28px;\n `}\n\n\n :last-of-type {\n height: 32px;\n }\n\n &:hover {\n cursor: pointer;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-200')\n )}\n }\n\n ${props =>\n props.$hoverColors &&\n props.$hoverColors[0] &&\n props.$hoverColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverColors'>>`\n &&:hover {\n ${props => props.theme.themeProp('color', props.$hoverColors[0], props.$hoverColors[1])}\n }\n `}\n\n ${props =>\n props.$hoverBackgroundColors &&\n props.$hoverBackgroundColors[0] &&\n props.$hoverBackgroundColors[1] &&\n css<Pick<ContextMenuItemStyleProps, '$hoverBackgroundColors'>>`\n &&:hover {\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.$hoverBackgroundColors[0],\n props.$hoverBackgroundColors[1]\n )}\n }\n `}\n`;\n\nexport const IconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-right: 8px;\n\n svg {\n height: 12px;\n }\n`;\n\nexport const SublevelIconContainer = styled.span\n .withConfig({\n shouldForwardProp\n })\n .attrs(applyDefaultTheme)`\n align-items: center;\n display: flex;\n height: fit-content;\n max-width: 12px;\n margin-left: auto;\n margin-right: 8px;\n padding-left: 24px;\n\n svg {\n height: 6px;\n width: 6px;\n }\n`;\n\nexport const Label = styled.span`\n align-items: center;\n display: flex;\n`;\n"],"names":["shouldForwardProp","prop","startsWith","ContextMenuItem","styled","span","withConfig","attrs","applyDefaultTheme","displayName","componentId","props","theme","primaryFontFamily","$openssublevel","themeProp","getColor","$icon","css","$hoverColors","$hoverBackgroundColors","IconContainer","SublevelIconContainer","Label"],"mappings":";;;AAqBA,MAAMA,iBAAiB,GAAIC,IAAY,IAAc;EACnD,OAAOA,IAAI,KAAK,OAAO,IAAI,CAACA,IAAI,CAACC,UAAU,CAAC,GAAG,CAAC;AAClD,CAAC;AAEM,MAAMC,eAAe,GAAGC,MAAM,CAACC,IAAI,CACvCC,UAAU,CAAC;AACVN,EAAAA;AACF,CAAC,CAAC,CACDO,KAAK,CAA4BC,iBAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,wCAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,6DAAA,EAAA,6EAAA,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA,qDAAA,EAAA,GAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAIrCC,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACC,iBAAiB,EAK1CF,KAAK,IAAKA,KAAK,CAACG,cAAc,GAAG,OAAO,GAAG,cAAe,EAEnEH,KAAK,IACLA,KAAK,CAACC,KAAK,CAACG,SAAS,CACnB,OAAO,EACPJ,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAChCL,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CACjC,CAAC,EAEDL,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACG,SAAS,CAAC,kBAAkB,EAAEJ,KAAK,CAACC,KAAK,CAACI,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,EAE/FL,KAAK,IACL,CAACA,KAAK,CAACM,KAAK,IACZC,GAAG,CAAA,CAAA,oBAAA,CAAA,CAEF,EA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BAAiB,CAAC,CAAAF,UAAA,CAAA;EAAAG,WAAA,EAAA,8CAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kJAAA,CAAA;MAeda,KAAK,GAAGnB,MAAM,CAACC,IAAI,CAAAC,UAAA,CAAA;EAAAG,WAAA,EAAA,8BAAA;EAAAC,WAAA,EAAA;AAAA,CAAA,CAAA,CAAA,CAAA,kCAAA,CAAA;;;;"}
@@ -1,22 +1,18 @@
1
- import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React__default from 'react';
3
- import PropTypes from 'prop-types';
4
2
  import { ContextMenuItemsGroup as ContextMenuItemsGroup$1 } from './ContextMenuItemsGroup.styled.js';
3
+ import { jsx } from 'react/jsx-runtime';
5
4
 
6
5
  const ContextMenuItemsGroup = React__default.forwardRef(function ContextMenuItemsGroup({
7
6
  children,
8
7
  ...props
9
8
  }, forwardedRef) {
10
- return React__default.createElement(ContextMenuItemsGroup$1, _extends({
11
- ref: forwardedRef
12
- }, props, {
13
- role: "group"
14
- }), children);
9
+ return jsx(ContextMenuItemsGroup$1, {
10
+ ref: forwardedRef,
11
+ ...props,
12
+ role: "group",
13
+ children: children
14
+ });
15
15
  });
16
- ContextMenuItemsGroup.propTypes = process.env.NODE_ENV !== "production" ? {
17
- children: PropTypes.arrayOf(PropTypes.node)
18
- } : {};
19
- ContextMenuItemsGroup.defaultProps = {};
20
16
 
21
17
  export { ContextMenuItemsGroup as default };
22
18
  //# sourceMappingURL=ContextMenuItemsGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport * as S from './ContextMenuItemsGroup.styled';\n\n/**\n * Simple wrapper for a group of context menu items. These will be displayed without a border between each item.\n *\n * See the documentation for `ContextMenu` for an example.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItemsGroup } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItemsGroup from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItemsGroup'\n * ```\n *\n */\nconst ContextMenuItemsGroup = React.forwardRef(function ContextMenuItemsGroup(\n { children, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItemsGroup ref={forwardedRef} {...props} role=\"group\">\n {children}\n </S.ContextMenuItemsGroup>\n );\n});\n\nContextMenuItemsGroup.propTypes = {\n /**\n * An array containing nodes of the `ContextMenuItem` component\n */\n children: PropTypes.arrayOf(PropTypes.node)\n};\n\nContextMenuItemsGroup.defaultProps = {};\n\nexport default ContextMenuItemsGroup;\n"],"names":["ContextMenuItemsGroup","React","forwardRef","children","props","forwardedRef","createElement","S","_extends","ref","role","propTypes","process","env","NODE_ENV","PropTypes","arrayOf","node","defaultProps"],"mappings":";;;;;AAkBMA,MAAAA,qBAAqB,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,qBAAqBA,CAC3E;EAAEG,QAAQ;EAAE,GAAGC,KAAAA;AAAM,CAAC,EACtBC,YAAY,EACZ;EACA,OACEJ,cAAA,CAAAK,aAAA,CAACC,uBAAuB,EAAAC,QAAA,CAAA;AAACC,IAAAA,GAAG,EAAEJ,YAAAA;AAAa,GAAA,EAAKD,KAAK,EAAA;AAAEM,IAAAA,IAAI,EAAC,OAAA;AAAO,GAAA,CAAA,EAChEP,QACsB,CAAC,CAAA;AAE9B,CAAC,EAAC;AAEFH,qBAAqB,CAACW,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAG,YAAA,GAAA;AAIhCX,EAAAA,QAAQ,EAAEY,SAAS,CAACC,OAAO,CAACD,SAAS,CAACE,IAAI,CAAA;AAC5C,CAAC,GAAA,EAAA,CAAA;AAEDjB,qBAAqB,CAACkB,YAAY,GAAG,EAAE;;;;"}
1
+ {"version":3,"file":"ContextMenuItemsGroup.js","sources":["../../../../src/components/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.tsx"],"sourcesContent":["import React from 'react';\nimport * as S from './ContextMenuItemsGroup.styled';\n\ntype ContextMenuItemsGroupOwnProps = {\n /**\n * Nodes of the `ContextMenuItem` component — one, or an array.\n */\n children?: React.ReactNode;\n};\n\n// Omit before & — a bare intersection narrows colliding props instead of overriding them.\ntype Props = Omit<\n React.ComponentPropsWithoutRef<typeof S.ContextMenuItemsGroup>,\n keyof ContextMenuItemsGroupOwnProps\n> &\n ContextMenuItemsGroupOwnProps;\n\n/**\n * Simple wrapper for a group of context menu items. These will be displayed without a border between each item.\n *\n * See the documentation for `ContextMenu` for an example.\n *\n * ### Import\n *\n * ``` js\n * import { ContextMenuItemsGroup } from '@ntbjs/react-components/widgets/ContextMenu'\n * // or\n * import ContextMenuItemsGroup from '@ntbjs/react-components/widgets/ContextMenu/ContextMenuItemsGroup'\n * ```\n *\n */\nconst ContextMenuItemsGroup = React.forwardRef<any, Props>(function ContextMenuItemsGroup(\n { children, ...props },\n forwardedRef\n) {\n return (\n <S.ContextMenuItemsGroup ref={forwardedRef} {...props} role=\"group\">\n {children}\n </S.ContextMenuItemsGroup>\n );\n});\n\nexport default ContextMenuItemsGroup;\n"],"names":["ContextMenuItemsGroup","React","forwardRef","children","props","forwardedRef","_jsx","S","ref","role"],"mappings":";;;;AA+BA,MAAMA,qBAAqB,GAAGC,cAAK,CAACC,UAAU,CAAa,SAASF,qBAAqBA,CACvF;EAAEG,QAAQ;EAAE,GAAGC;AAAM,CAAC,EACtBC,YAAY,EACZ;AACA,EAAA,OACEC,GAAA,CAACC,uBAAuB,EAAA;AAACC,IAAAA,GAAG,EAAEH,YAAa;AAAA,IAAA,GAAKD,KAAK;AAAEK,IAAAA,IAAI,EAAC,OAAO;AAAAN,IAAAA,QAAA,EAChEA;AAAQ,GACc,CAAC;AAE9B,CAAC;;;;"}