@redocly/theme 0.56.0-rc.2 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/lib/components/Breadcrumbs/Breadcrumbs.js +1 -1
  2. package/lib/components/Button/Button.d.ts +1 -1
  3. package/lib/components/Button/Button.js +3 -1
  4. package/lib/components/Button/ButtonGroup.d.ts +12 -0
  5. package/lib/components/Button/ButtonGroup.js +38 -0
  6. package/lib/components/Button/variables.js +32 -5
  7. package/lib/components/Catalog/Catalog.d.ts +1 -1
  8. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +11 -6
  9. package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +5 -1
  10. package/lib/components/Catalog/CatalogEntitiesEmptyState.js +25 -4
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -13
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +4 -2
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +6 -6
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +18 -1
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +6 -0
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +47 -0
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +8 -1
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +2 -1
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +12 -5
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +1 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +1 -1
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -1
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -1
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +4 -10
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +3 -1
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +2 -6
  34. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -2
  35. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +5 -5
  36. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +3 -3
  37. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
  38. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
  39. package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
  40. package/lib/components/Catalog/CatalogEntityIcon.js +22 -29
  41. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
  42. package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
  43. package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
  44. package/lib/components/Catalog/CatalogEntityTypeTag.js +40 -0
  45. package/lib/components/Catalog/CatalogPageDescription.js +3 -3
  46. package/lib/components/Catalog/CatalogSelector.d.ts +1 -1
  47. package/lib/components/Catalog/CatalogSelector.js +4 -3
  48. package/lib/components/Catalog/CatalogSortButton.js +6 -6
  49. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +1 -0
  50. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +3 -15
  51. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +1 -0
  52. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
  53. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +1 -5
  54. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +3 -3
  55. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +5 -32
  56. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
  57. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +12 -37
  58. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +1 -0
  59. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +8 -4
  60. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
  61. package/lib/components/Catalog/CatalogTagsWithTooltip.js +4 -4
  62. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
  63. package/lib/components/Catalog/variables.js +42 -8
  64. package/lib/components/CodeBlock/CodeBlock.d.ts +16 -6
  65. package/lib/components/CodeBlock/CodeBlock.js +3 -2
  66. package/lib/components/CodeBlock/CodeBlockControls.d.ts +4 -3
  67. package/lib/components/CodeBlock/CodeBlockControls.js +35 -8
  68. package/lib/components/CodeBlock/CodeBlockDropdown.d.ts +3 -0
  69. package/lib/components/CodeBlock/CodeBlockDropdown.js +35 -0
  70. package/lib/components/CodeBlock/CodeBlockTabs.d.ts +2 -2
  71. package/lib/components/CodeBlock/CodeBlockTabs.js +18 -9
  72. package/lib/components/CodeBlock/variables.js +1 -1
  73. package/lib/components/Dropdown/Dropdown.js +1 -0
  74. package/lib/components/Dropdown/DropdownMenu.js +4 -0
  75. package/lib/components/Dropdown/variables.js +1 -0
  76. package/lib/components/Feedback/Feedback.js +1 -1
  77. package/lib/components/Filter/FilterCheckboxes.js +5 -2
  78. package/lib/components/Footer/FooterItem.js +4 -7
  79. package/lib/components/Footer/variables.js +2 -2
  80. package/lib/components/Image/Image.js +2 -0
  81. package/lib/components/Markdown/Markdown.js +9 -9
  82. package/lib/components/Markdown/styles/headingAnchor.js +0 -1
  83. package/lib/components/Menu/MenuItem.js +5 -5
  84. package/lib/components/Menu/variables.js +3 -1
  85. package/lib/components/Navbar/NavbarItem.js +8 -39
  86. package/lib/components/Navbar/variables.js +2 -2
  87. package/lib/components/PageActions/PageActions.d.ts +6 -0
  88. package/lib/components/PageActions/PageActions.js +104 -0
  89. package/lib/components/PageActions/PageActionsMenuItem.d.ts +7 -0
  90. package/lib/components/PageActions/PageActionsMenuItem.js +58 -0
  91. package/lib/components/PageActions/variables.d.ts +1 -0
  92. package/lib/components/PageActions/variables.dark.d.ts +1 -0
  93. package/lib/components/PageActions/variables.dark.js +9 -0
  94. package/lib/components/PageActions/variables.js +37 -0
  95. package/lib/components/Search/SearchDialog.js +2 -2
  96. package/lib/components/Select/variables.js +2 -2
  97. package/lib/components/TableOfContent/TableOfContent.js +15 -12
  98. package/lib/components/Tag/Tag.d.ts +2 -1
  99. package/lib/components/Tag/Tag.js +3 -3
  100. package/lib/components/Tag/variables.js +14 -0
  101. package/lib/core/constants/catalog.d.ts +1 -1
  102. package/lib/core/constants/common.d.ts +4 -0
  103. package/lib/core/constants/common.js +5 -1
  104. package/lib/core/contexts/CodeSnippetContext.d.ts +7 -0
  105. package/lib/core/contexts/CodeSnippetContext.js +23 -0
  106. package/lib/core/contexts/index.d.ts +1 -0
  107. package/lib/core/contexts/index.js +1 -0
  108. package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
  109. package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
  110. package/lib/core/hooks/code-walkthrough/use-renderable-files.d.ts +1 -2
  111. package/lib/core/hooks/code-walkthrough/use-renderable-files.js +2 -2
  112. package/lib/core/hooks/index.d.ts +1 -0
  113. package/lib/core/hooks/index.js +1 -0
  114. package/lib/core/hooks/use-active-heading.d.ts +7 -2
  115. package/lib/core/hooks/use-active-heading.js +160 -23
  116. package/lib/core/hooks/use-active-section-id.d.ts +1 -1
  117. package/lib/core/hooks/use-active-section-id.js +2 -2
  118. package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +2 -2
  119. package/lib/core/hooks/use-codeblock-tabs-controls.js +6 -6
  120. package/lib/core/hooks/use-local-state.d.ts +1 -0
  121. package/lib/core/hooks/use-local-state.js +32 -0
  122. package/lib/core/hooks/use-page-actions.d.ts +2 -0
  123. package/lib/core/hooks/use-page-actions.js +101 -0
  124. package/lib/core/hooks/use-theme-hooks.js +2 -0
  125. package/lib/core/styles/dark.js +2 -0
  126. package/lib/core/styles/global.js +2 -0
  127. package/lib/core/types/catalog.d.ts +5 -1
  128. package/lib/core/types/hooks.d.ts +2 -1
  129. package/lib/core/types/index.d.ts +1 -0
  130. package/lib/core/types/index.js +1 -0
  131. package/lib/core/types/l10n.d.ts +1 -1
  132. package/lib/core/types/page-actions.d.ts +15 -0
  133. package/lib/core/types/page-actions.js +3 -0
  134. package/lib/core/types/sidebar.d.ts +1 -0
  135. package/lib/core/types/telemetry.d.ts +5 -20
  136. package/lib/core/utils/download-code-walkthrough.js +27 -7
  137. package/lib/core/utils/enhanced-smoothstep.d.ts +5 -0
  138. package/lib/core/utils/enhanced-smoothstep.js +15 -0
  139. package/lib/core/utils/get-file-icon.d.ts +3 -2
  140. package/lib/core/utils/get-file-icon.js +109 -29
  141. package/lib/core/utils/icon-resolver.d.ts +28 -0
  142. package/lib/core/utils/icon-resolver.js +52 -0
  143. package/lib/core/utils/index.d.ts +4 -1
  144. package/lib/core/utils/index.js +4 -1
  145. package/lib/core/utils/lang-to-name.d.ts +1 -0
  146. package/lib/core/utils/lang-to-name.js +37 -0
  147. package/lib/core/utils/{text-transform.js → string.js} +1 -1
  148. package/lib/ext/configure.d.ts +1 -1
  149. package/lib/icons/CDNIcon/CDNIcon.d.ts +14 -0
  150. package/lib/icons/CDNIcon/CDNIcon.js +48 -0
  151. package/lib/icons/ChatGptIcon/ChatGptIcon.d.ts +9 -0
  152. package/lib/icons/ChatGptIcon/ChatGptIcon.js +22 -0
  153. package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.d.ts +9 -0
  154. package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.js +23 -0
  155. package/lib/icons/ClaudeIcon/ClaudeIcon.d.ts +9 -0
  156. package/lib/icons/ClaudeIcon/ClaudeIcon.js +22 -0
  157. package/lib/icons/GenericIcon/GenericIcon.d.ts +11 -0
  158. package/lib/icons/GenericIcon/GenericIcon.js +61 -0
  159. package/lib/icons/GraphqlIcon/GraphqlIcon.d.ts +9 -0
  160. package/lib/icons/GraphqlIcon/GraphqlIcon.js +36 -0
  161. package/lib/icons/GraphqlIcon/index.d.ts +1 -0
  162. package/lib/icons/GraphqlIcon/index.js +6 -0
  163. package/lib/icons/HexagonIcon/HexagonIcon.d.ts +9 -0
  164. package/lib/icons/HexagonIcon/HexagonIcon.js +22 -0
  165. package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.d.ts +9 -0
  166. package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.js +23 -0
  167. package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
  168. package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
  169. package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
  170. package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
  171. package/lib/icons/NoneIcon/NoneIcon.d.ts +9 -0
  172. package/lib/icons/NoneIcon/NoneIcon.js +17 -0
  173. package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
  174. package/lib/icons/NotesIcon/NotesIcon.js +26 -0
  175. package/lib/icons/types.d.ts +6 -0
  176. package/lib/index.d.ts +7 -1
  177. package/lib/index.js +7 -1
  178. package/lib/layouts/CodeWalkthroughLayout.js +2 -2
  179. package/lib/layouts/DocumentationLayout.js +14 -10
  180. package/lib/markdoc/components/Cards/CardIcon.js +7 -19
  181. package/lib/markdoc/components/CodeGroup/CodeGroup.d.ts +4 -0
  182. package/lib/markdoc/components/CodeGroup/CodeGroup.js +72 -0
  183. package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +7 -4
  184. package/lib/markdoc/components/Heading/Heading.d.ts +2 -1
  185. package/lib/markdoc/components/Heading/Heading.js +21 -3
  186. package/lib/markdoc/components/Icon/Icon.d.ts +3 -0
  187. package/lib/markdoc/components/Icon/Icon.js +29 -0
  188. package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
  189. package/lib/markdoc/components/Tabs/Tab.js +5 -2
  190. package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -1
  191. package/lib/markdoc/components/Tabs/variables.js +2 -0
  192. package/lib/markdoc/components/default.d.ts +2 -0
  193. package/lib/markdoc/components/default.js +2 -0
  194. package/lib/markdoc/default.js +4 -0
  195. package/lib/markdoc/tags/card.js +1 -1
  196. package/lib/markdoc/tags/code-group.d.ts +2 -0
  197. package/lib/markdoc/tags/code-group.js +23 -0
  198. package/lib/markdoc/tags/code-snippet.js +1 -1
  199. package/lib/markdoc/tags/icon.d.ts +2 -0
  200. package/lib/markdoc/tags/icon.js +16 -0
  201. package/lib/markdoc/tags/tab.js +1 -0
  202. package/package.json +4 -4
  203. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  204. package/src/components/Button/Button.tsx +4 -2
  205. package/src/components/Button/ButtonGroup.tsx +53 -0
  206. package/src/components/Button/variables.ts +32 -5
  207. package/src/components/Catalog/Catalog.tsx +1 -1
  208. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +12 -6
  209. package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -4
  210. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +25 -17
  211. package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +25 -9
  212. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +12 -15
  213. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +39 -2
  214. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +61 -0
  215. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +12 -1
  216. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
  217. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +15 -4
  218. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +5 -1
  219. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
  220. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +11 -3
  221. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +37 -0
  222. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +1 -1
  223. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -0
  224. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +7 -23
  225. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +5 -6
  226. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +21 -13
  227. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +9 -2
  228. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
  229. package/src/components/Catalog/CatalogEntityIcon.tsx +33 -33
  230. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
  231. package/src/components/Catalog/CatalogEntityTypeTag.tsx +49 -0
  232. package/src/components/Catalog/CatalogPageDescription.tsx +5 -4
  233. package/src/components/Catalog/CatalogSelector.tsx +3 -1
  234. package/src/components/Catalog/CatalogSortButton.tsx +19 -20
  235. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +1 -0
  236. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +3 -17
  237. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +1 -0
  238. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +5 -8
  239. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +6 -36
  240. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +18 -46
  241. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -0
  242. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +9 -4
  243. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
  244. package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
  245. package/src/components/Catalog/variables.ts +42 -8
  246. package/src/components/CodeBlock/CodeBlock.tsx +15 -5
  247. package/src/components/CodeBlock/CodeBlockControls.tsx +67 -26
  248. package/src/components/CodeBlock/CodeBlockDropdown.tsx +53 -0
  249. package/src/components/CodeBlock/CodeBlockTabs.tsx +29 -20
  250. package/src/components/CodeBlock/variables.ts +1 -1
  251. package/src/components/Dropdown/Dropdown.tsx +1 -0
  252. package/src/components/Dropdown/DropdownMenu.tsx +4 -0
  253. package/src/components/Dropdown/variables.ts +1 -0
  254. package/src/components/Feedback/Feedback.tsx +1 -1
  255. package/src/components/Filter/FilterCheckboxes.tsx +9 -2
  256. package/src/components/Footer/FooterItem.tsx +5 -12
  257. package/src/components/Footer/variables.ts +2 -2
  258. package/src/components/Image/Image.tsx +2 -0
  259. package/src/components/Markdown/Markdown.tsx +3 -3
  260. package/src/components/Markdown/styles/headingAnchor.ts +0 -1
  261. package/src/components/Menu/MenuItem.tsx +5 -5
  262. package/src/components/Menu/variables.ts +3 -1
  263. package/src/components/Navbar/NavbarItem.tsx +8 -17
  264. package/src/components/Navbar/variables.ts +2 -2
  265. package/src/components/PageActions/PageActions.tsx +110 -0
  266. package/src/components/PageActions/PageActionsMenuItem.tsx +73 -0
  267. package/src/components/PageActions/variables.dark.ts +6 -0
  268. package/src/components/PageActions/variables.ts +34 -0
  269. package/src/components/Search/SearchDialog.tsx +2 -2
  270. package/src/components/Select/variables.ts +2 -2
  271. package/src/components/TableOfContent/TableOfContent.tsx +33 -36
  272. package/src/components/Tag/Tag.tsx +11 -2
  273. package/src/components/Tag/variables.ts +14 -0
  274. package/src/core/constants/catalog.ts +1 -1
  275. package/src/core/constants/common.ts +4 -0
  276. package/src/core/contexts/CodeSnippetContext.tsx +31 -0
  277. package/src/core/contexts/index.ts +1 -0
  278. package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
  279. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +3 -4
  280. package/src/core/hooks/index.ts +1 -0
  281. package/src/core/hooks/use-active-heading.ts +199 -28
  282. package/src/core/hooks/use-active-section-id.ts +2 -1
  283. package/src/core/hooks/use-codeblock-tabs-controls.ts +8 -8
  284. package/src/core/hooks/use-local-state.ts +30 -0
  285. package/src/core/hooks/use-page-actions.ts +115 -0
  286. package/src/core/hooks/use-theme-hooks.ts +2 -0
  287. package/src/core/styles/dark.ts +2 -1
  288. package/src/core/styles/global.ts +2 -0
  289. package/src/core/types/catalog.ts +5 -1
  290. package/src/core/types/hooks.ts +2 -0
  291. package/src/core/types/index.ts +1 -0
  292. package/src/core/types/l10n.ts +21 -0
  293. package/src/core/types/page-actions.ts +18 -0
  294. package/src/core/types/sidebar.ts +1 -0
  295. package/src/core/types/telemetry.ts +5 -13
  296. package/src/core/utils/download-code-walkthrough.ts +5 -4
  297. package/src/core/utils/enhanced-smoothstep.ts +14 -0
  298. package/src/core/utils/get-file-icon.tsx +94 -0
  299. package/src/core/utils/icon-resolver.ts +57 -0
  300. package/src/core/utils/index.ts +4 -1
  301. package/src/core/utils/lang-to-name.ts +35 -0
  302. package/src/ext/configure.ts +1 -1
  303. package/src/icons/CDNIcon/CDNIcon.tsx +47 -0
  304. package/src/icons/ChatGptIcon/ChatGptIcon.tsx +23 -0
  305. package/src/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.tsx +24 -0
  306. package/src/icons/ClaudeIcon/ClaudeIcon.tsx +23 -0
  307. package/src/icons/GenericIcon/GenericIcon.tsx +69 -0
  308. package/src/icons/GraphqlIcon/GraphqlIcon.tsx +81 -0
  309. package/src/icons/GraphqlIcon/index.ts +1 -0
  310. package/src/icons/HexagonIcon/HexagonIcon.tsx +23 -0
  311. package/src/icons/MarkdownFullIcon/MarkdownFullIcon.tsx +24 -0
  312. package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
  313. package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
  314. package/src/icons/NoneIcon/NoneIcon.tsx +17 -0
  315. package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
  316. package/src/icons/types.ts +7 -0
  317. package/src/index.ts +7 -1
  318. package/src/layouts/CodeWalkthroughLayout.tsx +1 -1
  319. package/src/layouts/DocumentationLayout.tsx +23 -13
  320. package/src/markdoc/components/Cards/CardIcon.tsx +6 -21
  321. package/src/markdoc/components/CodeGroup/CodeGroup.tsx +78 -0
  322. package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +7 -4
  323. package/src/markdoc/components/Heading/Heading.tsx +22 -3
  324. package/src/markdoc/components/Icon/Icon.tsx +16 -0
  325. package/src/markdoc/components/Tabs/Tab.tsx +6 -1
  326. package/src/markdoc/components/Tabs/Tabs.tsx +1 -1
  327. package/src/markdoc/components/Tabs/variables.ts +2 -0
  328. package/src/markdoc/components/default.ts +2 -0
  329. package/src/markdoc/default.ts +4 -0
  330. package/src/markdoc/tags/card.ts +1 -1
  331. package/src/markdoc/tags/code-group.ts +21 -0
  332. package/src/markdoc/tags/code-snippet.ts +1 -1
  333. package/src/markdoc/tags/icon.ts +14 -0
  334. package/src/markdoc/tags/tab.ts +1 -0
  335. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +0 -1
  336. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +0 -5
  337. package/lib/ext/process-scorecard.d.ts +0 -5
  338. package/lib/ext/process-scorecard.js +0 -11
  339. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +0 -1
  340. package/src/core/utils/get-file-icon.ts +0 -42
  341. package/src/ext/process-scorecard.ts +0 -13
  342. /package/lib/core/utils/{text-transform.d.ts → string.d.ts} +0 -0
  343. /package/src/core/utils/{text-transform.ts → string.ts} +0 -0
