@redocly/theme 0.69.0-next.1 → 0.69.0-next.10

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 (264) hide show
  1. package/lib/components/Accordion/Accordion.js +5 -1
  2. package/lib/components/Accordion/variables.js +1 -1
  3. package/lib/components/Admonition/Admonition.d.ts +1 -1
  4. package/lib/components/Admonition/Admonition.js +1 -1
  5. package/lib/components/Admonition/variables.dark.js +2 -2
  6. package/lib/components/Admonition/variables.js +10 -10
  7. package/lib/components/Badge/Badge.d.ts +3 -1
  8. package/lib/components/Badge/Badge.js +7 -2
  9. package/lib/components/Banner/variables.dark.js +2 -0
  10. package/lib/components/Banner/variables.js +3 -1
  11. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  12. package/lib/components/Breadcrumbs/variables.js +1 -1
  13. package/lib/components/Button/ButtonGroup.d.ts +3 -5
  14. package/lib/components/Button/ButtonGroup.js +25 -5
  15. package/lib/components/Button/variables.js +27 -4
  16. package/lib/components/Buttons/ConnectMCPButton.js +39 -123
  17. package/lib/components/Buttons/CopyButton.js +12 -1
  18. package/lib/components/Buttons/variables.d.ts +0 -1
  19. package/lib/components/Buttons/variables.js +3 -44
  20. package/lib/components/Catalog/CatalogEntities.js +1 -0
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  26. package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
  27. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
  28. package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
  29. package/lib/components/Catalog/variables.js +5 -5
  30. package/lib/components/CatalogClassic/variables.js +2 -2
  31. package/lib/components/CodeBlock/CodeBlock.js +2 -1
  32. package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
  33. package/lib/components/Dropdown/Dropdown.d.ts +10 -20
  34. package/lib/components/Dropdown/Dropdown.js +13 -2
  35. package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
  36. package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
  37. package/lib/components/Dropdown/variables.js +19 -2
  38. package/lib/components/Feedback/Mood.js +18 -14
  39. package/lib/components/Feedback/Rating.js +18 -13
  40. package/lib/components/Feedback/Scale.js +27 -22
  41. package/lib/components/Feedback/Sentiment.js +17 -13
  42. package/lib/components/Filter/FilterInput.js +4 -2
  43. package/lib/components/Filter/FilterSelect.js +1 -0
  44. package/lib/components/Filter/variables.js +2 -2
  45. package/lib/components/Image/variables.js +5 -3
  46. package/lib/components/JsonViewer/Helpers.js +12 -42
  47. package/lib/components/LanguagePicker/variables.js +1 -1
  48. package/lib/components/MCP/McpConnectionTabs.d.ts +7 -0
  49. package/lib/components/MCP/McpConnectionTabs.js +151 -0
  50. package/lib/components/Markdown/styles/base-table.js +8 -0
  51. package/lib/components/Markdown/variables.js +1 -1
  52. package/lib/components/Menu/MenuItem.js +1 -1
  53. package/lib/components/Menu/variables.js +1 -1
  54. package/lib/components/Navbar/variables.js +1 -1
  55. package/lib/components/PageActions/PageActions.js +4 -6
  56. package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
  57. package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
  58. package/lib/components/Panel/Panel.js +5 -1
  59. package/lib/components/Panel/variables.js +1 -1
  60. package/lib/components/Product/variables.js +2 -1
  61. package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
  62. package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
  63. package/lib/components/Search/SearchAiDialog.js +4 -1
  64. package/lib/components/Search/SearchAiMessage.js +1 -1
  65. package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
  66. package/lib/components/Search/SearchDialog.js +2 -2
  67. package/lib/components/Search/SearchItem.js +6 -3
  68. package/lib/components/Search/SearchRecent.js +1 -0
  69. package/lib/components/Search/SearchSuggestedPages.js +1 -0
  70. package/lib/components/Search/variables.js +9 -5
  71. package/lib/components/Segmented/Segmented.js +3 -3
  72. package/lib/components/Select/Select.js +30 -23
  73. package/lib/components/Select/variables.js +3 -3
  74. package/lib/components/Sidebar/Sidebar.js +2 -38
  75. package/lib/components/SplitButton/SplitButton.d.ts +21 -0
  76. package/lib/components/SplitButton/SplitButton.js +37 -0
  77. package/lib/components/Switch/variables.dark.js +2 -2
  78. package/lib/components/Switch/variables.js +2 -2
  79. package/lib/components/Tag/variables.js +2 -2
  80. package/lib/components/Tags/variables.js +1 -1
  81. package/lib/components/Toast/variables.js +1 -1
  82. package/lib/components/Tooltip/AnchorTooltip.js +2 -2
  83. package/lib/components/Tooltip/JsTooltip.js +2 -2
  84. package/lib/components/UserMenu/variables.js +1 -1
  85. package/lib/core/constants/mcp.d.ts +4 -0
  86. package/lib/core/constants/mcp.js +10 -1
  87. package/lib/core/constants/search.js +2 -2
  88. package/lib/core/contexts/PageActionsContext.d.ts +5 -0
  89. package/lib/core/contexts/PageActionsContext.js +10 -0
  90. package/lib/core/contexts/index.d.ts +1 -0
  91. package/lib/core/contexts/index.js +1 -0
  92. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
  93. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
  94. package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
  95. package/lib/core/hooks/use-active-heading.js +59 -15
  96. package/lib/core/hooks/use-active-section-id.js +3 -1
  97. package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
  98. package/lib/core/hooks/use-connect-mcp-button.js +16 -13
  99. package/lib/core/hooks/use-control.js +3 -0
  100. package/lib/core/hooks/use-local-state.js +1 -0
  101. package/lib/core/hooks/use-mcp-config.d.ts +2 -0
  102. package/lib/core/hooks/use-mcp-config.js +14 -4
  103. package/lib/core/hooks/use-mobile-menu.js +10 -2
  104. package/lib/core/styles/global.js +16 -11
  105. package/lib/core/styles/palette.js +2 -0
  106. package/lib/core/types/button-group.d.ts +2 -0
  107. package/lib/core/types/button-group.js +3 -0
  108. package/lib/core/types/catalog.d.ts +2 -4
  109. package/lib/core/types/common.d.ts +2 -0
  110. package/lib/core/types/hooks.d.ts +1 -0
  111. package/lib/core/types/index.d.ts +1 -0
  112. package/lib/core/types/l10n.d.ts +1 -1
  113. package/lib/core/types/mcp.d.ts +1 -1
  114. package/lib/core/utils/RenderWithLink.d.ts +2 -0
  115. package/lib/core/utils/RenderWithLink.js +20 -0
  116. package/lib/core/utils/index.d.ts +1 -0
  117. package/lib/core/utils/index.js +1 -0
  118. package/lib/core/utils/mcp.d.ts +5 -0
  119. package/lib/core/utils/mcp.js +35 -0
  120. package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
  121. package/lib/icons/CodexIcon/CodexIcon.js +22 -0
  122. package/lib/icons/LinkIcon/LinkIcon.js +1 -1
  123. package/lib/index.d.ts +2 -0
  124. package/lib/index.js +2 -0
  125. package/lib/layouts/McpNotAllowed.js +10 -10
  126. package/lib/markdoc/components/Cards/Card.d.ts +8 -1
  127. package/lib/markdoc/components/Cards/Card.js +55 -16
  128. package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
  129. package/lib/markdoc/components/Cards/CardBadge.js +30 -0
  130. package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
  131. package/lib/markdoc/components/Cards/CardIcon.js +6 -3
  132. package/lib/markdoc/components/Cards/variables.dark.js +32 -0
  133. package/lib/markdoc/components/Cards/variables.js +81 -7
  134. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
  135. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
  136. package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
  137. package/lib/markdoc/components/Heading/Heading.js +5 -2
  138. package/lib/markdoc/components/Tabs/TabList.js +6 -2
  139. package/lib/markdoc/components/Tabs/Tabs.js +4 -2
  140. package/lib/markdoc/components/Tabs/variables.js +4 -4
  141. package/lib/markdoc/tags/admonition.js +1 -1
  142. package/lib/markdoc/tags/card.js +14 -0
  143. package/lib/markdoc/tags/connect-mcp.js +2 -1
  144. package/package.json +19 -10
  145. package/src/components/Accordion/Accordion.tsx +7 -3
  146. package/src/components/Accordion/variables.ts +1 -1
  147. package/src/components/Admonition/Admonition.tsx +2 -2
  148. package/src/components/Admonition/variables.dark.ts +2 -2
  149. package/src/components/Admonition/variables.ts +10 -10
  150. package/src/components/Badge/Badge.tsx +16 -2
  151. package/src/components/Banner/variables.dark.ts +2 -0
  152. package/src/components/Banner/variables.ts +3 -1
  153. package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
  154. package/src/components/Breadcrumbs/variables.ts +1 -1
  155. package/src/components/Button/ButtonGroup.tsx +28 -10
  156. package/src/components/Button/variables.ts +27 -4
  157. package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
  158. package/src/components/Buttons/CopyButton.tsx +14 -2
  159. package/src/components/Buttons/variables.ts +2 -44
  160. package/src/components/Catalog/CatalogEntities.tsx +1 -0
  161. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
  162. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  163. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  164. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
  165. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  166. package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
  167. package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
  168. package/src/components/Catalog/variables.ts +5 -5
  169. package/src/components/CatalogClassic/variables.ts +2 -2
  170. package/src/components/CodeBlock/CodeBlock.tsx +2 -1
  171. package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
  172. package/src/components/Dropdown/Dropdown.tsx +25 -4
  173. package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
  174. package/src/components/Dropdown/variables.ts +19 -2
  175. package/src/components/Feedback/Mood.tsx +22 -15
  176. package/src/components/Feedback/Rating.tsx +22 -14
  177. package/src/components/Feedback/Scale.tsx +40 -32
  178. package/src/components/Feedback/Sentiment.tsx +21 -14
  179. package/src/components/Filter/FilterInput.tsx +5 -3
  180. package/src/components/Filter/FilterSelect.tsx +1 -0
  181. package/src/components/Filter/variables.ts +2 -2
  182. package/src/components/Image/variables.ts +5 -3
  183. package/src/components/JsonViewer/Helpers.tsx +13 -9
  184. package/src/components/LanguagePicker/variables.ts +1 -1
  185. package/src/components/MCP/McpConnectionTabs.tsx +263 -0
  186. package/src/components/Markdown/styles/base-table.ts +8 -0
  187. package/src/components/Markdown/variables.ts +1 -1
  188. package/src/components/Menu/MenuItem.tsx +2 -2
  189. package/src/components/Menu/variables.ts +1 -1
  190. package/src/components/Navbar/variables.ts +1 -1
  191. package/src/components/PageActions/PageActions.tsx +22 -23
  192. package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
  193. package/src/components/Panel/Panel.tsx +7 -3
  194. package/src/components/Panel/variables.ts +1 -1
  195. package/src/components/Product/variables.ts +2 -1
  196. package/src/components/ReplayGate/ReplayGate.tsx +3 -0
  197. package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
  198. package/src/components/Search/SearchAiDialog.tsx +4 -1
  199. package/src/components/Search/SearchAiMessage.tsx +1 -1
  200. package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
  201. package/src/components/Search/SearchDialog.tsx +2 -2
  202. package/src/components/Search/SearchItem.tsx +7 -1
  203. package/src/components/Search/SearchRecent.tsx +1 -0
  204. package/src/components/Search/SearchSuggestedPages.tsx +1 -0
  205. package/src/components/Search/variables.ts +9 -5
  206. package/src/components/Segmented/Segmented.tsx +6 -3
  207. package/src/components/Select/Select.tsx +36 -22
  208. package/src/components/Select/variables.ts +3 -3
  209. package/src/components/Sidebar/Sidebar.tsx +2 -6
  210. package/src/components/SplitButton/SplitButton.tsx +95 -0
  211. package/src/components/Switch/variables.dark.ts +2 -2
  212. package/src/components/Switch/variables.ts +2 -2
  213. package/src/components/Tag/variables.ts +2 -2
  214. package/src/components/Tags/variables.ts +1 -1
  215. package/src/components/Toast/variables.ts +1 -1
  216. package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
  217. package/src/components/Tooltip/JsTooltip.tsx +2 -2
  218. package/src/components/UserMenu/variables.ts +1 -1
  219. package/src/core/constants/mcp.ts +14 -0
  220. package/src/core/constants/search.ts +2 -2
  221. package/src/core/contexts/PageActionsContext.tsx +7 -0
  222. package/src/core/contexts/index.ts +1 -0
  223. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
  224. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
  225. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
  226. package/src/core/hooks/use-active-heading.ts +79 -15
  227. package/src/core/hooks/use-active-section-id.ts +3 -1
  228. package/src/core/hooks/use-connect-mcp-button.ts +23 -15
  229. package/src/core/hooks/use-control.ts +5 -1
  230. package/src/core/hooks/use-local-state.ts +1 -0
  231. package/src/core/hooks/use-mcp-config.ts +15 -4
  232. package/src/core/hooks/use-mobile-menu.ts +11 -3
  233. package/src/core/openapi/index.ts +1 -1
  234. package/src/core/styles/global.ts +17 -12
  235. package/src/core/styles/palette.ts +2 -0
  236. package/src/core/types/button-group.ts +2 -0
  237. package/src/core/types/catalog.ts +2 -4
  238. package/src/core/types/common.ts +3 -0
  239. package/src/core/types/hooks.ts +1 -0
  240. package/src/core/types/index.ts +1 -0
  241. package/src/core/types/l10n.ts +29 -1
  242. package/src/core/types/mcp.ts +1 -1
  243. package/src/core/utils/RenderWithLink.tsx +19 -0
  244. package/src/core/utils/index.ts +1 -0
  245. package/src/core/utils/mcp.ts +39 -0
  246. package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
  247. package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
  248. package/src/index.ts +2 -0
  249. package/src/layouts/McpNotAllowed.tsx +37 -11
  250. package/src/markdoc/components/Cards/Card.tsx +79 -14
  251. package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
  252. package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
  253. package/src/markdoc/components/Cards/variables.dark.ts +32 -0
  254. package/src/markdoc/components/Cards/variables.ts +81 -7
  255. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
  256. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
  257. package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
  258. package/src/markdoc/components/Heading/Heading.tsx +7 -4
  259. package/src/markdoc/components/Tabs/TabList.tsx +6 -2
  260. package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
  261. package/src/markdoc/components/Tabs/variables.ts +4 -4
  262. package/src/markdoc/tags/admonition.ts +1 -1
  263. package/src/markdoc/tags/card.ts +14 -0
  264. package/src/markdoc/tags/connect-mcp.ts +3 -1
