@redocly/theme 0.55.0-rc.1 → 0.55.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 (353) hide show
  1. package/lib/components/Admonition/Admonition.js +4 -0
  2. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
  3. package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -1
  4. package/lib/components/Button/Button.d.ts +1 -0
  5. package/lib/components/Catalog/Catalog.d.ts +11 -0
  6. package/lib/components/Catalog/Catalog.js +138 -0
  7. package/lib/components/Catalog/CatalogActionsRow.d.ts +15 -0
  8. package/lib/components/Catalog/CatalogActionsRow.js +34 -0
  9. package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +8 -0
  10. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +179 -0
  11. package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +8 -0
  12. package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +20 -0
  13. package/lib/components/Catalog/CatalogEntities.d.ts +18 -0
  14. package/lib/components/Catalog/CatalogEntities.js +63 -0
  15. package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +2 -0
  16. package/lib/components/Catalog/CatalogEntitiesEmptyState.js +38 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +12 -0
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +133 -0
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +7 -0
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +49 -0
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +6 -0
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +48 -0
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +6 -0
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +111 -0
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.d.ts +6 -0
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +25 -0
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +6 -0
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +69 -0
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +7 -0
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +48 -0
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +6 -0
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +19 -0
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +6 -0
  34. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +20 -0
  35. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +6 -0
  36. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +20 -0
  37. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +6 -0
  38. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +23 -0
  39. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +6 -0
  40. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +21 -0
  41. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +6 -0
  42. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +24 -0
  43. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +6 -0
  44. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.js +21 -0
  45. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +21 -0
  46. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +37 -0
  47. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +10 -0
  48. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -0
  49. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +25 -0
  50. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +27 -0
  51. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +22 -0
  52. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +60 -0
  53. package/lib/components/Catalog/CatalogEntityIcon.d.ts +5 -0
  54. package/lib/components/Catalog/CatalogEntityIcon.js +38 -0
  55. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +5 -0
  56. package/lib/components/Catalog/CatalogEntityTypeIcon.js +42 -0
  57. package/lib/components/Catalog/CatalogHighlight.d.ts +4 -0
  58. package/lib/components/Catalog/CatalogHighlight.js +48 -0
  59. package/lib/components/Catalog/CatalogPageDescription.d.ts +9 -0
  60. package/lib/components/Catalog/CatalogPageDescription.js +52 -0
  61. package/lib/components/Catalog/CatalogSelector.d.ts +12 -0
  62. package/lib/components/Catalog/CatalogSelector.js +48 -0
  63. package/lib/components/Catalog/CatalogSortButton.d.ts +10 -0
  64. package/lib/components/Catalog/CatalogSortButton.js +71 -0
  65. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.d.ts +5 -0
  66. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +19 -0
  67. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -0
  68. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +63 -0
  69. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.d.ts +5 -0
  70. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +19 -0
  71. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +11 -0
  72. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +101 -0
  73. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +31 -0
  74. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +106 -0
  75. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +27 -0
  76. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +127 -0
  77. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +6 -0
  78. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +20 -0
  79. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.d.ts +7 -0
  80. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +66 -0
  81. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +9 -0
  82. package/lib/components/Catalog/CatalogTagsWithTooltip.js +46 -0
  83. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +7 -0
  84. package/lib/components/Catalog/CatalogViewModeToggle.js +67 -0
  85. package/lib/components/Catalog/variables.d.ts +1 -0
  86. package/lib/components/Catalog/variables.dark.d.ts +1 -0
  87. package/lib/components/Catalog/variables.dark.js +8 -0
  88. package/lib/components/Catalog/variables.js +354 -0
  89. package/lib/components/CatalogClassic/CatalogClassicHighlight.js +1 -1
  90. package/lib/components/Dropdown/variables.js +1 -1
  91. package/lib/components/Filter/Filter.d.ts +1 -1
  92. package/lib/components/Filter/Filter.js +2 -2
  93. package/lib/components/Filter/FilterCheckboxes.d.ts +1 -1
  94. package/lib/components/Filter/FilterCheckboxes.js +4 -4
  95. package/lib/components/Filter/FilterContent.d.ts +3 -1
  96. package/lib/components/Filter/FilterContent.js +34 -4
  97. package/lib/components/Filter/FilterInput.js +35 -3
  98. package/lib/components/Filter/FilterSelect.d.ts +1 -1
  99. package/lib/components/Filter/FilterSelect.js +4 -4
  100. package/lib/components/Image/Image.js +2 -2
  101. package/lib/components/LoadMore/LoadMore.d.ts +8 -0
  102. package/lib/components/LoadMore/LoadMore.js +18 -0
  103. package/lib/components/Markdown/Markdown.js +1 -1
  104. package/lib/components/Marker/Marker.d.ts +10 -0
  105. package/lib/components/Marker/Marker.js +62 -0
  106. package/lib/components/Menu/MenuItem.d.ts +1 -1
  107. package/lib/components/Menu/MenuItem.js +7 -3
  108. package/lib/components/PageNavigation/NavigationButton.d.ts +13 -0
  109. package/lib/components/PageNavigation/NavigationButton.js +32 -0
  110. package/lib/components/PageNavigation/NextButton.js +10 -29
  111. package/lib/components/PageNavigation/PageNavigation.js +1 -1
  112. package/lib/components/PageNavigation/PreviousButton.js +11 -27
  113. package/lib/components/Search/SearchAiConversationInput.js +2 -1
  114. package/lib/components/Select/Select.js +22 -6
  115. package/lib/components/Select/SelectInput.d.ts +1 -0
  116. package/lib/components/Select/SelectInput.js +7 -3
  117. package/lib/components/Select/variables.js +2 -2
  118. package/lib/components/Sidebar/Sidebar.d.ts +3 -0
  119. package/lib/components/Sidebar/Sidebar.js +3 -2
  120. package/lib/components/SkipContent/SkipContent.d.ts +2 -0
  121. package/lib/components/SkipContent/SkipContent.js +68 -0
  122. package/lib/components/SkipContent/variables.d.ts +1 -0
  123. package/lib/components/SkipContent/variables.js +23 -0
  124. package/lib/components/Tag/Tag.d.ts +3 -1
  125. package/lib/components/Tag/Tag.js +54 -2
  126. package/lib/components/Tag/variables.js +21 -0
  127. package/lib/components/Tooltip/Tooltip.d.ts +2 -1
  128. package/lib/components/Tooltip/Tooltip.js +26 -19
  129. package/lib/components/Tooltip/variables.js +17 -0
  130. package/lib/components/VersionPicker/VersionPicker.js +22 -3
  131. package/lib/components/VersionPicker/variables.js +1 -0
  132. package/lib/core/constants/catalog.d.ts +1 -0
  133. package/lib/core/constants/catalog.js +5 -0
  134. package/lib/core/constants/common.d.ts +1 -0
  135. package/lib/core/constants/common.js +2 -1
  136. package/lib/core/constants/index.d.ts +1 -0
  137. package/lib/core/constants/index.js +1 -0
  138. package/lib/core/constants/search.d.ts +1 -0
  139. package/lib/core/constants/search.js +2 -1
  140. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
  141. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.js +5 -2
  142. package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
  143. package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
  144. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +4 -0
  145. package/lib/core/hooks/catalog/useCatalogEntities.js +17 -0
  146. package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.d.ts +15 -0
  147. package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.js +23 -0
  148. package/lib/core/hooks/catalog/useCatalogTableViewRow.d.ts +11 -0
  149. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +26 -0
  150. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +17 -9
  151. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +242 -47
  152. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +9 -2
  153. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +2 -2
  154. package/lib/core/hooks/index.d.ts +3 -1
  155. package/lib/core/hooks/index.js +3 -1
  156. package/lib/core/hooks/use-active-page-version.d.ts +1 -0
  157. package/lib/core/hooks/{use-page-active-version.js → use-active-page-version.js} +3 -3
  158. package/lib/core/hooks/use-user-teams.d.ts +1 -0
  159. package/lib/core/hooks/use-user-teams.js +10 -0
  160. package/lib/core/styles/dark.js +2 -0
  161. package/lib/core/styles/global.js +65 -60
  162. package/lib/core/types/catalog.d.ts +118 -5
  163. package/lib/core/types/code-walkthrough.d.ts +13 -0
  164. package/lib/core/types/code-walkthrough.js +3 -0
  165. package/lib/core/types/filter.d.ts +1 -0
  166. package/lib/core/types/hooks.d.ts +11 -4
  167. package/lib/core/types/index.d.ts +3 -0
  168. package/lib/core/types/index.js +3 -0
  169. package/lib/core/types/l10n.d.ts +1 -1
  170. package/lib/core/types/marker.d.ts +4 -0
  171. package/lib/core/types/marker.js +3 -0
  172. package/lib/core/types/telemetry.d.ts +32 -0
  173. package/lib/core/types/telemetry.js +3 -0
  174. package/lib/core/utils/index.d.ts +1 -0
  175. package/lib/core/utils/index.js +1 -0
  176. package/lib/core/utils/js-utils.d.ts +18 -0
  177. package/lib/core/utils/js-utils.js +31 -0
  178. package/lib/core/utils/parse-style-string.d.ts +1 -0
  179. package/lib/core/utils/parse-style-string.js +23 -0
  180. package/lib/icons/AscSortIcon/AscSortIcon.d.ts +9 -0
  181. package/lib/icons/AscSortIcon/AscSortIcon.js +25 -0
  182. package/lib/icons/CardsIcon/CardsIcon.d.ts +9 -0
  183. package/lib/icons/CardsIcon/CardsIcon.js +25 -0
  184. package/lib/icons/CaretDownIcon/CaretDownIcon.d.ts +9 -0
  185. package/lib/icons/CaretDownIcon/CaretDownIcon.js +22 -0
  186. package/lib/icons/CaretUpIcon/CaretUpIcon.d.ts +9 -0
  187. package/lib/icons/CaretUpIcon/CaretUpIcon.js +22 -0
  188. package/lib/icons/DescSortIcon/DescSortIcon.d.ts +9 -0
  189. package/lib/icons/DescSortIcon/DescSortIcon.js +25 -0
  190. package/lib/icons/EntityTypeIcon/EntityTypeIcon.d.ts +9 -0
  191. package/lib/icons/EntityTypeIcon/EntityTypeIcon.js +26 -0
  192. package/lib/icons/GithubIcon/GithubIcon.d.ts +9 -0
  193. package/lib/icons/GithubIcon/GithubIcon.js +22 -0
  194. package/lib/icons/GraphIcon/GraphIcon.d.ts +9 -0
  195. package/lib/icons/GraphIcon/GraphIcon.js +22 -0
  196. package/lib/icons/PeopleIcon/PeopleIcon.d.ts +9 -0
  197. package/lib/icons/PeopleIcon/PeopleIcon.js +27 -0
  198. package/lib/icons/SlackIcon/SlackIcon.d.ts +9 -0
  199. package/lib/icons/SlackIcon/SlackIcon.js +29 -0
  200. package/lib/icons/SortIcon/SortIcon.d.ts +9 -0
  201. package/lib/icons/SortIcon/SortIcon.js +25 -0
  202. package/lib/icons/TableIcon/TableIcon.d.ts +9 -0
  203. package/lib/icons/TableIcon/TableIcon.js +22 -0
  204. package/lib/icons/TagsIcon/TagsIcon.d.ts +9 -0
  205. package/lib/icons/TagsIcon/TagsIcon.js +24 -0
  206. package/lib/index.d.ts +19 -1
  207. package/lib/index.js +20 -1
  208. package/lib/layouts/PageLayout.js +2 -1
  209. package/lib/layouts/RootLayout.js +2 -0
  210. package/lib/markdoc/components/CodeWalkthrough/CodeStep.d.ts +1 -2
  211. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +26 -20
  212. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +32 -3
  213. package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
  214. package/lib/markdoc/components/Tabs/Tab.js +10 -2
  215. package/lib/markdoc/components/Tabs/TabList.d.ts +1 -4
  216. package/lib/markdoc/components/Tabs/TabList.js +18 -38
  217. package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -1
  218. package/lib/markdoc/components/Tabs/Tabs.js +5 -9
  219. package/lib/markdoc/tags/code-step.js +0 -3
  220. package/lib/markdoc/tags/code-walkthrough.js +0 -1
  221. package/package.json +4 -3
  222. package/src/components/Admonition/Admonition.tsx +4 -0
  223. package/src/components/Breadcrumbs/Breadcrumbs.tsx +7 -2
  224. package/src/components/Button/Button.tsx +1 -1
  225. package/src/components/Catalog/Catalog.tsx +235 -0
  226. package/src/components/Catalog/CatalogActionsRow.tsx +58 -0
  227. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +227 -0
  228. package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +29 -0
  229. package/src/components/Catalog/CatalogEntities.tsx +107 -0
  230. package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -0
  231. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +207 -0
  232. package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +60 -0
  233. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +67 -0
  234. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +93 -0
  235. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +35 -0
  236. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +83 -0
  237. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +62 -0
  238. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +36 -0
  239. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +38 -0
  240. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +33 -0
  241. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +41 -0
  242. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +42 -0
  243. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +39 -0
  244. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +31 -0
  245. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +97 -0
  246. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +80 -0
  247. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +92 -0
  248. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +127 -0
  249. package/src/components/Catalog/CatalogEntityIcon.tsx +41 -0
  250. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +48 -0
  251. package/src/components/Catalog/CatalogHighlight.tsx +56 -0
  252. package/src/components/Catalog/CatalogPageDescription.tsx +72 -0
  253. package/src/components/Catalog/CatalogSelector.tsx +67 -0
  254. package/src/components/Catalog/CatalogSortButton.tsx +78 -0
  255. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +26 -0
  256. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +77 -0
  257. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +26 -0
  258. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +120 -0
  259. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +176 -0
  260. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +180 -0
  261. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +28 -0
  262. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +77 -0
  263. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +83 -0
  264. package/src/components/Catalog/CatalogViewModeToggle.tsx +65 -0
  265. package/src/components/Catalog/variables.dark.ts +5 -0
  266. package/src/components/Catalog/variables.ts +351 -0
  267. package/src/components/CatalogClassic/CatalogClassicHighlight.tsx +1 -1
  268. package/src/components/Dropdown/variables.ts +1 -1
  269. package/src/components/Filter/Filter.tsx +10 -2
  270. package/src/components/Filter/FilterCheckboxes.tsx +8 -4
  271. package/src/components/Filter/FilterContent.tsx +21 -5
  272. package/src/components/Filter/FilterInput.tsx +16 -4
  273. package/src/components/Filter/FilterSelect.tsx +8 -4
  274. package/src/components/Image/Image.tsx +5 -9
  275. package/src/components/LoadMore/LoadMore.tsx +38 -0
  276. package/src/components/Markdown/Markdown.tsx +1 -1
  277. package/src/components/Marker/Marker.tsx +53 -0
  278. package/src/components/Menu/MenuItem.tsx +11 -2
  279. package/src/components/PageNavigation/NavigationButton.tsx +68 -0
  280. package/src/components/PageNavigation/NextButton.tsx +20 -43
  281. package/src/components/PageNavigation/PageNavigation.tsx +1 -1
  282. package/src/components/PageNavigation/PreviousButton.tsx +20 -43
  283. package/src/components/Search/SearchAiConversationInput.tsx +3 -0
  284. package/src/components/Select/Select.tsx +29 -4
  285. package/src/components/Select/SelectInput.tsx +20 -1
  286. package/src/components/Select/variables.ts +2 -2
  287. package/src/components/Sidebar/Sidebar.tsx +1 -1
  288. package/src/components/SkipContent/SkipContent.tsx +47 -0
  289. package/src/components/SkipContent/variables.ts +20 -0
  290. package/src/components/Tag/Tag.tsx +67 -1
  291. package/src/components/Tag/variables.ts +21 -0
  292. package/src/components/Tooltip/Tooltip.tsx +31 -22
  293. package/src/components/Tooltip/variables.ts +17 -0
  294. package/src/components/VersionPicker/VersionPicker.tsx +32 -2
  295. package/src/components/VersionPicker/variables.ts +1 -0
  296. package/src/core/constants/catalog.ts +1 -0
  297. package/src/core/constants/common.ts +1 -0
  298. package/src/core/constants/index.ts +1 -0
  299. package/src/core/constants/search.ts +2 -0
  300. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +6 -3
  301. package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
  302. package/src/core/hooks/catalog/useCatalogEntities.ts +16 -0
  303. package/src/core/hooks/catalog/useCatalogTableHeaderCellActions.ts +38 -0
  304. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +40 -0
  305. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +326 -65
  306. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +9 -6
  307. package/src/core/hooks/index.ts +3 -1
  308. package/src/core/hooks/{use-page-active-version.ts → use-active-page-version.ts} +1 -1
  309. package/src/core/hooks/use-user-teams.ts +8 -0
  310. package/src/core/styles/dark.ts +2 -0
  311. package/src/core/styles/global.ts +5 -0
  312. package/src/core/types/catalog.ts +143 -5
  313. package/src/core/types/code-walkthrough.ts +15 -0
  314. package/src/core/types/filter.ts +1 -0
  315. package/src/core/types/hooks.ts +32 -5
  316. package/src/core/types/index.ts +3 -0
  317. package/src/core/types/l10n.ts +22 -1
  318. package/src/core/types/marker.ts +4 -0
  319. package/src/core/types/telemetry.ts +36 -0
  320. package/src/core/utils/index.ts +1 -0
  321. package/src/core/utils/js-utils.ts +31 -0
  322. package/src/core/utils/load-and-navigate.ts +5 -4
  323. package/src/core/utils/parse-style-string.ts +21 -0
  324. package/src/icons/AscSortIcon/AscSortIcon.tsx +29 -0
  325. package/src/icons/CardsIcon/CardsIcon.tsx +38 -0
  326. package/src/icons/CaretDownIcon/CaretDownIcon.tsx +26 -0
  327. package/src/icons/CaretUpIcon/CaretUpIcon.tsx +26 -0
  328. package/src/icons/DescSortIcon/DescSortIcon.tsx +29 -0
  329. package/src/icons/EntityTypeIcon/EntityTypeIcon.tsx +49 -0
  330. package/src/icons/GithubIcon/GithubIcon.tsx +35 -0
  331. package/src/icons/GraphIcon/GraphIcon.tsx +26 -0
  332. package/src/icons/PeopleIcon/PeopleIcon.tsx +46 -0
  333. package/src/icons/SlackIcon/SlackIcon.tsx +61 -0
  334. package/src/icons/SortIcon/SortIcon.tsx +29 -0
  335. package/src/icons/TableIcon/TableIcon.tsx +26 -0
  336. package/src/icons/TagsIcon/TagsIcon.tsx +41 -0
  337. package/src/index.ts +21 -1
  338. package/src/layouts/PageLayout.tsx +4 -1
  339. package/src/layouts/RootLayout.tsx +2 -0
  340. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +76 -36
  341. package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +8 -3
  342. package/src/markdoc/components/Tabs/Tab.tsx +12 -1
  343. package/src/markdoc/components/Tabs/TabList.tsx +40 -70
  344. package/src/markdoc/components/Tabs/Tabs.tsx +11 -10
  345. package/src/markdoc/tags/code-step.ts +0 -3
  346. package/src/markdoc/tags/code-walkthrough.ts +0 -1
  347. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +0 -1
  348. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +0 -5
  349. package/lib/core/hooks/use-page-active-version.d.ts +0 -1
  350. package/lib/ext/process-scorecard.d.ts +0 -5
  351. package/lib/ext/process-scorecard.js +0 -11
  352. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +0 -1
  353. package/src/ext/process-scorecard.ts +0 -13
