@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
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Icon = Icon;
18
+ const react_1 = __importDefault(require("react"));
19
+ const CDNIcon_1 = require("../../../icons/CDNIcon/CDNIcon");
20
+ const utils_1 = require("../../../core/utils");
21
+ function Icon(props) {
22
+ const { name } = props, rest = __rest(props, ["name"]);
23
+ const resolvedIcon = (0, utils_1.resolveIcon)(name);
24
+ if (resolvedIcon.type === 'font-awesome') {
25
+ return react_1.default.createElement(CDNIcon_1.CDNIcon, Object.assign({ name: resolvedIcon.name, type: resolvedIcon.style }, rest));
26
+ }
27
+ return null;
28
+ }
29
+ //# sourceMappingURL=Icon.js.map
@@ -10,6 +10,7 @@ export type TabProps = {
10
10
  onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
11
11
  onClick: () => void;
12
12
  icon?: React.ReactNode;
13
+ iconRawContent?: string;
13
14
  };
14
- export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }: TabProps): JSX.Element;
15
+ export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }: TabProps): JSX.Element;
15
16
  export declare const Tab: import("styled-components").StyledComponent<typeof TabComponent, any, {}, never>;
@@ -8,17 +8,20 @@ exports.TabComponent = TabComponent;
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const styled_components_1 = __importDefault(require("styled-components"));
10
10
  const TabList_1 = require("../../../markdoc/components/Tabs/TabList");
11
- function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }) {
11
+ const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
12
+ function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }) {
12
13
  return (react_1.default.createElement(TabList_1.TabItem, { "data-component-name": "Markdoc/Tabs/Tab", size: size, tabIndex: 0 },
13
14
  react_1.default.createElement(TabList_1.TabButtonLink, { id: `tab-${tabId}`, role: "tab", "aria-selected": "false", "aria-controls": `panel-${tabId}`, tabIndex: -1, size: size, disabled: disabled, ref: setRef, onKeyDown: onKeyDown, onClick: onClick },
14
15
  react_1.default.createElement(LabelWrapper, null,
15
- icon,
16
+ react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: icon, rawContent: iconRawContent }),
16
17
  label))));
17
18
  }
18
19
  const LabelWrapper = styled_components_1.default.div `
19
20
  display: flex;
20
21
  align-items: center;
21
22
  gap: 4px;
23
+ --icon-width: var(--md-tabs-icon-size);
24
+ --icon-height: var(--md-tabs-icon-size);
22
25
  `;
23
26
  exports.Tab = (0, styled_components_1.default)(TabComponent) ``;
24
27
  //# sourceMappingURL=Tab.js.map
@@ -9,7 +9,7 @@ export type TabItemProps = {
9
9
  disable?: boolean;
10
10
  onClick?: () => void;
11
11
  children: React.ReactNode;
12
- icon?: React.ReactNode;
12
+ icon?: React.ReactNode | string;
13
13
  };