@@ -134,8 +134,28 @@ export type TranslationKey =
134
134
  | 'page.forbidden.description'
135
135
  | 'page.notFound.title'
136
136
  | 'page.notFound.description'
137
+ | 'page.apiNotFound.title'
138
+ | 'page.apiNotFound.description'
139
+ | 'page.apiNotFound.hint'
140
+ | 'page.apiNotFound.backButton'
137
141
  | 'page.mcpNotAllowed.title'
138
142
  | 'page.mcpNotAllowed.description'
143
+ | 'page.mcpNotAllowed.publicNote'
144
+ | 'page.mcpNotAllowed.publicEndpointHint'
145
+ | 'page.mcpNotAllowed.mainEndpointHint'
146
+ | 'page.mcpNotAllowed.snippets.terminal.hint'
147
+ | 'page.mcpNotAllowed.snippets.claudeCode.headline'
148
+ | 'page.mcpNotAllowed.snippets.claudeDesktop.headline'
149
+ | 'page.mcpNotAllowed.snippets.claudeDesktop.instruction'
150
+ | 'page.mcpNotAllowed.snippets.chatgptApp.headline'
151
+ | 'page.mcpNotAllowed.snippets.chatgptApp.instruction'
152
+ | 'page.mcpNotAllowed.snippets.codexCli.headline'
153
+ | 'page.mcpNotAllowed.snippets.prompt.headline'
154
+ | 'page.mcpNotAllowed.snippets.prompt.hint'
155
+ | 'page.mcpNotAllowed.snippets.json.hint'
156
+ | 'page.mcpNotAllowed.tabs.claude'
157
+ | 'page.mcpNotAllowed.tabs.chatgpt'
158
+ | 'page.mcpNotAllowed.tabs.json'
139
159
  | 'page.lastUpdated.timeago'
