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

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 (280) 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 +161 -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/AccordionGroupContext.d.ts +1 -0
  89. package/lib/core/contexts/AccordionGroupContext.js +6 -0
  90. package/lib/core/contexts/PageActionsContext.d.ts +5 -0
  91. package/lib/core/contexts/PageActionsContext.js +10 -0
  92. package/lib/core/contexts/index.d.ts +2 -0
  93. package/lib/core/contexts/index.js +2 -0
  94. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
  95. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +2 -0
  96. package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
  97. package/lib/core/hooks/use-active-heading.js +63 -15
  98. package/lib/core/hooks/use-active-section-id.js +3 -1
  99. package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
  100. package/lib/core/hooks/use-connect-mcp-button.js +23 -15
  101. package/lib/core/hooks/use-control.js +3 -0
  102. package/lib/core/hooks/use-local-state.js +1 -0
  103. package/lib/core/hooks/use-mcp-config.d.ts +2 -0
  104. package/lib/core/hooks/use-mcp-config.js +14 -4
  105. package/lib/core/hooks/use-mobile-menu.js +10 -2
  106. package/lib/core/hooks/use-tabs.js +4 -2
  107. package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
  108. package/lib/core/hooks/use-telemetry-fallback.js +2 -0
  109. package/lib/core/styles/global.js +16 -11
  110. package/lib/core/styles/palette.js +2 -0
  111. package/lib/core/types/button-group.d.ts +2 -0
  112. package/lib/core/types/button-group.js +3 -0
  113. package/lib/core/types/catalog.d.ts +2 -4
  114. package/lib/core/types/common.d.ts +2 -0
  115. package/lib/core/types/hooks.d.ts +1 -0
  116. package/lib/core/types/index.d.ts +1 -0
  117. package/lib/core/types/l10n.d.ts +1 -1
  118. package/lib/core/types/mcp.d.ts +1 -1
  119. package/lib/core/utils/RenderWithLink.d.ts +2 -0
  120. package/lib/core/utils/RenderWithLink.js +20 -0
  121. package/lib/core/utils/index.d.ts +1 -0
  122. package/lib/core/utils/index.js +1 -0
  123. package/lib/core/utils/mcp.d.ts +5 -0
  124. package/lib/core/utils/mcp.js +35 -0
  125. package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
  126. package/lib/icons/CodexIcon/CodexIcon.js +22 -0
  127. package/lib/icons/LinkIcon/LinkIcon.js +1 -1
  128. package/lib/index.d.ts +2 -0
  129. package/lib/index.js +2 -0
  130. package/lib/layouts/McpNotAllowed.js +10 -10
  131. package/lib/markdoc/components/Accordion/Accordion.js +6 -6
  132. package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +2 -1
  133. package/lib/markdoc/components/Accordion/AccordionGroup.js +39 -3
  134. package/lib/markdoc/components/Cards/Card.d.ts +8 -1
  135. package/lib/markdoc/components/Cards/Card.js +55 -16
  136. package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
  137. package/lib/markdoc/components/Cards/CardBadge.js +30 -0
  138. package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
  139. package/lib/markdoc/components/Cards/CardIcon.js +6 -3
  140. package/lib/markdoc/components/Cards/variables.dark.js +32 -0
  141. package/lib/markdoc/components/Cards/variables.js +81 -7
  142. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
  143. package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
  144. package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
  145. package/lib/markdoc/components/Heading/Heading.js +5 -2
  146. package/lib/markdoc/components/Tabs/TabList.js +6 -2
  147. package/lib/markdoc/components/Tabs/Tabs.js +4 -2
  148. package/lib/markdoc/components/Tabs/variables.js +4 -4
  149. package/lib/markdoc/tags/accordion-group.js +3 -0
  150. package/lib/markdoc/tags/admonition.js +1 -1
  151. package/lib/markdoc/tags/card.js +14 -0
  152. package/lib/markdoc/tags/connect-mcp.js +2 -1
  153. package/package.json +19 -10
  154. package/src/components/Accordion/Accordion.tsx +7 -3
  155. package/src/components/Accordion/variables.ts +1 -1
  156. package/src/components/Admonition/Admonition.tsx +2 -2
  157. package/src/components/Admonition/variables.dark.ts +2 -2
  158. package/src/components/Admonition/variables.ts +10 -10
  159. package/src/components/Badge/Badge.tsx +16 -2
  160. package/src/components/Banner/variables.dark.ts +2 -0
  161. package/src/components/Banner/variables.ts +3 -1
  162. package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
  163. package/src/components/Breadcrumbs/variables.ts +1 -1
  164. package/src/components/Button/ButtonGroup.tsx +28 -10
  165. package/src/components/Button/variables.ts +27 -4
  166. package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
  167. package/src/components/Buttons/CopyButton.tsx +14 -2
  168. package/src/components/Buttons/variables.ts +2 -44
  169. package/src/components/Catalog/CatalogEntities.tsx +1 -0
  170. package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
  171. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  172. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  173. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
  174. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  175. package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
  176. package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
  177. package/src/components/Catalog/variables.ts +5 -5
  178. package/src/components/CatalogClassic/variables.ts +2 -2
  179. package/src/components/CodeBlock/CodeBlock.tsx +2 -1
  180. package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
  181. package/src/components/Dropdown/Dropdown.tsx +25 -4
  182. package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
  183. package/src/components/Dropdown/variables.ts +19 -2
  184. package/src/components/Feedback/Mood.tsx +22 -15
  185. package/src/components/Feedback/Rating.tsx +22 -14
  186. package/src/components/Feedback/Scale.tsx +40 -32
  187. package/src/components/Feedback/Sentiment.tsx +21 -14
  188. package/src/components/Filter/FilterInput.tsx +5 -3
  189. package/src/components/Filter/FilterSelect.tsx +1 -0
  190. package/src/components/Filter/variables.ts +2 -2
  191. package/src/components/Image/variables.ts +5 -3
  192. package/src/components/JsonViewer/Helpers.tsx +13 -9
  193. package/src/components/LanguagePicker/variables.ts +1 -1
  194. package/src/components/MCP/McpConnectionTabs.tsx +285 -0
  195. package/src/components/Markdown/styles/base-table.ts +8 -0
  196. package/src/components/Markdown/variables.ts +1 -1
  197. package/src/components/Menu/MenuItem.tsx +2 -2
  198. package/src/components/Menu/variables.ts +1 -1
  199. package/src/components/Navbar/variables.ts +1 -1
  200. package/src/components/PageActions/PageActions.tsx +22 -23
  201. package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
  202. package/src/components/Panel/Panel.tsx +7 -3
  203. package/src/components/Panel/variables.ts +1 -1
  204. package/src/components/Product/variables.ts +2 -1
  205. package/src/components/ReplayGate/ReplayGate.tsx +3 -0
  206. package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
  207. package/src/components/Search/SearchAiDialog.tsx +4 -1
  208. package/src/components/Search/SearchAiMessage.tsx +1 -1
  209. package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
  210. package/src/components/Search/SearchDialog.tsx +2 -2
  211. package/src/components/Search/SearchItem.tsx +7 -1
  212. package/src/components/Search/SearchRecent.tsx +1 -0
  213. package/src/components/Search/SearchSuggestedPages.tsx +1 -0
  214. package/src/components/Search/variables.ts +9 -5
  215. package/src/components/Segmented/Segmented.tsx +6 -3
  216. package/src/components/Select/Select.tsx +36 -22
  217. package/src/components/Select/variables.ts +3 -3
  218. package/src/components/Sidebar/Sidebar.tsx +2 -6
  219. package/src/components/SplitButton/SplitButton.tsx +95 -0
  220. package/src/components/Switch/variables.dark.ts +2 -2
  221. package/src/components/Switch/variables.ts +2 -2
  222. package/src/components/Tag/variables.ts +2 -2
  223. package/src/components/Tags/variables.ts +1 -1
  224. package/src/components/Toast/variables.ts +1 -1
  225. package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
  226. package/src/components/Tooltip/JsTooltip.tsx +2 -2
  227. package/src/components/UserMenu/variables.ts +1 -1
  228. package/src/core/constants/mcp.ts +14 -0
  229. package/src/core/constants/search.ts +2 -2
  230. package/src/core/contexts/AccordionGroupContext.tsx +3 -0
  231. package/src/core/contexts/PageActionsContext.tsx +7 -0
  232. package/src/core/contexts/index.ts +2 -0
  233. package/src/core/hooks/__mocks__/use-theme-hooks.ts +2 -0
  234. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
  235. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +2 -0
  236. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
  237. package/src/core/hooks/use-active-heading.ts +83 -15
  238. package/src/core/hooks/use-active-section-id.ts +3 -1
  239. package/src/core/hooks/use-connect-mcp-button.ts +31 -17
  240. package/src/core/hooks/use-control.ts +5 -1
  241. package/src/core/hooks/use-local-state.ts +1 -0
  242. package/src/core/hooks/use-mcp-config.ts +15 -4
  243. package/src/core/hooks/use-mobile-menu.ts +11 -3
  244. package/src/core/hooks/use-tabs.ts +4 -2
  245. package/src/core/hooks/use-telemetry-fallback.ts +2 -0
  246. package/src/core/openapi/index.ts +1 -1
  247. package/src/core/styles/global.ts +17 -12
  248. package/src/core/styles/palette.ts +2 -0
  249. package/src/core/types/button-group.ts +2 -0
  250. package/src/core/types/catalog.ts +2 -4
  251. package/src/core/types/common.ts +3 -0
  252. package/src/core/types/hooks.ts +1 -0
  253. package/src/core/types/index.ts +1 -0
  254. package/src/core/types/l10n.ts +29 -1
  255. package/src/core/types/mcp.ts +1 -1
  256. package/src/core/utils/RenderWithLink.tsx +19 -0
  257. package/src/core/utils/index.ts +1 -0
  258. package/src/core/utils/mcp.ts +39 -0
  259. package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
  260. package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
  261. package/src/index.ts +2 -0
  262. package/src/layouts/McpNotAllowed.tsx +37 -11
  263. package/src/markdoc/components/Accordion/Accordion.tsx +8 -2
  264. package/src/markdoc/components/Accordion/AccordionGroup.tsx +9 -2
  265. package/src/markdoc/components/Cards/Card.tsx +79 -14
  266. package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
  267. package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
  268. package/src/markdoc/components/Cards/variables.dark.ts +32 -0
  269. package/src/markdoc/components/Cards/variables.ts +81 -7
  270. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
  271. package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
  272. package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
  273. package/src/markdoc/components/Heading/Heading.tsx +7 -4
  274. package/src/markdoc/components/Tabs/TabList.tsx +6 -2
  275. package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
  276. package/src/markdoc/components/Tabs/variables.ts +4 -4
  277. package/src/markdoc/tags/accordion-group.ts +3 -0
  278. package/src/markdoc/tags/admonition.ts +1 -1
  279. package/src/markdoc/tags/card.ts +14 -0
  280. package/src/markdoc/tags/connect-mcp.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.69.0-next.1",
