@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.
- 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 +161 -0
- 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/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/AccordionGroupContext.d.ts +1 -0
- package/lib/core/contexts/AccordionGroupContext.js +6 -0
- package/lib/core/contexts/PageActionsContext.d.ts +5 -0
- package/lib/core/contexts/PageActionsContext.js +10 -0
- package/lib/core/contexts/index.d.ts +2 -0
- package/lib/core/contexts/index.js +2 -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 +2 -0
- package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
- package/lib/core/hooks/use-active-heading.js +63 -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 +23 -15
- 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/hooks/use-tabs.js +4 -2
- package/lib/core/hooks/use-telemetry-fallback.d.ts +2 -0
- package/lib/core/hooks/use-telemetry-fallback.js +2 -0
- package/lib/core/styles/global.js +16 -11
- 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.js +6 -6
- package/lib/markdoc/components/Accordion/AccordionGroup.d.ts +2 -1
- package/lib/markdoc/components/Accordion/AccordionGroup.js +39 -3
- 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/tags/accordion-group.js +3 -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 +285 -0
- 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/mcp.ts +14 -0
- package/src/core/constants/search.ts +2 -2
- package/src/core/contexts/AccordionGroupContext.tsx +3 -0
- package/src/core/contexts/PageActionsContext.tsx +7 -0
- package/src/core/contexts/index.ts +2 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +2 -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 +2 -0
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +83 -15
- package/src/core/hooks/use-active-section-id.ts +3 -1
- package/src/core/hooks/use-connect-mcp-button.ts +31 -17
- 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/hooks/use-tabs.ts +4 -2
- package/src/core/hooks/use-telemetry-fallback.ts +2 -0
- package/src/core/openapi/index.ts +1 -1
- package/src/core/styles/global.ts +17 -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 +8 -2
- package/src/markdoc/components/Accordion/AccordionGroup.tsx +9 -2
- 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/tags/accordion-group.ts +3 -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
|
@@ -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?:
|
|
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
|
|
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<{
|
|
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 */
|
|
@@ -21,24 +21,38 @@ export const cards = css`
|
|
|
21
21
|
--card-border-radius: var(--border-radius-xl);
|
|
22
22
|
--card-border-style: solid;
|
|
23
23
|
--card-link-cursor: pointer;
|
|
24
|
-
--card-link-icon-width:
|
|
25
|
-
--card-link-icon-height:
|
|
24
|
+
--card-link-icon-width: 14px;
|
|
25
|
+
--card-link-icon-height: 14px;
|
|
26
26
|
--card-border-width: 1px;
|
|
27
|
-
--card-image-border-radius: var(--border-radius-
|
|
27
|
+
--card-image-border-radius: var(--border-radius-xl);
|
|
28
28
|
--card-image-aspect-ratio: 16 / 9;
|
|
29
|
-
--card-icon-border-radius: var(--border-radius-
|
|
29
|
+
--card-icon-border-radius: var(--border-radius-lg);
|
|
30
30
|
--card-icon-border: var(--card-border-width) var(--border-style) var(--card-icon-border-color);
|
|
31
31
|
--card-icon-padding: var(--spacing-sm);
|
|
32
32
|
--card-icon-size: 24px;
|
|
33
33
|
--card-icon-height: var(--card-icon-size);
|
|
34
34
|
--card-icon-width: var(--card-icon-size);
|
|
35
35
|
--card-icon-gap: var(--spacing-base);
|
|
36
|
-
--card-title-margin: 0;
|
|
36
|
+
--card-title-margin: 0 var(--spacing-xs) 0 0;
|
|
37
37
|
--card-title-font-weight: var(--font-weight-semibold);
|
|
38
|
+
--card-title-row-gap: var(--spacing-xxs);
|
|
38
39
|
--card-content-gap: 4px;
|
|
39
40
|
--card-padding: 16px 20px;
|
|
40
41
|
--card-body-font-size: var(--font-size-base);
|
|
41
42
|
--card-body-line-height: var(--line-height-base);
|
|
43
|
+
--card-cta-margin-top: var(--spacing-base);
|
|
44
|
+
--card-cta-gap: var(--spacing-xxs);
|
|
45
|
+
--card-cta-font-size: var(--font-size-base);
|
|
46
|
+
--card-cta-font-weight: var(--font-weight-regular);
|
|
47
|
+
--card-cta-text-color: var(--text-color-secondary);
|
|
48
|
+
--card-cta-icon-width: 14px;
|
|
49
|
+
--card-cta-icon-height: 14px;
|
|
50
|
+
--card-badge-margin: 0 var(--spacing-xxs) 0 0 ;
|
|
51
|
+
--card-badge-padding: 0 var(--spacing-xxs);
|
|
52
|
+
--card-badge-border-radius: var(--badge-border-radius);
|
|
53
|
+
--card-badge-font-size: var(--font-size-sm);
|
|
54
|
+
--card-badge-font-weight: var(--font-weight-regular);
|
|
55
|
+
--card-badge-line-height: var(--line-height-sm);
|
|
42
56
|
|
|
43
57
|
/**
|
|
44
58
|
* @tokens Card variants
|
|
@@ -74,7 +88,7 @@ export const cards = css`
|
|
|
74
88
|
--card-bg-color: transparent;
|
|
75
89
|
--card-bg-color-hover: var(--layer-color);
|
|
76
90
|
--card-border-width: 0;
|
|
77
|
-
--card-border-radius: var(--border-radius-
|
|
91
|
+
--card-border-radius: var(--border-radius-xl);
|
|
78
92
|
--card-padding: var(--spacing-xs) 0;
|
|
79
93
|
--card-icon-border-color-hover: var(--card-icon-border-color);
|
|
80
94
|
--card-icon-bg-color-hover: var(--card-icon-bg-color);
|
|
@@ -82,5 +96,65 @@ export const cards = css`
|
|
|
82
96
|
--card-hover-transition: initial;
|
|
83
97
|
}
|
|
84
98
|
|
|
99
|
+
/**
|
|
100
|
+
* @tokens Card icon colors
|
|
101
|
+
*/
|
|
102
|
+
.card-icon-color-red {
|
|
103
|
+
--card-icon-color: var(--color-red-7);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.card-icon-color-green {
|
|
107
|
+
--card-icon-color: var(--color-green-8);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.card-icon-color-blue {
|
|
111
|
+
--card-icon-color: var(--color-blue-7);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.card-icon-color-grey {
|
|
115
|
+
--card-icon-color: var(--text-color-secondary);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.card-icon-color-turquoise {
|
|
119
|
+
--card-icon-color: var(--color-turquoise-8);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.card-icon-color-magenta {
|
|
123
|
+
--card-icon-color: var(--color-magenta-7);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.card-icon-color-purple {
|
|
127
|
+
--card-icon-color: var(--color-purple-7);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.card-icon-color-carrot {
|
|
131
|
+
--card-icon-color: var(--color-carrot-8);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.card-icon-color-raspberry {
|
|
135
|
+
--card-icon-color: var(--color-raspberry-7);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.card-icon-color-orange {
|
|
139
|
+
--card-icon-color: var(--color-orange-7);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.card-icon-color-grass {
|
|
143
|
+
--card-icon-color: var(--color-grass-8);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.card-icon-color-persian-green {
|
|
147
|
+
--card-icon-color: var(--color-persian-green-8);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.card-icon-color-sky {
|
|
151
|
+
--card-icon-color: var(--color-sky-8);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.card-icon-color-blueberry {
|
|
155
|
+
--card-icon-color: var(--color-blueberry-7);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// @tokens End
|
|
85
159
|
`;
|
|
86
|
-
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
160
|
+
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
@@ -63,6 +63,7 @@ const CodePanelWrapper = styled.div`
|
|
|
63
63
|
background-color: var(--code-panel-bg-color);
|
|
64
64
|
border: 1px solid var(--code-panel-border-color);
|
|
65
65
|
border-radius: var(--code-panel-border-radius);
|
|
66
|
+
overflow: clip;
|
|
66
67
|
--code-block-max-height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
|
|
67
68
|
height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
|
|
68
69
|
position: sticky;
|
|
@@ -153,7 +153,7 @@ const StepContent = styled.div.withConfig({
|
|
|
153
153
|
margin: var(--spacing-xs) 0px var(--spacing-xs) calc(var(--spacing-unit) * 3.5);
|
|
154
154
|
padding: var(--spacing-md) var(--spacing-lg);
|
|
155
155
|
background: ${({ isActive }) => (isActive ? 'var(--layer-color)' : 'none')};
|
|
156
|
-
border-radius: var(--border-radius);
|
|
156
|
+
border-radius: var(--code-step-border-radius);
|
|
157
157
|
|
|
158
158
|
&:hover {
|
|
159
159
|
background-color: ${({ isActive }) =>
|
|
@@ -7,10 +7,11 @@ export const codeWalkthrough = css`
|
|
|
7
7
|
--code-step-bg-active: var(--layer-color);
|
|
8
8
|
--code-step-bg-hover: var(--color-hover-base);
|
|
9
9
|
--code-step-bg-active-hover: var(--layer-color-hover);
|
|
10
|
+
--code-step-border-radius: var(--border-radius-lg);
|
|
10
11
|
|
|
11
12
|
--code-panel-bg-color: var(--layer-color);
|
|
12
13
|
--code-panel-line-numbering-color: var(--text-color-disabled);
|
|
13
14
|
--code-panel-header-height: var(--spacing-lg);
|
|
14
15
|
--code-panel-border-color: var(--border-color-secondary);
|
|
15
|
-
--code-panel-border-radius: var(--border-radius);
|
|
16
|
+
--code-panel-border-radius: var(--border-radius-xl);
|
|
16
17
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createElement, isValidElement } from 'react';
|
|
1
|
+
import React, { createElement, isValidElement, useContext } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { useLocation } from 'react-router';
|
|
4
4
|
|
|
@@ -9,6 +9,7 @@ import { concatClassNames } from '@redocly/theme/core/utils';
|
|
|
9
9
|
import { LinkIcon } from '@redocly/theme/icons/LinkIcon/LinkIcon';
|
|
10
10
|
import { PageActions } from '@redocly/theme/components/PageActions/PageActions';
|
|
11
11
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
12
|
+
import { PageActionsContext } from '@redocly/theme/core/contexts';
|
|
12
13
|
import {
|
|
13
14
|
ANCHOR_CLASS,
|
|
14
15
|
HEADING_ANCHOR_CLASS,
|
|
@@ -65,8 +66,10 @@ export function Heading({
|
|
|
65
66
|
const { usePageProps } = useThemeHooks();
|
|
66
67
|
const pageProps = usePageProps();
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
// The page-type fallback is only for backward compatibility; templates set the scope.
|
|
70
|
+
const withPageActions =
|
|
71
|
+
useContext(PageActionsContext) ??
|
|
72
|
+
(pageProps?.metadata?.type === 'markdown' || pageProps?.metadata?.type === 'asciidoc');
|
|
70
73
|
const headingTextId = `${id}-heading-text`;
|
|
71
74
|
|
|
72
75
|
const linkEl = (
|
|
@@ -101,7 +104,7 @@ export function Heading({
|
|
|
101
104
|
<HeadingContentWrapper>
|
|
102
105
|
{linkEl}
|
|
103
106
|
{headingText}
|
|
104
|
-
{
|
|
107
|
+
{withPageActions && __idx === 0 ? <PageActions pageSlug={pathname} /> : null}
|
|
105
108
|
</HeadingContentWrapper>
|
|
106
109
|
</div>
|
|
107
110
|
);
|
|
@@ -173,6 +173,7 @@ export function TabList({
|
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
useEffect(() => {
|
|
176
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
176
177
|
onReadyChange?.(isReady);
|
|
177
178
|
}, [isReady, onReadyChange]);
|
|
178
179
|
|
|
@@ -281,6 +282,7 @@ const useHighlightBarAnimation = (props: UseHighlightBarAnimationProps) => {
|
|
|
281
282
|
});
|
|
282
283
|
|
|
283
284
|
useEffect(() => {
|
|
285
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
284
286
|
const activeIndex = childrenArray.findIndex((child) => child.props.label === activeTab);
|
|
285
287
|
const container = tabsContainerRef.current;
|
|
286
288
|
|
|
@@ -302,6 +304,7 @@ const useHighlightBarAnimation = (props: UseHighlightBarAnimationProps) => {
|
|
|
302
304
|
const moreButtonRect = moreButton.getBoundingClientRect();
|
|
303
305
|
const containerRect = container.getBoundingClientRect();
|
|
304
306
|
|
|
307
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
|
|
305
308
|
setHighlightStyle({
|
|
306
309
|
left: moreButtonRect.left - containerRect.left,
|
|
307
310
|
width: moreButtonRect.width,
|
|
@@ -319,6 +322,7 @@ const useHighlightBarAnimation = (props: UseHighlightBarAnimationProps) => {
|
|
|
319
322
|
|
|
320
323
|
if (visibleTabs.includes(activeIndex)) {
|
|
321
324
|
activeTabElement.classList.add('active');
|
|
325
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
|
|
322
326
|
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
323
327
|
return;
|
|
324
328
|
}
|
|
@@ -400,8 +404,8 @@ export const TabItem = styled.li.withConfig({
|
|
|
400
404
|
right: -4px;
|
|
401
405
|
bottom: -2px;
|
|
402
406
|
left: -4px;
|
|
403
|
-
border:
|
|
404
|
-
border-radius:
|
|
407
|
+
border: var(--border-width) var(--border-style) var(--button-border-color-focused);
|
|
408
|
+
border-radius: var(--border-radius-md);
|
|
405
409
|
pointer-events: none;
|
|
406
410
|
}
|
|
407
411
|
}
|
|
@@ -144,7 +144,9 @@ function useValidateActiveTab(
|
|
|
144
144
|
initialTab: string,
|
|
145
145
|
) {
|
|
146
146
|
useEffect(() => {
|
|
147
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
147
148
|
const availableLabels = childrenArray.map((child) => child.props.label);
|
|
149
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent
|
|
148
150
|
if (activeTab && !availableLabels.includes(activeTab) && availableLabels.length > 0) {
|
|
149
151
|
setActiveTab(initialTab);
|
|
150
152
|
}
|
|
@@ -221,8 +223,8 @@ export const TabContent = styled.div`
|
|
|
221
223
|
right: -4px;
|
|
222
224
|
bottom: -2px;
|
|
223
225
|
left: -4px;
|
|
224
|
-
border:
|
|
225
|
-
border-radius:
|
|
226
|
+
border: var(--border-width) var(--border-style) var(--button-border-color-focused);
|
|
227
|
+
border-radius: var(--border-radius-md);
|
|
226
228
|
pointer-events: none;
|
|
227
229
|
}
|
|
228
230
|
}
|
|
@@ -50,7 +50,7 @@ export const markdownTabs = css`
|
|
|
50
50
|
--md-tabs-small-tab-font-size: var(--font-size-base); // @presenter FontSize
|
|
51
51
|
--md-tabs-small-tab-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
52
52
|
--md-tabs-small-tab-line-height: var(--line-height-base); // @presenter LineHeight
|
|
53
|
-
--md-tabs-small-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
53
|
+
--md-tabs-small-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
54
54
|
|
|
55
55
|
--md-tabs-active-tab-text-color: var(--color-primary-text, var(--md-tabs-active-tab-text-color-legacy)); // @presenter Color
|
|
56
56
|
--md-tabs-active-tab-font-family: var(--md-tabs-tab-font-family); // @presenter FontFamily
|
|
@@ -63,14 +63,14 @@ export const markdownTabs = css`
|
|
|
63
63
|
--md-tabs-medium-active-tab-line-height: var(--md-tabs-medium-tab-line-height); // @presenter LineHeight
|
|
64
64
|
--md-tabs-medium-active-tab-padding: var(--md-tabs-medium-tab-padding); // @presenter Spacing
|
|
65
65
|
--md-tabs-medium-active-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
66
|
-
--md-tabs-medium-active-tab-border-radius:
|
|
66
|
+
--md-tabs-medium-active-tab-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
67
67
|
|
|
68
68
|
--md-tabs-small-active-tab-font-size: var(--md-tabs-small-tab-font-size); // @presenter FontSize
|
|
69
69
|
--md-tabs-small-active-tab-font-weight: var(--md-tabs-small-tab-font-weight); // @presenter FontWeight
|
|
70
70
|
--md-tabs-small-active-tab-line-height: var(--md-tabs-small-tab-line-height); // @presenter LineHeight
|
|
71
71
|
--md-tabs-small-active-tab-padding: var(--md-tabs-small-tab-padding); // @presenter Spacing
|
|
72
72
|
--md-tabs-small-active-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
73
|
-
--md-tabs-small-active-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
73
|
+
--md-tabs-small-active-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
74
74
|
|
|
75
75
|
--md-tabs-hover-tab-text-color: var(--md-tabs-tab-text-color); // @presenter Color
|
|
76
76
|
--md-tabs-hover-tab-font-family: var(--md-tabs-tab-font-family); // @presenter FontFamily
|
|
@@ -90,7 +90,7 @@ export const markdownTabs = css`
|
|
|
90
90
|
--md-tabs-small-hover-tab-line-height: var(--md-tabs-small-tab-line-height); // @presenter LineHeight
|
|
91
91
|
--md-tabs-small-hover-tab-padding: var(--md-tabs-small-tab-padding); // @presenter Spacing
|
|
92
92
|
--md-tabs-small-hover-tab-border-width: var(--md-tabs-medium-tab-border-width); // @presenter Spacing
|
|
93
|
-
--md-tabs-small-hover-tab-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
93
|
+
--md-tabs-small-hover-tab-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
94
94
|
|
|
95
95
|
--md-tabs-tab-text-disabled-color: var(--text-color-disabled); // @presenter Color
|
|
96
96
|
|
|
@@ -3,6 +3,9 @@ import type { MarkdocSchemaWrapper } from '@redocly/theme/markdoc/tags/types';
|
|
|
3
3
|
export const accordionGroup: MarkdocSchemaWrapper = {
|
|
4
4
|
schema: {
|
|
5
5
|
render: 'AccordionGroup',
|
|
6
|
+
attributes: {
|
|
7
|
+
singleExpanded: { type: Boolean, default: false },
|
|
8
|
+
},
|
|
6
9
|
},
|
|
7
10
|
tagName: 'accordion-group',
|
|
8
11
|
};
|
|
@@ -7,7 +7,7 @@ export const admonition: MarkdocSchemaWrapper = {
|
|
|
7
7
|
type: String,
|
|
8
8
|
required: true,
|
|
9
9
|
default: 'info',
|
|
10
|
-
matches: ['warning', 'info', 'danger', 'success', '
|
|
10
|
+
matches: ['warning', 'info', 'danger', 'success', 'idea'],
|
|
11
11
|
},
|
|
12
12
|
name: { type: String },
|
|
13
13
|
},
|
package/src/markdoc/tags/card.ts
CHANGED
|
@@ -52,7 +52,21 @@ export const card: MarkdocSchemaWrapper = {
|
|
|
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,5 +1,7 @@
|
|
|
1
1
|
import type { MarkdocSchemaWrapper } from '@redocly/theme/markdoc/tags/types';
|
|
2
2
|
|
|
3
|
+
import { DEFAULT_MCP_OPTIONS } from '@redocly/theme/core/constants';
|
|
4
|
+
|
|
3
5
|
export const connectMcp: MarkdocSchemaWrapper = {
|
|
4
6
|
schema: {
|
|
5
7
|
render: 'ConnectMCP',
|
|
@@ -16,7 +18,7 @@ export const connectMcp: MarkdocSchemaWrapper = {
|
|
|
16
18
|
},
|
|
17
19
|
options: {
|
|
18
20
|
type: Array,
|
|
19
|
-
default:
|
|
21
|
+
default: DEFAULT_MCP_OPTIONS,
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
selfClosing: true,
|