140
160
  | 'page.lastUpdated.on'
141
161
  | 'catalog.filters.placeholder'
@@ -271,8 +291,14 @@ export type TranslationKey =
271
291
  | 'page.actions.connectMcp.cursorDescription'
272
292
  | 'page.actions.connectMcp.vscode'
273
293
  | 'page.actions.connectMcp.vscodeDescription'
294
+ | 'page.actions.connectMcp.claudeCode'
295
+ | 'page.actions.connectMcp.claudeCodeDescription'
296
+ | 'page.actions.connectMcp.codex'
297
+ | 'page.actions.connectMcp.codexDescription'
274
298
  | 'page.actions.connectMcp.copyConfig'
275
299
  | 'page.actions.connectMcp.copyConfigDescription'
300
+ | 'page.actions.connectMcp.moreOptions'
301
+ | 'page.actions.moreActions'
276
302
  | 'openapi.download.description.title'
277
303
  | 'openapi.info.title'
278
304
  | 'openapi.info.contact.url'
@@ -280,6 +306,7 @@ export type TranslationKey =
280
306
  | 'openapi.info.license'
281
307
  | 'openapi.info.termsOfService'
282
308
  | 'openapi.info.metadata.title'
309
+ | 'graphql.info.metadata.title'
283
310
  | 'openapi.key'
