@redocly/theme 0.55.0-next.7 → 0.55.0-next.9

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 (286) hide show
  1. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  2. package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -1
  3. package/lib/components/Catalog/Catalog.d.ts +11 -0
  4. package/lib/components/Catalog/Catalog.js +138 -0
  5. package/lib/components/Catalog/CatalogActionsRow.d.ts +15 -0
  6. package/lib/components/Catalog/CatalogActionsRow.js +34 -0
  7. package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +8 -0
  8. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +179 -0
  9. package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +8 -0
  10. package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +20 -0
  11. package/lib/components/Catalog/CatalogEntities.d.ts +18 -0
  12. package/lib/components/Catalog/CatalogEntities.js +63 -0
  13. package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +2 -0
  14. package/lib/components/Catalog/CatalogEntitiesEmptyState.js +38 -0
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +12 -0
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +133 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +7 -0
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +49 -0
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +6 -0
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +48 -0
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +6 -0
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +111 -0
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.d.ts +6 -0
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +25 -0
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +6 -0
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +69 -0
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +7 -0
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +48 -0
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +6 -0
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +19 -0
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +6 -0
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +20 -0
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +6 -0
  34. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +20 -0
  35. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +6 -0
  36. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +23 -0
  37. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +6 -0
  38. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +21 -0
  39. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +6 -0
  40. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +24 -0
  41. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +6 -0
  42. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.js +21 -0
  43. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +21 -0
  44. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +37 -0
  45. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +10 -0
  46. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -0
  47. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +25 -0
  48. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +27 -0
  49. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +22 -0
  50. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +60 -0
  51. package/lib/components/Catalog/CatalogEntityIcon.d.ts +5 -0
  52. package/lib/components/Catalog/CatalogEntityIcon.js +38 -0
  53. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +5 -0
  54. package/lib/components/Catalog/CatalogEntityTypeIcon.js +42 -0
  55. package/lib/components/Catalog/CatalogHighlight.d.ts +4 -0
  56. package/lib/components/Catalog/CatalogHighlight.js +48 -0
  57. package/lib/components/Catalog/CatalogPageDescription.d.ts +9 -0
  58. package/lib/components/Catalog/CatalogPageDescription.js +52 -0
  59. package/lib/components/Catalog/CatalogSelector.d.ts +12 -0
  60. package/lib/components/Catalog/CatalogSelector.js +48 -0
  61. package/lib/components/Catalog/CatalogSortButton.d.ts +10 -0
  62. package/lib/components/Catalog/CatalogSortButton.js +71 -0
  63. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.d.ts +5 -0
  64. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +19 -0
  65. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -0
  66. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +63 -0
  67. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.d.ts +5 -0
  68. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +19 -0
  69. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +11 -0
  70. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +101 -0
  71. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +31 -0
  72. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +106 -0
  73. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +27 -0
  74. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +127 -0
  75. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +6 -0
  76. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +20 -0
  77. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.d.ts +7 -0
  78. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +66 -0
  79. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +9 -0
  80. package/lib/components/Catalog/CatalogTagsWithTooltip.js +46 -0
  81. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +7 -0
  82. package/lib/components/Catalog/CatalogViewModeToggle.js +67 -0
  83. package/lib/components/Catalog/variables.d.ts +1 -0
  84. package/lib/components/Catalog/variables.dark.d.ts +1 -0
  85. package/lib/components/Catalog/variables.dark.js +8 -0
  86. package/lib/components/Catalog/variables.js +354 -0
  87. package/lib/components/CatalogClassic/CatalogClassicHighlight.js +1 -1
  88. package/lib/components/Filter/Filter.d.ts +1 -1
  89. package/lib/components/Filter/Filter.js +2 -2
  90. package/lib/components/Filter/FilterCheckboxes.d.ts +1 -1
  91. package/lib/components/Filter/FilterCheckboxes.js +4 -4
  92. package/lib/components/Filter/FilterContent.d.ts +3 -1
  93. package/lib/components/Filter/FilterContent.js +34 -4
  94. package/lib/components/Filter/FilterInput.js +35 -3
  95. package/lib/components/Filter/FilterSelect.d.ts +1 -1
  96. package/lib/components/Filter/FilterSelect.js +4 -4
  97. package/lib/components/LoadMore/LoadMore.d.ts +8 -0
  98. package/lib/components/LoadMore/LoadMore.js +18 -0
  99. package/lib/components/Markdown/Markdown.js +1 -1
  100. package/lib/components/PageNavigation/NavigationButton.d.ts +13 -0
  101. package/lib/components/PageNavigation/NavigationButton.js +32 -0
  102. package/lib/components/PageNavigation/NextButton.js +10 -29
  103. package/lib/components/PageNavigation/PageNavigation.js +1 -1
  104. package/lib/components/PageNavigation/PreviousButton.js +11 -27
  105. package/lib/components/Search/SearchAiConversationInput.js +2 -1
  106. package/lib/components/Select/Select.js +3 -3
  107. package/lib/components/Sidebar/Sidebar.d.ts +3 -0
  108. package/lib/components/Sidebar/Sidebar.js +3 -2
  109. package/lib/components/SkipContent/SkipContent.d.ts +2 -0
  110. package/lib/components/SkipContent/SkipContent.js +68 -0
  111. package/lib/components/SkipContent/variables.d.ts +1 -0
  112. package/lib/components/SkipContent/variables.js +23 -0
  113. package/lib/components/Tag/Tag.d.ts +3 -1
  114. package/lib/components/Tag/Tag.js +54 -2
  115. package/lib/components/Tag/variables.js +21 -0
  116. package/lib/components/Tooltip/Tooltip.d.ts +2 -1
  117. package/lib/components/Tooltip/Tooltip.js +26 -19
  118. package/lib/components/Tooltip/variables.js +17 -0
  119. package/lib/core/constants/catalog.d.ts +1 -0
  120. package/lib/core/constants/catalog.js +5 -0
  121. package/lib/core/constants/common.d.ts +1 -0
  122. package/lib/core/constants/common.js +2 -1
  123. package/lib/core/constants/index.d.ts +1 -0
  124. package/lib/core/constants/index.js +1 -0
  125. package/lib/core/constants/search.d.ts +1 -0
  126. package/lib/core/constants/search.js +2 -1
  127. package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
  128. package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
  129. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +4 -0
  130. package/lib/core/hooks/catalog/useCatalogEntities.js +17 -0
  131. package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.d.ts +15 -0
  132. package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.js +23 -0
  133. package/lib/core/hooks/catalog/useCatalogTableViewRow.d.ts +11 -0
  134. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +26 -0
  135. package/lib/core/hooks/index.d.ts +2 -0
  136. package/lib/core/hooks/index.js +2 -0
  137. package/lib/core/hooks/use-user-teams.d.ts +1 -0
  138. package/lib/core/hooks/use-user-teams.js +10 -0
  139. package/lib/core/styles/dark.js +2 -0
  140. package/lib/core/styles/global.js +65 -60
  141. package/lib/core/types/catalog.d.ts +118 -5
  142. package/lib/core/types/filter.d.ts +1 -0
  143. package/lib/core/types/hooks.d.ts +11 -4
  144. package/lib/core/types/index.d.ts +1 -0
  145. package/lib/core/types/index.js +1 -0
  146. package/lib/core/types/l10n.d.ts +1 -1
  147. package/lib/core/types/telemetry.d.ts +32 -0
  148. package/lib/core/types/telemetry.js +3 -0
  149. package/lib/icons/AscSortIcon/AscSortIcon.d.ts +9 -0
  150. package/lib/icons/AscSortIcon/AscSortIcon.js +25 -0
  151. package/lib/icons/CardsIcon/CardsIcon.d.ts +9 -0
  152. package/lib/icons/CardsIcon/CardsIcon.js +25 -0
  153. package/lib/icons/CaretDownIcon/CaretDownIcon.d.ts +9 -0
  154. package/lib/icons/CaretDownIcon/CaretDownIcon.js +22 -0
  155. package/lib/icons/CaretUpIcon/CaretUpIcon.d.ts +9 -0
  156. package/lib/icons/CaretUpIcon/CaretUpIcon.js +22 -0
  157. package/lib/icons/DescSortIcon/DescSortIcon.d.ts +9 -0
  158. package/lib/icons/DescSortIcon/DescSortIcon.js +25 -0
  159. package/lib/icons/EntityTypeIcon/EntityTypeIcon.d.ts +9 -0
  160. package/lib/icons/EntityTypeIcon/EntityTypeIcon.js +26 -0
  161. package/lib/icons/GithubIcon/GithubIcon.d.ts +9 -0
  162. package/lib/icons/GithubIcon/GithubIcon.js +22 -0
  163. package/lib/icons/GraphIcon/GraphIcon.d.ts +9 -0
  164. package/lib/icons/GraphIcon/GraphIcon.js +22 -0
  165. package/lib/icons/PeopleIcon/PeopleIcon.d.ts +9 -0
  166. package/lib/icons/PeopleIcon/PeopleIcon.js +27 -0
  167. package/lib/icons/SlackIcon/SlackIcon.d.ts +9 -0
  168. package/lib/icons/SlackIcon/SlackIcon.js +29 -0
  169. package/lib/icons/SortIcon/SortIcon.d.ts +9 -0
  170. package/lib/icons/SortIcon/SortIcon.js +25 -0
  171. package/lib/icons/TableIcon/TableIcon.d.ts +9 -0
  172. package/lib/icons/TableIcon/TableIcon.js +22 -0
  173. package/lib/icons/TagsIcon/TagsIcon.d.ts +9 -0
  174. package/lib/icons/TagsIcon/TagsIcon.js +24 -0
  175. package/lib/index.d.ts +18 -0
  176. package/lib/index.js +19 -0
  177. package/lib/layouts/PageLayout.js +2 -1
  178. package/lib/layouts/RootLayout.js +2 -0
  179. package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
  180. package/lib/markdoc/components/Tabs/Tab.js +10 -2
  181. package/lib/markdoc/components/Tabs/TabList.js +2 -2
  182. package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -1
  183. package/lib/markdoc/components/Tabs/Tabs.js +2 -2
  184. package/package.json +2 -1
  185. package/src/components/Breadcrumbs/Breadcrumbs.tsx +7 -2
  186. package/src/components/Catalog/Catalog.tsx +235 -0
  187. package/src/components/Catalog/CatalogActionsRow.tsx +58 -0
  188. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +227 -0
  189. package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +29 -0
  190. package/src/components/Catalog/CatalogEntities.tsx +107 -0
  191. package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -0
  192. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +207 -0
  193. package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +60 -0
  194. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +67 -0
  195. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +93 -0
  196. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +35 -0
  197. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +83 -0
  198. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +62 -0
  199. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +36 -0
  200. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +38 -0
  201. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +33 -0
  202. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +41 -0
  203. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +42 -0
  204. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +39 -0
  205. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +31 -0
  206. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +97 -0
  207. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +80 -0
  208. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +92 -0
  209. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +127 -0
  210. package/src/components/Catalog/CatalogEntityIcon.tsx +41 -0
  211. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +48 -0
  212. package/src/components/Catalog/CatalogHighlight.tsx +56 -0
  213. package/src/components/Catalog/CatalogPageDescription.tsx +72 -0
  214. package/src/components/Catalog/CatalogSelector.tsx +67 -0
  215. package/src/components/Catalog/CatalogSortButton.tsx +78 -0
  216. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +26 -0
  217. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +77 -0
  218. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +26 -0
  219. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +120 -0
  220. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +176 -0
  221. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +180 -0
  222. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +28 -0
  223. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +77 -0
  224. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +83 -0
  225. package/src/components/Catalog/CatalogViewModeToggle.tsx +65 -0
  226. package/src/components/Catalog/variables.dark.ts +5 -0
  227. package/src/components/Catalog/variables.ts +351 -0
  228. package/src/components/CatalogClassic/CatalogClassicHighlight.tsx +1 -1
  229. package/src/components/Filter/Filter.tsx +10 -2
  230. package/src/components/Filter/FilterCheckboxes.tsx +8 -4
  231. package/src/components/Filter/FilterContent.tsx +21 -5
  232. package/src/components/Filter/FilterInput.tsx +16 -4
  233. package/src/components/Filter/FilterSelect.tsx +8 -4
  234. package/src/components/LoadMore/LoadMore.tsx +38 -0
  235. package/src/components/Markdown/Markdown.tsx +1 -1
  236. package/src/components/PageNavigation/NavigationButton.tsx +68 -0
  237. package/src/components/PageNavigation/NextButton.tsx +20 -43
  238. package/src/components/PageNavigation/PageNavigation.tsx +1 -1
  239. package/src/components/PageNavigation/PreviousButton.tsx +20 -43
  240. package/src/components/Search/SearchAiConversationInput.tsx +3 -0
  241. package/src/components/Select/Select.tsx +5 -3
  242. package/src/components/Sidebar/Sidebar.tsx +1 -1
  243. package/src/components/SkipContent/SkipContent.tsx +47 -0
  244. package/src/components/SkipContent/variables.ts +20 -0
  245. package/src/components/Tag/Tag.tsx +67 -1
  246. package/src/components/Tag/variables.ts +21 -0
  247. package/src/components/Tooltip/Tooltip.tsx +31 -22
  248. package/src/components/Tooltip/variables.ts +17 -0
  249. package/src/core/constants/catalog.ts +1 -0
  250. package/src/core/constants/common.ts +1 -0
  251. package/src/core/constants/index.ts +1 -0
  252. package/src/core/constants/search.ts +2 -0
  253. package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
  254. package/src/core/hooks/catalog/useCatalogEntities.ts +16 -0
  255. package/src/core/hooks/catalog/useCatalogTableHeaderCellActions.ts +38 -0
  256. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +40 -0
  257. package/src/core/hooks/index.ts +2 -0
  258. package/src/core/hooks/use-user-teams.ts +8 -0
  259. package/src/core/styles/dark.ts +2 -0
  260. package/src/core/styles/global.ts +5 -0
  261. package/src/core/types/catalog.ts +143 -5
  262. package/src/core/types/filter.ts +1 -0
  263. package/src/core/types/hooks.ts +32 -5
  264. package/src/core/types/index.ts +1 -0
  265. package/src/core/types/l10n.ts +22 -1
  266. package/src/core/types/telemetry.ts +36 -0
  267. package/src/core/utils/load-and-navigate.ts +5 -4
  268. package/src/icons/AscSortIcon/AscSortIcon.tsx +29 -0
  269. package/src/icons/CardsIcon/CardsIcon.tsx +38 -0
  270. package/src/icons/CaretDownIcon/CaretDownIcon.tsx +26 -0
  271. package/src/icons/CaretUpIcon/CaretUpIcon.tsx +26 -0
  272. package/src/icons/DescSortIcon/DescSortIcon.tsx +29 -0
  273. package/src/icons/EntityTypeIcon/EntityTypeIcon.tsx +49 -0
  274. package/src/icons/GithubIcon/GithubIcon.tsx +35 -0
  275. package/src/icons/GraphIcon/GraphIcon.tsx +26 -0
  276. package/src/icons/PeopleIcon/PeopleIcon.tsx +46 -0
  277. package/src/icons/SlackIcon/SlackIcon.tsx +61 -0
  278. package/src/icons/SortIcon/SortIcon.tsx +29 -0
  279. package/src/icons/TableIcon/TableIcon.tsx +26 -0
  280. package/src/icons/TagsIcon/TagsIcon.tsx +41 -0
  281. package/src/index.ts +20 -0
  282. package/src/layouts/PageLayout.tsx +4 -1
  283. package/src/layouts/RootLayout.tsx +2 -0
  284. package/src/markdoc/components/Tabs/Tab.tsx +12 -1
  285. package/src/markdoc/components/Tabs/TabList.tsx +2 -1
  286. package/src/markdoc/components/Tabs/Tabs.tsx +8 -3
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { CatalogEntityConfig } from '@redocly/config';
4
+
5
+ import { BffCatalogEntity } from '@redocly/theme/core/types';
6
+ import { CatalogCard } from '@redocly/theme/components/Catalog/CatalogCardView/CatalogCard';
7
+
8
+ export type CatalogCardViewProps = {
9
+ entities: BffCatalogEntity[];
10
+ catalogConfig: CatalogEntityConfig;
11
+ };
12
+
13
+ export function CatalogCardView({ entities, catalogConfig }: CatalogCardViewProps) {
14
+ return (
15
+ <CatalogCardsWrapper data-component-name="Catalog/CatalogCardView/CatalogCardView">
16
+ {entities.map((entity) => (
17
+ <CatalogCard key={entity.id} entity={entity} catalogConfig={catalogConfig} />
18
+ ))}
19
+ </CatalogCardsWrapper>
20
+ );
21
+ }
22
+
23
+ const CatalogCardsWrapper = styled.div`
24
+ display: grid;
25
+ grid-template-columns: repeat(auto-fill, minmax(var(--catalog-card-min-width), 1fr));
26
+ gap: var(--catalog-cards-group-gap);
27
+ margin-bottom: var(--spacing-xl);
28
+ margin-top: var(--spacing-xl);
29
+ `;
@@ -0,0 +1,107 @@
1
+ import React, { JSX, useEffect } from 'react';
2
+ import { CatalogEntityConfig } from '@redocly/config';
3
+
4
+ import { BffCatalogEntity, BffCatalogEntityList, SortOption } from '@redocly/theme/core/types';
5
+ import { useThemeHooks, useCatalogEntities } from '@redocly/theme/core/hooks';
6
+ import { ArrowDownIcon } from '@redocly/theme/icons/ArrowDownIcon/ArrowDownIcon';
7
+ import { CatalogCardView } from '@redocly/theme/components/Catalog/CatalogCardView/CatalogCardView';
8
+ import { CatalogTableView } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
9
+ import { HighlightContext } from '@redocly/theme/components/Catalog/CatalogHighlight';
10
+ import { LoadMore } from '@redocly/theme/components/LoadMore/LoadMore';
11
+ import { CatalogEntitiesEmptyState } from '@redocly/theme/components/Catalog/CatalogEntitiesEmptyState';
12
+
13
+ export type CatalogEntitiesProps = {
14
+ catalogConfig: CatalogEntityConfig;
15
+ excludedEntities?: CatalogEntityConfig['excludes'];
16
+ filterQuery: string;
17
+ entitiesTypes: string[];
18
+ searchQuery: string;
19
+ viewMode: string;
20
+ setEntitiesCounter: (counter: number) => void;
21
+ initialEntitiesList?: BffCatalogEntityList;
22
+ sortOption: SortOption | null;
23
+ setSortOption: (sortOption: SortOption | null) => void;
24
+ handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
25
+ isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
26
+ };
27
+
28
+ const LOAD_MORE_THRESHOLD = 10;
29
+
30
+ export function CatalogEntities(props: CatalogEntitiesProps): JSX.Element {
31
+ const {
32
+ catalogConfig,
33
+ excludedEntities,
34
+ filterQuery,
35
+ entitiesTypes,
36
+ sortOption,
37
+ searchQuery,
38
+ viewMode,
39
+ setEntitiesCounter,
40
+ setSortOption,
41
+ handleSortClick,
42
+ isColumnSorted,
43
+ } = props;
44
+
45
+ const { useFetchCatalogEntities } = useThemeHooks();
46
+
47
+ const { initialFilter } = useCatalogEntities({
48
+ entitiesTypes,
49
+ excludedEntities,
50
+ });
51
+
52
+ const {
53
+ items: entities,
54
+ query,
55
+ total,
56
+ } = useFetchCatalogEntities(
57
+ {
58
+ limit: LOAD_MORE_THRESHOLD,
59
+ filter:
60
+ initialFilter && filterQuery
61
+ ? `${initialFilter} AND ${filterQuery}`
62
+ : initialFilter || filterQuery,
63
+ sort: sortOption || undefined,
64
+ search: searchQuery,
65
+ },
66
+ props.initialEntitiesList,
67
+ );
68
+
69
+ const shouldShowLoadMore =
70
+ query.hasNextPage ||
71
+ (query.isPlaceholderData && entities && entities.length >= LOAD_MORE_THRESHOLD);
72
+
73
+ useEffect(() => {
74
+ setEntitiesCounter(total || 0);
75
+ }, [total, setEntitiesCounter]);
76
+
77
+ if (!query.isPending && (!entities || entities.length === 0)) {
78
+ return <CatalogEntitiesEmptyState />;
79
+ }
80
+
81
+ return (
82
+ <HighlightContext.Provider value={[searchQuery]} data-component-name="Catalog/CatalogEntities">
83
+ {viewMode === 'cards' ? (
84
+ <CatalogCardView entities={entities} catalogConfig={catalogConfig} />
85
+ ) : (
86
+ <CatalogTableView<BffCatalogEntity>
87
+ entities={entities}
88
+ catalogConfig={catalogConfig}
89
+ setSortOption={setSortOption}
90
+ currentSortOption={sortOption}
91
+ handleSortClick={handleSortClick}
92
+ isColumnSorted={isColumnSorted}
93
+ />
94
+ )}
95
+
96
+ {shouldShowLoadMore && (
97
+ <LoadMore
98
+ icon={<ArrowDownIcon size="var(--catalog-load-more-icon-size)" />}
99
+ onClick={query.fetchNextPage}
100
+ disabled={query.isFetchingNextPage}
101
+ blinking={query.isFetchingNextPage}
102
+ label={query.isFetchingNextPage ? 'Loading...' : 'Load More'}
103
+ />
104
+ )}
105
+ </HighlightContext.Provider>
106
+ );
107
+ }
@@ -0,0 +1,38 @@
1
+ import React, { JSX } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ export function CatalogEntitiesEmptyState(): JSX.Element {
5
+ return (
6
+ <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>
10
+ </EmptyStateWrapper>
11
+ );
12
+ }
13
+
14
+ const EmptyStateWrapper = styled.div`
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ justify-content: center;
19
+ padding: var(--catalog-empty-state-padding);
20
+ text-align: center;
21
+ min-height: var(--catalog-empty-state-min-height);
22
+ `;
23
+
24
+ const EmptyStateHeader = styled.p`
25
+ color: var(--catalog-empty-state-header-text-color);
26
+ font-size: var(--catalog-empty-state-header-font-size);
27
+ font-weight: var(--catalog-empty-state-header-font-weight);
28
+ line-height: var(--catalog-empty-state-header-line-height);
29
+ margin: 0;
30
+ `;
31
+
32
+ const EmptyStateText = styled.p`
33
+ color: var(--catalog-empty-state-text-color);
34
+ font-size: var(--catalog-empty-state-font-size);
35
+ font-weight: var(--catalog-empty-state-font-weight);
36
+ line-height: var(--catalog-empty-state-line-height);
37
+ margin: 0;
38
+ `;
@@ -0,0 +1,207 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
4
+
5
+ import type { BffCatalogEntity, BffCatalogRelatedEntityList } from '@redocly/theme/core/types';
6
+
7
+ import { breakpoints } from '@redocly/theme/core/utils';
8
+ import { ArrowLeftIcon } from '@redocly/theme/icons/ArrowLeftIcon/ArrowLeftIcon';
9
+ import { CatalogPageDescription } from '@redocly/theme/components/Catalog/CatalogPageDescription';
10
+ import { CatalogEntityProperties } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties';
11
+ import { CatalogEntityMetadata } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityMetadata';
12
+ import { CatalogEntityLinks } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityLinks';
13
+ import { Breadcrumbs } from '@redocly/theme/components/Breadcrumbs/Breadcrumbs';
14
+ import { Sidebar } from '@redocly/theme/components/Sidebar/Sidebar';
15
+ import { Menu } from '@redocly/theme/components/Menu/Menu';
16
+ import { Button } from '@redocly/theme/components/Button/Button';
17
+ import { CatalogEntityRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations';
18
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
19
+
20
+ import { SidebarActions } from '../../SidebarActions/SidebarActions';
21
+
22
+ export type CatalogEntityProps = {
23
+ entity: BffCatalogEntity;
24
+ entitiesCatalogConfig: EntitiesCatalogConfig;
25
+ catalogConfig: CatalogEntityConfig;
26
+ initialRelations: BffCatalogRelatedEntityList;
27
+ mainCatalogLabelTranslationKey?: string;
28
+ mainCatalogSlug?: string;
29
+ };
30
+
31
+ export function CatalogEntity({
32
+ entity,
33
+ entitiesCatalogConfig,
34
+ catalogConfig,
35
+ initialRelations,
36
+ mainCatalogLabelTranslationKey,
37
+ mainCatalogSlug,
38
+ }: CatalogEntityProps) {
39
+ const { useTranslate, useCatalog } = useThemeHooks();
40
+ const { translate } = useTranslate();
41
+ const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
42
+ const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
43
+
44
+ const { layout, collapsedSidebar, onChangeViewClick, onChangeCollapseSidebarClick } =
45
+ useCatalog();
46
+
47
+ return (
48
+ <CatalogPageWrapper data-component-name="Catalog/CatalogEntity/CatalogEntity">
49
+ <CatalogSidebar
50
+ collapsed={collapsedSidebar}
51
+ header={
52
+ <BackLink
53
+ icon={<ArrowLeftIcon />}
54
+ iconPosition="left"
55
+ variant="ghost"
56
+ size="medium"
57
+ data-component-name="Sidebar/BackButton"
58
+ to={linkToMainCatalog}
59
+ >
60
+ {collapsedSidebar ? (
61
+ ''
62
+ ) : (
63
+ <div data-translation-key="sidebar.menu.backLabel">
64
+ {translate('sidebar.menu.backLabel')}
65
+ </div>
66
+ )}
67
+ </BackLink>
68
+ }
69
+ menu={
70
+ <Menu
71
+ items={[
72
+ {
73
+ label: 'Overview',
74
+ link: `${linkToMainCatalog}/entities/${entity.key}`,
75
+ active: true,
76
+ items: [],
77
+ hasActiveSubItem: false,
78
+ },
79
+ ]}
80
+ />
81
+ }
82
+ footer={
83
+ <SidebarActions
84
+ layout={layout}
85
+ collapsedSidebar={collapsedSidebar}
86
+ isApiDocs={false}
87
+ onChangeViewClick={onChangeViewClick}
88
+ onChangeCollapseSidebarClick={onChangeCollapseSidebarClick}
89
+ />
90
+ }
91
+ />
92
+ <CatalogPageContent>
93
+ <Breadcrumbs
94
+ additionalBreadcrumbs={[
95
+ ...(mainCatalogLabelTranslationKey
96
+ ? [
97
+ {
98
+ label: translate(mainCatalogLabelTranslationKey),
99
+ link: `catalogs/${mainCatalogSlug}`,
100
+ },
101
+ ]
102
+ : []),
103
+ { label: linkToMainCatalogLabel, link: linkToMainCatalog },
104
+ { label: entity.title },
105
+ ]}
106
+ />
107
+ <CatalogEntityPageWrapper>
108
+ <CatalogPageDescription
109
+ title={entity.title}
110
+ description={entity.summary ?? ''}
111
+ tag={entity.key}
112
+ />
113
+ <CatalogEntityProperties entity={entity} />
114
+ <CatalogTwoColumnsSection>
115
+ <CatalogEntityMetadata entity={entity} />
116
+ <CatalogEntityLinks entity={entity} />
117
+ </CatalogTwoColumnsSection>
118
+ <CatalogEntityRelations
119
+ entity={entity}
120
+ entitiesCatalogConfig={entitiesCatalogConfig}
121
+ catalogConfig={catalogConfig}
122
+ initialRelations={initialRelations}
123
+ />
124
+ </CatalogEntityPageWrapper>
125
+ </CatalogPageContent>
126
+ </CatalogPageWrapper>
127
+ );
128
+ }
129
+
130
+ const CatalogPageWrapper = styled.div`
131
+ --sidebar-width: var(--catalog-sidebar-width);
132
+ --link-color-primary: var(--breadcrumbs-text-color);
133
+
134
+ display: flex;
135
+ flex-direction: column;
136
+
137
+ font-weight: var(--font-weight-regular);
138
+
139
+ color: var(--text-color-secondary);
140
+ font-size: var(--font-size-base);
141
+ font-family: var(--font-family-base);
142
+ line-height: var(--line-height-base);
143
+
144
+ hr {
145
+ border: 0;
146
+ width: calc(100% + 48px);
147
+ margin: auto -24px 0 -24px;
148
+ border-top: 1px solid var(--border-color-primary);
149
+ }
150
+ a:not([role='button']) {
151
+ text-decoration: none;
152
+ color: var(--link-color-primary);
153
+ font-weight: var(--link-font-weight);
154
+ }
155
+
156
+ @media screen and (min-width: ${breakpoints.medium}) {
157
+ flex-direction: row;
158
+ padding: 0;
159
+ }
160
+ `;
161
+
162
+ const CatalogPageContent = styled.main`
163
+ flex: 1;
164
+ width: 90%;
165
+ margin: 0 auto;
166
+
167
+ @media screen and (min-width: ${breakpoints.medium}) {
168
+ width: 100%;
169
+ padding: var(--catalog-page-padding);
170
+ }
171
+ `;
172
+
173
+ const CatalogSidebar = styled(Sidebar)`
174
+ display: none;
175
+
176
+ @media screen and (min-width: ${breakpoints.medium}) {
177
+ display: flex;
178
+ }
179
+ --menu-container-padding-top: 0;
180
+ `;
181
+
182
+ const CatalogEntityPageWrapper = styled.div`
183
+ display: flex;
184
+ flex-direction: column;
185
+
186
+ font-weight: var(--font-weight-regular);
187
+
188
+ color: var(--text-color-secondary);
189
+ font-size: var(--font-size-base);
190
+ font-family: var(--font-family-base);
191
+ line-height: var(--line-height-base);
192
+ `;
193
+
194
+ const CatalogTwoColumnsSection = styled.section`
195
+ display: grid;
196
+ grid-template-columns: 1fr 1fr;
197
+ gap: 24px;
198
+ align-items: start;
199
+ `;
200
+
201
+ const BackLink = styled(Button)`
202
+ padding: var(--spacing-unit) 0;
203
+ height: calc(var(--line-height-base) + var(--spacing-unit) * 2);
204
+ justify-content: flex-start;
205
+ width: 100%;
206
+ margin-bottom: 0px;
207
+ `;
@@ -0,0 +1,60 @@
1
+ import React, { ReactNode, JSX } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ export type CatalogEntityInfoBarProps = {
5
+ leftContent: ReactNode;
6
+ rightContent: ReactNode;
7
+ withSeparator?: boolean;
8
+ };
9
+
10
+ export function CatalogEntityInfoBar({
11
+ leftContent,
12
+ rightContent,
13
+ withSeparator = true,
14
+ }: CatalogEntityInfoBarProps): JSX.Element {
15
+ return (
16
+ <InfoBarWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityInfoBar">
17
+ <LeftColumn withSeparator={withSeparator}>{leftContent}</LeftColumn>
18
+ <RightColumn>{rightContent}</RightColumn>
19
+ </InfoBarWrapper>
20
+ );
21
+ }
22
+
23
+ const InfoBarWrapper = styled.div`
24
+ display: grid;
25
+ grid-template-columns: 1fr 1fr;
26
+ grid-template-areas: 'left right';
27
+ align-items: center;
28
+
29
+ color: var(--catalog-card-text-color, inherit);
30
+ background-color: var(--catalog-card-bg-color, white);
31
+ border: var(--catalog-card-border-width, 1px) var(--catalog-card-border-style)
32
+ var(--catalog-card-border-color);
33
+ border-radius: var(--catalog-card-border-radius);
34
+ transition: all 0.2s ease-in-out;
35
+ height: 100%;
36
+ padding: var(--catalog-card-gap);
37
+
38
+ &:hover {
39
+ border-color: var(--catalog-card-border-color-hover);
40
+ }
41
+ `;
42
+
43
+ const LeftColumn = styled.div<{ withSeparator?: boolean }>`
44
+ font-weight: var(--font-weight-medium);
45
+ color: var(--catalog-metadata-label-color);
46
+ width: 100%;
47
+ grid-area: left;
48
+ justify-self: start;
49
+ text-align: left;
50
+ border-right: ${({ withSeparator }) =>
51
+ withSeparator ? '1px solid var(--border-color-primary)' : 'none'};
52
+ `;
53
+
54
+ const RightColumn = styled.div`
55
+ color: var(--catalog-metadata-value-color);
56
+ font-weight: var(--font-weight-medium);
57
+ grid-area: right;
58
+ justify-self: end;
59
+ text-align: right;
60
+ `;
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { BffCatalogEntity } from '@redocly/theme/core/types';
5
+ import { LaunchIcon } from '@redocly/theme/icons/LaunchIcon/LaunchIcon';
6
+ import { DocumentIcon } from '@redocly/theme/icons/DocumentIcon/DocumentIcon';
7
+ import { CatalogEntityInfoBar } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityInfoBar';
8
+ import { Link } from '@redocly/theme/components/Link/Link';
9
+
10
+ export type CatalogEntityLinksProps = {
11
+ entity: BffCatalogEntity;
12
+ };
13
+
14
+ export function CatalogEntityLinks({ entity }: CatalogEntityLinksProps) {
15
+ const links = Object.entries(entity.links || []);
16
+
17
+ if (!links.length) {
18
+ return null;
19
+ }
20
+
21
+ return (
22
+ <LinksWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityLinks">
23
+ <Heading>Links</Heading>
24
+ {links.map(([key, value]) => (
25
+ <CatalogEntityInfoBar
26
+ key={key}
27
+ leftContent={
28
+ <Label>
29
+ <DocumentIcon /> {value.label}
30
+ </Label>
31
+ }
32
+ rightContent={
33
+ <Link color="var(--catalog-metadata-link-color)" to={value.url} target="_blank">
34
+ <LaunchIcon />
35
+ </Link>
36
+ }
37
+ withSeparator={false}
38
+ />
39
+ ))}
40
+ </LinksWrapper>
41
+ );
42
+ }
43
+
44
+ const LinksWrapper = styled.div`
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: var(--spacing-xs);
48
+ border-radius: var(--border-radius);
49
+ background-color: var(--catalog-metadata-bg-color);
50
+ transition: all 0.2s ease-in-out;
51
+ margin: var(--spacing-lg) 0;
52
+ `;
53
+
54
+ const Label = styled.span`
55
+ display: flex;
56
+ align-items: center;
57
+ gap: var(--spacing-unit);
58
+ font-weight: var(--font-weight-medium);
59
+ color: var(--catalog-metadata-label-color);
60
+ `;
61
+
62
+ const Heading = styled.h2`
63
+ margin-bottom: var(--spacing-sm);
64
+ margin-top: 0;
65
+ font-size: var(--font-size-md);
66
+ color: var(--catalog-metadata-heading-color);
67
+ `;
@@ -0,0 +1,93 @@
1
+ import React, { useState } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { BffCatalogEntity } from '@redocly/theme/core/types';
5
+ import { ChevronDownIcon } from '@redocly/theme/icons/ChevronDownIcon/ChevronDownIcon';
6
+ import { capitalize } from '@redocly/theme/core/utils';
7
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
8
+ import { CatalogEntityInfoBar } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityInfoBar';
9
+
10
+ const MAX_INITIAL_ITEMS = 4;
11
+
12
+ export type CatalogEntityMetadataProps = {
13
+ entity: BffCatalogEntity;
14
+ };
15
+
16
+ export function CatalogEntityMetadata({ entity }: CatalogEntityMetadataProps) {
17
+ const { useTranslate } = useThemeHooks();
18
+ const { translate } = useTranslate();
19
+ const { schema, ...metadataToShow } = entity.metadata || {};
20
+ const metadata = Object.entries(metadataToShow);
21
+ const [isOn, setIsOn] = useState(false);
22
+ const hasMoreItems = metadata.length > MAX_INITIAL_ITEMS;
23
+ const visibleMetadata = isOn ? metadata : metadata.slice(0, MAX_INITIAL_ITEMS);
24
+
25
+ if (!metadata.length) {
26
+ return null;
27
+ }
28
+ return (
29
+ <MetadataWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityMetadata">
30
+ <Heading>{translate('catalog.entity.metadata.title')}</Heading>
31
+ {visibleMetadata.map(([key, value]) => (
32
+ <CatalogEntityInfoBar
33
+ key={key}
34
+ leftContent={<Label>{capitalize(key)}:</Label>}
35
+ rightContent={<Value>{value}</Value>}
36
+ />
37
+ ))}
38
+ {hasMoreItems && (
39
+ <ShowMoreButton onClick={() => setIsOn(!isOn)}>
40
+ {isOn ? 'Show less' : 'Show more'} <ChevronIcon $isExpanded={isOn} />
41
+ </ShowMoreButton>
42
+ )}
43
+ </MetadataWrapper>
44
+ );
45
+ }
46
+
47
+ const MetadataWrapper = styled.div`
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: var(--spacing-xs);
51
+ border-radius: var(--border-radius);
52
+ background-color: var(--catalog-metadata-bg-color);
53
+ transition: all 0.2s ease-in-out;
54
+ margin: var(--spacing-lg) 0;
55
+ `;
56
+
57
+ const Label = styled.span`
58
+ font-weight: var(--font-weight-medium);
59
+ color: var(--catalog-metadata-label-color);
60
+ `;
61
+
62
+ const Value = styled.span`
63
+ color: var(--catalog-metadata-value-color);
64
+ font-weight: var(--font-weight-medium);
65
+ `;
66
+
67
+ const Heading = styled.h2`
68
+ margin-bottom: var(--spacing-base);
69
+ margin-top: 0;
70
+ font-size: var(--catalog-metadata-heading-size);
71
+ `;
72
+
73
+ const ChevronIcon = styled(ChevronDownIcon)<{ $isExpanded: boolean }>`
74
+ transform: ${({ $isExpanded }) => ($isExpanded ? 'rotate(180deg)' : 'rotate(0)')};
75
+ transition: transform 0.2s ease;
76
+ `;
77
+
78
+ const ShowMoreButton = styled.button`
79
+ background: none;
80
+ border: none;
81
+ display: flex;
82
+ align-items: center;
83
+ gap: var(--catalog-metadata-button-gap, 0.5rem);
84
+ cursor: pointer;
85
+ color: var(--catalog-metadata-button-color);
86
+ padding: 0;
87
+ font-weight: var(--font-weight-medium);
88
+ margin-top: var(--spacing-unit);
89
+
90
+ &:hover {
91
+ color: var(--catalog-metadata-button-color-hover);
92
+ }
93
+ `;
@@ -0,0 +1,35 @@
1
+ import React, { JSX } from 'react';
2
+ import { useNavigate } from 'react-router-dom';
3
+
4
+ import { BffCatalogEntity } from '@redocly/theme/core/types';
5
+ import { DocumentIcon, getPathPrefix, Tag, useThemeHooks } from '@redocly/theme';
6
+ import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
+
8
+ export type ApiDescriptionPropertyProps = {
9
+ entity: BffCatalogEntity;
10
+ };
11
+
12
+ export function ApiDescriptionProperty({ entity }: ApiDescriptionPropertyProps): JSX.Element {
13
+ const { useTranslate } = useThemeHooks();
14
+ const { translate } = useTranslate();
15
+ const navigate = useNavigate();
16
+ const pathPrefix = getPathPrefix();
17
+ const descriptionFile = entity.metadata?.descriptionFile;
18
+
19
+ return (
20
+ <div data-component-name="Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty">
21
+ <CatalogEntityPropertyCard
22
+ header={
23
+ <>
24
+ <DocumentIcon />
25
+ {translate('catalog.entity.properties.apiDescription.title')}
26
+ </>
27
+ }
28
+ content={<Tag>{descriptionFile}</Tag>}
29
+ onClick={() => {
30
+ navigate(`${pathPrefix}/${descriptionFile}`);
31
+ }}
32
+ />
33
+ </div>
34
+ );
35
+ }