@@ -8,9 +8,17 @@ 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, }) {
11
+ function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }) {
12
12
  return (react_1.default.createElement(TabList_1.TabItem, { "data-component-name": "Markdoc/Tabs/Tab", size: size, tabIndex: 0 },
13
- 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 }, label)));
13
+ 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
+ react_1.default.createElement(LabelWrapper, null,
15
+ icon,
16
+ label))));
14
17
  }
18
+ const LabelWrapper = styled_components_1.default.div `
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 4px;
22
+ `;
15
23
  exports.Tab = (0, styled_components_1.default)(TabComponent) ``;
16
24
  //# sourceMappingURL=Tab.js.map
@@ -26,8 +26,5 @@ export declare const TabItem: import("styled-components").StyledComponent<"li",
26
26
  size: TabsSize;
27
27
  tabIndex?: number;
28
28
  }, never>;
29
- export declare const TabButtonLink: import("styled-components").StyledComponent<"button", any, {
30
- size: TabsSize;
31
- disabled?: boolean;
32
- }, never>;
29
+ export declare const TabButtonLink: import("styled-components").StyledComponent<React.FC<import("../../../components/Button/Button").ButtonProps>, any, import("../../../components/Button/Button").ButtonProps, never>;
33
30
  export {};
@@ -22,34 +22,29 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
25
28
  Object.defineProperty(exports, "__esModule", { value: true });