3
+ "version": "0.69.0-next.11",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -42,6 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@babel/core": "7.29.7",
44
44
  "@markdoc/markdoc": "0.5.2",
45
+ "@redocly/realm-asyncapi-sdk": "0.15.0-next.4",
45
46
  "@shikijs/types": "3.21.0",
46
47
  "@testing-library/react": "16.3.0",
47
48
  "@testing-library/user-event": "14.6.1",
@@ -53,8 +54,8 @@
53
54
  "@types/nprogress": "0.2.3",
54
55
  "@types/react": "^19.2.7",
55
56
  "@types/react-dom": "^19.2.3",
56
- "@vitest/coverage-v8": "4.1.10",
57
- "@vitest/ui": "4.1.10",
57
+ "@vitest/coverage-v8": "4.1.11",
58
+ "@vitest/ui": "4.1.11",
58
59
  "concurrently": "7.6.0",
59
60
  "react-router": "^8.3.0",
60
61
  "resize-observer-polyfill": "1.5.1",
@@ -65,15 +66,15 @@
65
66
  "tsconfig-paths": "4.2.0",
66
67
  "tsconfig-paths-webpack-plugin": "3.5.2",
67
68
  "typescript": "6.0.3",
68
- "vitest": "4.1.10",
69
+ "vitest": "4.1.11",
69
70
  "vitest-when": "0.6.2",