@@ -11,6 +11,7 @@ import {
11
11
  } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
12
12
  import { CatalogActionsRow } from '@redocly/theme/components/Catalog/CatalogActionsRow';
13
13
  import { HighlightContext } from '@redocly/theme/components/Catalog/CatalogHighlight';
14
+ import { CatalogEntitiesEmptyState } from '@redocly/theme/components/Catalog/CatalogEntitiesEmptyState';
14
15
 
15
16
  export type CatalogEntityRelationsTableProps = {
16
17
  entity: BffCatalogEntity;
@@ -23,13 +24,14 @@ export type CatalogEntityRelationsTableProps = {
23
24
  };
24
25
  searchQuery: string;
25
26
  setSearchQuery: (query: string) => void;
26
- heading: string;
27
+ heading?: string;
27
28
  columns: CatalogColumn<BffCatalogRelatedEntity>[];
28
29
  sortOption: SortOption | null;
29
30
  setSortOption: (sortOption: SortOption | null) => void;
30
31
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
31
32
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
32
33
  shouldShowLoadMore: boolean;
34
+ listType?: 'default' | 'team';
33
35
  };
34
36
 
35
37
  export function CatalogEntityRelationsTable({
@@ -46,19 +48,22 @@ export function CatalogEntityRelationsTable({
46
48
  handleSortClick,
47
49
  isColumnSorted,
48
50
  shouldShowLoadMore,
51
+ listType,
49
52
  }: CatalogEntityRelationsTableProps): JSX.Element {
50
53
  return (
51
54
  <div data-component-name="Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable">
52
- <Heading>{heading}</Heading>
53
- <CatalogActionsRow
54
- searchQuery={searchQuery}
55
- setSearchQuery={setSearchQuery}
56
- sortOption={sortOption}
57
- setSortOption={setSortOption}
58
- style={{ marginBottom: '12px' }}
59
- />
60
- {relations.length > 0 && (
61
- <HighlightContext.Provider value={[searchQuery]}>
55
+ {heading && <Heading>{heading}</Heading>}
56
+ {(searchQuery || relations.length > 0) && (
57
+ <CatalogActionsRow
58
+ searchQuery={searchQuery}
59
+ setSearchQuery={setSearchQuery}
60
+ sortOption={sortOption}
61
+ setSortOption={setSortOption}
62
+ style={{ marginBottom: '12px' }}
63
+ />
64
+ )}
65
+ <HighlightContext.Provider value={[searchQuery]}>
66
+ {relations.length > 0 ? (
62
67
  <CatalogTableView
63
68
  entities={relations}
64
69
  entitiesCatalogConfig={entitiesCatalogConfig}
@@ -68,9 +73,12 @@ export function CatalogEntityRelationsTable({
68
73
  currentSortOption={sortOption}
69
74
  handleSortClick={handleSortClick}
70
75
  isColumnSorted={isColumnSorted}
76
+ style={{ marginTop: 0 }}
71
77
  />
72
- </HighlightContext.Provider>
73
- )}
78
+ ) : (
79
+ <CatalogEntitiesEmptyState listType={listType} />
80
+ )}
81
+ </HighlightContext.Provider>
74
82
  {shouldShowLoadMore && (
75
83
  <LoadMore
76
84
  icon={<ArrowDownIcon size="var(--catalog-load-more-icon-size)" />}
@@ -88,6 +88,7 @@ export function CatalogEntityTeamRelations({
88
88
  <Tabs forceReady={relations.length > 0} size={TabsSize.MEDIUM}>
89
89
  <TabItem label="Members" icon={<PeopleIcon />} onClick={() => setFilter('type:user')}>
90
90
  <CatalogEntityRelationsTable
91
+ key={`members-${relations.length}-${relations.map((r) => r.id).join(',')}`}
91
92
  entity={entity}
92
93
  entitiesCatalogConfig={entitiesCatalogConfig}
93
94
  catalogConfig={catalogConfig}
@@ -95,17 +96,22 @@ export function CatalogEntityTeamRelations({
95
96
  query={query}
96
97
  searchQuery={searchQuery}
97
98
  setSearchQuery={setSearchQuery}
98
- heading="Members"
99
99
  columns={teamColumns}
100
100
  sortOption={sortOption}
101
101
  setSortOption={setSortOption}
102
102
  handleSortClick={handleSortClick}
103
103
  isColumnSorted={isColumnSorted}
104
104
  shouldShowLoadMore={shouldShowLoadMore}
105
+ listType="team"
105
106
  />
106
107
  </TabItem>
107
- <TabItem label="Related entities" icon={<EntityTypeIcon />} onClick={() => setFilter('')}>
108
+ <TabItem
109
+ label="Related entities"
110
+ icon={<EntityTypeIcon />}
111
+ onClick={() => setFilter('-type:user')}
112
+ >
108
113
  <CatalogEntityDefaultRelations
114
+ key={`related-${relations.length}-${relations.map((r) => r.id).join(',')}`}
109
115
  entity={entity}
110
116
  relations={relations}
111
117
  query={query}
@@ -119,6 +125,7 @@ export function CatalogEntityTeamRelations({
119
125
  handleSortClick={handleSortClick}
120
126
  isColumnSorted={isColumnSorted}
121
127
  shouldShowLoadMore={shouldShowLoadMore}
128
+ shouldShowHeading={false}
122
129
  />
123
130
  </TabItem>
124
131
  </Tabs>
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { BffCatalogEntity } from '@redocly/theme/core/types';
5
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
6
+ import { JsonViewer } from '@redocly/theme/components/JsonViewer/JsonViewer';
7
+
8
+ export type CatalogEntitySchemaProps = {
9
+ entity: BffCatalogEntity;
10
+ };
11
+
12
+ export function CatalogEntitySchema({ entity }: CatalogEntitySchemaProps) {
13
+ const { useTranslate } = useThemeHooks();
14
+ const { translate } = useTranslate();
15
+ const { schema, ...metadataToShow } = entity.metadata || {};
16
+ const metadata = Object.entries(metadataToShow);
17
+
18
+ if (!metadata.length) {
19
+ return null;
20
+ }
21
+
22
+ let parsedSchema;
23
+
24
+ try {
25
+ parsedSchema = JSON.parse(schema);
26
+ } catch (error) {
27
+ return null;
28
+ }
29
+
30
+ return (
31
+ <MetadataWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityMetadata">
32
+ <Heading>{translate('catalog.entity.metadata.title')}</Heading>
33
+ <JsonViewer data={parsedSchema} expandLevel={3} title="JSON" />
34
+ </MetadataWrapper>
35
+ );
36
+ }
37
+
38
+ const MetadataWrapper = styled.div`
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: var(--spacing-xs);
42
+ border-radius: var(--border-radius);
43
+ background-color: var(--catalog-metadata-bg-color);
44
+ transition: all 0.2s ease-in-out;
45
+ margin: var(--spacing-lg) 0;
46
+ `;
47
+
48
+ const Heading = styled.h2`
49
+ margin-bottom: var(--spacing-base);
50
+ margin-top: 0;
51
+ font-size: var(--catalog-metadata-heading-size);
52
+ `;
@@ -5,43 +5,43 @@ import { CodeIcon } from '@redocly/theme/icons/CodeIcon/CodeIcon';
5
5
  import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
6
6
  import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
7
7
  import { UserIcon } from '@redocly/theme/icons/UserIcon/UserIcon';
8
-
9
- const iconColor = 'var(--catalog-entity-icon-color)';
10
-
11
- const entityIconMap: Record<EntityType, JSX.Element> = {
12
- service: <CodeIcon color={iconColor} />,
13
- domain: <GraphIcon color={iconColor} />,
14
- team: <PeopleIcon color={iconColor} />,
15
- user: <UserIcon color={iconColor} />,
16
- 'api-description': <CodeIcon color={iconColor} />,
17
- 'data-schema': <CodeIcon color={iconColor} />,
18
- 'api-operation': <CodeIcon color={iconColor} />,
19
- };
8
+ import { NetworkIcon } from '@redocly/theme/icons/NetworkIcon/NetworkIcon';
9
+ import { MoleculesIcon } from '@redocly/theme/icons/MoleculesIcon/MoleculesIcon';
20
10
 
21
11
  export type CatalogEntityIconProps = {
22
12
  entityType: string;
13
+ defaultColor?: boolean;
14
+ };
15
+
16
+ const getIconColor = (entityType: EntityType) => `var(--catalog-entity-icon-color-${entityType})`;
17
+
18
+ const getEntityIcon = ({ entityType, defaultColor }: CatalogEntityIconProps) => {
19
+ const iconColor = defaultColor
20
+ ? `var(--catalog-entity-icon-color)`
21
+ : getIconColor(entityType as EntityType);
22
+
23
+ const entityIconMap: Record<EntityType, JSX.Element> = {
24
+ service: <CodeIcon color={iconColor} />,
25
+ domain: <GraphIcon color={iconColor} />,
26
+ team: <PeopleIcon color={iconColor} />,
27
+ user: <UserIcon color={iconColor} />,
28
+ 'api-description': <CodeIcon color={iconColor} />,
29
+ 'data-schema': <NetworkIcon color={iconColor} />,
30
+ 'api-operation': <MoleculesIcon color={iconColor} />,
31
+ };
32
+
33
+ return entityIconMap[entityType as EntityType];
23
34
  };
24
35
 
25
- export function CatalogEntityIcon({ entityType }: CatalogEntityIconProps): JSX.Element {
26
- const key = entityType.toLowerCase() as EntityType;
27
-
28
- switch (key) {
29
- case 'service':
30
- return entityIconMap.service;
31
- case 'domain':
32
- return entityIconMap.domain;
33
- case 'team':
34
- return entityIconMap.team;
35
- case 'user':
36
- return entityIconMap.user;
37
- case 'api-description':
38
- return entityIconMap['api-description'];
39
- case 'data-schema':
40
- return entityIconMap.service;
41
- case 'api-operation':
42
- return entityIconMap.service;
43
- default:
44
- const exhaustiveCheck: never = key;
45
- throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
36
+ export function CatalogEntityIcon({
37
+ entityType,
38
+ defaultColor = false,
39
+ }: CatalogEntityIconProps): JSX.Element {
40
+ const icon = getEntityIcon({ entityType, defaultColor });
41
+
42
+ if (!icon) {
43
+ throw new Error(`Unhandled entity type: ${entityType}`);
46
44
  }
45
+
46
+ return icon;
47
47
  }
@@ -1,48 +1,43 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
- import { CodeIcon } from '@redocly/theme/icons/CodeIcon/CodeIcon';
5
- import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
6
- import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
7
- import { UserIcon } from '@redocly/theme/icons/UserIcon/UserIcon';
8
-
9
- const getEntityIcon = (entityType: string): ReactNode => {
10
- const iconColor = 'var(--catalog-entity-icon-color)';
11
-
12
- switch (entityType.toLowerCase()) {
13
- case 'service':
14
- return <CodeIcon color={iconColor} />;
15
- case 'domain':
16
- return <GraphIcon color={iconColor} />;
17
- case 'team':
18
- return <PeopleIcon color={iconColor} />;
19
- case 'user':
20
- return <UserIcon color={iconColor} />;
21
- default:
22
- return <CodeIcon color={iconColor} />;
23
- }
24
- };
4
+ import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
25
5
 
26
6
  export type CatalogEntityTypeIconProps = {
27
7
  entityType: string;
8
+ defaultColor?: boolean;
28
9
  };
29
10
 
30
- export function CatalogEntityTypeIcon({ entityType }: CatalogEntityTypeIconProps) {
11
+ export function CatalogEntityTypeIcon({
12
+ entityType,
13
+ defaultColor = false,
14
+ }: CatalogEntityTypeIconProps) {
31
15
  return (
32
- <IconContainer data-component-name="Catalog/CatalogEntityTypeIcon">
33
- {getEntityIcon(entityType)}
16
+ <IconContainer
17
+ data-component-name="Catalog/CatalogEntityTypeIcon"
18
+ entityType={entityType}
19
+ defaultColor={defaultColor}
20
+ >
21
+ <CatalogEntityIcon entityType={entityType} defaultColor={defaultColor} />
34
22
  </IconContainer>
35
23
  );
36
24
  }
37
25
 
38
- const IconContainer = styled.div`
26
+ const IconContainer = styled.div<{ entityType: string; defaultColor: boolean }>`
39
27
  display: flex;
40
28
  align-items: center;
41
29
  justify-content: center;
42
30
  width: var(--catalog-table-icon-width);
43
31
  height: var(--catalog-table-icon-height);
44
32
  border-radius: var(--catalog-table-icon-border-radius);
45
- background-color: var(--catalog-table-icon-bg-color);
33
+ background-color: ${({ defaultColor, entityType }) =>
34
+ defaultColor
35
+ ? 'var(--catalog-entity-bg-color)'
36
+ : `var(--catalog-entity-bg-color-${entityType})`};
46
37
  flex-shrink: 0;
47
- border: var(--catalog-table-icon-border-width) solid var(--catalog-table-icon-border-color);
38
+ border: 1px solid
39
+ ${({ defaultColor, entityType }) =>
40
+ defaultColor
41
+ ? 'var(--catalog-entity-border-color)'
42
+ : `var(--catalog-entity-border-color-${entityType})`};
48
43
  `;
@@ -0,0 +1,49 @@
1
+ import React, { JSX } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { EntityType } from '@redocly/theme/core/types';
5
+ import { Tag } from '@redocly/theme/components/Tag/Tag';
6
+ import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
7
+
8
+ export type CatalogEntityTypeTagProps = {
9
+ entityType: string;
10
+ };
11
+
12
+ const entityTagColorMap: Record<EntityType, string> = {
13
+ service: 'blue',
14
+ domain: 'grass',
15
+ team: 'purple',
16
+ user: 'yellow',
17
+ 'api-description': 'sky',
18
+ 'data-schema': 'carrot',
19
+ 'api-operation': 'raspberry',
20
+ };
21
+
22
+ export const getEntityTagColor = (type: EntityType): string => {
23
+ const color = entityTagColorMap[type];
24
+
25
+ if (!color) {
26
+ throw new Error(`Unhandled entity type: ${type}`);
27
+ }
28
+
29
+ return color;
30
+ };
31
+
32
+ export function CatalogEntityTypeTag({ entityType }: CatalogEntityTypeTagProps): JSX.Element {
33
+ return (
34
+ <EntityTypeTagWrapper
35
+ entityType={entityType as EntityType}
36
+ data-component-name="Catalog/CatalogEntityTypeTag"
37
+ >
38
+ <CatalogHighlight>{entityType}</CatalogHighlight>
39
+ </EntityTypeTagWrapper>
40
+ );
41
+ }
42
+
43
+ const EntityTypeTagWrapper = styled(Tag)<{ entityType: EntityType }>`
44
+ font-size: var(--font-size-base);
45
+ background-color: transparent;
46
+ text-transform: lowercase;
47
+ border: 1px solid ${({ entityType }) => `var(--catalog-entity-border-color-${entityType})`};
48
+ color: ${({ entityType }) => `var(--catalog-entity-icon-color-${entityType})`};
49
+ `;
@@ -3,8 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  import { breakpoints } from '@redocly/theme/core/utils';
5
5
  import { H3 } from '@redocly/theme/components/Typography/H3';
6
-
7
- import { CounterTag } from '../Tags/CounterTag';
6
+ import { Tag } from '@redocly/theme/components/Tag/Tag';
8
7
 
9
8
  export type CatalogPageDescriptionProps = {
10
9
  title: string;
@@ -23,9 +22,11 @@ export function CatalogPageDescription({
23
22
  }: CatalogPageDescriptionProps) {
24
23
  return (
25
24
  <CatalogPageDescriptionWrapper>
26
- <CatalogTitleWrapper>
25
+ <CatalogTitleWrapper data-component-name="Catalog/CatalogEntityTitle">
27
26
  <CatalogTitle data-translation-key={titleTranslationKey}>{title}</CatalogTitle>
28
- <CounterTag borderless>{tag}</CounterTag>
27
+ <Tag borderless textTransform="none">
28
+ {tag}
29
+ </Tag>
29
30
  </CatalogTitleWrapper>
30
31
  <CatalogDescription data-translation-key={descriptionTranslationKey}>
31
32
  {description}
@@ -3,7 +3,9 @@ import styled from 'styled-components';
3
3
  import { useNavigate } from 'react-router-dom';
4
4
 
5
5
  import { Select } from '@redocly/theme/components/Select/Select';
6
- import { CatalogSwitcherItem, getPathPrefix, SortOption, useThemeHooks } from '@redocly/theme/core';
6
+ import { CatalogSwitcherItem, SortOption } from '@redocly/theme/core/types/catalog';
7
+ import { getPathPrefix } from '@redocly/theme/core/utils';
8
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
7
9
  import { ChevronDownIcon } from '@redocly/theme/icons/ChevronDownIcon/ChevronDownIcon';
8
10
 
9
11
  export type CatalogSelectorProps = {
@@ -29,29 +29,28 @@ export function CatalogSortButton({
29
29
  );
30
30
 
31
31
  return (
32
- <CatalogSortButtonWrapper
33
- data-component-name="Catalog/CatalogSortButton"
34
- trigger={
35
- <SortTrigger>
36
- <SortIconWrapper>
37
- {currentSort === '-title' ? <DescSortIcon /> : <AscSortIcon />}
38
- </SortIconWrapper>
39
- <SortText>Sort</SortText>
40
- </SortTrigger>
41
- }
42
- alignment="end"
43
- >
44
- <DropdownMenu>
45
- <DropdownMenuItem onAction={() => toggleSort('title')}>
46
- {currentSort === '-title' ? 'Title | A → Z' : 'Title | Z → A'}
47
- </DropdownMenuItem>
48
- </DropdownMenu>
49
- </CatalogSortButtonWrapper>
32
+ <div data-component-name="Catalog/CatalogSortButton">
33
+ <Dropdown
34
+ trigger={
35
+ <SortTrigger>
36
+ <SortIconWrapper>
37
+ {currentSort === '-title' ? <DescSortIcon /> : <AscSortIcon />}
38
+ </SortIconWrapper>
39
+ <SortText>Sort</SortText>
40
+ </SortTrigger>
41
+ }
42
+ alignment="end"
43
+ >
44
+ <DropdownMenu>
45
+ <DropdownMenuItem onAction={() => toggleSort('title')}>
46
+ {currentSort === '-title' ? 'Title | A → Z' : 'Title | Z → A'}
47
+ </DropdownMenuItem>
48
+ </DropdownMenu>
49
+ </Dropdown>
50
+ </div>
50
51
  );
51
52
  }
52
53
 
53
- const CatalogSortButtonWrapper = styled(Dropdown)``;
54
-
55
54
  const SortTrigger = styled.div`
56
55
  display: flex;
57
56
  align-items: center;
@@ -19,6 +19,7 @@ export function CatalogDomainsCell({ domains }: CatalogDomainsCellProps) {
19
19
  backgroundColor: 'transparent',
20
20
  borderRadius: 'var(--border-radius-xl)',
21
21
  },
22
+ textTransform: 'none',
22
23
  }}
23
24
  />
24
25
  </div>
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
5
- import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
5
+ import { CatalogEntityTypeIcon } from '@redocly/theme/components/Catalog/CatalogEntityTypeIcon';
6
6
  import { BffCatalogEntity } from '@redocly/theme/core/types';
7
7
 
8
8
  type Entity = Pick<BffCatalogEntity, 'type' | 'title' | 'summary'>;
@@ -13,11 +13,9 @@ export type CatalogEntityCellProps<T extends Entity> = {
13
13
  export function CatalogEntityCell<T extends Entity>({ entity }: CatalogEntityCellProps<T>) {
14
14
  return (
15
15
  <EntityTitleCellWrapper data-component-name="Catalog/CatalogTableView/CatalogEntityCell">
16
- <IconContainer>
17
- <CatalogEntityIcon entityType={entity.type} />
18
- </IconContainer>
16
+ <CatalogEntityTypeIcon entityType={entity.type} defaultColor={true} />
19
17
  <EntityTitleContent>
20
- <EntityTitle>
18
+ <EntityTitle data-component-name="Catalog/CatalogTableView/CatalogEntityTitle">
21
19
  <CatalogHighlight>{entity.title}</CatalogHighlight>
22
20
  </EntityTitle>
23
21
  {entity.summary && (
@@ -37,18 +35,6 @@ const EntityTitleCellWrapper = styled.div`
37
35
  max-width: 100%;
38
36
  `;
39
37
 
40
- const IconContainer = styled.div`
41
- display: flex;
42
- align-items: center;
43
- justify-content: center;
44
- width: var(--catalog-table-icon-width);
45
- height: var(--catalog-table-icon-height);
46
- border-radius: var(--catalog-table-icon-border-radius);
47
- background-color: var(--catalog-table-icon-bg-color);
48
- flex-shrink: 0;
49
- border: var(--catalog-table-icon-border-width) solid var(--catalog-table-icon-border-color);
50
- `;
51
-
52
38
  const EntityTitleContent = styled.div`
53
39
  display: flex;
54
40
  flex-direction: column;
@@ -19,6 +19,7 @@ export function CatalogOwnersCell({ owners }: CatalogOwnersCellProps) {
19
19
  backgroundColor: 'transparent',
20
20
  borderRadius: 'var(--border-radius-xl)',
21
21
  },
22
+ textTransform: 'none',
22
23
  }}
23
24
  />
24
25
  </div>
@@ -5,8 +5,10 @@ import { SortOption } from '@redocly/theme/core/types';
5
5
  import { CaretDownIcon } from '@redocly/theme/icons/CaretDownIcon/CaretDownIcon';
6
6
  import { CaretUpIcon } from '@redocly/theme/icons/CaretUpIcon/CaretUpIcon';
7
7
  import { useCatalogTableHeaderCellActions } from '@redocly/theme/core/hooks/catalog/useCatalogTableHeaderCellActions';
8
-
9
- import { BaseEntity, CatalogColumn } from './CatalogTableView';
8
+ import {
9
+ BaseEntity,
10
+ CatalogColumn,
11
+ } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
10
12
 
11
13
  export type CatalogTableHeaderCellProps<T extends BaseEntity> = {
12
14
  column: CatalogColumn<T>;
@@ -37,7 +39,7 @@ export const CatalogTableHeaderCell = <T extends BaseEntity>({
37
39
  $sortable={Boolean(column.sortable && sortKey)}
38
40
  >
39
41
  <HeaderContent>
40
- <HeaderTitle>{column.title}</HeaderTitle>
42
+ <span>{column.title}</span>
41
43
  {column.sortable && sortKey && (
42
44
  <SortIndicator>
43
45
  <SortArrow $isActive={isUpActive}>
@@ -81,14 +83,9 @@ const TableHeaderCellWrapper = styled.div<{ $sortable: boolean }>`
81
83
  const HeaderContent = styled.div`
82
84
  display: flex;
83
85
  align-items: center;
84
- justify-content: space-between;
85
86
  width: 100%;
86
87
  `;
87
88
 
88
- const HeaderTitle = styled.span`
89
- flex: 1;
90
- `;
91
-
92
89
  const SortIndicator = styled.div`
93
90
  display: flex;
94
91
  flex-direction: column;
@@ -2,14 +2,14 @@ import React, { ReactNode } from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
4
4
 
5
- import { EntityType, SortOption, BffCatalogEntity } from '@redocly/theme/core/types';
6
- import { Tag } from '@redocly/theme/components/Tag/Tag';
5
+ import { SortOption, BffCatalogEntity } from '@redocly/theme/core/types';
7
6
  import { CatalogOwnersCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogOwnersCell';
8
7
  import { CatalogDomainsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogDomainsCell';
9
8
  import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
10
9
  import { CatalogTableHeaderCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableHeaderCell';
11
10
  import { CatalogTagsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTagsCell';
12
11
  import { CatalogTableViewRow } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableViewRow';
12
+ import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag';
13
13
 
14
14
  export type BaseEntity = {
15
15
  id: string;
@@ -28,6 +28,7 @@ export type CatalogTableViewProps<T extends BaseEntity> = {
28
28
  currentSortOption?: SortOption | null;
29
29
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
30
30
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
31
+ style?: React.CSSProperties;
31
32
  };
32
33
 
33
34
  export type CatalogColumn<T> = {
@@ -40,28 +41,6 @@ export type CatalogColumn<T> = {
40
41
  sortKey?: string;
41
42
  };
42
43
 
43
- export const getEntityTagColor = (type: EntityType): string => {
44
- switch (type) {
45
- case 'service':
46
- return 'blue';
47
- case 'domain':
48
- return 'grass';
49
- case 'team':
50
- return 'purple';
51
- case 'user':
52
- return 'yellow';
53
- case 'api-description':
54
- return 'sky';
55
- case 'data-schema':
56
- return 'sky';
57
- case 'api-operation':
58
- return 'sky';
59
- default:
60
- const exhaustiveCheck: never = type;
61
- throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
62
- }
63
- };
64
-
65
44
  const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
66
45
  {
67
46
  key: 'entity',
@@ -75,11 +54,7 @@ const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
75
54
  {
76
55
  key: 'type',
77
56
  title: 'Type',
78
- render: (entity) => (
79
- <EntityTypeTag color={getEntityTagColor(entity.type as EntityType)}>
80
- {entity.type}
81
- </EntityTypeTag>
82
- ),
57
+ render: (entity) => <CatalogEntityTypeTag entityType={entity.type} />,
83
58
  width: '2fr',
84
59
  minWidth: '120px',
85
60
  sortable: true,
@@ -121,9 +96,10 @@ export const CatalogTableView = <T extends BaseEntity>({
121
96
  currentSortOption,
122
97
  handleSortClick,
123
98
  isColumnSorted,
99
+ style,
124
100
  }: CatalogTableViewProps<T>) => {
125
101
  return (
126
- <CatalogTableWrapper data-component-name="Catalog/CatalogTableView">
102
+ <CatalogTableWrapper data-component-name="Catalog/CatalogTableView" style={style}>
127
103
  <CatalogTableHeader
128
104
  columnsWidths={columns.map((column) => column.width || '1fr')}
129
105
  columnsMinWidths={columns.map((column) => column.minWidth || 'auto')}
@@ -154,12 +130,6 @@ export const CatalogTableView = <T extends BaseEntity>({
154
130
  );
155
131
  };
156
132
 
157
- const EntityTypeTag = styled(Tag)`
158
- font-size: var(--font-size-base);
159
- background-color: transparent;
160
- text-transform: lowercase;
161
- `;
162
-
163
133
  const CatalogTableWrapper = styled.div`
164
134
  width: 100%;
165
135
  border-bottom: 1px solid var(--catalog-table-border-color);