284
311
  | 'openapi.value'
285
312
  | 'openapi.enum'
@@ -369,6 +396,8 @@ export type TranslationKey =
369
396
  | 'openapi.mcp.inputExample'
370
397
  | 'openapi.mcp.outputSchema'
371
398
  | 'openapi.mcp.outputExample'
399
+ | 'openapi.mcp.exampleTitle'
400
+ | 'openapi.mcp.argumentsExample'
372
401
  | 'asyncapi.download.description.title'
373
402
  | 'asyncapi.info.title'
374
403
  | 'asyncapi.info.contact.url'
@@ -449,7 +478,6 @@ export type TranslationKey =
449
478
  | 'graphql.sample'
450
479
  | 'graphql.referenced'
451
480
  | 'graphql.content.fragment'
452
- | 'button.copy.tooltipText'
453
481
  | 'button.download.tooltipText'
454
482
  | 'button.externalLink.tooltipText'
455
483
  | 'button.email.tooltipText'
@@ -1,6 +1,6 @@
1
1
  export type MCPClientType = 'cursor' | 'vscode';
2
2
 
3
- export type MCPOption = 'cursor' | 'vscode' | 'copy';
3
+ export type MCPOption = 'cursor' | 'vscode' | 'claude-code' | 'codex' | 'copy';
4
4
 
5
5
  export type McpConnectionParams = {
6
6
  serverName: string;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+
3
+ import type { JSX } from 'react';
4
+
5
+ // Splits a translated sentence on <link>...</link> markers and renders the
6
+ // marked phrase as an anchor, so each locale keeps its own word order.
7
+ export function renderWithLink(text: string, href: string): JSX.Element {
8
+ const [before, label, after] = text.split(/<link>|<\/link>/);
9
+ if (label === undefined) {
10
+ return <>{text}</>;
11
+ }
12
+ return (
13
+ <>
14
+ {before}
15
+ <a href={href}>{label}</a>
16
+ {after}
17
+ </>
18
+ );
19
+ }
@@ -48,3 +48,4 @@ export * from './get-auto-dismiss-duration';
48
48
  export * from './tooltip-placement';
49
49
  export * from './telemetry/get-base-data-attributes';
50
50
  export * from './telemetry/generate-before-after-context';
51
+ export * from './RenderWithLink';
@@ -32,3 +32,42 @@ export function generateMCPDeepLink(
32
32
  return generateCursorMCPDeepLink(config);
33
33
  }
34
34
  }