70
- "webpack": "5.105.2",
71
- "@redocly/realm-asyncapi-sdk": "0.15.0-next.0"
71
+ "webpack": "5.105.2"
72
72
  },
73
73
  "dependencies": {
74
+ "@redocly/config": "0.56.0",
74
75
  "@tanstack/react-query": "5.62.3",
75
76
  "@tanstack/react-virtual": "3.13.0",
76
- "@xyflow/react": "^12.8.2",
77
+ "@xyflow/react": "12.8.3",
77
78
  "copy-to-clipboard": "3.3.3",
78
79
  "file-saver": "2.0.5",
79
80
  "highlight-words-core": "1.2.2",
@@ -83,10 +84,18 @@
83
84
  "lodash.debounce": "^4.0.8",
84
85
  "lodash.throttle": "4.1.1",
85
86
  "nprogress": "0.2.0",
86
- "openapi-sampler": "^1.7.2",
87
+ "openapi-sampler": "^1.7.5",
87
88
  "react-calendar": "5.1.0",
88
- "react-date-picker": "11.0.0",
89
- "@redocly/config": "0.53.1"
89
+ "react-date-picker": "11.0.0"
90
+ },
91
+ "nx": {
92
+ "targets": {
93
+ "vitest:test": {
94
+ "dependsOn": [
95
+ "build"
96
+ ]
97
+ }
98
+ }
90
99
  },