14
14
  type TabsProps = {
15
15
  children: React.ReactElement<TabItemProps>[];
@@ -98,6 +98,8 @@ exports.markdownTabs = (0, styled_components_1.css) `
98
98
 
99
99
  --md-tabs-tab-focused-padding: var(--spacing-unit); // @presenter Spacing
100
100
 
101
+ --md-tabs-icon-size: 16px; // @presenter Spacing
102
+
101
103
  // @tokens End
102
104
  `;
103
105
  //# sourceMappingURL=variables.js.map
@@ -18,3 +18,5 @@ export * from '../../markdoc/components/CodeWalkthrough/CodeStep';
18
18
  export * from '../../markdoc/components/CodeWalkthrough/Input';
19
19
  export * from '../../markdoc/components/CodeWalkthrough/CodeToggle';
20
20
  export * from '../../markdoc/components/CodeWalkthrough/CodeContainer';
21
+ export * from '../../markdoc/components/CodeGroup/CodeGroup';
22
+ export * from '../../markdoc/components/Icon/Icon';
@@ -34,4 +34,6 @@ __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeStep"), expor
34
34
  __exportStar(require("../../markdoc/components/CodeWalkthrough/Input"), exports);
35
35
  __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeToggle"), exports);
36
36
  __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeContainer"), exports);
37
+ __exportStar(require("../../markdoc/components/CodeGroup/CodeGroup"), exports);
38
+ __exportStar(require("../../markdoc/components/Icon/Icon"), exports);
37
39
  //# sourceMappingURL=default.js.map
@@ -52,6 +52,8 @@ const code_walkthrough_1 = require("../markdoc/tags/code-walkthrough");
52
52
  const code_step_1 = require("../markdoc/tags/code-step");
53
53
  const input_1 = require("../markdoc/tags/input");
54
54
  const code_toggle_1 = require("../markdoc/tags/code-toggle");
55
+ const code_group_1 = require("../markdoc/tags/code-group");
56
+ const icon_1 = require("../markdoc/tags/icon");
55
57
  exports.tags = {
56
58
  [admonition_1.admonition.tagName]: admonition_1.admonition.schema,
57
59
  [debug_1.debug.tagName]: debug_1.debug.schema,
@@ -69,5 +71,7 @@ exports.tags = {
69
71
  [code_step_1.codeStep.tagName]: code_step_1.codeStep.schema,
70
72
  [code_toggle_1.toggle.tagName]: code_toggle_1.toggle.schema,
71
73
  [input_1.input.tagName]: input_1.input.schema,
74
+ [code_group_1.codeGroup.tagName]: code_group_1.codeGroup.schema,
75
+ [icon_1.icon.tagName]: icon_1.icon.schema,
72
76
  };
73
77
  //# sourceMappingURL=default.js.map
@@ -14,7 +14,7 @@ exports.card = {
14
14
  type: String,
15
15
  resolver: 'link',
16
16
  },
17
- icon: { type: String, resolver: 'inlineSvgOrImageLink' },
17
+ icon: { type: String, resolver: 'relativeOrCdnIcon' },
18
18
  lineClamp: {
19
19
  type: Number,
20
20
  },
@@ -0,0 +1,2 @@
1
+ import type { MarkdocSchemaWrapper } from '../../markdoc/tags/types';
2
+ export declare const codeGroup: MarkdocSchemaWrapper;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.codeGroup = void 0;
7
+ const markdoc_1 = __importDefault(require("@markdoc/markdoc"));
8
+ exports.codeGroup = {
9
+ schema: {
10
+ render: 'CodeGroup',
11
+ children: ['fence', 'tag'],
12
+ attributes: {
13
+ mode: { type: String, default: 'tabs', matches: ['tabs', 'dropdown'] },
14
+ },
15
+ transform(node, config) {
16
+ const attributes = node.transformAttributes(config);
17
+ const children = node.transformChildren(config);
18
+ return new markdoc_1.default.Tag('CodeGroup', attributes, children);
19
+ },
20
+ },
21
+ tagName: 'code-group',
22
+ };
23
+ //# sourceMappingURL=code-group.js.map
@@ -9,7 +9,7 @@ const code_snippet_file_1 = require("../../markdoc/attributes/code-snippet-file"
9
9
  exports.codeSnippet = {
10
10
  schema: {
11
11
  attributes: {
12
- file: { type: code_snippet_file_1.CodeSnippetFile, render: false, required: true },
12
+ file: { type: code_snippet_file_1.CodeSnippetFile, required: true },
13
13
  language: { type: String, render: true },
14
14
  title: { type: String, render: true },
15
15
  to: { type: [String, Number], render: false },
@@ -0,0 +1,2 @@
1
+ import type { MarkdocSchemaWrapper } from '../../markdoc/tags/types';
2
+ export declare const icon: MarkdocSchemaWrapper;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.icon = void 0;
4
+ exports.icon = {
5
+ schema: {
6
+ render: 'Icon',
7
+ attributes: {
8
+ name: { type: String, required: true },
9
+ size: { type: String, default: '1em' },
10
+ color: { type: String, default: 'currentColor' },
11
+ },
12
+ selfClosing: true,
13
+ },
14
+ tagName: 'icon',
15
+ };
16
+ //# sourceMappingURL=icon.js.map
@@ -6,6 +6,7 @@ exports.tab = {
6
6
  attributes: {
7
7
  label: { type: String, required: true },
8
8
  disable: { type: Boolean, default: false },
9
+ icon: { type: String, resolver: 'relativeOrCdnIcon' },
9
10
  },
10
11
  render: 'div',
11
12
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.56.0-rc.2",
3
+ "version": "0.56.0",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -26,7 +26,7 @@
26
26
  "./markdoc/*": "./lib/markdoc/*.js"
27
27
  },
28
28
  "peerDependencies": {
29
- "@markdoc/markdoc": "0.5.1",
29
+ "@markdoc/markdoc": "0.5.2",
30
30
  "lodash.debounce": "^4.0.8",
31
31
  "lodash.throttle": "^4.1.1",
32
32
  "react": "^19.1.0",
@@ -89,8 +89,8 @@
89
89
  "nprogress": "0.2.0",
90
90
  "react-calendar": "5.1.0",
91
91
  "react-date-picker": "11.0.0",
92
- "@redocly/config": "0.26.3-rc.1",
93
- "@redocly/realm-asyncapi-sdk": "0.2.0-next.1"
92
+ "@redocly/config": "0.28.0",
93
+ "@redocly/realm-asyncapi-sdk": "0.2.0"
94
94
  },
95
95
  "scripts": {
96
96
  "watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
@@ -36,7 +36,7 @@ export function Breadcrumbs(props: {
36
36
  payload: {
37
37
  link: breadcrumb.link,
38
38
  position: idx + 1,
39
- total_breadcrumbs: breadcrumbs.length,
39
+ totalBreadcrumbs: breadcrumbs.length,
40
40
  },
41
41
  });
42
42
  }}
@@ -27,13 +27,13 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
27
27
  size?: ButtonSize;
28
28
  extraClass?: string;
29
29
  to?: string;
30
+ external?: boolean;
30
31
  icon?: JSX.Element;
31
32
  iconPosition?: 'left' | 'right';
32
33
  title?: string;
33
34
  tabIndex?: number;
34
35
  onClick?: (e?: any) => void;
35
36
  ref?: React.Ref<HTMLButtonElement>;
36
- type?: 'button' | 'submit' | 'reset';
37
37
  }
38
38
 
39
39
  const getBlink = (): Keyframes => keyframes`
@@ -67,6 +67,7 @@ export function generateClassName({
67
67
  extraClass = '',
68
68
  }: ButtonProps) {
69
69
  const classNames = [
70
+ 'button',
70
71
  extraClass,
71
72
  `button-tone-${tone}`,
72
73
  `button-variant-${variant}`,
@@ -96,6 +97,7 @@ const StyledButton = styled.button.attrs((props: ButtonProps) => ({
96
97
  background-color: var(--button-bg-color);
97
98
  border: var(--button-border-width) var(--button-border-style) var(--button-border-color);
98
99
  box-shadow: var(--button-box-shadow);
100
+ backdrop-filter: var(--button-backdrop-filter, none);
99
101
 
100
102
  font-weight: var(--button-font-weight);
101
103
  font-size: var(--button-font-size);
@@ -189,7 +191,7 @@ const ButtonComponent: React.FC<ButtonProps> = (props) => {
189
191
 
190
192
  if (props.to) {
191
193
  return (
192
- <StyledButtonLink to={props.to} onClick={props.onClick}>
194
+ <StyledButtonLink to={props.to} external={props.external} onClick={props.onClick}>
193
195
  {button}
194
196
  </StyledButtonLink>
195
197
  );
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { JSX } from 'react';
5
+ import type { ButtonSize } from '@redocly/theme/components/Button/Button';
6
+
7
+ type ButtonGroupVariant = 'outlined';
8
+
9
+ type ButtonGroupProps = {
10
+ variant?: ButtonGroupVariant;
11
+ size?: ButtonSize;
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ };
15
+
16
+ export function ButtonGroup(props: ButtonGroupProps): JSX.Element {
17
+ const { variant = 'outlined', className = '', children, size = 'medium' } = props;
18
+
19
+ return (
20
+ <ButtonGroupWrapper
21
+ data-component-name="Button/ButtonGroup"
22
+ className={`button-group-${variant} button-group-size-${size} ${className}`}
23
+ >
24
+ {children}
25
+ </ButtonGroupWrapper>
26
+ );
27
+ }
28
+
29
+ const ButtonGroupWrapper = styled.div`
30
+ display: flex;
31
+ line-height: var(--button-line-height);
32
+
33
+ .button {
34
+ border-radius: 0;
35
+ }
36
+
37
+ & > .button:first-child,
38
+ *:first-child > .button {
39
+ border-top-left-radius: var(--button-border-radius);
40
+ border-bottom-left-radius: var(--button-border-radius);
41
+ }
42
+
43
+ & > .button:last-child,
44
+ *:last-child > .button {
45
+ border-top-right-radius: var(--button-border-radius);
46
+ border-bottom-right-radius: var(--button-border-radius);
47
+ }
48
+
49
+ & > .button:not(:first-child),
50
+ *:not(:first-child) > .button {
51
+ border-left: none;
52
+ }
53
+ `;
@@ -91,9 +91,12 @@ export const button = css`
91
91
  * @tokens Button size
92
92
  */
93
93
 
94
- .button-size-small {
94
+ .button-size-small,
95
+ .button-group-size-small .button {
96
+ --button-font-size: var(--font-size-base);
95
97
  --button-border-radius: var(--border-radius);
96
98
  --button-padding: 1px var(--spacing-sm);
99
+ --button-line-height: var(--line-height-base);
97
100
 
98
101
  --button-icon-size: 14px;
99
102
  --button-icon-padding: 5px; /* Padding for small buttons with only icon */
@@ -101,11 +104,25 @@ export const button = css`
101
104
  --button-icon-right-padding: 1px 10px 1px var(--spacing-sm); /* Padding for small buttons with icon on the right */
102
105
  }
103
106
 
104
- .button-size-large {
107
+ .button-size-medium,
108
+ .button-group-size-medium .button {
109
+ --button-font-size: var(--font-size-base);
110
+ --button-border-radius: var(--border-radius-md);
111
+ --button-padding: 5px var(--spacing-sm);
112
+ --button-line-height: var(--line-height-base);
113
+
114
+ --button-icon-size: 16px;
115
+ --button-icon-padding: var(--spacing-xs); /* Padding for buttons with only icon */
116
+ --button-icon-left-padding: 5px var(--spacing-base) 5px 14px; /* Padding for buttons with icon on the left */
117
+ --button-icon-right-padding: 5px 14px 5px var(--spacing-base); /* Padding for buttons with icon on the right */
118
+ }
119
+
120
+ .button-size-large,
121
+ .button-group-size-large .button {
105
122
  --button-font-size: var(--font-size-lg); // @presenter FontSize
106
- --button-line-height: var(--line-height-lg); // @presenter LineHeight
107
- --border-radius: var(--border-radius-lg);
123
+ --button-border-radius: var(--border-radius-md);
108
124
  --button-padding: var(--spacing-xs) var(--spacing-md);
125
+ --button-line-height: var(--line-height-lg); // @presenter LineHeight
109
126
 
110
127
  --button-icon-size: 18px;
111
128
  --button-icon-padding: 11px; /* Padding for large buttons with only icon */
@@ -153,7 +170,8 @@ export const button = css`
153
170
  --button-border-color-danger-pressed: transparent;
154
171
  }
155
172
 
156
- .button-variant-outlined {
173
+ .button-variant-outlined,
174
+ .button-group-outlined .button {
157
175
  --button-color: var(--button-content-color-custom); // @presenter Color
158
176
  --button-color-hover: var(--button-content-color-custom-hover); // @presenter Color
159
177
  --button-color-active: var(--button-content-color-custom-hover); // @presenter Color
@@ -163,6 +181,15 @@ export const button = css`
163
181
  --button-bg-color-disabled: transparent; // @presenter Color
164
182
  --button-border-width: 1px;
165
183
  --button-border-width-disabled: 1px;
184
+ --button-bg-color: transparent; // @presenter Color
185
+ --button-border-color-disabled: var(--color-warm-grey-2); // @presenter Color
186
+ --button-border-color-danger: var(--color-raspberry-6); // @presenter Color
187
+ --button-border-color-danger-hover: var(--color-raspberry-7); // @presenter Color
188
+ --button-border-color-danger-pressed: var(--color-raspberry-8); // @presenter Color
189
+ }
190
+
191
+ .button-group-outlined .button {
192
+ --button-bg-color-hover: var(--color-hover-base); // @presenter Color
166
193
  }
167
194
 
168
195
  .button-variant-text {
@@ -8,7 +8,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
8
8
  import { H3 } from '@redocly/theme/components/Typography/H3';
9
9
  import { FilterContent } from '@redocly/theme/components/Filter/FilterContent';
10
10
  import { Sidebar, SidebarHeader } from '@redocly/theme/components/Sidebar/Sidebar';
11
- import { CatalogSwitcherItem } from '@redocly/theme/core';
11
+ import { CatalogSwitcherItem } from '@redocly/theme/core/types/catalog';
12
12
  import { CatalogSelector } from '@redocly/theme/components/Catalog/CatalogSelector';
13
13
  import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
14
14
  import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
@@ -10,7 +10,8 @@ import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIc
10
10
  import { ArrowUpRightIcon } from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
11
11
  import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
12
12
  import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
13
- import { getPathPrefix } from '@redocly/theme/core';
13
+ import { getPathPrefix } from '@redocly/theme/core/utils';
14
+ import { TooltipComponent } from '@redocly/theme/components/Tooltip/Tooltip';
14
15
 
15
16
  export type CatalogCardProps = {
16
17
  entity: BffCatalogEntity;
@@ -34,9 +35,11 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
34
35
  >
35
36
  <CardContent>
36
37
  <CardHeader>
37
- <HeaderIconWrapper>
38
- <CatalogEntityIcon entityType={entity.type} />
39
- </HeaderIconWrapper>
38
+ <TooltipComponent tip={entity.type} placement="bottom" className="catalog">
39
+ <HeaderIconWrapper>
40
+ <CatalogEntityIcon entityType={entity.type} defaultColor={true} />
41
+ </HeaderIconWrapper>
42
+ </TooltipComponent>
40
43
  <CardTitle>
41
44
  <CatalogHighlight>{entity.title}</CatalogHighlight>
42
45
  </CardTitle>
@@ -57,6 +60,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
57
60
  backgroundColor: 'var(--catalog-card-icon-bg-color)',
58
61
  },
59
62
  icon: <GraphIcon color="var(--color-green-8)" />,
63
+ textTransform: 'none',
60
64
  }}
61
65
  />
62
66
  </MetadataColumn>
@@ -71,6 +75,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
71
75
  backgroundColor: 'var(--catalog-card-icon-bg-color)',
72
76
  borderRadius: 'var(--border-radius-xl)',
73
77
  },
78
+ textTransform: 'none',
74
79
  }}
75
80
  />
76
81
  </MetadataColumn>
@@ -89,6 +94,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
89
94
  },
90
95
  borderless: true,
91
96
  color: 'grey',
97
+ textTransform: 'none',
92
98
  }}
93
99
  itemsToShow={3}
94
100
  />
@@ -163,6 +169,7 @@ const CardContent = styled.div`
163
169
  `;
164
170
 
165
171
  const CardFooter = styled.div`
172
+ height: var(--catalog-card-footer-height);
166
173
  display: flex;
167
174
  align-items: center;
168
175
  justify-content: space-between;
@@ -176,8 +183,7 @@ const Divider = styled.div`
176
183
  `;
177
184
 
178
185
  const CatalogCardWrapper = styled.div`
179
- min-height: var(--catalog-card-min-height);
180
- height: 100%;
186
+ height: var(--catalog-card-height);
181
187
  color: var(--catalog-card-text-color);
182
188
  font-size: var(--catalog-card-font-size);
183
189
  font-weight: var(--catalog-card-font-weight);
@@ -1,12 +1,35 @@
1
1
  import React, { JSX } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
- export function CatalogEntitiesEmptyState(): JSX.Element {
4
+ import { HexagonIcon } from '@redocly/theme/icons/HexagonIcon/HexagonIcon';
5
+
6
+ interface CatalogEntitiesEmptyStateProps {
7
+ listType?: 'default' | 'team';
8
+ }
9
+
10
+ export function CatalogEntitiesEmptyState({
11
+ listType = 'default',
12
+ }: CatalogEntitiesEmptyStateProps): JSX.Element {
13
+ if (listType === 'team') {
14
+ return (
15
+ <EmptyStateWrapper data-component-name="Catalog/CatalogEntitiesEmptyState">
16
+ <EmptyStateIconWrapper>
17
+ <HexagonIcon size="21px" color="var(--color-warm-grey-7)" />
18
+ </EmptyStateIconWrapper>
19
+ <EmptyStateHeader>No team members yet</EmptyStateHeader>
20
+ <EmptyStateText>Your team members will appear here</EmptyStateText>
21
+ <EmptyStateText>once they&apos;ve been added to the team.</EmptyStateText>
22
+ </EmptyStateWrapper>
23
+ );
24
+ }
5
25
  return (
6
26
  <EmptyStateWrapper data-component-name="Catalog/CatalogEntitiesEmptyState">
7
- <EmptyStateHeader>No entities yet</EmptyStateHeader>
8
- <EmptyStateText>Start by adding your first entity to</EmptyStateText>
9
- <EmptyStateText>begin building your catalog.</EmptyStateText>
27
+ <EmptyStateIconWrapper>
28
+ <HexagonIcon size="21px" color="var(--color-warm-grey-7)" />
29
+ </EmptyStateIconWrapper>
30
+ <EmptyStateHeader>No entities found</EmptyStateHeader>
31
+ <EmptyStateText>Try adjusting your search criteria or</EmptyStateText>
32
+ <EmptyStateText>check back later for new additions.</EmptyStateText>
10
33
  </EmptyStateWrapper>
11
34
  );
12
35
  }
@@ -21,6 +44,17 @@ const EmptyStateWrapper = styled.div`
21
44
  min-height: var(--catalog-empty-state-min-height);
22
45
  `;
23
46
 
47
+ const EmptyStateIconWrapper = styled.div`
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ background-color: var(--color-warm-grey-2);
52
+ width: 40px;
53
+ height: 40px;
54
+ border-radius: 50%;
55
+ margin-bottom: var(--spacing-xxs);
56
+ `;
57
+
24
58
  const EmptyStateHeader = styled.p`
25
59
  color: var(--catalog-empty-state-header-text-color);
26
60
  font-size: var(--catalog-empty-state-header-font-size);
@@ -16,16 +16,15 @@ import { Menu } from '@redocly/theme/components/Menu/Menu';
16
16
  import { Button } from '@redocly/theme/components/Button/Button';
17
17
  import { CatalogEntityRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations';
18
18
  import { useThemeHooks } from '@redocly/theme/core/hooks';
19
-
20
- import { SidebarActions } from '../../SidebarActions/SidebarActions';
19
+ import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
20
+ import { CatalogEntitySchema } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntitySchema';
21
+ import { CatalogEntityMethodAndPath } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath';
21
22
 
22
23
  export type CatalogEntityProps = {
23
24
  entity: BffCatalogEntity;
24
25
  entitiesCatalogConfig: EntitiesCatalogConfig;
25
26
  catalogConfig: CatalogEntityConfig;
26
27
  initialRelations: BffCatalogRelatedEntityList;
27
- mainCatalogLabelTranslationKey?: string;
28
- mainCatalogSlug?: string;
29
28
  };
30
29
 
31
30
  export function CatalogEntity({
@@ -33,16 +32,31 @@ export function CatalogEntity({
33
32
  entitiesCatalogConfig,
34
33
  catalogConfig,
35
34
  initialRelations,
36
- mainCatalogLabelTranslationKey,
37
- mainCatalogSlug,
38
35
  }: CatalogEntityProps) {
39
36
  const { useTranslate, useCatalog } = useThemeHooks();
40
37
  const { translate } = useTranslate();
41
38
  const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
42
39
  const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
43
40
 
44
- const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick } =
45
- useCatalog();
41
+ const {
42
+ layout,
43
+ collapsedSidebar,
44
+ onChangeViewClick,
45
+ onChangeCollapseSidebarClick,
46
+ searchQuery,
47
+ setSearchQuery,
48
+ } = useCatalog();
49
+
50
+ const renderEntityContent = (): React.ReactElement => {
51
+ switch (entity.type) {
52
+ case 'data-schema':
53
+ return <CatalogEntitySchema entity={entity} />;
54
+ case 'api-operation':
55
+ return <CatalogEntityMethodAndPath entity={entity} />;
56
+ default:
57
+ return <CatalogEntityMetadata entity={entity} />;
58
+ }
59
+ };
46
60
 
47
61
  return (
48
62
  <CatalogPageWrapper data-component-name="Catalog/CatalogEntity/CatalogEntity">
@@ -92,14 +106,6 @@ export function CatalogEntity({
92
106
  <CatalogPageContent>
93
107
  <Breadcrumbs
94
108
  additionalBreadcrumbs={[
95
- ...(mainCatalogLabelTranslationKey
96
- ? [
97
- {
98
- label: translate(mainCatalogLabelTranslationKey),
99
- link: `catalogs/${mainCatalogSlug}`,
100
- },
101
- ]
102
- : []),
103
109
  { label: linkToMainCatalogLabel, link: linkToMainCatalog },
104
110
  { label: entity.title },
105
111
  ]}
@@ -112,7 +118,7 @@ export function CatalogEntity({
112
118
  />
113
119
  <CatalogEntityProperties entity={entity} />
114
120
  <CatalogTwoColumnsSection>
115
- <CatalogEntityMetadata entity={entity} />
121
+ {renderEntityContent()}
116
122
  <CatalogEntityLinks entity={entity} />
117
123
  </CatalogTwoColumnsSection>
118
124
  <CatalogEntityRelations
@@ -120,6 +126,8 @@ export function CatalogEntity({
120
126
  entitiesCatalogConfig={entitiesCatalogConfig}
121
127
  catalogConfig={catalogConfig}
122
128
  initialRelations={initialRelations}
129
+ searchQuery={searchQuery}
130
+ setSearchQuery={setSearchQuery}
123
131
  />
124
132
  </CatalogEntityPageWrapper>
125
133
  </CatalogPageContent>