35
+
36
+ // Server names can contain spaces (e.g. "Docs MCP server") which break bare CLI
37
+ // arguments, so commands use a slugified form while JSON configs keep the raw name.
38
+ export function slugifyMcpServerName(name: string): string {
39
+ return name
40
+ .toLowerCase()
41
+ .replace(/[^a-z0-9_-]+/g, '-')
42
+ .replace(/^-+|-+$/g, '');
43
+ }
44
+
45
+ // Claude Desktop's config file only launches stdio commands, so remote servers
46
+ // connect through the mcp-remote bridge.
47
+ export function generateClaudeDesktopConfig(config: McpConnectionParams): string {
48
+ return JSON.stringify(
49
+ {
50
+ mcpServers: {
51
+ [slugifyMcpServerName(config.serverName)]: {
52
+ command: 'npx',
53
+ args: ['-y', 'mcp-remote', config.url],
54
+ },
55
+ },
56
+ },
57
+ null,
58
+ 2,
59
+ );
60
+ }
61
+
62
+ export function generateClaudeCodeCommand(config: McpConnectionParams): string {
63
+ return `claude mcp add --transport http ${slugifyMcpServerName(config.serverName)} ${config.url}`;
64
+ }
65
+
66
+ export function generateCodexCommand(config: McpConnectionParams): string {
67
+ return `codex mcp add ${slugifyMcpServerName(config.serverName)} --url ${config.url}`;
68
+ }
69
+
70
+ // Pasted into an AI assistant (Claude Code, Codex) so it installs the server itself.
71
+ export function generateMcpInstallPrompt(config: McpConnectionParams): string {
72
+ return `Add the MCP server "${slugifyMcpServerName(config.serverName)}" with URL ${config.url} (streamable HTTP transport) to my MCP configuration, then verify it is connected.`;
73
+ }
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import type { IconProps } from '@redocly/theme/icons/types';
5
+
6
+ import { getCssColorVariable } from '@redocly/theme/core/utils';
7
+
8
+ const Icon = (props: IconProps) => (
9
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
10
+ <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.073zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.8956zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997z" />
11
+ </svg>
12
+ );
13
+
14
+ export const CodexIcon = styled(Icon).attrs({
15
+ 'data-component-name': 'icons/CodexIcon/CodexIcon',
16
+ })`
17
+ path {
18
+ fill: ${({ color }) => getCssColorVariable(color)};
19
+ }
20
+
21
+ height: ${({ size }) => size || '16px'};
22
+ width: ${({ size }) => size || '16px'};
23
+ `;
@@ -15,7 +15,7 @@ const Icon = (props: IconProps) => (
15
15
  {...props}
16
16
  >
17
17
  <path
18
- d="M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z"
18
+ d="M0 6C0 2.68629 2.68629 0 6 0H14C17.3137 0 20 2.68629 20 6V14C20 17.3137 17.3137 20 14 20H6C2.68629 20 0 17.3137 0 14V6Z"
19
19
  fill="var(--layer-color)"
20
20
  />
21
21
  <path
package/src/index.ts CHANGED
@@ -15,6 +15,8 @@ export * from '@redocly/theme/components/Badge/Badge';
15
15
  export * from '@redocly/theme/components/Dropdown/Dropdown';
16
16
  export * from '@redocly/theme/components/Dropdown/DropdownMenu';
17
17
  export * from '@redocly/theme/components/Dropdown/DropdownMenuItem';
18
+ export * from '@redocly/theme/components/Dropdown/DropdownMenuItemContent';
19
+ export * from '@redocly/theme/components/SplitButton/SplitButton';
18
20
  export * from '@redocly/theme/components/Loaders/Loading';
19
21
  export * from '@redocly/theme/components/LoadMore/LoadMore';
20
22
  export * from '@redocly/theme/components/Link/Link';
@@ -3,28 +3,61 @@ import styled from 'styled-components';
3
3
 
4
4
  import type { JSX } from 'react';
5
5
 
6
- import { useThemeHooks } from '@redocly/theme/core/hooks';
6
+ import { useThemeHooks, useMCPConfig } from '@redocly/theme/core/hooks';
7
+ import { renderWithLink } from '@redocly/theme/core/utils';
7
8
  import { ConnectMCPButton } from '@redocly/theme/components/Buttons/ConnectMCPButton';
9
+ import { McpConnectionTabs } from '@redocly/theme/components/MCP/McpConnectionTabs';
8
10
 
9
11
  export default function McpNotAllowed(): JSX.Element {
10
12
  const { useTranslate } = useThemeHooks();
11
13
  const { translate } = useTranslate();
14
+ const { isPublicEndpointPage, alternateServerUrl } = useMCPConfig();
12
15
 
13
16
  return (
14
17
  <NotAllowedWrapper data-component-name="layouts/McpNotAllowed">
15
- <StatusText>405</StatusText>
16
18
  <Title data-translation-key="page.mcpNotAllowed.title">
17
- {translate('page.mcpNotAllowed.title', 'Method not allowed')}
19
+ {translate('page.mcpNotAllowed.title', 'Connect to the MCP server')}
18
20
  </Title>
19
21
  <Description data-translation-key="page.mcpNotAllowed.description">
20
22
  {translate(
21
23
  'page.mcpNotAllowed.description',
22
- 'To use this MCP server, register it in your MCP Client (for example: VS Code, Cursor, or Claude Code).',
24
+ 'To use this MCP server, register it in your MCP client (for example: VS Code, Cursor, or Claude Code).',
23
25
  )}
24
26
  </Description>
27
+ {isPublicEndpointPage && (
28
+ <Description data-translation-key="page.mcpNotAllowed.publicNote">
29
+ {translate(
30
+ 'page.mcpNotAllowed.publicNote',
31
+ 'This endpoint serves publicly available content only and requires no login.',
32
+ )}
33
+ </Description>
34
+ )}
35
+ {isPublicEndpointPage && alternateServerUrl && (
36
+ <Description data-translation-key="page.mcpNotAllowed.mainEndpointHint">
37
+ {renderWithLink(
38
+ translate(
39
+ 'page.mcpNotAllowed.mainEndpointHint',
40
+ 'To access content available to your account, use the <link>main MCP endpoint</link>.',
41
+ ),
42
+ alternateServerUrl,
43
+ )}
44
+ </Description>
45
+ )}
46
+ {!isPublicEndpointPage && alternateServerUrl && (
47
+ <Description data-translation-key="page.mcpNotAllowed.publicEndpointHint">
48
+ {renderWithLink(
49
+ translate(
50
+ 'page.mcpNotAllowed.publicEndpointHint',
51
+ 'To connect anonymously without an account, use the <link>public endpoint</link>.',
52
+ ),
53
+ alternateServerUrl,
54
+ )}
55
+ </Description>
56
+ )}
25
57
  <ButtonWrapper>
26
58
  <ConnectMCPButton alignment="start" />
27
59
  </ButtonWrapper>
60
+ <McpConnectionTabs />
28
61
  </NotAllowedWrapper>
29
62
  );
30
63
  }
@@ -44,13 +77,6 @@ const NotAllowedWrapper = styled.div`
44
77
  }
45
78
  `;
46
79
 
47
- const StatusText = styled.div`
48
- color: var(--page-mcp-405-status-text-color);
49
- font-size: var(--page-mcp-405-status-font-size);
50
- line-height: var(--page-mcp-405-status-line-height);
51
- font-weight: var(--page-mcp-405-status-font-weight);
52
- `;
53
-
54
80
  const Title = styled.div`
55
81
  font-size: var(--page-mcp-405-title-font-size);
56
82
  line-height: var(--page-mcp-405-title-line-height);
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { ChevronRightIcon } from '@redocly/theme/icons/ChevronRightIcon/ChevronRightIcon';
5
+ import { ArrowUpRightIcon } from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
5
6
  import { CardImage } from '@redocly/theme/markdoc/components/Cards/CardImage';
6
7
  import { CardIcon, CardIconWrapper } from '@redocly/theme/markdoc/components/Cards/CardIcon';
8
+ import { CardBadge } from '@redocly/theme/markdoc/components/Cards/CardBadge';
7
9
  import { Link } from '@redocly/theme/components/Link/Link';
8
10
 
9
11
  export type CardProps = React.PropsWithChildren<{
@@ -17,8 +19,15 @@ export type CardProps = React.PropsWithChildren<{
17
19
  layout?: 'horizontal' | 'vertical' | 'combined';
18
20
  variant?: 'filled' | 'outlined' | 'elevated' | 'ghost';
19
21
  iconVariant?: 'filled' | 'ghost';
22
+ iconColor?: string;
20
23
  align?: 'start' | 'center' | 'end';
21
24
  to?: string;
25
+ linkIcon?: 'chevron' | 'arrow';
26
+ cta?: React.ReactNode;
27
+ badge?: string;
28
+ badgeColor?: string;
29
+ badgeIcon?: string;
30
+ badgeIconRawContent?: string;
22
31
  }>;
23
32
 
24
33
  export function Card({
@@ -32,8 +41,15 @@ export function Card({
32
41
  variant = 'filled',
33
42
  lineClamp,
34
43
  iconVariant = 'filled',
44
+ iconColor,
35
45
  align = 'start',
36
46
  to,
47
+ cta,
48
+ linkIcon,
49
+ badge,
50
+ badgeColor,
51
+ badgeIcon,
52
+ badgeIconRawContent,
37
53
  children,
38
54
  }: CardProps) {
39
55
  const titleNoSpaces = title?.replace(/\s+/g, '-').toLowerCase();
@@ -66,14 +82,30 @@ export function Card({
66
82
  src={icon}
67
83
  rawContent={iconRawContent}
68
84
  position={iconPosition}
85
+ color={iconColor}
69
86
  />
70
87
  )}
71
88
  <ContentWrapper>
72
- <Title id={cardTitleId} $isCardLink={!!to} $justifyContent={justifyContent}>
73
- {title}
74
- {variant == 'ghost' && !!to && <CardLinkIcon />}
75
- </Title>
89
+ <TitleWrapper id={cardTitleId} $isCardLink={!!to} $justifyContent={justifyContent}>
90
+ <Title>
91
+ {title}
92
+ {!!to && !!linkIcon && (
93
+ <CardLinkIcon as={linkIcon === 'arrow' ? ArrowUpRightIcon : undefined} />
94
+ )}
95
+ </Title>
96
+ {!!badge && (
97
+ <CardBadge color={badgeColor} icon={badgeIcon} iconRawContent={badgeIconRawContent}>
98
+ {badge}
99
+ </CardBadge>
100
+ )}
101
+ </TitleWrapper>
76
102
  <Body $lineClamp={lineClamp}>{children}</Body>
103
+ {!!to && !!cta && (
104
+ <Cta $justifyContent={justifyContent}>
105
+ <CtaText> {cta} </CtaText>
106
+ <CtaIcon />
107
+ </Cta>
108
+ )}
77
109
  </ContentWrapper>
78
110
  </CardContentWrapper>
79
111
  </>
@@ -105,25 +137,28 @@ const ContentWrapper = styled.div`
105
137
  width: 100%;
106
138
  `;
107
139
 
108
- const Title = styled.h3<{ $isCardLink: boolean; $justifyContent: string }>`
109
- margin: var(--card-title-margin);
110
- font-weight: var(--card-title-font-weight);
140
+ const TitleWrapper = styled.div<{ $isCardLink: boolean; $justifyContent: string }>`
111
141
  color: var(--card-title-text-color);
112
142
  display: flex;
113
143
  align-items: center;
144
+ flex-wrap: wrap;
145
+ row-gap: var(--card-title-row-gap);
114
146
  justify-content: ${({ $justifyContent }) => $justifyContent};
115
147
  width: 100%;
116
148
  `;
117
149
 
150
+ const Title = styled.h3`
151
+ margin: var(--card-title-margin);
152
+ font-weight: var(--card-title-font-weight);
153
+ `;
154
+
155
+ // The `as` prop selects the icon; the chevron is the default target.
118
156
  const CardLinkIcon = styled(ChevronRightIcon)`
119
157
  width: var(--card-link-icon-width);
120
158
  height: var(--card-link-icon-height);
121
- color: var(--card-link-icon-color);
159
+ color: var(--icon-color-secondary);
122
160
  margin-left: var(--spacing-xxs);
123
- opacity: 0;
124
- transition:
125
- opacity 0.3s,
126
- transform 0.3s;
161
+ margin-top: calc(var(--spacing-xxs) / 2);
127
162
  `;
128
163
 
129
164
  const Body = styled.div<{ $lineClamp?: number }>`
@@ -149,6 +184,29 @@ const Body = styled.div<{ $lineClamp?: number }>`
149
184
  }