91
100
  "scripts": {
92
101
  "watch": "tsgo -p tsconfig.build.json && (concurrently \"tsgo -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useState } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import type { BaseSyntheticEvent, PropsWithChildren, ReactNode, JSX } from 'react';
@@ -32,6 +32,12 @@ export function Accordion({
32
32
  }: PropsWithChildren<AccordionProps>): JSX.Element {
33
33
  const [isExpanded, setExpanded] = useState(expanded);
34
34
  const [animate, setAnimate] = useState(false);
35
+ const [prevExpanded, setPrevExpanded] = useState(expanded);
36
+
37
+ if (prevExpanded !== expanded) {
38
+ setPrevExpanded(expanded);
39
+ setExpanded(expanded);
40
+ }
35
41
 
36
42
  const toggle = ({ target }: BaseSyntheticEvent): void => {
37
43
  if (target instanceof HTMLAnchorElement || !isExpandable) return;
@@ -40,8 +46,6 @@ export function Accordion({
40
46
  onToggle?.(!isExpanded);
41
47
  };
42
48
 
43
- useEffect(() => setExpanded(expanded), [expanded]);
44
-
45
49
  return (
46
50
  <AccordionWrapper
47
51
  className={className}
@@ -12,7 +12,7 @@ export const accordion = css`
12
12
  * @tokens Accordion common
13
13
  */
14
14
 
15
- --accordion-border-radius: var(--border-radius); // @presenter BorderRadius
15
+ --accordion-border-radius: var(--border-radius-xl); // @presenter BorderRadius
16
16
  --accordion-border: none; // @presenter Border
17
17
 
18
18
  --accordion-line-height: var(--line-height-base); // @presenter LineHeight
@@ -10,7 +10,7 @@ import { InformationIcon } from '@redocly/theme/icons/InformationIcon/Informatio
10
10
  import { IdeaIcon } from '@redocly/theme/icons/IdeaIcon/IdeaIcon';
11
11
 
12
12
  type AdmonitionTypeProps = {
13
- type: 'warning' | 'success' | 'danger' | 'info' | 'default';
13
+ type: 'warning' | 'success' | 'danger' | 'info' | 'idea';
14
14
  };
15
15
 
16
16
  export type AdmonitionProps = Partial<AdmonitionTypeProps> & {
@@ -25,7 +25,7 @@ const IconsMap: Record<AdmonitionTypeProps['type'], FC<{ color?: string }>> = {
25
25
  success: CheckmarkOutlineIcon,
26
26
  danger: ErrorIcon,
27
27
  info: InformationIcon,
28
- default: IdeaIcon,
28
+ idea: IdeaIcon,
29
29
  };
30
30
 
31
31
  export function Admonition({
@@ -13,6 +13,6 @@ export const admonitionDarkMode = css`
13
13
  --admonition-success-bg-color: color-mix(in srgb, var(--color-green-1) 40%, transparent); // @presenter Color
14
14
  --admonition-success-border: var(--admonition-border-width) var(--admonition-border-style) color-mix(in srgb, var(--color-green-3) 40%, transparent); // @presenter Border
15
15
 
16
- --admonition-default-bg-color: color-mix(in srgb, var(--color-primary-bg, var(--admonition-default-bg-color-legacy)) 40%, transparent); // @presenter Color
17
- --admonition-default-border: var(--admonition-border-width) var(--admonition-border-style) color-mix(in srgb, var(--color-primary-border, var(--admonition-default-border-color-legacy)) 40%, transparent); // @presenter Border
16
+ --admonition-idea-bg-color: color-mix(in srgb, var(--color-primary-bg, var(--admonition-default-bg-color-legacy)) 40%, transparent); // @presenter Color
17
+ --admonition-idea-border: var(--admonition-border-width) var(--admonition-border-style) color-mix(in srgb, var(--color-primary-border, var(--admonition-default-border-color-legacy)) 40%, transparent); // @presenter Border
18
18
  `;
@@ -32,7 +32,7 @@ export const admonition = css`
32
32
  * @tokens Admonition border
33
33
  */
34
34
 
35
- --admonition-border-radius: var(--border-radius-lg); // @presenter BorderRadius
35
+ --admonition-border-radius: var(--border-radius-xl); // @presenter BorderRadius
36
36
  --admonition-border-style: var(--border-style);
37
37
  --admonition-border-width: 1px;
38
38
 
@@ -90,17 +90,17 @@ export const admonition = css`
90
90
  --admonition-success-border: var(--admonition-success-border-width) var(--admonition-success-border-style) var(--admonition-success-border-color); // @presenter Border
91
91
 
92
92
  /**
93
- * @tokens Admonition type primary
93
+ * @tokens Admonition type idea
94
94
  */
95
95
 
96
- --admonition-default-bg-color: var(--color-primary-bg, var(--admonition-default-bg-color-legacy)); // @presenter Color
97
- --admonition-default-text-color: var(--admonition-heading-text-color); // @presenter Color
98
- --admonition-default-heading-text-color: var(--admonition-heading-text-color); // @presenter Color
99
- --admonition-default-icon-color: var(--color-primary-base, var(--admonition-default-icon-color-legacy)); // @presenter Color
100
- --admonition-default-border-color: var(--color-primary-border, var(--admonition-default-border-color-legacy)); // @presenter Color
101
- --admonition-default-border-style: var(--admonition-border-style); // @presenter Color
102
- --admonition-default-border-width: var(--admonition-border-width); // @presenter Color
103
- --admonition-default-border: var(--admonition-default-border-width) var(--admonition-default-border-style) var(--admonition-default-border-color); // @presenter Border
96
+ --admonition-idea-bg-color: var(--color-primary-bg, var(--admonition-default-bg-color-legacy)); // @presenter Color
97
+ --admonition-idea-text-color: var(--admonition-heading-text-color); // @presenter Color
98
+ --admonition-idea-heading-text-color: var(--admonition-heading-text-color); // @presenter Color
99
+ --admonition-idea-icon-color: var(--color-primary-base, var(--admonition-default-icon-color-legacy)); // @presenter Color
100
+ --admonition-idea-border-color: var(--color-primary-border, var(--admonition-default-border-color-legacy)); // @presenter Color
101
+ --admonition-idea-border-style: var(--admonition-border-style); // @presenter Color
102
+ --admonition-idea-border-width: var(--admonition-border-width); // @presenter Color
103
+ --admonition-idea-border: var(--admonition-idea-border-width) var(--admonition-idea-border-style) var(--admonition-idea-border-color); // @presenter Border
104
104
 
105
105
  // @tokens End
106
106
  `;
@@ -11,9 +11,18 @@ export type BadgeProps = PropsWithChildren<{
11
11
  key?: string;
12
12
  className?: string;
13
13
  icon?: string;
14
+ /** Inline SVG content for the icon */
15
+ iconRawContent?: string;
14
16
  }>;
15
17
 
16
- export function Badge({ icon, children, deprecated, color, ...props }: BadgeProps): JSX.Element {
18
+ export function Badge({
19
+ icon,
20
+ iconRawContent,
21
+ children,
22
+ deprecated,
23
+ color,
24
+ ...props
25
+ }: BadgeProps): JSX.Element {
17
26
  return (
18
27
  <BadgeComponent
19
28
  {...props}
@@ -21,7 +30,7 @@ export function Badge({ icon, children, deprecated, color, ...props }: BadgeProp
21
30
  $deprecated={deprecated}
22
31
  data-component-name="Badge/Badge"
23
32
  >
24
- {icon ? <BadgeIcon icon={icon} /> : null}
33
+ {icon || iconRawContent ? <BadgeIcon icon={icon} rawContent={iconRawContent} /> : null}
25
34
  {children}
26
35
  </BadgeComponent>
27
36
  );
@@ -54,4 +63,9 @@ const BadgeIcon = styled(GenericIcon)`
54
63
  margin-right: var(--spacing-xxs);
55
64
  flex-shrink: 0;
56
65
  vertical-align: middle;
66
+
67
+ /* For inline SVG to align properly */
68
+ svg {
69
+ display: block;
70
+ }
57
71
  `;
@@ -6,5 +6,7 @@ export const bannerDarkMode = css`
6
6
  */
7
7
 
8
8
  --banner-warning-text-color: var(--color-white); // @presenter Color
9
+
10
+ // @tokens End
9
11
  `;
10
12
 
@@ -8,7 +8,7 @@ export const banner = css`
8
8
  --banner-button-size: 22px;
9
9
  --banner-button-padding: 3px; // @presenter Spacing
10
10
  --banner-button-font-size: var(--font-size-base);
11
- --banner-button-border-radius: var(--border-radius);
11
+ --banner-button-border-radius: var(--border-radius-md);
12
12
  --banner-button-padding-inline: 1px var(--spacing-sm);
13
13
  --banner-button-line-height: var(--line-height-base); // @presenter LineHeight
14
14
  --banner-button-icon-size: 14px;
@@ -47,5 +47,7 @@ export const banner = css`
47
47
  --banner-error-link-color: var(--banner-error-text-color); // @presenter Color
48
48
  --banner-error-link-decoration: underline 1px var(--banner-error-link-color);
49
49
  --banner-error-link-decoration-hover: underline 2px var(--banner-error-link-color);
50
+
51
+ // @tokens End
50
52
  `;
51
53
 
@@ -61,7 +61,7 @@ const baseBreadcrumbStyles = `
61
61
  align-items: center;
62
62
  gap: var(--breadcrumbs-gap);
63
63
  padding: var(--breadcrumb-padding);
64
- border-radius: var(--border-radius);
64
+ border-radius: var(--breadcrumbs-border-radius);
65
65
  color: var(--breadcrumbs-text-color);
66
66
  text-decoration: none;
67
67
 
@@ -13,7 +13,7 @@ export const breadcrumbs = css`
13
13
  --breadcrumbs-icon-size: var(--font-size-base); // @presenter FontSize
14
14
  --breadcrumbs-font-weight-active: var(--font-weight-medium); // @presenter FontWeight
15
15
 
16
- --breadcrumbs-border-radius: var(--border-radius); // @presenter BorderRadius
16
+ --breadcrumbs-border-radius: var(--border-radius-md); // @presenter BorderRadius
17
17
  --breadcrumbs-gap: var(--spacing-xxs); // @presenter Spacing
18
18
 
19
19
  --breadcrumbs-padding: 2px var(--spacing-xs); // @presenter Spacing
@@ -2,13 +2,11 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import type { JSX } from 'react';
5
- import type { ButtonSize } from '@redocly/theme/components/Button/Button';
5
+ import type { ButtonGroupSize, ButtonGroupVariant } from '@redocly/theme/core/types';
6
6
 
7
- type ButtonGroupVariant = 'outlined';
8
-
9
- type ButtonGroupProps = {
7
+ export type ButtonGroupProps = {
10
8
  variant?: ButtonGroupVariant;
11
- size?: ButtonSize;
9
+ size?: ButtonGroupSize;
12
10
  children: React.ReactNode;
13
11
  className?: string;
14
12
  };
@@ -30,24 +28,44 @@ const ButtonGroupWrapper = styled.div`
30
28
  display: flex;
31
29
  line-height: var(--button-line-height);
32
30
 
33
- .button {
31
+ & > .button,
32
+ & > * > .button {
34
33
  border-radius: 0;
35
34
  }
36
35
 
37
36
  & > .button:first-child,
38
- *:first-child > .button {
37
+ & > *:first-child > .button {
39
38
  border-top-left-radius: var(--button-border-radius);
40
39
  border-bottom-left-radius: var(--button-border-radius);
41
40
  }
42
41
 
43
42
  & > .button:last-child,
44
- *:last-child > .button {
43
+ & > *:last-child > .button {
45
44
  border-top-right-radius: var(--button-border-radius);
46
45
  border-bottom-right-radius: var(--button-border-radius);
47
46
  }
48
47
 
48
+ /* Adjacent segments share a single divider line: the leading segment drops its
49
+ own right border and the trailing one draws the divider as its left border. */
50
+ & > .button:not(:last-child),
51
+ & > *:not(:last-child) > .button {
52
+ border-right-style: none;
53
+ border-right-width: 0;
54
+ }
55
+
49
56
  & > .button:not(:first-child),
50
- *:not(:first-child) > .button {
51
- border-left: none;
57
+ & > *:not(:first-child) > .button {
58
+ border-left-width: 1px;
59
+ border-left-style: solid;
60
+ border-left-color: color-mix(
61
+ in srgb,
62
+ var(--button-group-divider-color) calc(var(--button-group-divider-opacity) * 100%),
63
+ transparent
64
+ );
65
+ }
66
+
67
+ & > .button:not(:first-child):disabled,
68
+ & > *:not(:first-child) > .button:disabled {
69
+ border-left-color: var(--button-group-divider-color-disabled);
52
70
  }
53
71
  `;
@@ -68,7 +68,7 @@ export const button = css`
68
68
  --button-font-weight: var(--font-weight-regular);
69
69
  --button-font-size: var(--font-size-base);
70
70
  --button-line-height: var(--line-height-base);
71
- --button-border-radius: var(--border-radius-md);
71
+ --button-border-radius: var(--border-radius-lg);
72
72
  --button-padding: 5px var(--spacing-sm);
73
73
  --button-text-wrap: nowrap;
74
74
  --button-gap: var(--spacing-xs);
@@ -94,7 +94,7 @@ export const button = css`
94
94
  .button-size-small,
95
95
  .button-group-size-small .button {
96
96
  --button-font-size: var(--font-size-base);
97
- --button-border-radius: var(--border-radius);
97
+ --button-border-radius: var(--border-radius-md);
98
98
  --button-padding: 1px var(--spacing-sm);
99
99
  --button-line-height: var(--line-height-base);
100
100
 
@@ -107,7 +107,7 @@ export const button = css`
107
107
  .button-size-medium,
108
108
  .button-group-size-medium .button {
109
109
  --button-font-size: var(--font-size-base);
110
- --button-border-radius: var(--border-radius-md);
110
+ --button-border-radius: var(--border-radius-lg);
111
111
  --button-padding: 5px var(--spacing-sm);
112
112
  --button-line-height: var(--line-height-base);
113
113
 
@@ -120,7 +120,7 @@ export const button = css`
120
120
  .button-size-large,
121
121
  .button-group-size-large .button {
122
122
  --button-font-size: var(--font-size-lg); // @presenter FontSize
123
- --button-border-radius: var(--border-radius-md);
123
+ --button-border-radius: var(--border-radius-xl);
124
124
  --button-padding: var(--spacing-xs) var(--spacing-md);
125
125
  --button-line-height: var(--line-height-lg); // @presenter LineHeight
126
126
 
@@ -241,5 +241,28 @@ export const button = css`
241
241
  --button-icon-right-padding: 0;
242
242
  }
243
243
 
244
+ /**
245
+ * @tokens Button group divider
246
+ */
247
+
248
+ --button-group-divider-color: transparent;
249
+ --button-group-divider-opacity: 1;
250
+ --button-group-divider-color-disabled: var(--color-warm-grey-2); // @presenter Color
251
+
252
+ .button-group-primary {
253
+ --button-group-divider-color: var(--button-content-color-inverse); // @presenter Color
254
+ --button-group-divider-opacity: 0.32;
255
+ }
256
+
257
+ .button-group-secondary {
258
+ --button-group-divider-color: var(--button-content-color); // @presenter Color
259
+ --button-group-divider-opacity: 0.12;
260
+ }
261
+
262
+ .button-group-outlined {
263
+ --button-group-divider-color: var(--button-border-color); // @presenter Color
264
+ --button-group-divider-opacity: 1;
265
+ }
266
+
244
267
  // @tokens End
245
268
  `;