26
29
  exports.TabButtonLink = exports.TabItem = exports.TabListContainer = void 0;
27
30
  exports.TabList = TabList;
28
- const react_1 = __importStar(require("react"));
31
+ const react_1 = __importDefault(require("react"));
29
32
  const styled_components_1 = __importStar(require("styled-components"));
30
33
  const Tab_1 = require("../../../markdoc/components/Tabs/Tab");
31
34
  const Dropdown_1 = require("../../../components/Dropdown/Dropdown");
32
35
  const DropdownMenu_1 = require("../../../components/Dropdown/DropdownMenu");
33
36
  const DropdownMenuItem_1 = require("../../../components/Dropdown/DropdownMenuItem");
34
- const ChevronDownIcon_1 = require("../../../icons/ChevronDownIcon/ChevronDownIcon");
35
- const ChevronUpIcon_1 = require("../../../icons/ChevronUpIcon/ChevronUpIcon");
37
+ const Button_1 = require("../../../components/Button/Button");
36
38
  function TabList({ childrenArray, size, overflowTabs, visibleTabs, setTabRef, onTabClick, handleKeyboard, getTabId, activeTab, isAnimating, highlightStyle, allTabsHidden, tabsContainerRef, }) {
37
- const [isDropdownOpen, setIsDropdownOpen] = (0, react_1.useState)(false);
38
- const handleDropdownOpen = (0, react_1.useCallback)(() => {
39
- setIsDropdownOpen(true);
40
- }, []);
41
- const handleDropdownClose = (0, react_1.useCallback)(() => {
42
- setIsDropdownOpen(false);
43
- }, []);
44
39
  return (react_1.default.createElement(exports.TabListContainer, { role: "tablist", ref: tabsContainerRef, "data-animating": isAnimating },
45
40
  react_1.default.createElement(HighlightBar, { size: size, style: { left: highlightStyle.left, width: highlightStyle.width } },
46
41
  react_1.default.createElement("div", null)),
47
42
  childrenArray.map((child, index) => {
48
43
  if (!visibleTabs.includes(index))
49
44
  return null;
50
- const { label } = child.props;
45
+ const { label, icon } = child.props;
51
46
  const tabId = getTabId(label, index);
52
- return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, size: size, disabled: child.props.disable, setRef: (el) => {
47
+ return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, icon: icon, size: size, disabled: child.props.disable, setRef: (el) => {
53
48
  setTabRef(el, index);
54
49
  if (el) {
55
50
  el.setAttribute('data-label', label);
@@ -59,20 +54,16 @@ function TabList({ childrenArray, size, overflowTabs, visibleTabs, setTabRef, on
59
54
  onTabClick(label);
60
55
  } }));
61
56
  }),
62
- react_1.default.createElement(exports.TabItem, { size: size, active: overflowTabs.some((index) => activeTab === childrenArray[index].props.label), tabIndex: 0 }, overflowTabs.length > 0 && (react_1.default.createElement("div", { onPointerEnter: handleDropdownOpen, onPointerLeave: handleDropdownClose },
63
- react_1.default.createElement(Dropdown_1.Dropdown, { trigger: react_1.default.createElement(exports.TabButtonLink, { size: size, className: overflowTabs.some((index) => activeTab === childrenArray[index].props.label)
64
- ? 'active'
65
- : undefined },
66
- allTabsHidden ? activeTab : 'More',
67
- isDropdownOpen ? react_1.default.createElement(ChevronUpIcon_1.ChevronUpIcon, null) : react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, null)), alignment: "start", withArrow: false, active: isDropdownOpen, triggerEvent: "click" },
68
- react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, overflowTabs.map((index) => {
69
- const { label } = childrenArray[index].props;
70
- const tabId = getTabId(label, index);
71
- return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: `more-${tabId}`, active: activeTab === label, onAction: () => {
72
- onTabClick(index);
73
- handleDropdownClose();
74
- }, disabled: childrenArray[index].props.disable }, label));
75
- }))))))));
57
+ react_1.default.createElement(exports.TabItem, { size: size, active: overflowTabs.some((index) => activeTab === childrenArray[index].props.label), tabIndex: 0 }, overflowTabs.length > 0 && (react_1.default.createElement(Dropdown_1.Dropdown, { trigger: react_1.default.createElement(exports.TabButtonLink, { size: size, className: overflowTabs.some((index) => activeTab === childrenArray[index].props.label)
58
+ ? 'active'
59
+ : undefined }, allTabsHidden ? activeTab : 'More'), alignment: "start", withArrow: true },
60
+ react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, overflowTabs.map((index) => {
61
+ const { label } = childrenArray[index].props;
62
+ const tabId = getTabId(label, index);
63
+ return (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: `more-${tabId}`, active: activeTab === label, onAction: () => {
64
+ onTabClick(index);
65
+ }, disabled: childrenArray[index].props.disable }, label));
66
+ })))))));
76
67
  }