150
185
  `;
151
186
 
187
+ const Cta = styled.div<{ $justifyContent: string }>`
188
+ display: flex;
189
+ gap: var(--card-cta-gap);
190
+ align-items: center;
191
+ margin-top: var(--card-cta-margin-top);
192
+ color: var(--card-cta-text-color);
193
+ font-size: var(--card-cta-font-size);
194
+ justify-content: ${({ $justifyContent }) => $justifyContent};
195
+
196
+ && > * {
197
+ cursor: pointer;
198
+ }
199
+ `;
200
+
201
+ const CtaText = styled.span`
202
+ font-weight: var(--card-cta-font-weight);
203
+ `;
204
+
205
+ const CtaIcon = styled(ChevronRightIcon)`
206
+ width: var(--card-cta-icon-width);
207
+ height: var(--card-cta-icon-height);
208
+ `;
209
+
152
210
  const CardWrapper = styled.div.attrs<{
153
211
  $variant: string;
154
212
  $isCardLink: boolean;
@@ -185,6 +243,13 @@ const CardWrapper = styled.div.attrs<{
185
243
  height: 100%;
186
244
  object-fit: cover;
187
245
  `}
246
+ }
247
+
248
+ &:hover,
249
+ &:focus-within {
250
+ ${Cta} {
251
+ color: var(--card-link-icon-color);
252
+ }
188
253
  }
