@redocly/theme 0.69.0-next.0 → 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.
- package/lib/components/Accordion/Accordion.js +5 -1
- package/lib/components/Accordion/variables.js +1 -1
- package/lib/components/Admonition/Admonition.d.ts +1 -1
- package/lib/components/Admonition/Admonition.js +1 -1
- package/lib/components/Admonition/variables.dark.js +2 -2
- package/lib/components/Admonition/variables.js +10 -10
- package/lib/components/Badge/Badge.d.ts +3 -1
- package/lib/components/Badge/Badge.js +7 -2
- package/lib/components/Banner/variables.dark.js +2 -0
- package/lib/components/Banner/variables.js +3 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
- package/lib/components/Breadcrumbs/variables.js +1 -1
- package/lib/components/Button/ButtonGroup.d.ts +3 -5
- package/lib/components/Button/ButtonGroup.js +25 -5
- package/lib/components/Button/variables.js +27 -4
- package/lib/components/Buttons/ConnectMCPButton.js +39 -123
- package/lib/components/Buttons/CopyButton.js +12 -1
- package/lib/components/Buttons/variables.d.ts +0 -1
- package/lib/components/Buttons/variables.js +3 -44
- package/lib/components/Catalog/CatalogEntities.js +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +1 -0
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
- package/lib/components/Catalog/variables.js +5 -5
- package/lib/components/CatalogClassic/variables.js +2 -2
- package/lib/components/CodeBlock/CodeBlock.js +2 -1
- package/lib/components/CodeBlock/CodeBlockContainer.js +1 -0
- package/lib/components/Dropdown/Dropdown.d.ts +10 -20
- package/lib/components/Dropdown/Dropdown.js +13 -2
- package/lib/components/Dropdown/DropdownMenuItemContent.d.ts +9 -0
- package/lib/components/Dropdown/DropdownMenuItemContent.js +56 -0
- package/lib/components/Dropdown/variables.js +19 -2
- package/lib/components/Feedback/Mood.js +18 -14
- package/lib/components/Feedback/Rating.js +18 -13
- package/lib/components/Feedback/Scale.js +27 -22
- package/lib/components/Feedback/Sentiment.js +17 -13
- package/lib/components/Filter/FilterInput.js +4 -2
- package/lib/components/Filter/FilterSelect.js +1 -0
- package/lib/components/Filter/variables.js +2 -2
- package/lib/components/Image/variables.js +5 -3
- package/lib/components/JsonViewer/Helpers.js +12 -42
- package/lib/components/LanguagePicker/variables.js +1 -1
- package/lib/components/MCP/McpConnectionTabs.d.ts +7 -0
- package/lib/components/MCP/McpConnectionTabs.js +151 -0
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/Markdown/styles/base-table.js +8 -0
- package/lib/components/Markdown/variables.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/Menu/variables.js +1 -1
- package/lib/components/Navbar/variables.js +1 -1
- package/lib/components/PageActions/PageActions.js +4 -6
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +4 -4
- package/lib/components/PageActions/PageActionsMenuItem.js +27 -43
- package/lib/components/Panel/Panel.js +5 -1
- package/lib/components/Panel/variables.js +1 -1
- package/lib/components/Product/variables.js +2 -1
- package/lib/components/ReplayGate/ReplayGate.d.ts +1 -0
- package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
- package/lib/components/Search/SearchAiDialog.js +4 -1
- package/lib/components/Search/SearchAiMessage.js +1 -1
- package/lib/components/Search/SearchAiNegativeFeedbackForm.js +2 -2
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Search/SearchItem.js +6 -3
- package/lib/components/Search/SearchRecent.js +1 -0
- package/lib/components/Search/SearchSuggestedPages.js +1 -0
- package/lib/components/Search/variables.js +9 -5
- package/lib/components/Segmented/Segmented.js +3 -3
- package/lib/components/Select/Select.js +30 -23
- package/lib/components/Select/variables.js +3 -3
- package/lib/components/Sidebar/Sidebar.js +2 -38
- package/lib/components/SplitButton/SplitButton.d.ts +21 -0
- package/lib/components/SplitButton/SplitButton.js +37 -0
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +2 -2
- package/lib/components/Tag/variables.js +2 -2
- package/lib/components/Tags/variables.js +1 -1
- package/lib/components/Toast/variables.js +1 -1
- package/lib/components/Tooltip/AnchorTooltip.js +2 -2
- package/lib/components/Tooltip/JsTooltip.js +2 -2
- package/lib/components/UserMenu/variables.js +1 -1
- package/lib/core/constants/accordion.d.ts +3 -0
- package/lib/core/constants/accordion.js +7 -0
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/mcp.d.ts +4 -0
- package/lib/core/constants/mcp.js +10 -1
- package/lib/core/constants/search.js +2 -2
- package/lib/core/contexts/PageActionsContext.d.ts +5 -0
- package/lib/core/contexts/PageActionsContext.js +10 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
- package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
- package/lib/core/hooks/use-active-heading.js +59 -15
- package/lib/core/hooks/use-active-section-id.js +3 -1
- package/lib/core/hooks/use-connect-mcp-button.d.ts +1 -1
- package/lib/core/hooks/use-connect-mcp-button.js +16 -13
- package/lib/core/hooks/use-control.js +3 -0
- package/lib/core/hooks/use-local-state.js +1 -0
- package/lib/core/hooks/use-mcp-config.d.ts +2 -0
- package/lib/core/hooks/use-mcp-config.js +14 -4
- package/lib/core/hooks/use-mobile-menu.js +10 -2
- package/lib/core/styles/global.js +56 -49
- package/lib/core/styles/palette.js +2 -0
- package/lib/core/types/button-group.d.ts +2 -0
- package/lib/core/types/button-group.js +3 -0
- package/lib/core/types/catalog.d.ts +2 -4
- package/lib/core/types/common.d.ts +2 -0
- package/lib/core/types/hooks.d.ts +1 -0
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/mcp.d.ts +1 -1
- package/lib/core/utils/RenderWithLink.d.ts +2 -0
- package/lib/core/utils/RenderWithLink.js +20 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/mcp.d.ts +5 -0
- package/lib/core/utils/mcp.js +35 -0
- package/lib/icons/CodexIcon/CodexIcon.d.ts +25 -0
- package/lib/icons/CodexIcon/CodexIcon.js +22 -0
- package/lib/icons/LinkIcon/LinkIcon.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/McpNotAllowed.js +10 -10
- package/lib/markdoc/components/Accordion/Accordion.d.ts +9 -0
- package/lib/markdoc/components/Accordion/Accordion.js +132 -0
- package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +5 -0
- package/lib/markdoc/components/Accordion/AccordionGroup.js +29 -0
- package/lib/markdoc/components/Accordion/variables.d.ts +1 -0
- package/lib/markdoc/components/Accordion/variables.js +40 -0
- package/lib/markdoc/components/Cards/Card.d.ts +8 -1
- package/lib/markdoc/components/Cards/Card.js +55 -16
- package/lib/markdoc/components/Cards/CardBadge.d.ts +9 -0
- package/lib/markdoc/components/Cards/CardBadge.js +30 -0
- package/lib/markdoc/components/Cards/CardIcon.d.ts +5 -4
- package/lib/markdoc/components/Cards/CardIcon.js +6 -3
- package/lib/markdoc/components/Cards/variables.dark.js +32 -0
- package/lib/markdoc/components/Cards/variables.js +81 -7
- package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +1 -0
- package/lib/markdoc/components/CodeWalkthrough/CodeStep.js +1 -1
- package/lib/markdoc/components/CodeWalkthrough/variables.js +2 -1
- package/lib/markdoc/components/Heading/Heading.js +5 -2
- package/lib/markdoc/components/Tabs/TabList.js +6 -2
- package/lib/markdoc/components/Tabs/Tabs.js +4 -2
- package/lib/markdoc/components/Tabs/variables.js +4 -4
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.d.ts +4 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/accordion-group.d.ts +2 -0
- package/lib/markdoc/tags/accordion-group.js +10 -0
- package/lib/markdoc/tags/accordion.d.ts +2 -0
- package/lib/markdoc/tags/accordion.js +14 -0
- package/lib/markdoc/tags/admonition.js +1 -1
- package/lib/markdoc/tags/card.js +14 -0
- package/lib/markdoc/tags/connect-mcp.js +2 -1
- package/package.json +19 -10
- package/src/components/Accordion/Accordion.tsx +7 -3
- package/src/components/Accordion/variables.ts +1 -1
- package/src/components/Admonition/Admonition.tsx +2 -2
- package/src/components/Admonition/variables.dark.ts +2 -2
- package/src/components/Admonition/variables.ts +10 -10
- package/src/components/Badge/Badge.tsx +16 -2
- package/src/components/Banner/variables.dark.ts +2 -0
- package/src/components/Banner/variables.ts +3 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +1 -1
- package/src/components/Breadcrumbs/variables.ts +1 -1
- package/src/components/Button/ButtonGroup.tsx +28 -10
- package/src/components/Button/variables.ts +27 -4
- package/src/components/Buttons/ConnectMCPButton.tsx +88 -145
- package/src/components/Buttons/CopyButton.tsx +14 -2
- package/src/components/Buttons/variables.ts +2 -44
- package/src/components/Catalog/CatalogEntities.tsx +1 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +1 -0
- package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
- package/src/components/Catalog/variables.ts +5 -5
- package/src/components/CatalogClassic/variables.ts +2 -2
- package/src/components/CodeBlock/CodeBlock.tsx +2 -1
- package/src/components/CodeBlock/CodeBlockContainer.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +25 -4
- package/src/components/Dropdown/DropdownMenuItemContent.tsx +72 -0
- package/src/components/Dropdown/variables.ts +19 -2
- package/src/components/Feedback/Mood.tsx +22 -15
- package/src/components/Feedback/Rating.tsx +22 -14
- package/src/components/Feedback/Scale.tsx +40 -32
- package/src/components/Feedback/Sentiment.tsx +21 -14
- package/src/components/Filter/FilterInput.tsx +5 -3
- package/src/components/Filter/FilterSelect.tsx +1 -0
- package/src/components/Filter/variables.ts +2 -2
- package/src/components/Image/variables.ts +5 -3
- package/src/components/JsonViewer/Helpers.tsx +13 -9
- package/src/components/LanguagePicker/variables.ts +1 -1
- package/src/components/MCP/McpConnectionTabs.tsx +263 -0
- package/src/components/Markdown/Markdown.tsx +2 -1
- package/src/components/Markdown/styles/base-table.ts +8 -0
- package/src/components/Markdown/variables.ts +1 -1
- package/src/components/Menu/MenuItem.tsx +2 -2
- package/src/components/Menu/variables.ts +1 -1
- package/src/components/Navbar/variables.ts +1 -1
- package/src/components/PageActions/PageActions.tsx +22 -23
- package/src/components/PageActions/PageActionsMenuItem.tsx +41 -55
- package/src/components/Panel/Panel.tsx +7 -3
- package/src/components/Panel/variables.ts +1 -1
- package/src/components/Product/variables.ts +2 -1
- package/src/components/ReplayGate/ReplayGate.tsx +3 -0
- package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
- package/src/components/Search/SearchAiDialog.tsx +4 -1
- package/src/components/Search/SearchAiMessage.tsx +1 -1
- package/src/components/Search/SearchAiNegativeFeedbackForm.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Search/SearchItem.tsx +7 -1
- package/src/components/Search/SearchRecent.tsx +1 -0
- package/src/components/Search/SearchSuggestedPages.tsx +1 -0
- package/src/components/Search/variables.ts +9 -5
- package/src/components/Segmented/Segmented.tsx +6 -3
- package/src/components/Select/Select.tsx +36 -22
- package/src/components/Select/variables.ts +3 -3
- package/src/components/Sidebar/Sidebar.tsx +2 -6
- package/src/components/SplitButton/SplitButton.tsx +95 -0
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +2 -2
- package/src/components/Tag/variables.ts +2 -2
- package/src/components/Tags/variables.ts +1 -1
- package/src/components/Toast/variables.ts +1 -1
- package/src/components/Tooltip/AnchorTooltip.tsx +2 -2
- package/src/components/Tooltip/JsTooltip.tsx +2 -2
- package/src/components/UserMenu/variables.ts +1 -1
- package/src/core/constants/accordion.ts +4 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/mcp.ts +14 -0
- package/src/core/constants/search.ts +2 -2
- package/src/core/contexts/PageActionsContext.tsx +7 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +79 -15
- package/src/core/hooks/use-active-section-id.ts +3 -1
- package/src/core/hooks/use-connect-mcp-button.ts +23 -15
- package/src/core/hooks/use-control.ts +5 -1
- package/src/core/hooks/use-local-state.ts +1 -0
- package/src/core/hooks/use-mcp-config.ts +15 -4
- package/src/core/hooks/use-mobile-menu.ts +11 -3
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +19 -12
- package/src/core/styles/palette.ts +2 -0
- package/src/core/types/button-group.ts +2 -0
- package/src/core/types/catalog.ts +2 -4
- package/src/core/types/common.ts +3 -0
- package/src/core/types/hooks.ts +1 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +29 -1
- package/src/core/types/mcp.ts +1 -1
- package/src/core/utils/RenderWithLink.tsx +19 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/mcp.ts +39 -0
- package/src/icons/CodexIcon/CodexIcon.tsx +23 -0
- package/src/icons/LinkIcon/LinkIcon.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/layouts/McpNotAllowed.tsx +37 -11
- package/src/markdoc/components/Accordion/Accordion.tsx +128 -0
- package/src/markdoc/components/Accordion/AccordionGroup.tsx +41 -0
- package/src/markdoc/components/Accordion/variables.ts +37 -0
- package/src/markdoc/components/Cards/Card.tsx +79 -14
- package/src/markdoc/components/Cards/CardBadge.tsx +39 -0
- package/src/markdoc/components/Cards/CardIcon.tsx +16 -5
- package/src/markdoc/components/Cards/variables.dark.ts +32 -0
- package/src/markdoc/components/Cards/variables.ts +81 -7
- package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +1 -0
- package/src/markdoc/components/CodeWalkthrough/CodeStep.tsx +1 -1
- package/src/markdoc/components/CodeWalkthrough/variables.ts +2 -1
- package/src/markdoc/components/Heading/Heading.tsx +7 -4
- package/src/markdoc/components/Tabs/TabList.tsx +6 -2
- package/src/markdoc/components/Tabs/Tabs.tsx +4 -2
- package/src/markdoc/components/Tabs/variables.ts +4 -4
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/accordion-group.ts +8 -0
- package/src/markdoc/tags/accordion.ts +12 -0
- package/src/markdoc/tags/admonition.ts +1 -1
- package/src/markdoc/tags/card.ts +14 -0
- package/src/markdoc/tags/connect-mcp.ts +3 -1
|
@@ -45,6 +45,7 @@ const utils_1 = require("../../../core/utils");
|
|
|
45
45
|
const LinkIcon_1 = require("../../../icons/LinkIcon/LinkIcon");
|
|
46
46
|
const PageActions_1 = require("../../../components/PageActions/PageActions");
|
|
47
47
|
const hooks_1 = require("../../../core/hooks");
|
|
48
|
+
const contexts_1 = require("../../../core/contexts");
|
|
48
49
|
const constants_1 = require("../../../core/constants");
|
|
49
50
|
function renderWithSpanWrapper(children) {
|
|
50
51
|
const childrenArray = react_1.default.Children.toArray(children);
|
|
@@ -68,10 +69,12 @@ function renderWithSpanWrapper(children) {
|
|
|
68
69
|
}
|
|
69
70
|
function Heading({ level, id, children, 'data-source': dataSource, 'data-hash': dataHash, className, __idx, }) {
|
|
70
71
|
var _a, _b;
|
|
72
|
+
var _c;
|
|
71
73
|
const { pathname } = (0, react_router_1.useLocation)();
|
|
72
74
|
const { usePageProps } = (0, hooks_1.useThemeHooks)();
|
|
73
75
|
const pageProps = usePageProps();
|
|
74
|
-
|
|
76
|
+
// The page-type fallback is only for backward compatibility; templates set the scope.
|
|
77
|
+
const withPageActions = (_c = (0, react_1.useContext)(contexts_1.PageActionsContext)) !== null && _c !== void 0 ? _c : (((_a = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _a === void 0 ? void 0 : _a.type) === 'markdown' || ((_b = pageProps === null || pageProps === void 0 ? void 0 : pageProps.metadata) === null || _b === void 0 ? void 0 : _b.type) === 'asciidoc');
|
|
75
78
|
const headingTextId = `${id}-heading-text`;
|
|
76
79
|
const linkEl = (react_1.default.createElement("a", { "aria-labelledby": headingTextId, href: `#${id}`, className: (0, utils_1.concatClassNames)(constants_1.ANCHOR_CLASS, 'before') },
|
|
77
80
|
react_1.default.createElement(LinkIcon_1.LinkIcon, { "aria-hidden": "true", focusable: "false", color: "--heading-anchor-color" })));
|
|
@@ -80,7 +83,7 @@ function Heading({ level, id, children, 'data-source': dataSource, 'data-hash':
|
|
|
80
83
|
react_1.default.createElement(HeadingContentWrapper, null,
|
|
81
84
|
linkEl,
|
|
82
85
|
headingText,
|
|
83
|
-
|
|
86
|
+
withPageActions && __idx === 0 ? react_1.default.createElement(PageActions_1.PageActions, { pageSlug: pathname }) : null)));
|
|
84
87
|
}
|
|
85
88
|
const HeadingContentWrapper = styled_components_1.default.div `
|
|
86
89
|
display: flex;
|
|
@@ -137,6 +137,7 @@ function TabList({ childrenArray, size, activeTab, onTabChange, containerRef, on
|
|
|
137
137
|
totalTabs,
|
|
138
138
|
});
|
|
139
139
|
(0, react_1.useEffect)(() => {
|
|
140
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
140
141
|
onReadyChange === null || onReadyChange === void 0 ? void 0 : onReadyChange(isReady);
|
|
141
142
|
}, [isReady, onReadyChange]);
|
|
142
143
|
const { highlightStyle } = useHighlightBarAnimation({
|
|
@@ -190,6 +191,7 @@ const useHighlightBarAnimation = (props) => {
|
|
|
190
191
|
width: 0,
|
|
191
192
|
});
|
|
192
193
|
(0, react_1.useEffect)(() => {
|
|
194
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
193
195
|
const activeIndex = childrenArray.findIndex((child) => child.props.label === activeTab);
|
|
194
196
|
const container = tabsContainerRef.current;
|
|
195
197
|
if (!container || activeIndex === -1) {
|
|
@@ -207,6 +209,7 @@ const useHighlightBarAnimation = (props) => {
|
|
|
207
209
|
return;
|
|
208
210
|
const moreButtonRect = moreButton.getBoundingClientRect();
|
|
209
211
|
const containerRect = container.getBoundingClientRect();
|
|
212
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
|
|
210
213
|
setHighlightStyle({
|
|
211
214
|
left: moreButtonRect.left - containerRect.left,
|
|
212
215
|
width: moreButtonRect.width,
|
|
@@ -220,6 +223,7 @@ const useHighlightBarAnimation = (props) => {
|
|
|
220
223
|
const { offsetLeft, offsetWidth } = activeTabElement;
|
|
221
224
|
if (visibleTabs.includes(activeIndex)) {
|
|
222
225
|
activeTabElement.classList.add('active');
|
|
226
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
|
|
223
227
|
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
224
228
|
return;
|
|
225
229
|
}
|
|
@@ -297,8 +301,8 @@ exports.TabItem = styled_components_1.default.li.withConfig({
|
|
|
297
301
|
right: -4px;
|
|
298
302
|
bottom: -2px;
|
|
299
303
|
left: -4px;
|
|
300
|
-
border:
|
|
301
|
-
border-radius:
|
|
304
|
+
border: var(--border-width) var(--border-style) var(--button-border-color-focused);
|
|
305
|
+
border-radius: var(--border-radius-md);
|
|
302
306
|
pointer-events: none;
|
|
303
307
|
}
|
|
304
308
|
}
|
|
@@ -87,7 +87,9 @@ function isTabItemFragment(node) {
|
|
|
87
87
|
*/
|
|
88
88
|
function useValidateActiveTab(activeTab, setActiveTab, childrenArray, initialTab) {
|
|
89
89
|
(0, react_1.useEffect)(() => {
|
|
90
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
90
91
|
const availableLabels = childrenArray.map((child) => child.props.label);
|
|
92
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
91
93
|
if (activeTab && !availableLabels.includes(activeTab) && availableLabels.length > 0) {
|
|
92
94
|
setActiveTab(initialTab);
|
|
93
95
|
}
|
|
@@ -148,8 +150,8 @@ exports.TabContent = styled_components_1.default.div `
|
|
|
148
150
|
right: -4px;
|
|
149
151
|
bottom: -2px;
|
|
150
152
|
left: -4px;
|
|
151
|
-
border:
|
|
152
|
-
border-radius:
|
|
153
|
+
border: var(--border-width) var(--border-style) var(--button-border-color-focused);
|
|
154
|
+
border-radius: var(--border-radius-md);
|
|
153
155
|
pointer-events: none;
|
|
154
156
|
}
|
|
155
157
|
}
|
|
@@ -52,7 +52,7 @@ exports.markdownTabs = (0, styled_components_1.css) `
|
|
|
52
52
|
--md-tabs-small-tab-font-size: var(--font-size-base); // @presenter FontSize
|
|
53
53
|
--md-tabs-small-tab-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
54
54
|
--md-tabs-small-tab-line-height: var(--line-height-base); // @presenter LineHeight
|
|
55
|
-
--md-tabs-small-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
55
|
+
--md-tabs-small-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
56
56
|
|
|
57
57
|
--md-tabs-active-tab-text-color: var(--color-primary-text, var(--md-tabs-active-tab-text-color-legacy)); // @presenter Color
|
|
58
58
|
--md-tabs-active-tab-font-family: var(--md-tabs-tab-font-family); // @presenter FontFamily
|
|
@@ -65,14 +65,14 @@ exports.markdownTabs = (0, styled_components_1.css) `
|
|
|
65
65
|
--md-tabs-medium-active-tab-line-height: var(--md-tabs-medium-tab-line-height); // @presenter LineHeight
|
|
66
66
|
--md-tabs-medium-active-tab-padding: var(--md-tabs-medium-tab-padding); // @presenter Spacing
|
|
67
67
|
--md-tabs-medium-active-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
68
|
-
--md-tabs-medium-active-tab-border-radius:
|
|
68
|
+
--md-tabs-medium-active-tab-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
69
69
|
|
|
70
70
|
--md-tabs-small-active-tab-font-size: var(--md-tabs-small-tab-font-size); // @presenter FontSize
|
|
71
71
|
--md-tabs-small-active-tab-font-weight: var(--md-tabs-small-tab-font-weight); // @presenter FontWeight
|
|
72
72
|
--md-tabs-small-active-tab-line-height: var(--md-tabs-small-tab-line-height); // @presenter LineHeight
|
|
73
73
|
--md-tabs-small-active-tab-padding: var(--md-tabs-small-tab-padding); // @presenter Spacing
|
|
74
74
|
--md-tabs-small-active-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
75
|
-
--md-tabs-small-active-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
75
|
+
--md-tabs-small-active-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
76
76
|
|
|
77
77
|
--md-tabs-hover-tab-text-color: var(--md-tabs-tab-text-color); // @presenter Color
|
|
78
78
|
--md-tabs-hover-tab-font-family: var(--md-tabs-tab-font-family); // @presenter FontFamily
|
|
@@ -92,7 +92,7 @@ exports.markdownTabs = (0, styled_components_1.css) `
|
|
|
92
92
|
--md-tabs-small-hover-tab-line-height: var(--md-tabs-small-tab-line-height); // @presenter LineHeight
|
|
93
93
|
--md-tabs-small-hover-tab-padding: var(--md-tabs-small-tab-padding); // @presenter Spacing
|
|
94
94
|
--md-tabs-small-hover-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
95
|
-
--md-tabs-small-hover-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
95
|
+
--md-tabs-small-hover-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
96
96
|
|
|
97
97
|
--md-tabs-tab-text-disabled-color: var(--text-color-disabled); // @presenter Color
|
|
98
98
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from '../../markdoc/components/Accordion/Accordion';
|
|
2
|
+
export * from '../../markdoc/components/Accordion/AccordionGroup';
|
|
1
3
|
export * from '../../markdoc/components/Admonition/Admonition';
|
|
2
4
|
export * from '../../markdoc/components/InlineSvg/InlineSvg';
|
|
3
5
|
export * from '../../markdoc/components/MarkdocExample/MarkdocExample';
|
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("../../markdoc/components/Accordion/Accordion"), exports);
|
|
18
|
+
__exportStar(require("../../markdoc/components/Accordion/AccordionGroup"), exports);
|
|
17
19
|
__exportStar(require("../../markdoc/components/Admonition/Admonition"), exports);
|
|
18
20
|
__exportStar(require("../../markdoc/components/InlineSvg/InlineSvg"), exports);
|
|
19
21
|
__exportStar(require("../../markdoc/components/MarkdocExample/MarkdocExample"), exports);
|
package/lib/markdoc/default.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from '../markdoc/attributes/img-srcset';
|
|
|
5
5
|
export * from '../markdoc/attributes/relative-path';
|
|
6
6
|
export * from '../markdoc/attributes/svg-content';
|
|
7
7
|
export * as components from '../markdoc/components/default';
|
|
8
|
+
import { accordion } from '../markdoc/tags/accordion';
|
|
9
|
+
import { accordionGroup } from '../markdoc/tags/accordion-group';
|
|
8
10
|
import { admonition } from '../markdoc/tags/admonition';
|
|
9
11
|
import { html } from '../markdoc/tags/html';
|
|
10
12
|
import { markdocExample } from '../markdoc/tags/markdoc-example';
|
|
@@ -29,6 +31,8 @@ import { connectMcp } from '../markdoc/tags/connect-mcp';
|
|
|
29
31
|
import { loginButton } from '../markdoc/tags/login-button';
|
|
30
32
|
import { diagram } from '../markdoc/tags/diagram';
|
|
31
33
|
export declare const tags: {
|
|
34
|
+
[accordion.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
35
|
+
[accordionGroup.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
32
36
|
[admonition.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
33
37
|
[debug.tagName]: import("./tags/types").MarkdocTagSchema;
|
|
34
38
|
[html.tagName]: import("./tags/types").MarkdocTagSchema;
|
package/lib/markdoc/default.js
CHANGED
|
@@ -47,6 +47,8 @@ __exportStar(require("../markdoc/attributes/svg-content"), exports);
|
|
|
47
47
|
/* Components */
|
|
48
48
|
exports.components = __importStar(require("../markdoc/components/default"));
|
|
49
49
|
/* Tags */
|
|
50
|
+
const accordion_1 = require("../markdoc/tags/accordion");
|
|
51
|
+
const accordion_group_1 = require("../markdoc/tags/accordion-group");
|
|
50
52
|
const admonition_1 = require("../markdoc/tags/admonition");
|
|
51
53
|
const html_1 = require("../markdoc/tags/html");
|
|
52
54
|
const markdoc_example_1 = require("../markdoc/tags/markdoc-example");
|
|
@@ -71,6 +73,8 @@ const connect_mcp_1 = require("../markdoc/tags/connect-mcp");
|
|
|
71
73
|
const login_button_1 = require("../markdoc/tags/login-button");
|
|
72
74
|
const diagram_1 = require("../markdoc/tags/diagram");
|
|
73
75
|
exports.tags = {
|
|
76
|
+
[accordion_1.accordion.tagName]: accordion_1.accordion.schema,
|
|
77
|
+
[accordion_group_1.accordionGroup.tagName]: accordion_group_1.accordionGroup.schema,
|
|
74
78
|
[admonition_1.admonition.tagName]: admonition_1.admonition.schema,
|
|
75
79
|
[debug_1.debug.tagName]: debug_1.debug.schema,
|
|
76
80
|
[html_1.html.tagName]: html_1.html.schema,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accordionGroup = void 0;
|
|
4
|
+
exports.accordionGroup = {
|
|
5
|
+
schema: {
|
|
6
|
+
render: 'AccordionGroup',
|
|
7
|
+
},
|
|
8
|
+
tagName: 'accordion-group',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=accordion-group.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accordion = void 0;
|
|
4
|
+
exports.accordion = {
|
|
5
|
+
schema: {
|
|
6
|
+
render: 'Accordion',
|
|
7
|
+
attributes: {
|
|
8
|
+
title: { type: String, required: true },
|
|
9
|
+
expanded: { type: Boolean, default: false },
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
tagName: 'accordion',
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=accordion.js.map
|
package/lib/markdoc/tags/card.js
CHANGED
|
@@ -52,7 +52,21 @@ exports.card = {
|
|
|
52
52
|
type: String,
|
|
53
53
|
matches: ['filled', 'ghost'],
|
|
54
54
|
},
|
|
55
|
+
iconColor: { type: String },
|
|
55
56
|
to: { type: String, resolver: 'link' },
|
|
57
|
+
linkIcon: {
|
|
58
|
+
type: String,
|
|
59
|
+
matches: ['arrow', 'chevron'],
|
|
60
|
+
},
|
|
61
|
+
cta: { type: String },
|
|
62
|
+
badge: { type: String },
|
|
63
|
+
badgeColor: { type: String },
|
|
64
|
+
badgeIcon: { type: String, resolver: 'relativeOrCdnIcon' },
|
|
65
|
+
badgeIconRawContent: {
|
|
66
|
+
// internal use only
|
|
67
|
+
type: String,
|
|
68
|
+
render: true,
|
|
69
|
+
},
|
|
56
70
|
},
|
|
57
71
|
},
|
|
58
72
|
tagName: 'card',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.connectMcp = void 0;
|
|
4
|
+
const constants_1 = require("../../core/constants");
|
|
4
5
|
exports.connectMcp = {
|
|
5
6
|
schema: {
|
|
6
7
|
render: 'ConnectMCP',
|
|
@@ -17,7 +18,7 @@ exports.connectMcp = {
|
|
|
17
18
|
},
|
|
18
19
|
options: {
|
|
19
20
|
type: Array,
|
|
20
|
-
default:
|
|
21
|
+
default: constants_1.DEFAULT_MCP_OPTIONS,
|
|
21
22
|
},
|
|
22
23
|
},
|
|
23
24
|
selfClosing: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.69.0-next.
|
|
3
|
+
"version": "0.69.0-next.10",
|
|
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.3",
|
|
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.
|
|
57
|
-
"@vitest/ui": "4.1.
|
|
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.
|
|
69
|
+
"vitest": "4.1.11",
|
|
69
70
|
"vitest-when": "0.6.2",
|
|
70
|
-
"webpack": "5.105.2"
|
|
71
|
-
"@redocly/realm-asyncapi-sdk": "0.14.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": "
|
|
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.
|
|
87
|
+
"openapi-sampler": "^1.7.5",
|
|
87
88
|
"react-calendar": "5.1.0",
|
|
88
|
-
"react-date-picker": "11.0.0"
|
|
89
|
-
|
|
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, {
|
|
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' | '
|
|
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
|
-
|
|
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-
|
|
17
|
-
--admonition-
|
|
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-
|
|
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
|
|
93
|
+
* @tokens Admonition type idea
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
|
-
--admonition-
|
|
97
|
-
--admonition-
|
|
98
|
-
--admonition-
|
|
99
|
-
--admonition-
|
|
100
|
-
--admonition-
|
|
101
|
-
--admonition-
|
|
102
|
-
--admonition-
|
|
103
|
-
--admonition-
|
|
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({
|
|
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
|
`;
|
|
@@ -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 {
|
|
5
|
+
import type { ButtonGroupSize, ButtonGroupVariant } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
type ButtonGroupProps = {
|
|
7
|
+
export type ButtonGroupProps = {
|
|
10
8
|
variant?: ButtonGroupVariant;
|
|
11
|
-
size?:
|
|
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:
|
|
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
|
`;
|