77
68
  exports.TabListContainer = styled_components_1.default.ul `
78
69
  position: relative;
@@ -166,22 +157,11 @@ const HighlightBar = styled_components_1.default.div `
166
157
  border-radius: var(--md-tabs-${({ size }) => size}-active-tab-border-radius);
167
158
  }
168
159
  `;
169
- exports.TabButtonLink = styled_components_1.default.button `
170
- all: unset;
171
- flex-grow: 1;
172
- cursor: pointer;
173
- width: 100%;
174
- text-align: center;
160
+ exports.TabButtonLink = (0, styled_components_1.default)(Button_1.Button) `
175
161
  color: var(--md-tabs-tab-text-color);
176
162
  font-family: var(--md-tabs-tab-font-family);
177
163
  font-style: var(--md-tabs-tab-font-style);
178
164
  background-color: var(--md-tabs-tab-bg-color);
179
- white-space: nowrap;
180
- display: inline-flex;
181
- align-items: center;
182
- justify-content: center;
183
- gap: var(--spacing-xxs);
184
- z-index: 2;
185
165
 
186
166
  transition:
187
167
  background-color 300ms ease-in-out,
@@ -9,12 +9,14 @@ export type TabItemProps = {
9
9
  disable?: boolean;
10
10
  onClick?: () => void;
11
11
  children: React.ReactNode;
12
+ icon?: React.ReactNode;
12
13
  };
13
14
  type TabsProps = {
14
15
  children: React.ReactElement<TabItemProps>[];
15
16
  className?: string;
16
17
  size: TabsSize;
18
+ forceReady?: boolean;
17
19
  };
18
- export declare function Tabs({ children, className, size }: TabsProps): JSX.Element;
20
+ export declare function Tabs({ children, className, size, forceReady }: TabsProps): JSX.Element;
19
21
  export declare const TabContent: import("styled-components").StyledComponent<"div", any, {}, never>;
20
22
  export {};
@@ -34,7 +34,7 @@ var TabsSize;
34
34
  TabsSize["SMALL"] = "small";
35
35
  TabsSize["MEDIUM"] = "medium";
36
36
  })(TabsSize || (exports.TabsSize = TabsSize = {}));
37
- function Tabs({ children, className, size }) {
37
+ function Tabs({ children, className, size, forceReady = false }) {
38
38
  var _a, _b;
39
39
  const [childrenArray, setChildrenArray] = (0, react_1.useState)(react_1.default.Children.toArray(children));
40
40
  (0, react_1.useEffect)(() => {
@@ -92,14 +92,10 @@ function Tabs({ children, className, size }) {
92
92
  else {
93
93
  setHighlightStyle({ left: offsetLeft, width: offsetWidth });
94
94
  }
95
- const timeoutId = setTimeout(() => {
96
- if (visibleTabs.includes(activeIndex)) {
97
- activeTabElement === null || activeTabElement === void 0 ? void 0 : activeTabElement.classList.add('active');
98
- }
99
- setIsAnimating(false);
100
- }, 300);
95
+ if (visibleTabs.includes(activeIndex)) {
96
+ activeTabElement === null || activeTabElement === void 0 ? void 0 : activeTabElement.classList.add('active');
97
+ }
101
98
  return () => {
102
- clearTimeout(timeoutId);
103
99
  container.querySelectorAll('[data-label]').forEach((el) => {
104
100
  el.classList.remove('active');
105
101
  });
@@ -115,7 +111,7 @@ function Tabs({ children, className, size }) {
115
111
  setIsAnimating(false);
116
112
  }
117
113
  }, [activeTab, prevTab, childrenArray, visibleTabs, overflowTabs]);
118
- return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, isReady: ready },
114
+ return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, isReady: ready || forceReady },
119
115
  react_1.default.createElement(TabList_1.TabList, { size: size, childrenArray: childrenArray, overflowTabs: overflowTabs, setTabRef: setTabRef, onTabClick: onTabClick, handleKeyboard: handleKeyboard, getTabId: getTabId, activeTab: activeTab, isAnimating: isAnimating, highlightStyle: highlightStyle, visibleTabs: visibleTabs, allTabsHidden: allTabsHidden, tabsContainerRef: tabsContainerRef }),
120
116
  childrenArray.map((child, index) => {
121
117
  const { label } = child.props;
@@ -18,9 +18,6 @@ exports.codeStep = {
18
18
  unless: {
19
19
  type: Object,
20
20
  },
21
- stepKey: {
22
- type: Number, // internal
23
- },
24
21
  },
25
22
  render: 'CodeStep',
26
23
  },
@@ -149,7 +149,6 @@ exports.codeWalkthrough = {
149
149
  function collectStepsFromChildren(children, idx = 0) {
150
150
  return children.flatMap((child) => {
151
151
  if (child instanceof markdoc_1.default.Tag && child.name === 'CodeStep') {
152
- child.attributes.stepKey = idx++;
153
152
  return [child];
154
153
  }
155
154
  if (child instanceof markdoc_1.default.Tag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.55.0-rc.1",
3
+ "version": "0.55.0",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -76,6 +76,7 @@
76
76
  "webpack": "5.94.0"
77
77
  },
78
78
  "dependencies": {
79
+ "@tanstack/react-query": "5.62.3",
79
80
  "@tanstack/react-virtual": "3.13.0",
80
81
  "copy-to-clipboard": "3.3.3",
81
82
  "file-saver": "2.0.5",
@@ -88,8 +89,8 @@
88
89
  "nprogress": "0.2.0",
89
90
  "react-calendar": "5.1.0",
90
91
  "react-date-picker": "11.0.0",
91
- "@redocly/config": "0.27.0-rc.0",
92
- "@redocly/realm-asyncapi-sdk": "0.1.0-rc.0"
92
+ "@redocly/config": "0.26.2",
93
+ "@redocly/realm-asyncapi-sdk": "0.1.0-next.0"
93
94
  },
94
95
  "scripts": {
95
96
  "watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
@@ -56,6 +56,10 @@ const Content = styled.div`
56
56
  & > p:first-child {
57
57
  margin-top: 0;
58
58
  }
