@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
@@ -9,6 +9,7 @@ import { Button } from '@redocly/theme/components/Button/Button';
9
9
 
10
10
  type SelectInputProps<T> = {
11
11
  id?: string;
12
+ listboxId?: string;
12
13
  selectedOptions: SelectOption<T>[];
13
14
  searchValue: any;
14
15
  stickyValue: any;
@@ -30,6 +31,7 @@ type SelectInputProps<T> = {
30
31
  export function SelectInput<T>(props: SelectInputProps<T>): React.ReactNode {
31
32
  const {
32
33
  id,
34
+ listboxId,
33
35
  onlyIcon,
34
36
  icon,
35
37
  customIcon,
@@ -119,6 +121,13 @@ export function SelectInput<T>(props: SelectInputProps<T>): React.ReactNode {
119
121
  }
120
122
  }}
121
123
  width={multiple ? (!searchValue && selectedOptions.length ? '10px' : 'auto') : '100%'}
124
+ tabIndex={0}
125
+ onFocus={(e) => {
126
+ e.stopPropagation();
127
+ }}
128
+ onMouseDown={(e) => {
129
+ e.preventDefault();
130
+ }}
122
131
  />
123
132
  );
124
133
 
@@ -135,7 +144,17 @@ export function SelectInput<T>(props: SelectInputProps<T>): React.ReactNode {
135
144
  );
136
145
 
137
146
  return (
138
- <SelectInputWrapper {...props} id={id} onFocus={onFocusHandler} onClick={onClickHandler}>
147
+ <SelectInputWrapper
148
+ {...props}
149
+ id={id}
150
+ onFocus={onFocusHandler}
151
+ onClick={onClickHandler}
152
+ role="button"
153
+ aria-haspopup="listbox"
154
+ aria-controls={listboxId}
155
+ aria-owns={listboxId}
156
+ aria-label="Select option"
157
+ >
139
158
  {!onlyIcon && (
140
159
  <>
141
160
  <SelectInputValue>
@@ -10,7 +10,7 @@ export const select = css`
10
10
  --select-text-color: var(--text-color-secondary); // @presenter Color
11
11
  --select-border-radius: var(--border-radius); // @presenter BorderRadius
12
12
  --select-border: var(--border-width) var(--border-style) var(--border-color-primary); // @presenter Border
13
-
13
+
14
14
  --select-input-padding-vertical: 6px; // @presenter Spacing
15
15
  --select-input-padding-horizontal: 6px; // @presenter Spacing
16
16
  --select-input-padding: var(--select-input-padding-vertical) var(--select-input-padding-horizontal);
@@ -38,7 +38,7 @@ export const select = css`
38
38
  --select-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
39
39
  --select-list-item-bg-color-active: transparent; // @presenter Color
40
40
  --select-list-item-bg-color-hover: var(--menu-item-bg-color-hover); // @presenter Color
41
- --select-list-item-font-weight-active: var(--font-weight-medium); // @presenter Color
41
+ --select-list-item-font-weight-active: var(--font-weight-medium); // @presenter Color
42
42
 
43
43
  --select-placeholder-color: var(--color-warm-grey-6); // @presenter Color
44
44
  // @tokens End
@@ -121,7 +121,7 @@ const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
121
121
  }
122
122
  `;
123
123
 
124
- const SidebarHeader = styled.div<{ collapsed?: boolean }>`
124
+ export const SidebarHeader = styled.div<{ collapsed?: boolean }>`
125
125
  margin: var(--sidebar-offset-top) var(--sidebar-margin-horizontal) 0
126
126
  var(--sidebar-margin-horizontal);
127
127
  padding: 0 0 var(--sidebar-header-padding-bottom) 0;
@@ -0,0 +1,47 @@
1
+ import React, { useCallback } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
5
+ import { CONTENT_ID } from '@redocly/theme/core/constants';
6
+
7
+ export function SkipContent(): React.JSX.Element {
8
+ const { useTranslate } = useThemeHooks();
9
+ const { translate } = useTranslate();
10
+
11
+ const handleSkipClick = useCallback((event: React.MouseEvent<HTMLAnchorElement>) => {
12
+ event.preventDefault();
13
+ const mainElement = document.getElementById(CONTENT_ID);
14
+ if (mainElement) {
15
+ mainElement.focus();
16
+ }
17
+ }, []);
18
+
19
+ return (
20
+ <SkipContentLint href={`#${CONTENT_ID}`} onClick={handleSkipClick}>
21
+ {translate('page.skipToContent.label', 'Skip to content')}
22
+ </SkipContentLint>
23
+ );
24
+ }
25
+
26
+ const SkipContentLint = styled.a`
27
+ position: absolute;
28
+ left: -9999px;
29
+ top: 8px;
30
+ z-index: 1000;
31
+ opacity: 0;
32
+ text-decoration: none;
33
+
34
+ background: var(--skip-content-background-color);
35
+ color: var(--skip-content-text-color);
36
+ padding: var(--skip-content-padding);
37
+
38
+ border-radius: var(--skip-content-border-radius);
39
+ border: var(--skip-content-border);
40
+ font-size: var(--skip-content-font-size);
41
+ font-weight: var(--skip-content-font-weight);
42
+
43
+ &:focus {
44
+ left: 8px;
45
+ opacity: 1;
46
+ }
47
+ `;
@@ -0,0 +1,20 @@
1
+ import { css } from 'styled-components';
2
+
3
+ export const skipContent = css`
4
+ /**
5
+ * @tokens SkipContent Base
6
+ */
7
+
8
+ --skip-content-text-color: var(--color-blue-7);
9
+ --skip-content-font-size: var(--font-size-xl);
10
+ --skip-content-font-weight: var(--font-weight-bold);
11
+ --skip-content-background-color: var(--bg-color);
12
+ --skip-content-border-color: var(--color-blue-7);
13
+ --skip-content-padding: var(--spacing-xs) var(--spacing-md);
14
+ --skip-content-border-radius: 100px;
15
+ --skip-content-border: 1px solid var(--skip-content-border-color);
16
+ --tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
17
+ --tooltip-max-width: 250px;
18
+
19
+ // @tokens End
20
+ `;
@@ -46,9 +46,11 @@ export type TagProps = {
46
46
  icon?: React.ReactNode;
47
47
  active?: boolean;
48
48
  tabIndex?: number;
49
+ style?: React.CSSProperties;
49
50
  onClick?: (event: React.MouseEvent) => void;
50
51
  onKeyDown?: (event: React.KeyboardEvent) => void;
51
52
  onClose?: (event: React.MouseEvent) => void;
53
+ maxLength?: number;
52
54
  };
53
55
 
54
56
  export function Tag({
@@ -65,8 +67,72 @@ export function Tag({
65
67
  borderless,
66
68
  withStatusDot,
67
69
  statusDotColor = 'var(--tag-status-dot-color-default)',
70
+ maxLength,
68
71
  ...otherProps
69
72
  }: TagProps): JSX.Element {
73
+ const truncateText = (text: string, maxLen: number): string => {
74
+ if (text.length <= maxLen) return text;
75
+ return text.slice(0, maxLen) + '...';
76
+ };
77
+
78
+ const extractTextFromElement = (element: React.ReactNode): string => {
79
+ if (typeof element === 'string') {
80
+ return element;
81
+ }
82
+ if (typeof element === 'number') {
83
+ return element.toString();
84
+ }
85
+ if (React.isValidElement(element)) {
86
+ const props = element.props as { children?: React.ReactNode };
87
+ if (typeof props.children === 'string') {
88
+ return props.children;
89
+ }
90
+ }
91
+ return '';
92
+ };
93
+
94
+ const truncateJSXElement = (element: React.ReactNode, maxLen: number): React.ReactNode => {
95
+ if (typeof element === 'string') {
96
+ return truncateText(element, maxLen);
97
+ }
98
+ if (typeof element === 'number') {
99
+ const numStr = element.toString();
100
+ return numStr.length > maxLen ? truncateText(numStr, maxLen) : element;
101
+ }
102
+ if (React.isValidElement(element)) {
103
+ const textContent = extractTextFromElement(element);
104
+ if (textContent.length <= maxLen) {
105
+ return element;
106
+ }
107
+
108
+ const props = element.props as { children?: React.ReactNode };
109
+
110
+ if (typeof props.children === 'string') {
111
+ return React.cloneElement(element, {
112
+ ...props,
113
+ children: truncateText(props.children, maxLen),
114
+ } as any);
115
+ }
116
+ }
117
+ return element;
118
+ };
119
+
120
+ const renderChildren = (): React.ReactNode => {
121
+ if (!maxLength) {
122
+ return children;
123
+ }
124
+
125
+ if (typeof children === 'string') {
126
+ return truncateText(children, maxLength);
127
+ }
128
+
129
+ if (React.isValidElement(children)) {
130
+ return truncateJSXElement(children, maxLength);
131
+ }
132
+
133
+ return children;
134
+ };
135
+
70
136
  return (
71
137
  <TagWrapper
72
138
  tabIndex={tabIndex}
@@ -80,7 +146,7 @@ export function Tag({
80
146
  {...otherProps}
81
147
  >
82
148
  {withStatusDot ? <StatusDot color={statusDotColor} /> : icon ? icon : null}
83
- <ContentWrapper>{children}</ContentWrapper>
149
+ <ContentWrapper>{renderChildren()}</ContentWrapper>
84
150
  {closable && (
85
151
  <CloseButton
86
152
  onClick={(event) => {
@@ -160,6 +160,27 @@ export const tag = css`
160
160
  --tag-close-button-bg-color-hover: var(--color-warm-grey-3); // @presenter Color
161
161
  }
162
162
 
163
+ .tag-grass {
164
+ --tag-color: var(--color-grass-8); // @presenter Color
165
+ --tag-bg-color: transparent; // @presenter Color
166
+ --tag-border-color: var(--color-grass-4); // @presenter Color
167
+ --tag-close-button-bg-color-hover: var(--color-grass-1); // @presenter Color
168
+ }
169
+
170
+ .tag-purple {
171
+ --tag-color: var(--color-purple-7); // @presenter Color
172
+ --tag-bg-color: transparent; // @presenter Color
173
+ --tag-border-color: var(--color-purple-4); // @presenter Color
174
+ --tag-close-button-bg-color-hover: var(--color-purple-1); // @presenter Color
175
+ }
176
+
177
+ .tag-sky {
178
+ --tag-color: var(--color-sky-9); // @presenter Color
179
+ --tag-bg-color: transparent; // @presenter Color
180
+ --tag-border-color: var(--color-sky-5); // @presenter Color
181
+ --tag-close-button-bg-color-hover: var(--color-sky-2); // @presenter Color
182
+ }
183
+
163
184
  /**
164
185
  * @tokens Tag http
165
186
  */
@@ -13,6 +13,7 @@ export type TooltipProps = {
13
13
  className?: string;
14
14
  width?: string;
15
15
  dataTestId?: string;
16
+ disabled?: boolean;
16
17
  };
17
18
 
18
19
  export function TooltipComponent({
@@ -24,6 +25,7 @@ export function TooltipComponent({
24
25
  className = 'default',
25
26
  width,
26
27
  dataTestId,
28
+ disabled = false,
27
29
  }: PropsWithChildren<TooltipProps>): JSX.Element {
28
30
  const ref = useRef<HTMLDivElement | null>(null);
29
31
  const { isOpened, handleOpen, handleClose } = useControl(isOpen);
@@ -33,20 +35,21 @@ export function TooltipComponent({
33
35
  const isControlled = isOpen !== undefined;
34
36
 
35
37
  useEffect(() => {
36
- if (isControlled) {
38
+ if (isControlled && !disabled) {
37
39
  if (isOpen) {
38
40
  handleOpen();
39
41
  } else {
40
42
  handleClose();
41
43
  }
42
44
  }
43
- }, [isOpen, isControlled, handleOpen, handleClose]);
45
+ }, [isOpen, isControlled, handleOpen, handleClose, disabled]);
44
46
 
45
- const controllers = !isControlled && {
46
- onMouseEnter: handleOpen,
47
- onMouseLeave: handleClose,
48
- onClick: handleClose,
49
- };
47
+ const controllers = !isControlled &&
48
+ !disabled && {
49
+ onMouseEnter: handleOpen,
50
+ onMouseLeave: handleClose,
51
+ onClick: handleClose,
52
+ };
50
53
 
51
54
  return (
52
55
  <TooltipWrapper
@@ -56,7 +59,7 @@ export function TooltipComponent({
56
59
  data-component-name="Tooltip/Tooltip"
57
60
  >
58
61
  {children}
59
- {isOpened && (
62
+ {isOpened && !disabled && (
60
63
  <TooltipBody
61
64
  data-testid={dataTestId || (typeof tip === 'string' ? tip : '')}
62
65
  placement={placement}
@@ -83,10 +86,11 @@ const PLACEMENTS = {
83
86
  withArrow &&
84
87
  css`
85
88
  &::after {
86
- border-left: 5px solid transparent;
87
- border-right: 5px solid transparent;
88
- border-top-width: 6px;
89
+ border-left: 6px solid transparent;
90
+ border-right: 6px solid transparent;
91
+ border-top-width: 8px;
89
92
  border-top-style: solid;
93
+ border-radius: 2px 2px 0 0;
90
94
  bottom: 0;
91
95
  left: 50%;
92
96
  transform: translate(-50%, 99%);
@@ -103,10 +107,11 @@ const PLACEMENTS = {
103
107
  withArrow &&
104
108
  css`
105
109
  &::after {
106
- border-left: 5px solid transparent;
107
- border-right: 5px solid transparent;
108
- border-bottom-width: 6px;
110
+ border-left: 6px solid transparent;
111
+ border-right: 6px solid transparent;
112
+ border-bottom-width: 8px;
109
113
  border-bottom-style: solid;
114
+ border-radius: 0 0 2px 2px;
110
115
  top: 0;
111
116
  left: 50%;
112
117
  transform: translate(-50%, -99%);
@@ -123,10 +128,11 @@ const PLACEMENTS = {
123
128
  withArrow &&
124
129
  css`
125
130
  &::after {
126
- border-top: 5px solid transparent;
127
- border-bottom: 5px solid transparent;
128
- border-left-width: 6px;
131
+ border-top: 6px solid transparent;
132
+ border-bottom: 6px solid transparent;
133
+ border-left-width: 8px;
129
134
  border-left-style: solid;
135
+ border-radius: 2px 0 0 2px;
130
136
  top: 50%;
131
137
  right: 0;
132
138
  transform: translate(99%, -50%);
@@ -143,10 +149,11 @@ const PLACEMENTS = {
143
149
  withArrow &&
144
150
  css`
145
151
  &::after {
146
- border-top: 5px solid transparent;
147
- border-bottom: 5px solid transparent;
148
- border-right-width: 6px;
152
+ border-top: 6px solid transparent;
153
+ border-bottom: 6px solid transparent;
154
+ border-right-width: 8px;
149
155
  border-right-style: solid;
156
+ border-radius: 0 2px 2px 0;
150
157
  top: 50%;
151
158
  left: 0;
152
159
  transform: translate(-99%, -50%);
@@ -173,7 +180,7 @@ const TooltipBody = styled.span<
173
180
  white-space: normal;
174
181
  overflow-wrap: break-word;
175
182
 
176
- border-radius: var(--border-radius);
183
+ border-radius: var(--border-radius-md);
177
184
  transition: opacity 0.3s ease-out;
178
185
 
179
186
  font-size: 13px;
@@ -187,11 +194,13 @@ const TooltipBody = styled.span<
187
194
  display: inline-block;
188
195
  width: 0;
189
196
  height: 0;
190
- border-color: var(--tooltip-bg-color);
197
+ border-color: var(--tooltip-arrow-color, var(--tooltip-bg-color));
191
198
  }
192
199
 
193
200
  background: var(--tooltip-bg-color);
194
201
  color: var(--tooltip-text-color);
202
+ border: var(--tooltip-border-width, 0) var(--tooltip-border-style, solid)
203
+ var(--tooltip-border-color, transparent);
195
204
  box-shadow: rgb(0 0 0 / 25%) 0 2px 4px;
196
205
 
197
206
  width: ${({ width }) => width || '120px'};
@@ -8,6 +8,10 @@ export const tooltip = css`
8
8
 
9
9
  --tooltip-text-color: var(--text-color-secondary);
10
10
  --tooltip-bg-color: var(--bg-color-raised);
11
+ --tooltip-arrow-color: var(--tooltip-bg-color);
12
+ --tooltip-border-width: 0;
13
+ --tooltip-border-style: solid;
14
+ --tooltip-border-color: transparent;
11
15
  --tooltip-padding-vertical: var(--spacing-xs);
12
16
  --tooltip-padding-horizontal: var(--spacing-sm);
13
17
  --tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
@@ -16,6 +20,19 @@ export const tooltip = css`
16
20
  .tooltip-copy-button {
17
21
  --tooltip-text-color: var(--text-color-secondary);
18
22
  --tooltip-bg-color: var(--bg-color-raised);
23
+ --tooltip-arrow-color: var(--tooltip-bg-color);
24
+ }
25
+
26
+ .tooltip-catalog {
27
+ --tooltip-text-color: var(--text-color-primary);
28
+ --tooltip-bg-color: var(--layer-color);
29
+ --tooltip-arrow-color: var(--border-color-secondary);
30
+ --tooltip-border-width: 2px;
31
+ --tooltip-border-color: var(--border-color-secondary);
32
+ --tooltip-padding-vertical: var(--spacing-xs);
33
+ --tooltip-padding-horizontal: var(--spacing-sm);
34
+ --tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
35
+ --tooltip-max-width: 300px;
19
36
  }
20
37
 
21
38
  // @tokens End
@@ -35,8 +35,15 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
35
35
  if (!options.length && !versionPicker?.showForUnversioned) return null;
36
36
 
37
37
  return (
38
- <VersionsPickerWrapper data-component-name="VersionPicker/VersionPicker">
39
- <VersionPickerLabel data-translation-key="versionPicker.label">
38
+ <VersionsPickerWrapper
39
+ data-component-name="VersionPicker/VersionPicker"
40
+ role="region"
41
+ aria-label={translate('versionPicker.label', 'Version selector')}
42
+ >
43
+ <VersionPickerLabel
44
+ data-translation-key="versionPicker.label"
45
+ htmlFor="version-picker-select"
46
+ >
40
47
  {translate('versionPicker.label', 'Version:')}
41
48
  </VersionPickerLabel>
42
49
  <VersionPickerSelect
@@ -45,7 +52,15 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
45
52
  options={options}
46
53
  value={value}
47
54
  onChange={handleOnChange}
55
+ dataAttributes={{
56
+ id: 'version-picker-select',
57
+ 'aria-describedby': 'version-picker-description',
58
+ 'aria-label': translate('versionPicker.label', 'Select version'),
59
+ }}
48
60
  />
61
+ <SrOnly id="version-picker-description">
62
+ This is version picker select, using it you can select a version of the API.
63
+ </SrOnly>
49
64
  </VersionsPickerWrapper>
50
65
  );
51
66
  }
@@ -72,6 +87,10 @@ export const VersionPickerSelect = styled(Select)<SelectProps>`
72
87
  border-radius: var(--version-picker-input-border-radius);
73
88
  padding: var(--version-picker-input-padding-vertical)
74
89
  var(--version-picker-input-padding-horizontal);
90
+
91
+ &:focus-within {
92
+ outline: 1px solid var(--version-picker-focus-outline-color);
93
+ }
75
94
  }
76
95
  `;
77
96
 
@@ -83,4 +102,15 @@ const VersionsPickerWrapper = styled.div`
83
102
  justify-content: space-between;
84
103
  padding: var(--version-picker-padding-vertical) var(--version-picker-padding-horizontal);
85
104
  border-bottom: var(--version-picker-border-bottom);
105
+
106
+ &:focus-visible {
107
+ outline: 1px solid var(--version-picker-focus-outline-color);
108
+ }
109
+ `;
110
+
111
+ const SrOnly = styled.span`
112
+ position: absolute;
113
+ width: 0;
114
+ height: 0;
115
+ overflow: hidden;
86
116
  `;
@@ -35,5 +35,6 @@ export const versionPicker = css`
35
35
  --version-picker-list-item-bg-color-active: var(--select-list-item-bg-color-active); // @presenter Color
36
36
  --version-picker-list-item-bg-color-hover: var(--select-list-item-bg-color-hover); // @presenter Color
37
37
 
38
+ --version-picker-focus-outline-color: var(--button-border-color-focused);
38
39
  // @tokens End
39
40
  `;
@@ -0,0 +1 @@
1
+ export const CATALOG_TAG_MAX_LENGTH = 15;
@@ -1,5 +1,6 @@
1
1
  export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
2
  export const DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
3
+ export const CONTENT_ID = 'content';
3
4
 
4
5
  export enum FEEDBACK_TYPES {
5
6
  RATING = 'rating',
@@ -2,3 +2,4 @@ export * from '@redocly/theme/core/constants/common';
2
2
  export * from '@redocly/theme/core/constants/environments';
3
3
  export * from '@redocly/theme/core/constants/code-walkthrough';
4
4
  export * from '@redocly/theme/core/constants/search';
5
+ export * from '@redocly/theme/core/constants/catalog';
@@ -38,4 +38,6 @@ export const AI_SEARCH_ERROR_CONFIG: Record<AiSearchError, AiSearchErrorConfig>
38
38
  [AiSearchError.ErrorProcessingResponse]: defaultErrorConfig,
39
39
  } as const;
40
40
 
41
+ export const AI_SEARCH_MAX_MESSAGE_LENGTH = 45000;
42
+
41
43
  export const SEARCH_DEBOUNCE_TIME_MS = 300;
@@ -1,10 +1,13 @@
1
1
  import { createContext } from 'react';
2
2
 
3
- import type { WalkthroughStepsState } from '@redocly/theme/core/hooks';
3
+ import type { WalkthroughStepsState } from '@redocly/theme/core/types';
4
4
 
5
5
  export const CodeWalkthroughStepsContext = createContext<WalkthroughStepsState>({
6
+ markers: {},
6
7
  activeStep: null,
7
8
  setActiveStep: () => {},
8
- register: () => {},
9
- unregister: () => {},
9
+ registerStep: () => {},
10
+ registerMarker: () => {},
11
+ removeMarker: () => {},
12
+ removeStep: () => {},
10
13
  });
@@ -85,4 +85,5 @@ export const useThemeHooks = jest.fn(() => ({
85
85
  submitFeedback: jest.fn(),
86
86
  })),
87
87
  useLoadAndNavigate: jest.fn(),
88
+ usePageProps: jest.fn().mockReturnValue({}),
88
89
  }));
@@ -0,0 +1,16 @@
1
+ import type { UseCatalogEntitiesProps } from '@redocly/theme';
2
+
3
+ export function useCatalogEntities({ entitiesTypes, excludedEntities }: UseCatalogEntitiesProps) {
4
+ const initialTypesWithoutAll = entitiesTypes.filter((type) => type !== 'all');
5
+ const initialTypesFilter = entitiesTypes.length ? `type:${initialTypesWithoutAll.join(',')}` : '';
6
+ const initialExcludedEntitiesFilter = excludedEntities?.length
7
+ ? `-key:${excludedEntities.map((entity) => entity.key).join(',')}`
8
+ : '';
9
+ const initialFilter = initialTypesFilter
10
+ ? `${initialTypesFilter} AND ${initialExcludedEntitiesFilter}`
11
+ : initialExcludedEntitiesFilter;
12
+
13
+ return {
14
+ initialFilter,
15
+ };
16
+ }
@@ -0,0 +1,38 @@
1
+ import {
2
+ BaseEntity,
3
+ CatalogColumn,
4
+ } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
5
+
6
+ import { SortOption } from '../../types';
7
+
8
+ type CatalogTableHeaderCellActionsProps<T extends BaseEntity> = {
9
+ column: CatalogColumn<T>;
10
+ handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
11
+ setSortOption: (sortOption: SortOption | null) => void;
12
+ isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
13
+ };
14
+
15
+ export function useCatalogTableHeaderCellActions<T extends BaseEntity>({
16
+ column,
17
+ handleSortClick,
18
+ setSortOption,
19
+ isColumnSorted,
20
+ }: CatalogTableHeaderCellActionsProps<T>) {
21
+ const sortKey = column.sortKey;
22
+ const isUpActive = sortKey ? isColumnSorted(sortKey, 'desc') : false;
23
+ const isDownActive = sortKey ? isColumnSorted(sortKey, 'asc') : false;
24
+
25
+ const handleCellClick = (): void => {
26
+ if (!column.sortable || !sortKey) return;
27
+
28
+ if (isDownActive) {
29
+ handleSortClick(sortKey, 'desc');
30
+ } else if (isUpActive) {
31
+ setSortOption(null);
32
+ } else {
33
+ handleSortClick(sortKey, 'asc');
34
+ }
35
+ };
36
+
37
+ return { handleCellClick, sortKey, isUpActive, isDownActive };
38
+ }
@@ -0,0 +1,40 @@
1
+ import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
2
+
3
+ import { getPathPrefix } from '../../utils';
4
+
5
+ type CatalogTableViewRowProps = {
6
+ entityKey: string;
7
+ entityType: string;
8
+ catalogConfig: CatalogEntityConfig;
9
+ entitiesCatalogConfig?: EntitiesCatalogConfig;
10
+ };
11
+
12
+ export function useCatalogTableViewRow({
13
+ entityKey,
14
+ entityType,
15
+ catalogConfig,
16
+ entitiesCatalogConfig,
17
+ }: CatalogTableViewRowProps) {
18
+ const getCatalogSpecificConfigByEntityTypeIncluded = () => {
19
+ if (!entitiesCatalogConfig) {
20
+ return;
21
+ }
22
+
23
+ return Object.values(entitiesCatalogConfig.catalogs ?? {}).find((catalog) => {
24
+ return catalog.includes?.some((include) => include.type === entityType);
25
+ });
26
+ };
27
+
28
+ const getEntityDetailsLink = () => {
29
+ const pathPrefix = getPathPrefix();
30
+ const catalogSpecificConfig = getCatalogSpecificConfigByEntityTypeIncluded();
31
+
32
+ if (!catalogSpecificConfig || !entitiesCatalogConfig) {
33
+ return `${pathPrefix}/catalogs/${catalogConfig.slug}/entities/${entityKey}`;
34
+ }
35
+
36
+ return `${pathPrefix}/catalogs/${catalogSpecificConfig.slug}/entities/${entityKey}`;
37
+ };
38
+
39
+ return { getEntityDetailsLink };
40
+ }