@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
|
@@ -7,10 +7,12 @@ exports.Card = Card;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const ChevronRightIcon_1 = require("../../../icons/ChevronRightIcon/ChevronRightIcon");
|
|
10
|
+
const ArrowUpRightIcon_1 = require("../../../icons/ArrowUpRightIcon/ArrowUpRightIcon");
|
|
10
11
|
const CardImage_1 = require("../../../markdoc/components/Cards/CardImage");
|
|
11
12
|
const CardIcon_1 = require("../../../markdoc/components/Cards/CardIcon");
|
|
13
|
+
const CardBadge_1 = require("../../../markdoc/components/Cards/CardBadge");
|
|
12
14
|
const Link_1 = require("../../../components/Link/Link");
|
|
13
|
-
function Card({ title = '', image, icon, iconRawContent, imagePosition = 'start', iconPosition = 'auto', layout = 'vertical', variant = 'filled', lineClamp, iconVariant = 'filled', align = 'start', to, children, }) {
|
|
15
|
+
function Card({ title = '', image, icon, iconRawContent, imagePosition = 'start', iconPosition = 'auto', layout = 'vertical', variant = 'filled', lineClamp, iconVariant = 'filled', iconColor, align = 'start', to, cta, linkIcon, badge, badgeColor, badgeIcon, badgeIconRawContent, children, }) {
|
|
14
16
|
const titleNoSpaces = title === null || title === void 0 ? void 0 : title.replace(/\s+/g, '-').toLowerCase();
|
|
15
17
|
const cardTitleId = `card-title-${titleNoSpaces}`;
|
|
16
18
|
const justifyContent = align === 'center' ? 'center' : align === 'end' ? 'flex-end' : 'flex-start';
|
|
@@ -20,12 +22,20 @@ function Card({ title = '', image, icon, iconRawContent, imagePosition = 'start'
|
|
|
20
22
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
21
23
|
image ? react_1.default.createElement(CardImage_1.CardImage, { src: image, alt: title, position: imagePosition }) : null,
|
|
22
24
|
react_1.default.createElement(CardContentWrapper, { $layout: layout, $alignItems: alignItems, $textAlign: textAlign, $hasImage: image !== undefined },
|
|
23
|
-
icon && (react_1.default.createElement(CardIcon_1.CardIcon, { variant: iconVariant, src: icon, rawContent: iconRawContent, position: iconPosition })),
|
|
25
|
+
icon && (react_1.default.createElement(CardIcon_1.CardIcon, { variant: iconVariant, src: icon, rawContent: iconRawContent, position: iconPosition, color: iconColor })),
|
|
24
26
|
react_1.default.createElement(ContentWrapper, null,
|
|
25
|
-
react_1.default.createElement(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
react_1.default.createElement(TitleWrapper, { id: cardTitleId, $isCardLink: !!to, $justifyContent: justifyContent },
|
|
28
|
+
react_1.default.createElement(Title, null,
|
|
29
|
+
title,
|
|
30
|
+
!!to && !!linkIcon && (react_1.default.createElement(CardLinkIcon, { as: linkIcon === 'arrow' ? ArrowUpRightIcon_1.ArrowUpRightIcon : undefined }))),
|
|
31
|
+
!!badge && (react_1.default.createElement(CardBadge_1.CardBadge, { color: badgeColor, icon: badgeIcon, iconRawContent: badgeIconRawContent }, badge))),
|
|
32
|
+
react_1.default.createElement(Body, { $lineClamp: lineClamp }, children),
|
|
33
|
+
!!to && !!cta && (react_1.default.createElement(Cta, { $justifyContent: justifyContent },
|
|
34
|
+
react_1.default.createElement(CtaText, null,
|
|
35
|
+
" ",
|
|
36
|
+
cta,
|
|
37
|
+
" "),
|
|
38
|
+
react_1.default.createElement(CtaIcon, null))))))));
|
|
29
39
|
}
|
|
30
40
|
const CardContentWrapper = styled_components_1.default.div `
|
|
31
41
|
display: flex;
|
|
@@ -44,24 +54,26 @@ const ContentWrapper = styled_components_1.default.div `
|
|
|
44
54
|
gap: var(--card-content-gap);
|
|
45
55
|
width: 100%;
|
|
46
56
|
`;
|
|
47
|
-
const
|
|
48
|
-
margin: var(--card-title-margin);
|
|
49
|
-
font-weight: var(--card-title-font-weight);
|
|
57
|
+
const TitleWrapper = styled_components_1.default.div `
|
|
50
58
|
color: var(--card-title-text-color);
|
|
51
59
|
display: flex;
|
|
52
60
|
align-items: center;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
row-gap: var(--card-title-row-gap);
|
|
53
63
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
54
64
|
width: 100%;
|
|
55
65
|
`;
|
|
66
|
+
const Title = styled_components_1.default.h3 `
|
|
67
|
+
margin: var(--card-title-margin);
|
|
68
|
+
font-weight: var(--card-title-font-weight);
|
|
69
|
+
`;
|
|
70
|
+
// The `as` prop selects the icon; the chevron is the default target.
|
|
56
71
|
const CardLinkIcon = (0, styled_components_1.default)(ChevronRightIcon_1.ChevronRightIcon) `
|
|
57
72
|
width: var(--card-link-icon-width);
|
|
58
73
|
height: var(--card-link-icon-height);
|
|
59
|
-
color: var(--
|
|
74
|
+
color: var(--icon-color-secondary);
|
|
60
75
|
margin-left: var(--spacing-xxs);
|
|
61
|
-
|
|
62
|
-
transition:
|
|
63
|
-
opacity 0.3s,
|
|
64
|
-
transform 0.3s;
|
|
76
|
+
margin-top: calc(var(--spacing-xxs) / 2);
|
|
65
77
|
`;
|
|
66
78
|
const Body = styled_components_1.default.div `
|
|
67
79
|
color: var(--card-text-color);
|
|
@@ -84,6 +96,26 @@ const Body = styled_components_1.default.div `
|
|
|
84
96
|
margin-bottom: 0;
|
|
85
97
|
}
|
|
86
98
|
`;
|
|
99
|
+
const Cta = styled_components_1.default.div `
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: var(--card-cta-gap);
|
|
102
|
+
align-items: center;
|
|
103
|
+
margin-top: var(--card-cta-margin-top);
|
|
104
|
+
color: var(--card-cta-text-color);
|
|
105
|
+
font-size: var(--card-cta-font-size);
|
|
106
|
+
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
107
|
+
|
|
108
|
+
&& > * {
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
const CtaText = styled_components_1.default.span `
|
|
113
|
+
font-weight: var(--card-cta-font-weight);
|
|
114
|
+
`;
|
|
115
|
+
const CtaIcon = (0, styled_components_1.default)(ChevronRightIcon_1.ChevronRightIcon) `
|
|
116
|
+
width: var(--card-cta-icon-width);
|
|
117
|
+
height: var(--card-cta-icon-height);
|
|
118
|
+
`;
|
|
87
119
|
const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $variant }) => ({
|
|
88
120
|
className: getCardWrapperClass($isCardLink, $variant),
|
|
89
121
|
})) `
|
|
@@ -112,6 +144,13 @@ const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $varia
|
|
|
112
144
|
height: 100%;
|
|
113
145
|
object-fit: cover;
|
|
114
146
|
`}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&:hover,
|
|
150
|
+
&:focus-within {
|
|
151
|
+
${Cta} {
|
|
152
|
+
color: var(--card-link-icon-color);
|
|
153
|
+
}
|
|
115
154
|
}
|
|
116
155
|
|
|
117
156
|
&.card-link {
|
|
@@ -130,8 +169,8 @@ const CardWrapper = styled_components_1.default.div.attrs(({ $isCardLink, $varia
|
|
|
130
169
|
background-color: var(--card-icon-bg-color-hover);
|
|
131
170
|
}
|
|
132
171
|
|
|
133
|
-
|
|
134
|
-
|
|
172
|
+
${CardLinkIcon} {
|
|
173
|
+
color: var(--card-link-icon-color);
|
|
135
174
|
}
|
|
136
175
|
}
|
|
137
176
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type CardBadgeProps = React.PropsWithChildren<{
|
|
3
|
+
color?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
/** Inline SVG content for the icon */
|
|
6
|
+
iconRawContent?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function CardBadge({ color, icon, iconRawContent, className, children }: CardBadgeProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CardBadge = CardBadge;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Badge_1 = require("../../../components/Badge/Badge");
|
|
10
|
+
function CardBadge({ color, icon, iconRawContent, className, children }) {
|
|
11
|
+
// `tag-default` keeps a badge grey when the name is absent or unknown.
|
|
12
|
+
const classNames = ['tag-default', color && `tag-${color}`, className].filter(Boolean).join(' ');
|
|
13
|
+
return (react_1.default.createElement(CardBadgeWrapper, { className: classNames, icon: icon, iconRawContent: iconRawContent }, children));
|
|
14
|
+
}
|
|
15
|
+
const CardBadgeWrapper = (0, styled_components_1.default)(Badge_1.Badge) `
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
margin: var(--card-badge-margin);
|
|
19
|
+
padding: var(--card-badge-padding);
|
|
20
|
+
border-radius: var(--card-badge-border-radius);
|
|
21
|
+
font-size: var(--card-badge-font-size);
|
|
22
|
+
font-weight: var(--card-badge-font-weight);
|
|
23
|
+
line-height: var(--card-badge-line-height);
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
|
|
27
|
+
--badge-text-color: var(--tag-color);
|
|
28
|
+
--badge-bg-color: var(--tag-bg-color);
|
|
29
|
+
`;
|
|
30
|
+
//# sourceMappingURL=CardBadge.js.map
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type CardIconProps = {
|
|
3
|
-
variant?:
|
|
3
|
+
variant?: 'filled' | 'ghost';
|
|
4
4
|
src: string;
|
|
5
5
|
rawContent?: string;
|
|
6
6
|
position?: 'auto' | 'start' | 'center' | 'end';
|
|
7
|
+
color?: string;
|
|
7
8
|
};
|
|
8
|
-
export declare function CardIcon({ variant, src, rawContent, position }: CardIconProps): React.JSX.Element;
|
|
9
|
+
export declare function CardIcon({ variant, src, rawContent, position, color }: CardIconProps): React.JSX.Element;
|
|
9
10
|
export declare const CardIconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$position" | "$variant"> & {
|
|
10
|
-
$variant?:
|
|
11
|
+
$variant?: 'filled' | 'ghost';
|
|
11
12
|
$position?: string;
|
|
12
13
|
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$position" | "$variant"> & {
|
|
13
|
-
$variant?:
|
|
14
|
+
$variant?: 'filled' | 'ghost';
|
|
14
15
|
$position?: string;
|
|
15
16
|
}, never>>> & string;
|
|
@@ -8,14 +8,17 @@ exports.CardIcon = CardIcon;
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
10
|
const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
|
|
11
|
-
function CardIcon({ variant, src, rawContent, position }) {
|
|
12
|
-
return (react_1.default.createElement(exports.CardIconWrapper, { $variant: variant, $position: position },
|
|
11
|
+
function CardIcon({ variant, src, rawContent, position, color }) {
|
|
12
|
+
return (react_1.default.createElement(exports.CardIconWrapper, { className: color && `card-icon-color-${color}`, $variant: variant, $position: position },
|
|
13
13
|
react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: src, rawContent: rawContent })));
|
|
14
14
|
}
|
|
15
15
|
exports.CardIconWrapper = styled_components_1.default.div `
|
|
16
|
+
--card-icon-bg-color-hover: ${({ $variant }) => $variant === 'ghost' && 'transparent'};
|
|
16
17
|
--icon-width: var(--card-icon-width);
|
|
17
18
|
--icon-height: var(--card-icon-height);
|
|
18
19
|
color: var(--card-icon-color);
|
|
20
|
+
/* An inline SVG fills from this. */
|
|
21
|
+
--icon-color: var(--card-icon-color);
|
|
19
22
|
|
|
20
23
|
display: flex;
|
|
21
24
|
align-self: ${({ $position }) => ($position ? $position : 'auto')};
|
|
@@ -24,7 +27,7 @@ exports.CardIconWrapper = styled_components_1.default.div `
|
|
|
24
27
|
min-height: var(--card-icon-height);
|
|
25
28
|
flex-shrink: 0;
|
|
26
29
|
|
|
27
|
-
padding: var(--card-icon-padding);
|
|
30
|
+
padding: ${({ $variant }) => ($variant === 'ghost' ? 0 : `var(--card-icon-padding)`)};
|
|
28
31
|
border: ${({ $variant }) => $variant !== 'ghost' && `var(--card-icon-border)`};
|
|
29
32
|
border-radius: var(--card-icon-border-radius);
|
|
30
33
|
overflow: hidden;
|
|
@@ -23,6 +23,38 @@ exports.cardsDarkMode = (0, styled_components_1.css) `
|
|
|
23
23
|
--card-box-shadow: 0px 8px 24px -4px #00000014, 0px 6px 12px -6px #0000001F;
|
|
24
24
|
--card-box-shadow-hover: 0px 14px 64px -4px #0000001F, 0px 8px 22px -6px #0000001F;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
.card-icon-color-green {
|
|
28
|
+
--card-icon-color: var(--color-green-7);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.card-icon-color-grey {
|
|
32
|
+
--card-icon-color: var(--color-warm-grey-8);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.card-icon-color-turquoise {
|
|
36
|
+
--card-icon-color: var(--color-turquoise-6);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card-icon-color-magenta {
|
|
40
|
+
--card-icon-color: var(--color-magenta-4);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.card-icon-color-carrot {
|
|
44
|
+
--card-icon-color: var(--color-carrot-6);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.card-icon-color-grass {
|
|
48
|
+
--card-icon-color: var(--color-grass-7);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.card-icon-color-persian-green {
|
|
52
|
+
--card-icon-color: var(--color-persian-green-7);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.card-icon-color-sky {
|
|
56
|
+
--card-icon-color: var(--color-sky-6);
|
|
57
|
+
}
|
|
26
58
|
`;
|
|
27
59
|
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
28
60
|
//# sourceMappingURL=variables.dark.js.map
|
|
@@ -23,24 +23,38 @@ exports.cards = (0, styled_components_1.css) `
|
|
|
23
23
|
--card-border-radius: var(--border-radius-xl);
|
|
24
24
|
--card-border-style: solid;
|
|
25
25
|
--card-link-cursor: pointer;
|
|
26
|
-
--card-link-icon-width:
|
|
27
|
-
--card-link-icon-height:
|
|
26
|
+
--card-link-icon-width: 14px;
|
|
27
|
+
--card-link-icon-height: 14px;
|
|
28
28
|
--card-border-width: 1px;
|
|
29
|
-
--card-image-border-radius: var(--border-radius-
|
|
29
|
+
--card-image-border-radius: var(--border-radius-xl);
|
|
30
30
|
--card-image-aspect-ratio: 16 / 9;
|
|
31
|
-
--card-icon-border-radius: var(--border-radius-
|
|
31
|
+
--card-icon-border-radius: var(--border-radius-lg);
|
|
32
32
|
--card-icon-border: var(--card-border-width) var(--border-style) var(--card-icon-border-color);
|
|
33
33
|
--card-icon-padding: var(--spacing-sm);
|
|
34
34
|
--card-icon-size: 24px;
|
|
35
35
|
--card-icon-height: var(--card-icon-size);
|
|
36
36
|
--card-icon-width: var(--card-icon-size);
|
|
37
37
|
--card-icon-gap: var(--spacing-base);
|
|
38
|
-
--card-title-margin: 0;
|
|
38
|
+
--card-title-margin: 0 var(--spacing-xs) 0 0;
|
|
39
39
|
--card-title-font-weight: var(--font-weight-semibold);
|
|
40
|
+
--card-title-row-gap: var(--spacing-xxs);
|
|
40
41
|
--card-content-gap: 4px;
|
|
41
42
|
--card-padding: 16px 20px;
|
|
42
43
|
--card-body-font-size: var(--font-size-base);
|
|
43
44
|
--card-body-line-height: var(--line-height-base);
|
|
45
|
+
--card-cta-margin-top: var(--spacing-base);
|
|
46
|
+
--card-cta-gap: var(--spacing-xxs);
|
|
47
|
+
--card-cta-font-size: var(--font-size-base);
|
|
48
|
+
--card-cta-font-weight: var(--font-weight-regular);
|
|
49
|
+
--card-cta-text-color: var(--text-color-secondary);
|
|
50
|
+
--card-cta-icon-width: 14px;
|
|
51
|
+
--card-cta-icon-height: 14px;
|
|
52
|
+
--card-badge-margin: 0 var(--spacing-xxs) 0 0 ;
|
|
53
|
+
--card-badge-padding: 0 var(--spacing-xxs);
|
|
54
|
+
--card-badge-border-radius: var(--badge-border-radius);
|
|
55
|
+
--card-badge-font-size: var(--font-size-sm);
|
|
56
|
+
--card-badge-font-weight: var(--font-weight-regular);
|
|
57
|
+
--card-badge-line-height: var(--line-height-sm);
|
|
44
58
|
|
|
45
59
|
/**
|
|
46
60
|
* @tokens Card variants
|
|
@@ -76,7 +90,7 @@ exports.cards = (0, styled_components_1.css) `
|
|
|
76
90
|
--card-bg-color: transparent;
|
|
77
91
|
--card-bg-color-hover: var(--layer-color);
|
|
78
92
|
--card-border-width: 0;
|
|
79
|
-
--card-border-radius: var(--border-radius-
|
|
93
|
+
--card-border-radius: var(--border-radius-xl);
|
|
80
94
|
--card-padding: var(--spacing-xs) 0;
|
|
81
95
|
--card-icon-border-color-hover: var(--card-icon-border-color);
|
|
82
96
|
--card-icon-bg-color-hover: var(--card-icon-bg-color);
|
|
@@ -84,6 +98,66 @@ exports.cards = (0, styled_components_1.css) `
|
|
|
84
98
|
--card-hover-transition: initial;
|
|
85
99
|
}
|
|
86
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @tokens Card icon colors
|
|
103
|
+
*/
|
|
104
|
+
.card-icon-color-red {
|
|
105
|
+
--card-icon-color: var(--color-red-7);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.card-icon-color-green {
|
|
109
|
+
--card-icon-color: var(--color-green-8);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.card-icon-color-blue {
|
|
113
|
+
--card-icon-color: var(--color-blue-7);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.card-icon-color-grey {
|
|
117
|
+
--card-icon-color: var(--text-color-secondary);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.card-icon-color-turquoise {
|
|
121
|
+
--card-icon-color: var(--color-turquoise-8);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.card-icon-color-magenta {
|
|
125
|
+
--card-icon-color: var(--color-magenta-7);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.card-icon-color-purple {
|
|
129
|
+
--card-icon-color: var(--color-purple-7);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.card-icon-color-carrot {
|
|
133
|
+
--card-icon-color: var(--color-carrot-8);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.card-icon-color-raspberry {
|
|
137
|
+
--card-icon-color: var(--color-raspberry-7);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.card-icon-color-orange {
|
|
141
|
+
--card-icon-color: var(--color-orange-7);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.card-icon-color-grass {
|
|
145
|
+
--card-icon-color: var(--color-grass-8);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.card-icon-color-persian-green {
|
|
149
|
+
--card-icon-color: var(--color-persian-green-8);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.card-icon-color-sky {
|
|
153
|
+
--card-icon-color: var(--color-sky-8);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.card-icon-color-blueberry {
|
|
157
|
+
--card-icon-color: var(--color-blueberry-7);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// @tokens End
|
|
87
161
|
`;
|
|
88
|
-
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
162
|
+
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
89
163
|
//# sourceMappingURL=variables.js.map
|
|
@@ -67,6 +67,7 @@ const CodePanelWrapper = styled_components_1.default.div `
|
|
|
67
67
|
background-color: var(--code-panel-bg-color);
|
|
68
68
|
border: 1px solid var(--code-panel-border-color);
|
|
69
69
|
border-radius: var(--code-panel-border-radius);
|
|
70
|
+
overflow: clip;
|
|
70
71
|
--code-block-max-height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
|
|
71
72
|
height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
|
|
72
73
|
position: sticky;
|
|
@@ -113,7 +113,7 @@ const StepContent = styled_components_1.default.div.withConfig({
|
|
|
113
113
|
margin: var(--spacing-xs) 0px var(--spacing-xs) calc(var(--spacing-unit) * 3.5);
|
|
114
114
|
padding: var(--spacing-md) var(--spacing-lg);
|
|
115
115
|
background: ${({ isActive }) => (isActive ? 'var(--layer-color)' : 'none')};
|
|
116
|
-
border-radius: var(--border-radius);
|
|
116
|
+
border-radius: var(--code-step-border-radius);
|
|
117
117
|
|
|
118
118
|
&:hover {
|
|
119
119
|
background-color: ${({ isActive }) => isActive ? 'var(--code-step-bg-active-hover)' : 'var(--code-step-bg-hover)'};
|
|
@@ -9,11 +9,12 @@ exports.codeWalkthrough = (0, styled_components_1.css) `
|
|
|
9
9
|
--code-step-bg-active: var(--layer-color);
|
|
10
10
|
--code-step-bg-hover: var(--color-hover-base);
|
|
11
11
|
--code-step-bg-active-hover: var(--layer-color-hover);
|
|
12
|
+
--code-step-border-radius: var(--border-radius-lg);
|
|
12
13
|
|
|
13
14
|
--code-panel-bg-color: var(--layer-color);
|
|
14
15
|
--code-panel-line-numbering-color: var(--text-color-disabled);
|
|
15
16
|
--code-panel-header-height: var(--spacing-lg);
|
|
16
17
|
--code-panel-border-color: var(--border-color-secondary);
|
|
17
|
-
--code-panel-border-radius: var(--border-radius);
|
|
18
|
+
--code-panel-border-radius: var(--border-radius-xl);
|
|
18
19
|
`;
|
|
19
20
|
//# sourceMappingURL=variables.js.map
|
|
@@ -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
|
|
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,
|