59
+
60
+ & > p:last-child {
61
+ margin-bottom: 0;
62
+ }
59
63
  `;
60
64
 
61
65
  const AdmonitionWrapper = styled.div<AdmonitionTypeProps>`
@@ -1,15 +1,20 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
+ import { BreadcrumbItem } from '@redocly/config';
3
4
 
4
5
  import type { JSX } from 'react';
5
6
 
6
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
7
8
  import { Breadcrumb } from '@redocly/theme/components/Breadcrumbs/Breadcrumb';
8
9
 
9
- export function Breadcrumbs(props: { className?: string }): JSX.Element | null {
10
+ export function Breadcrumbs(props: {
11
+ className?: string;
12
+ additionalBreadcrumbs?: BreadcrumbItem[];
13
+ }): JSX.Element | null {
10
14
  const { useBreadcrumbs, useTelemetry } = useThemeHooks();
15
+ const fileBreadcrumbs = useBreadcrumbs();
16
+ const breadcrumbs = [...fileBreadcrumbs, ...(props.additionalBreadcrumbs || [])];
11
17
  const telemetry = useTelemetry();
12
- const breadcrumbs = useBreadcrumbs();
13
18
 
14
19
  if (breadcrumbs.length === 0) {
15
20
  return null;
@@ -32,7 +32,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
32
32
  title?: string;
33
33
  tabIndex?: number;
34
34
  onClick?: (e?: any) => void;
35
-
35
+ ref?: React.Ref<HTMLButtonElement>;
36
36
  type?: 'button' | 'submit' | 'reset';
37
37
  }
38
38
 
@@ -0,0 +1,235 @@
1
+ import React, { JSX } from 'react';
2
+ import styled from 'styled-components';
3
+ import { CatalogEntityConfig } from '@redocly/config';
4
+
5
+ import { BffCatalogEntityList } from '@redocly/theme/core/types';
6
+ import { breakpoints } from '@redocly/theme/core/utils';
7
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
8
+ import { H3 } from '@redocly/theme/components/Typography/H3';
9
+ import { FilterContent } from '@redocly/theme/components/Filter/FilterContent';
10
+ import { Sidebar, SidebarHeader } from '@redocly/theme/components/Sidebar/Sidebar';
11
+ import { CatalogSwitcherItem } from '@redocly/theme/core';
12
+ import { CatalogSelector } from '@redocly/theme/components/Catalog/CatalogSelector';
13
+ import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
14
+ import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
15
+ import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
16
+ import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
17
+ import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
18
+ import { CatalogEntities } from '@redocly/theme/components/Catalog/CatalogEntities';
19
+
20
+ export type CatalogProps = {
21
+ catalogConfig: CatalogEntityConfig;
22
+ entitiesTypes: string[];
23
+ initialEntitiesList?: BffCatalogEntityList;
24
+ catalogSwitcherItems: CatalogSwitcherItem[];
25
+ };
26
+
27
+ export function Catalog(props: CatalogProps): JSX.Element {
28
+ const { catalogConfig, entitiesTypes, initialEntitiesList, catalogSwitcherItems } = props;
29
+
30
+ const { useTranslate, useCatalog } = useThemeHooks();
31
+
32
+ const { translate } = useTranslate();
33
+
34
+ const {
35
+ filters,
36
+ searchQuery,
37
+ setSearchQuery,
38
+ filterQuery,
39
+ sortOption,
40
+ setSortOption,
41
+ handleSortClick,
42
+ isColumnSorted,
43
+ viewMode,
44
+ setViewMode,
45
+ entitiesCounter,
46
+ setEntitiesCounter,
47
+ onChangeViewClick,
48
+ onChangeCollapseSidebarClick,
49
+ layout,
50
+ collapsedSidebar,
51
+ } = useCatalog(catalogConfig, initialEntitiesList?.page.total || 0);
52
+
53
+ return (
54
+ <>
55
+ <CatalogPageWrapper data-component-name="Catalog/Catalog">
56
+ <FiltersSidebar
57
+ collapsed={collapsedSidebar}
58
+ header={
59
+ collapsedSidebar ? null : (
60
+ <CatalogSelector
61
+ catalogSwitcherItems={catalogSwitcherItems}
62
+ setSearchQuery={setSearchQuery}
63
+ setSortOption={setSortOption}
64
+ />
65
+ )
66
+ }
67
+ menu={
68
+ <FilterContent
69
+ setFilterTerm={setSearchQuery}
70
+ filters={filters}
71
+ filterTerm={searchQuery}
72
+ hideSearch={true}
73
+ showCounter={false}
74
+ filterValuesCasing="sentence"
75
+ />
76
+ }
77
+ footer={
78
+ <SidebarActions
79
+ layout={layout}
80
+ collapsedSidebar={collapsedSidebar}
81
+ isApiDocs={false}
82
+ onChangeViewClick={onChangeViewClick}
83
+ onChangeCollapseSidebarClick={onChangeCollapseSidebarClick}
84
+ />
85
+ }
86
+ />
87
+ <CatalogPageContent>
88
+ <CatalogPageDescription>
89
+ <CatalogTitleWrapper>
90
+ <CatalogTitle data-translation-key={catalogConfig?.titleTranslationKey}>
91
+ {translate(catalogConfig?.titleTranslationKey)}{' '}
92
+ </CatalogTitle>
93
+ <CounterTag borderless>{entitiesCounter}</CounterTag>
94
+ </CatalogTitleWrapper>
95
+ <CatalogDescription data-translation-key={catalogConfig?.descriptionTranslationKey}>
96
+ {translate(catalogConfig?.descriptionTranslationKey)}
97
+ </CatalogDescription>
98
+ </CatalogPageDescription>
99
+
100
+ <CatalogActionsRow>
101
+ <CatalogSearchInputWrapper>
102
+ <FilterInput
103
+ value={searchQuery}
104
+ onChange={(updatedTerm) => setSearchQuery(updatedTerm)}
105
+ />
106
+ </CatalogSearchInputWrapper>
107
+
108
+ <CatalogControlsWrapper>
109
+ <CatalogSortButton onSortChange={setSortOption} currentSort={sortOption} />
110
+ <CatalogViewModeToggle viewMode={viewMode} onViewModeChange={setViewMode} />
111
+ </CatalogControlsWrapper>
112
+ </CatalogActionsRow>
113
+
114
+ <CatalogEntities
115
+ catalogConfig={catalogConfig}
116
+ excludedEntities={catalogConfig?.excludes}
117
+ filterQuery={filterQuery}
118
+ entitiesTypes={entitiesTypes}
119
+ sortOption={sortOption}
120
+ searchQuery={searchQuery}
121
+ viewMode={viewMode}
122
+ setEntitiesCounter={setEntitiesCounter}
123
+ initialEntitiesList={initialEntitiesList}
124
+ setSortOption={setSortOption}
125
+ handleSortClick={handleSortClick}
126
+ isColumnSorted={isColumnSorted}
127
+ />
128
+ </CatalogPageContent>
129
+ </CatalogPageWrapper>
130
+ </>
131
+ );
132
+ }
133
+
134
+ const CatalogActionsRow = styled.div`
135
+ display: flex;
136
+ align-items: center;
137
+ `;
138
+
139
+ const CatalogControlsWrapper = styled.div`
140
+ display: var(--catalog-controls-wrapper-display);
141
+ align-items: var(--catalog-controls-wrapper-align-items);
142
+ margin-left: var(--catalog-controls-wrapper-margin-left);
143
+ gap: var(--catalog-controls-wrapper-gap);
144
+ `;
145
+
146
+ const CatalogPageContent = styled.main`
147
+ flex: 1;
148
+ width: var(--catalog-page-content-width-mobile);
149
+ margin: var(--catalog-page-content-margin-mobile);
150
+
151
+ @media screen and (min-width: ${breakpoints.medium}) {
152
+ width: var(--catalog-page-content-width-desktop);
153
+ padding: var(--catalog-page-padding);
154
+ }
155
+ `;
156
+
157
+ const CatalogTitleWrapper = styled.div`
158
+ display: flex;
159
+ align-items: center;
160
+ color: var(--catalog-title-text-color);
161
+ font-weight: var(--catalog-title-font-weight) !important;
162
+ font-size: var(--catalog-title-font-size);
163
+ `;
164
+
165
+ const CatalogTitle = styled(H3)`
166
+ color: var(--catalog-title-text-color);
167
+ font-weight: var(--catalog-title-font-weight) !important;
168
+ font-size: var(--catalog-title-font-size);
169
+ margin: var(--catalog-title-margin);
170
+ margin-right: var(--catalog-title-spacing-right);
171
+ `;
172
+
173
+ const CatalogDescription = styled.p`
174
+ color: var(--catalog-description-text-color);
175
+ font-weight: var(--catalog-description-font-weight);
176
+ font-size: var(--catalog-description-font-size);
177
+ margin: var(--catalog-description-margin);
178
+ line-height: var(--catalog-description-line-height);
179
+ `;
180
+
181
+ const CatalogPageWrapper = styled.div`
182
+ --sidebar-width: var(--catalog-sidebar-width);
183
+
184
+ display: flex;
185
+ flex-direction: column;
186
+
187
+ font-weight: var(--catalog-page-wrapper-font-weight);
188
+ color: var(--catalog-page-wrapper-text-color);
189
+ font-size: var(--catalog-page-wrapper-font-size);
190
+ font-family: var(--catalog-page-wrapper-font-family);
191
+ line-height: var(--catalog-page-wrapper-line-height);
192
+
193
+ hr {
194
+ border: 0;
195
+ width: var(--catalog-hr-width);
196
+ margin: var(--catalog-hr-margin);
197
+ border-top: var(--catalog-hr-border-width) solid var(--catalog-hr-border-color);
198
+ }
199
+ a:not([role='button']) {
200
+ text-decoration: var(--catalog-link-text-decoration);
201
+ color: var(--catalog-link-color);
202
+ font-weight: var(--catalog-link-font-weight);
203
+ }
204
+
205
+ @media screen and (min-width: ${breakpoints.medium}) {
206
+ flex-direction: row;
207
+ padding: 0;
208
+ }
209
+ `;
210
+
211
+ const CatalogPageDescription = styled.div`
212
+ margin: var(--catalog-heading-margin);
213
+ display: var(--catalog-page-description-display-mobile);
214
+
215
+ @media screen and (min-width: ${breakpoints.medium}) {
216
+ display: var(--catalog-page-description-display-desktop);
217
+ }
218
+ `;
219
+
220
+ const FiltersSidebar = styled(Sidebar)`
221
+ display: var(--catalog-sidebar-display-mobile);
222
+
223
+ @media screen and (min-width: ${breakpoints.medium}) {
224
+ display: var(--catalog-sidebar-display-desktop);
225
+ }
226
+ --menu-container-padding-top: var(--catalog-sidebar-menu-container-padding-top);
227
+
228
+ ${SidebarHeader} {
229
+ border: none;
230
+ }
231
+ `;
232
+
233
+ const CatalogSearchInputWrapper = styled.div`
234
+ width: var(--catalog-search-input-wrapper-width);
235
+ `;
@@ -0,0 +1,58 @@
1
+ import React, { JSX } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { SortOption, CatalogViewMode } from '@redocly/theme/core/types';
5
+ import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
6
+ import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
7
+ import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
8
+
9
+ export type CatalogActionsRowProps = {
10
+ searchQuery: string;
11
+ setSearchQuery: (updatedTerm: string) => void;
12
+ sortOption: SortOption | null;
13
+ setSortOption: (option: SortOption | null) => void;
14
+ viewMode?: CatalogViewMode;
15
+ onViewModeChange?: (mode: CatalogViewMode) => void;
16
+ style?: React.CSSProperties;
17
+ };
18
+
19
+ export function CatalogActionsRow({
20
+ searchQuery,
21
+ setSearchQuery,
22
+ sortOption,
23
+ setSortOption,
24
+ viewMode,
25
+ onViewModeChange,
26
+ style,
27
+ }: CatalogActionsRowProps): JSX.Element {
28
+ return (
29
+ <CatalogActionsRowWrapper style={style}>
30
+ <CatalogSearchInputWrapper>
31
+ <FilterInput value={searchQuery} onChange={(updatedTerm) => setSearchQuery(updatedTerm)} />
32
+ </CatalogSearchInputWrapper>
33
+
34
+ <CatalogControlsWrapper>
35
+ <CatalogSortButton onSortChange={setSortOption} currentSort={sortOption} />
36
+ {viewMode && onViewModeChange && (
37
+ <CatalogViewModeToggle viewMode={viewMode} onViewModeChange={onViewModeChange} />
38
+ )}
39
+ </CatalogControlsWrapper>
40
+ </CatalogActionsRowWrapper>
41
+ );
42
+ }
43
+
44
+ export const CatalogActionsRowWrapper = styled.div`
45
+ display: flex;
46
+ align-items: center;
47
+ `;
48
+
49
+ export const CatalogControlsWrapper = styled.div`
50
+ display: var(--catalog-controls-wrapper-display);
51
+ align-items: var(--catalog-controls-wrapper-align-items);
52
+ margin-left: var(--catalog-controls-wrapper-margin-left);
53
+ gap: var(--catalog-controls-wrapper-gap);
54
+ `;
55
+
56
+ export const CatalogSearchInputWrapper = styled.div`
57
+ width: var(--catalog-search-input-wrapper-width);
58
+ `;