@redocly/theme 0.69.0-next.1 → 0.69.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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/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 +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/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/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/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/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 +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/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/admonition.ts +1 -1
- package/src/markdoc/tags/card.ts +14 -0
- package/src/markdoc/tags/connect-mcp.ts +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { SearchFacet, SearchFacetCount, SearchFilterItem } from '@redocly/theme/core/types';
|
|
@@ -27,15 +27,8 @@ export function SearchFilterFieldSelect({
|
|
|
27
27
|
const { useFacetQuery, useTranslate } = useThemeHooks();
|
|
28
28
|
const { translate } = useTranslate();
|
|
29
29
|
const { searchFacet, setSearchFacet, setSearchFacetQuery } = useFacetQuery(facet.field);
|
|
30
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
31
|
-
const [selectOptions, setSelectOptions] = useState<any[]>([]);
|
|
32
30
|
const isMultiple = facet.type === 'multi-select';
|
|
33
31
|
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
setSelectOptions(getSelectOptions());
|
|
36
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
37
|
-
}, [searchFacet, facet]);
|
|
38
|
-
|
|
39
32
|
const onSearch = (value: string | null) => {
|
|
40
33
|
if (value === null) {
|
|
41
34
|
setSearchFacet(null);
|
|
@@ -49,38 +42,10 @@ export function SearchFilterFieldSelect({
|
|
|
49
42
|
}
|
|
50
43
|
};
|
|
51
44
|
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const facetValueToSelectOption = (facetValue?: SearchFacetCount | string) => {
|
|
59
|
-
if (!facetValue) {
|
|
60
|
-
return { element: null, value: '' };
|
|
61
|
-
}
|
|
62
|
-
if (typeof facetValue === 'string') {
|
|
63
|
-
return {
|
|
64
|
-
element: (
|
|
65
|
-
<FilterSelectOptionWrapper>
|
|
66
|
-
<FilterSelectOptionText>{facetValue}</FilterSelectOptionText>
|
|
67
|
-
</FilterSelectOptionWrapper>
|
|
68
|
-
),
|
|
69
|
-
value: facetValue,
|
|
70
|
-
};
|
|
71
|
-
} else {
|
|
72
|
-
const { value, count, isCounterVisible } = facetValue as SearchFacetCount;
|
|
73
|
-
return {
|
|
74
|
-
element: (
|
|
75
|
-
<FilterSelectOptionWrapper>
|
|
76
|
-
<FilterSelectOptionText>{value}</FilterSelectOptionText>
|
|
77
|
-
{isCounterVisible && <CounterTag>{count}</CounterTag>}
|
|
78
|
-
</FilterSelectOptionWrapper>
|
|
79
|
-
),
|
|
80
|
-
value: value,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
};
|
|
45
|
+
const selectOptions = useMemo(
|
|
46
|
+
() => (searchFacet ? searchFacet.values : facet.values).map(facetValueToSelectOption),
|
|
47
|
+
[searchFacet, facet],
|
|
48
|
+
);
|
|
84
49
|
|
|
85
50
|
return (
|
|
86
51
|
<Select
|
|
@@ -113,6 +78,33 @@ export function SearchFilterFieldSelect({
|
|
|
113
78
|
);
|
|
114
79
|
}
|
|
115
80
|
|
|
81
|
+
function facetValueToSelectOption(facetValue?: SearchFacetCount | string) {
|
|
82
|
+
if (!facetValue) {
|
|
83
|
+
return { element: null, value: '' };
|
|
84
|
+
}
|
|
85
|
+
if (typeof facetValue === 'string') {
|
|
86
|
+
return {
|
|
87
|
+
element: (
|
|
88
|
+
<FilterSelectOptionWrapper>
|
|
89
|
+
<FilterSelectOptionText>{facetValue}</FilterSelectOptionText>
|
|
90
|
+
</FilterSelectOptionWrapper>
|
|
91
|
+
),
|
|
92
|
+
value: facetValue,
|
|
93
|
+
};
|
|
94
|
+
} else {
|
|
95
|
+
const { value, count, isCounterVisible } = facetValue as SearchFacetCount;
|
|
96
|
+
return {
|
|
97
|
+
element: (
|
|
98
|
+
<FilterSelectOptionWrapper>
|
|
99
|
+
<FilterSelectOptionText>{value}</FilterSelectOptionText>
|
|
100
|
+
{isCounterVisible && <CounterTag>{count}</CounterTag>}
|
|
101
|
+
</FilterSelectOptionWrapper>
|
|
102
|
+
),
|
|
103
|
+
value: value,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
116
108
|
const FilterSelectOptionWrapper = styled.div`
|
|
117
109
|
width: 100%;
|
|
118
110
|
display: flex;
|
|
@@ -94,6 +94,7 @@ export function SearchAiDialog({
|
|
|
94
94
|
if (!initialMessage?.trim().length) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- appends the initial message into the conversation state lifted to the search root once the dialog mounts
|
|
97
98
|
setConversation((prev) => [
|
|
98
99
|
...prev,
|
|
99
100
|
{ role: AiSearchConversationRole.USER, content: initialMessage },
|
|
@@ -105,6 +106,7 @@ export function SearchAiDialog({
|
|
|
105
106
|
return;
|
|
106
107
|
}
|
|
107
108
|
|
|
109
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- merges the streamed assistant response into the lifted conversation state as chunks arrive
|
|
108
110
|
setConversation((prev) => {
|
|
109
111
|
const lastMessage = prev[prev.length - 1];
|
|
110
112
|
const content: string = response || '';
|
|
@@ -146,6 +148,7 @@ export function SearchAiDialog({
|
|
|
146
148
|
|
|
147
149
|
useEffect(() => {
|
|
148
150
|
if (error) {
|
|
151
|
+
// oxlint-disable-next-line react-you-might-not-need-an-effect/no-pass-data-to-parent -- drops the pending message from the lifted conversation state once the request errors
|
|
149
152
|
setConversation((prev) => prev.slice(0, -1));
|
|
150
153
|
}
|
|
151
154
|
}, [error, setConversation]);
|
|
@@ -176,7 +179,7 @@ export function SearchAiDialog({
|
|
|
176
179
|
/>
|
|
177
180
|
{translate(
|
|
178
181
|
'search.ai.welcomeText',
|
|
179
|
-
'Welcome to AI
|
|
182
|
+
'Welcome to AI assistant! Feel free to ask me anything. How can I help you? ',
|
|
180
183
|
)}
|
|
181
184
|
</WelcomeWrapper>
|
|
182
185
|
)}
|
|
@@ -308,7 +308,7 @@ const MessageWrapper = styled.div<{ $role: string }>`
|
|
|
308
308
|
$role === AiSearchConversationRole.USER
|
|
309
309
|
? 'var(--spacing-sm)'
|
|
310
310
|
: 'var(--spacing-sm) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm)'};
|
|
311
|
-
border-radius: var(--border-radius-
|
|
311
|
+
border-radius: var(--border-radius-xl);
|
|
312
312
|
width: fit-content;
|
|
313
313
|
max-width: 100%;
|
|
314
314
|
word-wrap: break-word;
|
|
@@ -128,7 +128,7 @@ const FeedbackFormWrapper = styled.div`
|
|
|
128
128
|
padding: var(--spacing-xs);
|
|
129
129
|
background: var(--search-ai-feedback-form-bg-color);
|
|
130
130
|
border: 1px solid var(--search-ai-feedback-form-border-color);
|
|
131
|
-
border-radius: var(--border-radius-
|
|
131
|
+
border-radius: var(--border-radius-xl);
|
|
132
132
|
`;
|
|
133
133
|
|
|
134
134
|
const FeedbackHeader = styled.div`
|
|
@@ -170,7 +170,7 @@ const FeedbackTextArea = styled.textarea`
|
|
|
170
170
|
padding: var(--spacing-xs);
|
|
171
171
|
padding-right: 3rem;
|
|
172
172
|
border: 1px solid var(--border-color-primary);
|
|
173
|
-
border-radius: var(--border-radius-
|
|
173
|
+
border-radius: var(--border-radius-lg);
|
|
174
174
|
font-family: inherit;
|
|
175
175
|
font-size: var(--font-size-base);
|
|
176
176
|
line-height: var(--line-height-base);
|
|
@@ -493,7 +493,7 @@ export function SearchDialog({
|
|
|
493
493
|
<AiDisclaimer>
|
|
494
494
|
{translate(
|
|
495
495
|
'search.ai.disclaimer',
|
|
496
|
-
'AI
|
|
496
|
+
'AI assistant might provide incomplete or incorrect results. Verify important information.',
|
|
497
497
|
)}
|
|
498
498
|
</AiDisclaimer>
|
|
499
499
|
) : (
|
|
@@ -672,7 +672,6 @@ const SearchMessage = styled.div`
|
|
|
672
672
|
`;
|
|
673
673
|
|
|
674
674
|
const SearchProductTag = styled(Tag)`
|
|
675
|
-
--tag-border-radius: var(--border-radius);
|
|
676
675
|
border: none;
|
|
677
676
|
margin: var(--spacing-xs) var(--spacing-sm) !important;
|
|
678
677
|
`;
|
|
@@ -747,6 +746,7 @@ const SearchWithAI = styled.div`
|
|
|
747
746
|
outline: none;
|
|
748
747
|
border-top: 1px solid var(--search-item-border-color);
|
|
749
748
|
border-bottom: 1px solid var(--search-item-border-color);
|
|
749
|
+
border-radius: var(--search-item-border-radius);
|
|
750
750
|
|
|
751
751
|
transition: all 0.3s ease;
|
|
752
752
|
|
|
@@ -114,7 +114,12 @@ export function SearchItem({
|
|
|
114
114
|
<div>
|
|
115
115
|
{searchHighlight(parameter.place)}
|
|
116
116
|
{` → `}
|
|
117
|
-
{parameter.path?.length ?
|
|
117
|
+
{parameter.path?.length ? (
|
|
118
|
+
<>
|
|
119
|
+
{searchHighlight(parameter.path.join(' → '))}
|
|
120
|
+
{` → `}
|
|
121
|
+
</>
|
|
122
|
+
) : null}
|
|
118
123
|
{searchHighlight(parameter.name)}
|
|
119
124
|
</div>
|
|
120
125
|
<div>{searchHighlight(parameter.description)}</div>
|
|
@@ -145,6 +150,7 @@ const SearchItemWrapper = styled(Link)`
|
|
|
145
150
|
outline: none;
|
|
146
151
|
border-top: 1px solid var(--search-item-border-color);
|
|
147
152
|
border-bottom: 1px solid var(--search-item-border-color);
|
|
153
|
+
border-radius: var(--search-item-border-radius);
|
|
148
154
|
|
|
149
155
|
${ReturnKeyIcon} {
|
|
150
156
|
align-self: center;
|
|
@@ -97,6 +97,7 @@ const SearchRecentItem = styled.div`
|
|
|
97
97
|
font-weight: var(--search-recent-item-font-weight);
|
|
98
98
|
line-height: var(--search-recent-item-line-height);
|
|
99
99
|
padding: var(--search-recent-item-padding);
|
|
100
|
+
border-radius: var(--search-recent-item-border-radius);
|
|
100
101
|
color: var(--search-recent-item-text-color);
|
|
101
102
|
cursor: pointer;
|
|
102
103
|
|
|
@@ -81,6 +81,7 @@ const SearchSuggestedItem = styled(Link)`
|
|
|
81
81
|
line-height: var(--search-suggested-item-line-height);
|
|
82
82
|
color: var(--search-suggested-item-text-color);
|
|
83
83
|
padding: var(--search-suggested-item-padding);
|
|
84
|
+
border-radius: var(--search-suggested-item-border-radius);
|
|
84
85
|
cursor: pointer;
|
|
85
86
|
|
|
86
87
|
&:hover {
|
|
@@ -10,7 +10,7 @@ export const search = css`
|
|
|
10
10
|
--search-modal-min-height: 705px;
|
|
11
11
|
--search-modal-bg-color: var(--modal-bg-color);
|
|
12
12
|
--search-modal-box-shadow: var(--modal-box-shadow);
|
|
13
|
-
--search-modal-border-radius: var(--border-radius-
|
|
13
|
+
--search-modal-border-radius: var(--border-radius-xxl);
|
|
14
14
|
--search-modal-border: 1px solid var(--border-color-secondary);
|
|
15
15
|
|
|
16
16
|
--search-modal-header-bg-color: var(--bg-color-tonal); // @presenter Color
|
|
@@ -34,7 +34,7 @@ export const search = css`
|
|
|
34
34
|
--search-input-gap: var(--spacing-sm);
|
|
35
35
|
--search-input-height: 40px;
|
|
36
36
|
--search-input-border: none;
|
|
37
|
-
--search-input-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
37
|
+
--search-input-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
38
38
|
|
|
39
39
|
--search-group-title-padding: var(--spacing-sm);
|
|
40
40
|
--search-group-title-bg-color: var(--bg-color-tonal); // @presenter Color
|
|
@@ -53,6 +53,7 @@ export const search = css`
|
|
|
53
53
|
--search-item-bg-color-hover: var(--layer-color-ontonal-hover); // @presenter Color
|
|
54
54
|
--search-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
55
55
|
--search-item-border-color: transparent; // @presenter Color
|
|
56
|
+
--search-item-border-radius: var(--border-radius-lg);
|
|
56
57
|
--search-item-padding: var(--spacing-sm) var(--spacing-lg);
|
|
57
58
|
--search-item-gap: var(--spacing-xxs);
|
|
58
59
|
--search-item-product-icon-size: 16px;
|
|
@@ -71,6 +72,7 @@ export const search = css`
|
|
|
71
72
|
--search-recent-item-title-padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xxs) var(--spacing-lg); // @presenter Color
|
|
72
73
|
--search-recent-item-bg-color-active: var(--layer-color); // @presenter Color
|
|
73
74
|
--search-recent-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
75
|
+
--search-recent-item-border-radius: var(--search-item-border-radius);
|
|
74
76
|
|
|
75
77
|
--search-suggested-item-font-size: var(--font-size-base); // @presenter FontSize
|
|
76
78
|
--search-suggested-item-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
@@ -86,6 +88,7 @@ export const search = css`
|
|
|
86
88
|
--search-suggested-item-title-padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xxs) var(--spacing-lg); // @presenter Color
|
|
87
89
|
--search-suggested-item-bg-color-active: var(--layer-color); // @presenter Color
|
|
88
90
|
--search-suggested-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
91
|
+
--search-suggested-item-border-radius: var(--search-item-border-radius);
|
|
89
92
|
|
|
90
93
|
--search-shortcuts-gap: var(--spacing-xs);
|
|
91
94
|
|
|
@@ -94,6 +97,7 @@ export const search = css`
|
|
|
94
97
|
--search-message-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
95
98
|
--search-message-text-color: var(--text-color-secondary); // @presenter Color
|
|
96
99
|
--search-message-gap: var(--spacing-md);
|
|
100
|
+
--search-message-padding: var(--spacing-md);
|
|
97
101
|
|
|
98
102
|
--search-header-buttons-gap: var(--spacing-sm);
|
|
99
103
|
--search-header-buttons-padding-left: var(--spacing-sm);
|
|
@@ -133,7 +137,7 @@ export const search = css`
|
|
|
133
137
|
--search-trigger-border-style: var(--border-style);
|
|
134
138
|
--search-trigger-border-color: var(--input-border-color);
|
|
135
139
|
--search-trigger-border-color-hover: var(--input-border-color-hover);
|
|
136
|
-
--search-trigger-border-radius: var(--border-radius-
|
|
140
|
+
--search-trigger-border-radius: var(--border-radius-lg);
|
|
137
141
|
--search-trigger-padding-vertical: var(--input-padding-vertical);
|
|
138
142
|
--search-trigger-padding-horizontal: var(--input-padding-horizontal);
|
|
139
143
|
--search-trigger-padding: var(--search-trigger-padding-vertical) var(--search-trigger-padding-horizontal);
|
|
@@ -244,7 +248,7 @@ export const search = css`
|
|
|
244
248
|
--search-ai-conversation-input-bg-color-disabled: var(--color-warm-grey-1);
|
|
245
249
|
--search-ai-conversation-input-padding: var(--spacing-sm) var(--spacing-md);
|
|
246
250
|
--search-ai-conversation-input-border: 1px solid var(--border-color-secondary);
|
|
247
|
-
--search-ai-conversation-input-border-radius: var(--border-radius-
|
|
251
|
+
--search-ai-conversation-input-border-radius: var(--border-radius-xl);
|
|
248
252
|
--search-ai-conversation-input-font-size: var(--font-size-base);
|
|
249
253
|
--search-ai-conversation-input-placeholder-color: var(--search-input-placeholder-color);
|
|
250
254
|
--search-ai-conversation-input-border-color-focus: var(--color-primary-base, var(--search-ai-conversation-input-border-color-focus-legacy));
|
|
@@ -252,7 +256,7 @@ export const search = css`
|
|
|
252
256
|
|
|
253
257
|
--search-ai-conversation-input-send-button-right: 12px;
|
|
254
258
|
--search-ai-conversation-input-send-button-padding: 5px;
|
|
255
|
-
--search-ai-conversation-input-send-button-border-radius: var(--border-radius);
|
|
259
|
+
--search-ai-conversation-input-send-button-border-radius: var(--border-radius-md);
|
|
256
260
|
--search-ai-conversation-input-send-button-border-disabled: 1px solid var(--button-border-color-disabled);
|
|
257
261
|
|
|
258
262
|
--search-ai-conversation-input-min-height: 48px;
|
|
@@ -16,6 +16,7 @@ function SegmentedComponent<T>(
|
|
|
16
16
|
data-component-name="Segmented/Segmented"
|
|
17
17
|
className={`tag-grey ${size} ${className}`}
|
|
18
18
|
role="tablist"
|
|
19
|
+
$size={size}
|
|
19
20
|
>
|
|
20
21
|
{options.map((opt, index) => (
|
|
21
22
|
<React.Fragment key={index}>
|
|
@@ -40,12 +41,13 @@ export const Segmented = typedMemo(forwardRef(SegmentedComponent)) as <T>(
|
|
|
40
41
|
props: SegmentedProps<T> & { ref?: ForwardedRef<HTMLDivElement> },
|
|
41
42
|
) => ReactElement;
|
|
42
43
|
|
|
43
|
-
const SegmentedGroup = styled.div
|
|
44
|
+
const SegmentedGroup = styled.div<{ $size: string }>`
|
|
44
45
|
display: flex;
|
|
45
46
|
background: var(--segmented-buttons-bg-color-main);
|
|
46
47
|
padding: calc(var(--spacing-xxs) / 2);
|
|
47
48
|
gap: calc(var(--spacing-xxs) / 2);
|
|
48
|
-
border-radius:
|
|
49
|
+
border-radius: ${({ $size }) =>
|
|
50
|
+
$size === 'small' ? 'var(--border-radius-md)' : 'var(--border-radius-lg)'};
|
|
49
51
|
max-width: 100%;
|
|
50
52
|
width: fit-content;
|
|
51
53
|
`;
|
|
@@ -75,7 +77,8 @@ const SegmentedItem = styled.button<{ $isActive: boolean; $size: string }>`
|
|
|
75
77
|
cursor: pointer;
|
|
76
78
|
`}
|
|
77
79
|
line-height: var(--segmented-line-height);
|
|
78
|
-
border-radius:
|
|
80
|
+
border-radius: ${({ $size }) =>
|
|
81
|
+
$size === 'small' ? 'var(--border-radius)' : 'var(--border-radius-md)'};
|
|
79
82
|
padding: ${({ $size }) => ($size === 'small' ? 0 : '3px')} var(--spacing-sm);
|
|
80
83
|
white-space: nowrap;
|
|
81
84
|
text-overflow: ellipsis;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment,
|
|
1
|
+
import React, { Fragment, useId, useRef, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
@@ -68,33 +68,47 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
68
68
|
setDropdownActive(false);
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
const [prevOptions, setPrevOptions] = useState(options);
|
|
72
|
+
const [prevValue, setPrevValue] = useState(value);
|
|
73
|
+
const [prevMultiple, setPrevMultiple] = useState(multiple);
|
|
74
|
+
|
|
75
|
+
if (prevOptions !== options) {
|
|
76
|
+
setPrevOptions(options);
|
|
72
77
|
setFilteredOptions(options);
|
|
73
|
-
}
|
|
78
|
+
}
|
|
74
79
|
|
|
75
|
-
|
|
80
|
+
if (prevValue !== value || prevMultiple !== multiple) {
|
|
81
|
+
setPrevValue(value);
|
|
82
|
+
setPrevMultiple(multiple);
|
|
76
83
|
setSelectedOptions(getSelectedOptionsFromPropsValue());
|
|
77
|
-
|
|
78
|
-
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const changeSearchValue = (newSearchValue: string | null) => {
|
|
87
|
+
if (newSearchValue === searchValue) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
setSearchValue(newSearchValue);
|
|
79
92
|
|
|
80
|
-
useEffect(() => {
|
|
81
93
|
if (onSearch) {
|
|
82
|
-
onSearch
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
onSearch(newSearchValue as T);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (typeof newSearchValue === 'string') {
|
|
99
|
+
setFilteredOptions(
|
|
100
|
+
options.filter((option) => {
|
|
86
101
|
const valueForSearch = String(option.label ?? option.value ?? '');
|
|
87
102
|
return (
|
|
88
|
-
!valueForSearch ||
|
|
103
|
+
!valueForSearch ||
|
|
104
|
+
valueForSearch.toLowerCase().indexOf(newSearchValue.toLowerCase()) > -1
|
|
89
105
|
);
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
106
|
+
}),
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
setFilteredOptions(options);
|
|
95
110
|
}
|
|
96
|
-
|
|
97
|
-
}, [searchValue]);
|
|
111
|
+
};
|
|
98
112
|
|
|
99
113
|
const selectHandler = (selectedOption: SelectOption<T>) => {
|
|
100
114
|
const newSelectedOptions = multiple
|
|
@@ -113,7 +127,7 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
113
127
|
|
|
114
128
|
setSelectedOptions(newSelectedOptions);
|
|
115
129
|
onChange?.(newSelectedValues);
|
|
116
|
-
|
|
130
|
+
changeSearchValue(null);
|
|
117
131
|
setDropdownActive(false);
|
|
118
132
|
|
|
119
133
|
if (!multiple) {
|
|
@@ -125,7 +139,7 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
125
139
|
|
|
126
140
|
const searchHandler = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
127
141
|
const targetValue = e.target.value;
|
|
128
|
-
|
|
142
|
+
changeSearchValue(targetValue);
|
|
129
143
|
setDropdownActive(true);
|
|
130
144
|
};
|
|
131
145
|
|
|
@@ -150,7 +164,7 @@ export function Select<T>(props: SelectProps<T>): JSX.Element {
|
|
|
150
164
|
if (!e.relatedTarget || e.relatedTarget?.id !== inputId) {
|
|
151
165
|
setDropdownActive(false);
|
|
152
166
|
}
|
|
153
|
-
|
|
167
|
+
changeSearchValue(null);
|
|
154
168
|
setStickyInputValue('');
|
|
155
169
|
}
|
|
156
170
|
};
|
|
@@ -8,7 +8,7 @@ export const select = css`
|
|
|
8
8
|
--select-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
9
9
|
--select-line-height: var(--line-height-base); // @presenter LineHeight
|
|
10
10
|
--select-text-color: var(--text-color-secondary); // @presenter Color
|
|
11
|
-
--select-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
11
|
+
--select-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
12
12
|
--select-border: var(--border-width) var(--border-style) var(--border-color-primary); // @presenter Border
|
|
13
13
|
|
|
14
14
|
--select-input-padding-vertical: 6px; // @presenter Spacing
|
|
@@ -16,7 +16,7 @@ export const select = css`
|
|
|
16
16
|
--select-input-padding: var(--select-input-padding-vertical) var(--select-input-padding-horizontal);
|
|
17
17
|
--select-input-gap: var(--spacing-xs); // @presenter Spacing
|
|
18
18
|
--select-input-value-gap: var(--spacing-unit); // @presenter Spacing
|
|
19
|
-
--select-input-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
19
|
+
--select-input-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
20
20
|
--select-input-font-size: var(--font-size-base); // @presenter FontSize
|
|
21
21
|
--select-input-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
22
22
|
--select-input-line-height: var(--line-height-base); // @presenter LineHeight
|
|
@@ -35,7 +35,7 @@ export const select = css`
|
|
|
35
35
|
--select-list-item-padding: var(--select-list-item-padding-vertical) var(--select-list-item-padding-horizontal);
|
|
36
36
|
|
|
37
37
|
--select-list-item-gap: var(--spacing-xs); // @presenter Spacing
|
|
38
|
-
--select-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
38
|
+
--select-list-item-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
39
39
|
--select-list-item-bg-color-active: transparent; // @presenter Color
|
|
40
40
|
--select-list-item-bg-color-hover: var(--menu-item-bg-color-hover); // @presenter Color
|
|
41
41
|
--select-list-item-font-weight-active: var(--font-weight-medium); // @presenter Color
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
@@ -36,11 +36,7 @@ export function Sidebar({
|
|
|
36
36
|
menuItemsAnimation,
|
|
37
37
|
}: SidebarProps): JSX.Element | null {
|
|
38
38
|
const { isOpen } = useMobileMenu();
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
setMappedCollapsed(collapsed && !isOpen);
|
|
43
|
-
}, [isOpen, collapsed, setMappedCollapsed]);
|
|
39
|
+
const mappedCollapsed = collapsed && !isOpen;
|
|
44
40
|
|
|
45
41
|
const { sidebar } = useThemeConfig();
|
|
46
42
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { ComponentProps, JSX } from 'react';
|
|
5
|
+
import type { ButtonProps } from '@redocly/theme/components/Button/Button';
|
|
6
|
+
import type { ButtonGroupSize, ButtonGroupVariant } from '@redocly/theme/core/types';
|
|
7
|
+
|
|
8
|
+
import { Button } from '@redocly/theme/components/Button/Button';
|
|
9
|
+
import { ButtonGroup } from '@redocly/theme/components/Button/ButtonGroup';
|
|
10
|
+
import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
|
|
11
|
+
|
|
12
|
+
export type SplitButtonProps = {
|
|
13
|
+
button: React.ReactElement<ButtonProps>;
|
|
14
|
+
children: ComponentProps<typeof Dropdown>['children'];
|
|
15
|
+
variant?: ButtonGroupVariant;
|
|
16
|
+
size?: ButtonGroupSize;
|
|
17
|
+
placement?: 'top' | 'bottom';
|
|
18
|
+
alignment?: 'start' | 'end';
|
|
19
|
+
portalled?: boolean;
|
|
20
|
+
closeOnSelect?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
toggleAriaLabel: string;
|
|
23
|
+
onOpen?: () => void;
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function SplitButton(props: SplitButtonProps): JSX.Element {
|
|
29
|
+
const {
|
|
30
|
+
button,
|
|
31
|
+
children,
|
|
32
|
+
variant,
|
|
33
|
+
size,
|
|
34
|
+
placement = 'bottom',
|
|
35
|
+
alignment = 'end',
|
|
36
|
+
portalled,
|
|
37
|
+
closeOnSelect = true,
|
|
38
|
+
disabled,
|
|
39
|
+
toggleAriaLabel,
|
|
40
|
+
onOpen,
|
|
41
|
+
onClose,
|
|
42
|
+
className,
|
|
43
|
+
} = props;
|
|
44
|
+
|
|
45
|
+
const hasMenu = typeof children === 'function' || React.Children.toArray(children).length > 0;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<SplitButtonWrapper data-component-name="SplitButton/SplitButton" className={className}>
|
|
49
|
+
<ButtonGroup variant={variant} size={size}>
|
|
50
|
+
{button}
|
|
51
|
+
{hasMenu ? (
|
|
52
|
+
<ToggleDropdown
|
|
53
|
+
closeOnClick={closeOnSelect}
|
|
54
|
+
placement={placement}
|
|
55
|
+
alignment={alignment}
|
|
56
|
+
portalled={portalled}
|
|
57
|
+
withArrow
|
|
58
|
+
onOpen={onOpen}
|
|
59
|
+
onClose={onClose}
|
|
60
|
+
trigger={
|
|
61
|
+
<Button
|
|
62
|
+
aria-label={toggleAriaLabel}
|
|
63
|
+
aria-haspopup="menu"
|
|
64
|
+
variant={variant}
|
|
65
|
+
size={size}
|
|
66
|
+
disabled={disabled}
|
|
67
|
+
/>
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</ToggleDropdown>
|
|
72
|
+
) : null}
|
|
73
|
+
</ButtonGroup>
|
|
74
|
+
</SplitButtonWrapper>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const SplitButtonWrapper = styled.div`
|
|
79
|
+
position: relative;
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
|
|
82
|
+
/* Themed button margins must not split the group apart. Direct-child chains
|
|
83
|
+
keep the rule off buttons rendered inside the dropdown menu. */
|
|
84
|
+
> * > .button,
|
|
85
|
+
> * > * > .button {
|
|
86
|
+
margin: 0;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
/* The non-portalled menu is absolutely positioned against the nearest positioned
|
|
91
|
+
ancestor; keep the dropdown segment static so that ancestor is the whole
|
|
92
|
+
split button rather than the toggle segment. */
|
|
93
|
+
const ToggleDropdown = styled(Dropdown)`
|
|
94
|
+
position: static;
|
|
95
|
+
`;
|
|
@@ -14,7 +14,7 @@ export const switcherDarkMode = css`
|
|
|
14
14
|
--switch-border-color-disabled: var(--color-warm-grey-5); // @presenter Color
|
|
15
15
|
--switch-border-color-selected: var(--color-primary-base, var(--switch-border-color-selected-legacy)); // @presenter Color
|
|
16
16
|
--switch-border-width: var(--border-width); // @presenter Border
|
|
17
|
-
--switch-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
17
|
+
--switch-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
18
18
|
|
|
19
19
|
--switch-width: 32px; // @presenter Width
|
|
20
20
|
--switch-height: 18px; // @presenter Height
|
|
@@ -27,7 +27,7 @@ export const switcherDarkMode = css`
|
|
|
27
27
|
--switch-knob-bg-color-selected: var(--color-static-white); // @presenter Color
|
|
28
28
|
--switch-knob-bg-color-disabled: var(--color-warm-grey-6); // @presenter Color
|
|
29
29
|
|
|
30
|
-
--switch-knob-border-radius:
|
|
30
|
+
--switch-knob-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
31
31
|
--switch-knob-height: 14px; // @presenter Height
|
|
32
32
|
--switch-knob-width: 14px; // @presenter Width
|
|
33
33
|
--switch-knob-transition: all 0.3s; // @presenter Transition
|
|
@@ -13,7 +13,7 @@ export const switcher = css`
|
|
|
13
13
|
--switch-border-color-pressed: transparent; // @presenter Color
|
|
14
14
|
--switch-border-color-disabled: transparent; // @presenter Color
|
|
15
15
|
--switch-border-color-selected: transparent; // @presenter Color
|
|
16
|
-
--switch-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
16
|
+
--switch-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
17
17
|
--switch-border-width: var(--border-width); // @presenter Border
|
|
18
18
|
|
|
19
19
|
--switch-width: 32px; // @presenter Width
|
|
@@ -27,7 +27,7 @@ export const switcher = css`
|
|
|
27
27
|
--switch-knob-bg-color-selected: var(--color-white); // @presenter Color
|
|
28
28
|
--switch-knob-bg-color-disabled: var(--color-warm-grey-1); // @presenter Color
|
|
29
29
|
|
|
30
|
-
--switch-knob-border-radius:
|
|
30
|
+
--switch-knob-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
31
31
|
--switch-knob-height: 14px; // @presenter Height
|
|
32
32
|
--switch-knob-width: 14px; // @presenter Width
|
|
33
33
|
--switch-knob-transition: transform 0.3s; // @presenter Transition
|
|
@@ -8,9 +8,9 @@ export const tag = css`
|
|
|
8
8
|
|
|
9
9
|
--tag-border-width: 1px; //@presenter Border
|
|
10
10
|
--tag-border-style: solid; //@presenter Border
|
|
11
|
-
--tag-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
11
|
+
--tag-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
12
12
|
--tag-box-shadow: none; // @presenter Shadow
|
|
13
|
-
--tag-border-radius-focused: var(--border-radius); // @presenter BorderRadius
|
|
13
|
+
--tag-border-radius-focused: var(--tag-border-radius); // @presenter BorderRadius
|
|
14
14
|
|
|
15
15
|
--tag-status-dot-color-default: var(--color-persian-green-7);
|
|
16
16
|
--tag-badge-size: var(--spacing-xs);
|
|
@@ -13,6 +13,6 @@ export const httpTag = css`
|
|
|
13
13
|
--http-tag-bg-color: none;
|
|
14
14
|
|
|
15
15
|
--counter-tag-padding: 0px var(--spacing-xxs);
|
|
16
|
-
--counter-tag-border-radius: var(--border-radius);
|
|
16
|
+
--counter-tag-border-radius: var(--tag-border-radius);
|
|
17
17
|
--counter-tag-min-width: var(--spacing-md);
|
|
18
18
|
`
|
|
@@ -16,7 +16,7 @@ export const toast = css`
|
|
|
16
16
|
--toast-max-width: 360px;
|
|
17
17
|
--toast-bg-color: var(--layer-color); // @presenter Color
|
|
18
18
|
--toast-border: var(--border-width) var(--border-style) var(--border-color-secondary); // @presenter Border
|
|
19
|
-
--toast-border-radius: var(--border-radius-
|
|
19
|
+
--toast-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
20
20
|
--toast-font-family: var(--font-family-base); // @presenter FontFamily
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -250,7 +250,7 @@ const TooltipBody = styled.span.attrs<{ $anchorName: string }>(({ $anchorName })
|
|
|
250
250
|
overflow-wrap: break-word;
|
|
251
251
|
text-align: left;
|
|
252
252
|
|
|
253
|
-
border-radius: var(--border-radius-
|
|
253
|
+
border-radius: var(--border-radius-lg);
|
|
254
254
|
transition: opacity 0.3s ease-out;
|
|
255
255
|
|
|
256
256
|
font-size: var(--font-size-base);
|
|
@@ -270,7 +270,7 @@ const TooltipBody = styled.span.attrs<{ $anchorName: string }>(({ $anchorName })
|
|
|
270
270
|
|
|
271
271
|
background: var(--tooltip-bg-color);
|
|
272
272
|
color: var(--tooltip-text-color);
|
|
273
|
-
border: var(--tooltip-border-width,
|
|
273
|
+
border: var(--tooltip-border-width, 2px) var(--tooltip-border-style, solid)
|
|
274
274
|
var(--tooltip-border-color, transparent);
|
|
275
275
|
box-shadow: var(--bg-raised-shadow);
|
|
276
276
|
|