189
254
 
190
255
  &.card-link {
@@ -203,8 +268,8 @@ const CardWrapper = styled.div.attrs<{
203
268
  background-color: var(--card-icon-bg-color-hover);
204
269
  }
205
270
 
206
- svg {
207
- opacity: 1;
271
+ ${CardLinkIcon} {
272
+ color: var(--card-link-icon-color);
208
273
  }
209
274
  }
210
275
  }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { Badge } from '@redocly/theme/components/Badge/Badge';
5
+
6
+ export type CardBadgeProps = React.PropsWithChildren<{
7
+ color?: string;
8
+ icon?: string;
9
+ /** Inline SVG content for the icon */
10
+ iconRawContent?: string;
11
+ className?: string;
12
+ }>;
13
+
14
+ export function CardBadge({ color, icon, iconRawContent, className, children }: CardBadgeProps) {
15
+ // `tag-default` keeps a badge grey when the name is absent or unknown.
16
+ const classNames = ['tag-default', color && `tag-${color}`, className].filter(Boolean).join(' ');
17
+
18
+ return (
19
+ <CardBadgeWrapper className={classNames} icon={icon} iconRawContent={iconRawContent}>
20
+ {children}
21
+ </CardBadgeWrapper>
22
+ );
23
+ }
24
+
25
+ const CardBadgeWrapper = styled(Badge)`
26
+ display: flex;
27
+ align-items: center;
28
+ margin: var(--card-badge-margin);
29
+ padding: var(--card-badge-padding);
30
+ border-radius: var(--card-badge-border-radius);
31
+ font-size: var(--card-badge-font-size);
32
+ font-weight: var(--card-badge-font-weight);
33
+ line-height: var(--card-badge-line-height);
34
+ white-space: nowrap;
35
+ flex-shrink: 0;
36
+
37
+ --badge-text-color: var(--tag-color);
38
+ --badge-bg-color: var(--tag-bg-color);
39
+ `;
@@ -4,24 +4,35 @@ import styled from 'styled-components';
4
4
  import { GenericIcon } from '@redocly/theme/icons/GenericIcon/GenericIcon';
5
5
 
6
6
  export type CardIconProps = {
7
- variant?: string;
7
+ variant?: 'filled' | 'ghost';
8
8
  src: string;
9
9
  rawContent?: string;
10
10
  position?: 'auto' | 'start' | 'center' | 'end';
11
+ color?: string;
11
12
  };
12
13
 
13
- export function CardIcon({ variant, src, rawContent, position }: CardIconProps) {
14
+ export function CardIcon({ variant, src, rawContent, position, color }: CardIconProps) {
14
15
  return (
15
- <CardIconWrapper $variant={variant} $position={position}>
16
+ <CardIconWrapper
17
+ className={color && `card-icon-color-${color}`}
18
+ $variant={variant}
19
+ $position={position}
20
+ >
16
21
  <GenericIcon icon={src} rawContent={rawContent} />
17
22
  </CardIconWrapper>
18
23
  );
19
24
  }
20
25
 
21
- export const CardIconWrapper = styled.div<{ $variant?: string; $position?: string }>`
26
+ export const CardIconWrapper = styled.div<{
27
+ $variant?: 'filled' | 'ghost';
28
+ $position?: string;
29
+ }>`
30
+ --card-icon-bg-color-hover: ${({ $variant }) => $variant === 'ghost' && 'transparent'};
22
31
  --icon-width: var(--card-icon-width);
23
32
  --icon-height: var(--card-icon-height);
24
33
  color: var(--card-icon-color);
34
+ /* An inline SVG fills from this. */
35
+ --icon-color: var(--card-icon-color);
25
36
 
26
37
  display: flex;
27
38
  align-self: ${({ $position }) => ($position ? $position : 'auto')};
@@ -30,7 +41,7 @@ export const CardIconWrapper = styled.div<{ $variant?: string; $position?: strin
30
41
  min-height: var(--card-icon-height);
31
42
  flex-shrink: 0;
32
43
 
33
- padding: var(--card-icon-padding);
44
+ padding: ${({ $variant }) => ($variant === 'ghost' ? 0 : `var(--card-icon-padding)`)};
34
45
  border: ${({ $variant }) => $variant !== 'ghost' && `var(--card-icon-border)`};
35
46
  border-radius: var(--card-icon-border-radius);
36
47
  overflow: hidden;
@@ -21,5 +21,37 @@ export const cardsDarkMode = css`
21
21
  --card-box-shadow: 0px 8px 24px -4px #00000014, 0px 6px 12px -6px #0000001F;
22
22
  --card-box-shadow-hover: 0px 14px 64px -4px #0000001F, 0px 8px 22px -6px #0000001F;
23
23
  }
24
+
25
+ .card-icon-color-green {
26
+ --card-icon-color: var(--color-green-7);
27
+ }
28
+
29
+ .card-icon-color-grey {
30
+ --card-icon-color: var(--color-warm-grey-8);
31
+ }
32
+
33
+ .card-icon-color-turquoise {
34
+ --card-icon-color: var(--color-turquoise-6);
35
+ }
36
+
37
+ .card-icon-color-magenta {
38
+ --card-icon-color: var(--color-magenta-4);
39
+ }
40
+
41
+ .card-icon-color-carrot {
42
+ --card-icon-color: var(--color-carrot-6);
43
+ }
44
+
45
+ .card-icon-color-grass {
46
+ --card-icon-color: var(--color-grass-7);
47
+ }
48
+
49
+ .card-icon-color-persian-green {
50
+ --card-icon-color: var(--color-persian-green-7);
51
+ }
52
+
53
+ .card-icon-color-sky {
54
+ --card-icon-color: var(--color-sky-6);
55
+ }
24
56
  `;
25
57
  /* eslint-enable theme/no-raw-colors-in-styles */