@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
|
@@ -27,7 +27,7 @@ exports.productPicker = (0, styled_components_1.css) `
|
|
|
27
27
|
--product-picker-dropdown-item-padding-vertical: var(--dropdown-menu-item-padding-vertical); // @presenter Spacing
|
|
28
28
|
--product-picker-dropdown-item-separator-padding-top: var(--dropdown-menu-item-separator-padding-top ); // @presenter Spacing
|
|
29
29
|
--product-picker-dropdown-item-separator-padding-bottom: var(--dropdown-menu-item-separator-padding-bottom ); // @presenter Spacing
|
|
30
|
-
--product-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius
|
|
30
|
+
--product-picker-dropdown-item-border-radius: var(--dropdown-menu-item-border-radius); // @presenter BorderRadius
|
|
31
31
|
--product-picker-dropdown-item-bg-color-active: var(--dropdown-menu-item-bg-color-active); // @presenter Color
|
|
32
32
|
--product-picker-dropdown-item-bg-color-hover: var(--dropdown-menu-item-bg-color-hover); // @presenter Color
|
|
33
33
|
--product-picker-dropdown-item-bg-color-disabled: var(--dropdown-menu-item-bg-color-disabled); // @presenter Color
|
|
@@ -38,5 +38,6 @@ exports.productPicker = (0, styled_components_1.css) `
|
|
|
38
38
|
--product-picker-dropdown-item-color-hover: var(--dropdown-menu-item-color-hover);
|
|
39
39
|
--product-picker-dropdown-item-border-color-focused: var(--dropdown-menu-item-border-color-focused);
|
|
40
40
|
|
|
41
|
+
// @tokens End
|
|
41
42
|
`;
|
|
42
43
|
//# sourceMappingURL=variables.js.map
|
|
@@ -7,6 +7,7 @@ export type ReplayGateProps = {
|
|
|
7
7
|
setSelectedEnvironment: (envName: string) => void;
|
|
8
8
|
selectedEnvironment?: string;
|
|
9
9
|
apiId?: string;
|
|
10
|
+
onClose: () => void;
|
|
10
11
|
children: React.ReactNode;
|
|
11
12
|
};
|
|
12
13
|
export declare function ReplayGate({ children }: ReplayGateProps): React.JSX.Element;
|
|
@@ -47,13 +47,7 @@ function SearchFilterFieldSelect({ facet, filter, query, selectedValues, onChang
|
|
|
47
47
|
const { useFacetQuery, useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
48
48
|
const { translate } = useTranslate();
|
|
49
49
|
const { searchFacet, setSearchFacet, setSearchFacetQuery } = useFacetQuery(facet.field);
|
|
50
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
51
|
-
const [selectOptions, setSelectOptions] = (0, react_1.useState)([]);
|
|
52
50
|
const isMultiple = facet.type === 'multi-select';
|
|
53
|
-
(0, react_1.useEffect)(() => {
|
|
54
|
-
setSelectOptions(getSelectOptions());
|
|
55
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
-
}, [searchFacet, facet]);
|
|
57
51
|
const onSearch = (value) => {
|
|
58
52
|
if (value === null) {
|
|
59
53
|
setSearchFacet(null);
|
|
@@ -67,38 +61,34 @@ function SearchFilterFieldSelect({ facet, filter, query, selectedValues, onChang
|
|
|
67
61
|
});
|
|
68
62
|
}
|
|
69
63
|
};
|
|
70
|
-
const
|
|
71
|
-
return searchFacet
|
|
72
|
-
? searchFacet.values.map(facetValueToSelectOption)
|
|
73
|
-
: facet.values.map(facetValueToSelectOption);
|
|
74
|
-
};
|
|
75
|
-
const facetValueToSelectOption = (facetValue) => {
|
|
76
|
-
if (!facetValue) {
|
|
77
|
-
return { element: null, value: '' };
|
|
78
|
-
}
|
|
79
|
-
if (typeof facetValue === 'string') {
|
|
80
|
-
return {
|
|
81
|
-
element: (react_1.default.createElement(FilterSelectOptionWrapper, null,
|
|
82
|
-
react_1.default.createElement(FilterSelectOptionText, null, facetValue))),
|
|
83
|
-
value: facetValue,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
const { value, count, isCounterVisible } = facetValue;
|
|
88
|
-
return {
|
|
89
|
-
element: (react_1.default.createElement(FilterSelectOptionWrapper, null,
|
|
90
|
-
react_1.default.createElement(FilterSelectOptionText, null, value),
|
|
91
|
-
isCounterVisible && react_1.default.createElement(CounterTag_1.CounterTag, null, count))),
|
|
92
|
-
value: value,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
};
|
|
64
|
+
const selectOptions = (0, react_1.useMemo)(() => (searchFacet ? searchFacet.values : facet.values).map(facetValueToSelectOption), [searchFacet, facet]);
|
|
96
65
|
return (react_1.default.createElement(Select_1.Select, { value: selectedValues.length
|
|
97
66
|
? isMultiple
|
|
98
67
|
? selectedValues.map((value) => facetValueToSelectOption(value))
|
|
99
68
|
: facetValueToSelectOption(selectedValues[0])
|
|
100
69
|
: undefined, options: selectOptions, onChange: onChange, placeholder: `${translate('search.filter.field.placeholder', 'Search')} ${facet.name.toLowerCase()}...`, alignment: "start", multiple: isMultiple, searchable: true, footer: selectOptions.length === MAX_SELECT_OPTIONS ? (react_1.default.createElement(FilterSelectFooter, null, translate('search.filter.field.footer', 'Search to show more items...'))) : null, onSearch: onSearch, checkmarkIconPosition: "start" }));
|
|
101
70
|
}
|
|
71
|
+
function facetValueToSelectOption(facetValue) {
|
|
72
|
+
if (!facetValue) {
|
|
73
|
+
return { element: null, value: '' };
|
|
74
|
+
}
|
|
75
|
+
if (typeof facetValue === 'string') {
|
|
76
|
+
return {
|
|
77
|
+
element: (react_1.default.createElement(FilterSelectOptionWrapper, null,
|
|
78
|
+
react_1.default.createElement(FilterSelectOptionText, null, facetValue))),
|
|
79
|
+
value: facetValue,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const { value, count, isCounterVisible } = facetValue;
|
|
84
|
+
return {
|
|
85
|
+
element: (react_1.default.createElement(FilterSelectOptionWrapper, null,
|
|
86
|
+
react_1.default.createElement(FilterSelectOptionText, null, value),
|
|
87
|
+
isCounterVisible && react_1.default.createElement(CounterTag_1.CounterTag, null, count))),
|
|
88
|
+
value: value,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
102
92
|
const FilterSelectOptionWrapper = styled_components_1.default.div `
|
|
103
93
|
width: 100%;
|
|
104
94
|
display: flex;
|
|
@@ -80,6 +80,7 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
80
80
|
if (!(initialMessage === null || initialMessage === void 0 ? void 0 : initialMessage.trim().length)) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
+
// 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
|
|
83
84
|
setConversation((prev) => [
|
|
84
85
|
...prev,
|
|
85
86
|
{ role: constants_1.AiSearchConversationRole.USER, content: initialMessage },
|
|
@@ -89,6 +90,7 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
89
90
|
if (response === undefined || conversation.length === 0 || error) {
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
93
|
+
// 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
|
|
92
94
|
setConversation((prev) => {
|
|
93
95
|
const lastMessage = prev[prev.length - 1];
|
|
94
96
|
const content = response || '';
|
|
@@ -127,6 +129,7 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
127
129
|
]);
|
|
128
130
|
(0, react_1.useEffect)(() => {
|
|
129
131
|
if (error) {
|
|
132
|
+
// 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
|
|
130
133
|
setConversation((prev) => prev.slice(0, -1));
|
|
131
134
|
}
|
|
132
135
|
}, [error, setConversation]);
|
|
@@ -139,7 +142,7 @@ function SearchAiDialog({ isGeneratingResponse, response, initialMessage, error,
|
|
|
139
142
|
return (react_1.default.createElement(SearchAiDialogWrapper, { "data-component-name": "Search/SearchAiDialog", className: className },
|
|
140
143
|
!conversation.length && (react_1.default.createElement(WelcomeWrapper, null,
|
|
141
144
|
react_1.default.createElement(AiStarsIcon_1.AiStarsIcon, { color: "var(--search-ai-icon-color)", size: "32px", background: "var(--search-ai-icon-bg-color)", borderRadius: "var(--border-radius-lg)", margin: "0 var(--spacing-xs) 0 0" }),
|
|
142
|
-
translate('search.ai.welcomeText', 'Welcome to AI
|
|
145
|
+
translate('search.ai.welcomeText', 'Welcome to AI assistant! Feel free to ask me anything. How can I help you? '))),
|
|
143
146
|
react_1.default.createElement(ConversationWrapper, null,
|
|
144
147
|
conversation.map((item, index) => (react_1.default.createElement(SearchAiMessage_1.SearchAiMessage, { key: `search-ai-message-${index}`, role: item.role, content: item.content, isThinking: item.role === constants_1.AiSearchConversationRole.ASSISTANT &&
|
|
145
148
|
isGeneratingResponse &&
|
|
@@ -218,7 +218,7 @@ const MessageWrapper = styled_components_1.default.div `
|
|
|
218
218
|
padding: ${({ $role }) => $role === constants_2.AiSearchConversationRole.USER
|
|
219
219
|
? 'var(--spacing-sm)'
|
|
220
220
|
: 'var(--spacing-sm) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm)'};
|
|
221
|
-
border-radius: var(--border-radius-
|
|
221
|
+
border-radius: var(--border-radius-xl);
|
|
222
222
|
width: fit-content;
|
|
223
223
|
max-width: 100%;
|
|
224
224
|
word-wrap: break-word;
|
|
@@ -93,7 +93,7 @@ const FeedbackFormWrapper = styled_components_1.default.div `
|
|
|
93
93
|
padding: var(--spacing-xs);
|
|
94
94
|
background: var(--search-ai-feedback-form-bg-color);
|
|
95
95
|
border: 1px solid var(--search-ai-feedback-form-border-color);
|
|
96
|
-
border-radius: var(--border-radius-
|
|
96
|
+
border-radius: var(--border-radius-xl);
|
|
97
97
|
`;
|
|
98
98
|
const FeedbackHeader = styled_components_1.default.div `
|
|
99
99
|
display: flex;
|
|
@@ -128,7 +128,7 @@ const FeedbackTextArea = styled_components_1.default.textarea `
|
|
|
128
128
|
padding: var(--spacing-xs);
|
|
129
129
|
padding-right: 3rem;
|
|
130
130
|
border: 1px solid var(--border-color-primary);
|
|
131
|
-
border-radius: var(--border-radius-
|
|
131
|
+
border-radius: var(--border-radius-lg);
|
|
132
132
|
font-family: inherit;
|
|
133
133
|
font-size: var(--font-size-base);
|
|
134
134
|
line-height: var(--line-height-base);
|
|
@@ -263,7 +263,7 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
|
|
|
263
263
|
focusSearchInput();
|
|
264
264
|
} }),
|
|
265
265
|
react_1.default.createElement(SearchSuggestedPages_1.SearchSuggestedPages, null)))))) : (react_1.default.createElement(SearchAiDialog_1.SearchAiDialog, { initialMessage: query, response: aiSearch.response, isGeneratingResponse: aiSearch.isGeneratingResponse, error: aiSearch.error, resources: aiSearch.resources, conversation: aiSearch.conversation, setConversation: aiSearch.setConversation, onMessageSent: aiSearch.askQuestion, toolCalls: aiSearch.toolCalls, contentSegments: aiSearch.contentSegments }))),
|
|
266
|
-
react_1.default.createElement(SearchDialogFooter, null, mode === 'ai-dialog' ? (react_1.default.createElement(AiDisclaimer, null, translate('search.ai.disclaimer', 'AI
|
|
266
|
+
react_1.default.createElement(SearchDialogFooter, null, mode === 'ai-dialog' ? (react_1.default.createElement(AiDisclaimer, null, translate('search.ai.disclaimer', 'AI assistant might provide incomplete or incorrect results. Verify important information.'))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
267
267
|
react_1.default.createElement(SearchShortcuts, null,
|
|
268
268
|
react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.navigate", combination: "Tab", text: translate('search.keys.navigate', 'to navigate') }),
|
|
269
269
|
react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.select", combination: "\u23CE", text: translate('search.keys.select', 'to select') }),
|
|
@@ -396,7 +396,6 @@ const SearchMessage = styled_components_1.default.div `
|
|
|
396
396
|
gap: var(--search-message-gap);
|
|
397
397
|
`;
|
|
398
398
|
const SearchProductTag = (0, styled_components_1.default)(Tag_1.Tag) `
|
|
399
|
-
--tag-border-radius: var(--border-radius);
|
|
400
399
|
border: none;
|
|
401
400
|
margin: var(--spacing-xs) var(--spacing-sm) !important;
|
|
402
401
|
`;
|
|
@@ -462,6 +461,7 @@ const SearchWithAI = styled_components_1.default.div `
|
|
|
462
461
|
outline: none;
|
|
463
462
|
border-top: 1px solid var(--search-item-border-color);
|
|
464
463
|
border-bottom: 1px solid var(--search-item-border-color);
|
|
464
|
+
border-radius: var(--search-item-border-radius);
|
|
465
465
|
|
|
466
466
|
transition: all 0.3s ease;
|
|
467
467
|
|
|
@@ -48,7 +48,7 @@ const utils_1 = require("../../core/utils");
|
|
|
48
48
|
const ReturnKeyIcon_1 = require("../../icons/ReturnKeyIcon/ReturnKeyIcon");
|
|
49
49
|
const hooks_1 = require("../../core/hooks");
|
|
50
50
|
function SearchItem({ onClick, item, className, product, innerRef, }) {
|
|
51
|
-
var _a, _b, _c
|
|
51
|
+
var _a, _b, _c;
|
|
52
52
|
const ref = (0, react_1.useRef)(null);
|
|
53
53
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
54
54
|
const { translate } = useTranslate();
|
|
@@ -95,11 +95,13 @@ function SearchItem({ onClick, item, className, product, innerRef, }) {
|
|
|
95
95
|
react_1.default.createElement("div", null,
|
|
96
96
|
(0, SearchHighlight_1.searchHighlight)(parameter.place),
|
|
97
97
|
` → `,
|
|
98
|
-
((_b = parameter.path) === null || _b === void 0 ? void 0 : _b.length) ? (
|
|
98
|
+
((_b = parameter.path) === null || _b === void 0 ? void 0 : _b.length) ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
99
|
+
(0, SearchHighlight_1.searchHighlight)(parameter.path.join(' → ')),
|
|
100
|
+
` → `)) : null,
|
|
99
101
|
(0, SearchHighlight_1.searchHighlight)(parameter.name)),
|
|
100
102
|
react_1.default.createElement("div", null, (0, SearchHighlight_1.searchHighlight)(parameter.description)))) : (shouldShowPath && (react_1.default.createElement(SearchItemPath, null, highlight.path && highlight.path.length
|
|
101
103
|
? (0, SearchHighlight_1.searchHighlight)(highlight.path.join(' → '))
|
|
102
|
-
: (
|
|
104
|
+
: (_c = document.path) === null || _c === void 0 ? void 0 : _c.join(' → '))))),
|
|
103
105
|
react_1.default.createElement(ReturnKeyIcon_1.ReturnKeyIcon, { color: "var(--search-item-text-color)" })));
|
|
104
106
|
}
|
|
105
107
|
const SearchItemWrapper = (0, styled_components_1.default)(Link_1.Link) `
|
|
@@ -113,6 +115,7 @@ const SearchItemWrapper = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
113
115
|
outline: none;
|
|
114
116
|
border-top: 1px solid var(--search-item-border-color);
|
|
115
117
|
border-bottom: 1px solid var(--search-item-border-color);
|
|
118
|
+
border-radius: var(--search-item-border-radius);
|
|
116
119
|
|
|
117
120
|
${ReturnKeyIcon_1.ReturnKeyIcon} {
|
|
118
121
|
align-self: center;
|
|
@@ -97,6 +97,7 @@ const SearchRecentItem = styled_components_1.default.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
|
|
|
@@ -80,6 +80,7 @@ const SearchSuggestedItem = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
80
80
|
line-height: var(--search-suggested-item-line-height);
|
|
81
81
|
color: var(--search-suggested-item-text-color);
|
|
82
82
|
padding: var(--search-suggested-item-padding);
|
|
83
|
+
border-radius: var(--search-suggested-item-border-radius);
|
|
83
84
|
cursor: pointer;
|
|
84
85
|
|
|
85
86
|
&:hover {
|
|
@@ -11,7 +11,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
11
11
|
--search-modal-min-height: 705px;
|
|
12
12
|
--search-modal-bg-color: var(--modal-bg-color);
|
|
13
13
|
--search-modal-box-shadow: var(--modal-box-shadow);
|
|
14
|
-
--search-modal-border-radius: var(--border-radius-
|
|
14
|
+
--search-modal-border-radius: var(--border-radius-xxl);
|
|
15
15
|
--search-modal-border: 1px solid var(--border-color-secondary);
|
|
16
16
|
|
|
17
17
|
--search-modal-header-bg-color: var(--bg-color-tonal); // @presenter Color
|
|
@@ -35,7 +35,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
35
35
|
--search-input-gap: var(--spacing-sm);
|
|
36
36
|
--search-input-height: 40px;
|
|
37
37
|
--search-input-border: none;
|
|
38
|
-
--search-input-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
38
|
+
--search-input-border-radius: var(--border-radius-xl); // @presenter BorderRadius
|
|
39
39
|
|
|
40
40
|
--search-group-title-padding: var(--spacing-sm);
|
|
41
41
|
--search-group-title-bg-color: var(--bg-color-tonal); // @presenter Color
|
|
@@ -54,6 +54,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
54
54
|
--search-item-bg-color-hover: var(--layer-color-ontonal-hover); // @presenter Color
|
|
55
55
|
--search-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
56
56
|
--search-item-border-color: transparent; // @presenter Color
|
|
57
|
+
--search-item-border-radius: var(--border-radius-lg);
|
|
57
58
|
--search-item-padding: var(--spacing-sm) var(--spacing-lg);
|
|
58
59
|
--search-item-gap: var(--spacing-xxs);
|
|
59
60
|
--search-item-product-icon-size: 16px;
|
|
@@ -72,6 +73,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
72
73
|
--search-recent-item-title-padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xxs) var(--spacing-lg); // @presenter Color
|
|
73
74
|
--search-recent-item-bg-color-active: var(--layer-color); // @presenter Color
|
|
74
75
|
--search-recent-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
76
|
+
--search-recent-item-border-radius: var(--search-item-border-radius);
|
|
75
77
|
|
|
76
78
|
--search-suggested-item-font-size: var(--font-size-base); // @presenter FontSize
|
|
77
79
|
--search-suggested-item-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
@@ -87,6 +89,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
87
89
|
--search-suggested-item-title-padding: var(--spacing-md) var(--spacing-lg) var(--spacing-xxs) var(--spacing-lg); // @presenter Color
|
|
88
90
|
--search-suggested-item-bg-color-active: var(--layer-color); // @presenter Color
|
|
89
91
|
--search-suggested-item-border-color-focused: var(--color-blue-4); // @presenter Color
|
|
92
|
+
--search-suggested-item-border-radius: var(--search-item-border-radius);
|
|
90
93
|
|
|
91
94
|
--search-shortcuts-gap: var(--spacing-xs);
|
|
92
95
|
|
|
@@ -95,6 +98,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
95
98
|
--search-message-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
96
99
|
--search-message-text-color: var(--text-color-secondary); // @presenter Color
|
|
97
100
|
--search-message-gap: var(--spacing-md);
|
|
101
|
+
--search-message-padding: var(--spacing-md);
|
|
98
102
|
|
|
99
103
|
--search-header-buttons-gap: var(--spacing-sm);
|
|
100
104
|
--search-header-buttons-padding-left: var(--spacing-sm);
|
|
@@ -134,7 +138,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
134
138
|
--search-trigger-border-style: var(--border-style);
|
|
135
139
|
--search-trigger-border-color: var(--input-border-color);
|
|
136
140
|
--search-trigger-border-color-hover: var(--input-border-color-hover);
|
|
137
|
-
--search-trigger-border-radius: var(--border-radius-
|
|
141
|
+
--search-trigger-border-radius: var(--border-radius-lg);
|
|
138
142
|
--search-trigger-padding-vertical: var(--input-padding-vertical);
|
|
139
143
|
--search-trigger-padding-horizontal: var(--input-padding-horizontal);
|
|
140
144
|
--search-trigger-padding: var(--search-trigger-padding-vertical) var(--search-trigger-padding-horizontal);
|
|
@@ -245,7 +249,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
245
249
|
--search-ai-conversation-input-bg-color-disabled: var(--color-warm-grey-1);
|
|
246
250
|
--search-ai-conversation-input-padding: var(--spacing-sm) var(--spacing-md);
|
|
247
251
|
--search-ai-conversation-input-border: 1px solid var(--border-color-secondary);
|
|
248
|
-
--search-ai-conversation-input-border-radius: var(--border-radius-
|
|
252
|
+
--search-ai-conversation-input-border-radius: var(--border-radius-xl);
|
|
249
253
|
--search-ai-conversation-input-font-size: var(--font-size-base);
|
|
250
254
|
--search-ai-conversation-input-placeholder-color: var(--search-input-placeholder-color);
|
|
251
255
|
--search-ai-conversation-input-border-color-focus: var(--color-primary-base, var(--search-ai-conversation-input-border-color-focus-legacy));
|
|
@@ -253,7 +257,7 @@ exports.search = (0, styled_components_1.css) `
|
|
|
253
257
|
|
|
254
258
|
--search-ai-conversation-input-send-button-right: 12px;
|
|
255
259
|
--search-ai-conversation-input-send-button-padding: 5px;
|
|
256
|
-
--search-ai-conversation-input-send-button-border-radius: var(--border-radius);
|
|
260
|
+
--search-ai-conversation-input-send-button-border-radius: var(--border-radius-md);
|
|
257
261
|
--search-ai-conversation-input-send-button-border-disabled: 1px solid var(--button-border-color-disabled);
|
|
258
262
|
|
|
259
263
|
--search-ai-conversation-input-min-height: 48px;
|
|
@@ -38,7 +38,7 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
39
39
|
const typed_memo_1 = require("../../core/hoc/typed-memo");
|
|
40
40
|
function SegmentedComponent({ options, onChange, value, className = '', size = 'regular' }, ref) {
|
|
41
|
-
return (react_1.default.createElement(SegmentedGroup, { ref: ref, "data-component-name": "Segmented/Segmented", className: `tag-grey ${size} ${className}`, role: "tablist" }, options.map((opt, index) => (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
41
|
+
return (react_1.default.createElement(SegmentedGroup, { ref: ref, "data-component-name": "Segmented/Segmented", className: `tag-grey ${size} ${className}`, role: "tablist", $size: size }, options.map((opt, index) => (react_1.default.createElement(react_1.default.Fragment, { key: index },
|
|
42
42
|
opt.divider,
|
|
43
43
|
react_1.default.createElement(SegmentedItem, { key: opt.label, role: "tab", title: opt.label, onClick: () => onChange(opt), $isActive: value == opt.value, $size: size }, opt.element || opt.label))))));
|
|
44
44
|
}
|
|
@@ -48,7 +48,7 @@ const SegmentedGroup = styled_components_1.default.div `
|
|
|
48
48
|
background: var(--segmented-buttons-bg-color-main);
|
|
49
49
|
padding: calc(var(--spacing-xxs) / 2);
|
|
50
50
|
gap: calc(var(--spacing-xxs) / 2);
|
|
51
|
-
border-radius: var(--border-radius-md);
|
|
51
|
+
border-radius: ${({ $size }) => $size === 'small' ? 'var(--border-radius-md)' : 'var(--border-radius-lg)'};
|
|
52
52
|
max-width: 100%;
|
|
53
53
|
width: fit-content;
|
|
54
54
|
`;
|
|
@@ -75,7 +75,7 @@ const SegmentedItem = styled_components_1.default.button `
|
|
|
75
75
|
cursor: pointer;
|
|
76
76
|
`}
|
|
77
77
|
line-height: var(--segmented-line-height);
|
|
78
|
-
border-radius: var(--border-radius);
|
|
78
|
+
border-radius: ${({ $size }) => $size === 'small' ? 'var(--border-radius)' : 'var(--border-radius-md)'};
|
|
79
79
|
padding: ${({ $size }) => ($size === 'small' ? 0 : '3px')} var(--spacing-sm);
|
|
80
80
|
white-space: nowrap;
|
|
81
81
|
text-overflow: ellipsis;
|
|
@@ -71,32 +71,39 @@ function Select(props) {
|
|
|
71
71
|
(0, hooks_1.useOutsideClick)(selectRef, () => {
|
|
72
72
|
setDropdownActive(false);
|
|
73
73
|
});
|
|
74
|
-
(0, react_1.
|
|
74
|
+
const [prevOptions, setPrevOptions] = (0, react_1.useState)(options);
|
|
75
|
+
const [prevValue, setPrevValue] = (0, react_1.useState)(value);
|
|
76
|
+
const [prevMultiple, setPrevMultiple] = (0, react_1.useState)(multiple);
|
|
77
|
+
if (prevOptions !== options) {
|
|
78
|
+
setPrevOptions(options);
|
|
75
79
|
setFilteredOptions(options);
|
|
76
|
-
}
|
|
77
|
-
(
|
|
80
|
+
}
|
|
81
|
+
if (prevValue !== value || prevMultiple !== multiple) {
|
|
82
|
+
setPrevValue(value);
|
|
83
|
+
setPrevMultiple(multiple);
|
|
78
84
|
setSelectedOptions(getSelectedOptionsFromPropsValue());
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
}
|
|
86
|
+
const changeSearchValue = (newSearchValue) => {
|
|
87
|
+
if (newSearchValue === searchValue) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
setSearchValue(newSearchValue);
|
|
82
91
|
if (onSearch) {
|
|
83
|
-
onSearch
|
|
92
|
+
onSearch(newSearchValue);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (typeof newSearchValue === 'string') {
|
|
96
|
+
setFilteredOptions(options.filter((option) => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const valueForSearch = String((_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.value) !== null && _b !== void 0 ? _b : '');
|
|
99
|
+
return (!valueForSearch ||
|
|
100
|
+
valueForSearch.toLowerCase().indexOf(newSearchValue.toLowerCase()) > -1);
|
|
101
|
+
}));
|
|
84
102
|
}
|
|
85
103
|
else {
|
|
86
|
-
|
|
87
|
-
const filteredOptions = options.filter((option) => {
|
|
88
|
-
var _a, _b;
|
|
89
|
-
const valueForSearch = String((_b = (_a = option.label) !== null && _a !== void 0 ? _a : option.value) !== null && _b !== void 0 ? _b : '');
|
|
90
|
-
return (!valueForSearch || valueForSearch.toLowerCase().indexOf(searchValue.toLowerCase()) > -1);
|
|
91
|
-
});
|
|
92
|
-
setFilteredOptions(filteredOptions);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
setFilteredOptions(options);
|
|
96
|
-
}
|
|
104
|
+
setFilteredOptions(options);
|
|
97
105
|
}
|
|
98
|
-
|
|
99
|
-
}, [searchValue]);
|
|
106
|
+
};
|
|
100
107
|
const selectHandler = (selectedOption) => {
|
|
101
108
|
var _a;
|
|
102
109
|
const newSelectedOptions = multiple
|
|
@@ -113,7 +120,7 @@ function Select(props) {
|
|
|
113
120
|
: '';
|
|
114
121
|
setSelectedOptions(newSelectedOptions);
|
|
115
122
|
onChange === null || onChange === void 0 ? void 0 : onChange(newSelectedValues);
|
|
116
|
-
|
|
123
|
+
changeSearchValue(null);
|
|
117
124
|
setDropdownActive(false);
|
|
118
125
|
if (!multiple) {
|
|
119
126
|
setStickyInputValue('');
|
|
@@ -122,7 +129,7 @@ function Select(props) {
|
|
|
122
129
|
};
|
|
123
130
|
const searchHandler = (e) => {
|
|
124
131
|
const targetValue = e.target.value;
|
|
125
|
-
|
|
132
|
+
changeSearchValue(targetValue);
|
|
126
133
|
setDropdownActive(true);
|
|
127
134
|
};
|
|
128
135
|
const clearHandler = (option) => {
|
|
@@ -146,7 +153,7 @@ function Select(props) {
|
|
|
146
153
|
if (!e.relatedTarget || ((_b = e.relatedTarget) === null || _b === void 0 ? void 0 : _b.id) !== inputId) {
|
|
147
154
|
setDropdownActive(false);
|
|
148
155
|
}
|
|
149
|
-
|
|
156
|
+
changeSearchValue(null);
|
|
150
157
|
setStickyInputValue('');
|
|
151
158
|
}
|
|
152
159
|
};
|
|
@@ -10,7 +10,7 @@ exports.select = (0, styled_components_1.css) `
|
|
|
10
10
|
--select-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
11
11
|
--select-line-height: var(--line-height-base); // @presenter LineHeight
|
|
12
12
|
--select-text-color: var(--text-color-secondary); // @presenter Color
|
|
13
|
-
--select-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
13
|
+
--select-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
14
14
|
--select-border: var(--border-width) var(--border-style) var(--border-color-primary); // @presenter Border
|
|
15
15
|
|
|
16
16
|
--select-input-padding-vertical: 6px; // @presenter Spacing
|
|
@@ -18,7 +18,7 @@ exports.select = (0, styled_components_1.css) `
|
|
|
18
18
|
--select-input-padding: var(--select-input-padding-vertical) var(--select-input-padding-horizontal);
|
|
19
19
|
--select-input-gap: var(--spacing-xs); // @presenter Spacing
|
|
20
20
|
--select-input-value-gap: var(--spacing-unit); // @presenter Spacing
|
|
21
|
-
--select-input-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
21
|
+
--select-input-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
22
22
|
--select-input-font-size: var(--font-size-base); // @presenter FontSize
|
|
23
23
|
--select-input-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
24
24
|
--select-input-line-height: var(--line-height-base); // @presenter LineHeight
|
|
@@ -37,7 +37,7 @@ exports.select = (0, styled_components_1.css) `
|
|
|
37
37
|
--select-list-item-padding: var(--select-list-item-padding-vertical) var(--select-list-item-padding-horizontal);
|
|
38
38
|
|
|
39
39
|
--select-list-item-gap: var(--spacing-xs); // @presenter Spacing
|
|
40
|
-
--select-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
40
|
+
--select-list-item-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
41
41
|
--select-list-item-bg-color-active: transparent; // @presenter Color
|
|
42
42
|
--select-list-item-bg-color-hover: var(--menu-item-bg-color-hover); // @presenter Color
|
|
43
43
|
--select-list-item-font-weight-active: var(--font-weight-medium); // @presenter Color
|
|
@@ -1,54 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
exports.SidebarHeader = void 0;
|
|
40
7
|
exports.Sidebar = Sidebar;
|
|
41
|
-
const react_1 =
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
42
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
43
10
|
const utils_1 = require("../../core/utils");
|
|
44
11
|
const hooks_1 = require("../../core/hooks");
|
|
45
12
|
const MenuContainer_1 = require("../../components/Menu/MenuContainer");
|
|
46
13
|
function Sidebar({ versions, menu, footer, header, growContent, collapsed, className, menuItemsAnimation, }) {
|
|
47
14
|
const { isOpen } = (0, hooks_1.useMobileMenu)();
|
|
48
|
-
const
|
|
49
|
-
(0, react_1.useEffect)(() => {
|
|
50
|
-
setMappedCollapsed(collapsed && !isOpen);
|
|
51
|
-
}, [isOpen, collapsed, setMappedCollapsed]);
|
|
15
|
+
const mappedCollapsed = collapsed && !isOpen;
|
|
52
16
|
const { sidebar } = (0, hooks_1.useThemeConfig)();
|
|
53
17
|
if (sidebar === null || sidebar === void 0 ? void 0 : sidebar.hide) {
|
|
54
18
|
return null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ComponentProps, JSX } from 'react';
|
|
3
|
+
import type { ButtonProps } from '../../components/Button/Button';
|
|
4
|
+
import type { ButtonGroupSize, ButtonGroupVariant } from '../../core/types';
|
|
5
|
+
import { Dropdown } from '../../components/Dropdown/Dropdown';
|
|
6
|
+
export type SplitButtonProps = {
|
|
7
|
+
button: React.ReactElement<ButtonProps>;
|
|
8
|
+
children: ComponentProps<typeof Dropdown>['children'];
|
|
9
|
+
variant?: ButtonGroupVariant;
|
|
10
|
+
size?: ButtonGroupSize;
|
|
11
|
+
placement?: 'top' | 'bottom';
|
|
12
|
+
alignment?: 'start' | 'end';
|
|
13
|
+
portalled?: boolean;
|
|
14
|
+
closeOnSelect?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
toggleAriaLabel: string;
|
|
17
|
+
onOpen?: () => void;
|
|
18
|
+
onClose?: () => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function SplitButton(props: SplitButtonProps): JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.SplitButton = SplitButton;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Button_1 = require("../../components/Button/Button");
|
|
10
|
+
const ButtonGroup_1 = require("../../components/Button/ButtonGroup");
|
|
11
|
+
const Dropdown_1 = require("../../components/Dropdown/Dropdown");
|
|
12
|
+
function SplitButton(props) {
|
|
13
|
+
const { button, children, variant, size, placement = 'bottom', alignment = 'end', portalled, closeOnSelect = true, disabled, toggleAriaLabel, onOpen, onClose, className, } = props;
|
|
14
|
+
const hasMenu = typeof children === 'function' || react_1.default.Children.toArray(children).length > 0;
|
|
15
|
+
return (react_1.default.createElement(SplitButtonWrapper, { "data-component-name": "SplitButton/SplitButton", className: className },
|
|
16
|
+
react_1.default.createElement(ButtonGroup_1.ButtonGroup, { variant: variant, size: size },
|
|
17
|
+
button,
|
|
18
|
+
hasMenu ? (react_1.default.createElement(ToggleDropdown, { closeOnClick: closeOnSelect, placement: placement, alignment: alignment, portalled: portalled, withArrow: true, onOpen: onOpen, onClose: onClose, trigger: react_1.default.createElement(Button_1.Button, { "aria-label": toggleAriaLabel, "aria-haspopup": "menu", variant: variant, size: size, disabled: disabled }) }, children)) : null)));
|
|
19
|
+
}
|
|
20
|
+
const SplitButtonWrapper = styled_components_1.default.div `
|
|
21
|
+
position: relative;
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
|
|
24
|
+
/* Themed button margins must not split the group apart. Direct-child chains
|
|
25
|
+
keep the rule off buttons rendered inside the dropdown menu. */
|
|
26
|
+
> * > .button,
|
|
27
|
+
> * > * > .button {
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
/* The non-portalled menu is absolutely positioned against the nearest positioned
|
|
32
|
+
ancestor; keep the dropdown segment static so that ancestor is the whole
|
|
33
|
+
split button rather than the toggle segment. */
|
|
34
|
+
const ToggleDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
35
|
+
position: static;
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=SplitButton.js.map
|
|
@@ -16,7 +16,7 @@ exports.switcherDarkMode = (0, styled_components_1.css) `
|
|
|
16
16
|
--switch-border-color-disabled: var(--color-warm-grey-5); // @presenter Color
|
|
17
17
|
--switch-border-color-selected: var(--color-primary-base, var(--switch-border-color-selected-legacy)); // @presenter Color
|
|
18
18
|
--switch-border-width: var(--border-width); // @presenter Border
|
|
19
|
-
--switch-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
19
|
+
--switch-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
20
20
|
|
|
21
21
|
--switch-width: 32px; // @presenter Width
|
|
22
22
|
--switch-height: 18px; // @presenter Height
|
|
@@ -29,7 +29,7 @@ exports.switcherDarkMode = (0, styled_components_1.css) `
|
|
|
29
29
|
--switch-knob-bg-color-selected: var(--color-static-white); // @presenter Color
|
|
30
30
|
--switch-knob-bg-color-disabled: var(--color-warm-grey-6); // @presenter Color
|
|
31
31
|
|
|
32
|
-
--switch-knob-border-radius:
|
|
32
|
+
--switch-knob-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
33
33
|
--switch-knob-height: 14px; // @presenter Height
|
|
34
34
|
--switch-knob-width: 14px; // @presenter Width
|
|
35
35
|
--switch-knob-transition: all 0.3s; // @presenter Transition
|
|
@@ -15,7 +15,7 @@ exports.switcher = (0, styled_components_1.css) `
|
|
|
15
15
|
--switch-border-color-pressed: transparent; // @presenter Color
|
|
16
16
|
--switch-border-color-disabled: transparent; // @presenter Color
|
|
17
17
|
--switch-border-color-selected: transparent; // @presenter Color
|
|
18
|
-
--switch-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
18
|
+
--switch-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
19
19
|
--switch-border-width: var(--border-width); // @presenter Border
|
|
20
20
|
|
|
21
21
|
--switch-width: 32px; // @presenter Width
|
|
@@ -29,7 +29,7 @@ exports.switcher = (0, styled_components_1.css) `
|
|
|
29
29
|
--switch-knob-bg-color-selected: var(--color-white); // @presenter Color
|
|
30
30
|
--switch-knob-bg-color-disabled: var(--color-warm-grey-1); // @presenter Color
|
|
31
31
|
|
|
32
|
-
--switch-knob-border-radius:
|
|
32
|
+
--switch-knob-border-radius: var(--border-radius-full); // @presenter BorderRadius
|
|
33
33
|
--switch-knob-height: 14px; // @presenter Height
|
|
34
34
|
--switch-knob-width: 14px; // @presenter Width
|
|
35
35
|
--switch-knob-transition: transform 0.3s; // @presenter Transition
|
|
@@ -10,9 +10,9 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
10
10
|
|
|
11
11
|
--tag-border-width: 1px; //@presenter Border
|
|
12
12
|
--tag-border-style: solid; //@presenter Border
|
|
13
|
-
--tag-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
13
|
+
--tag-border-radius: var(--border-radius-md); // @presenter BorderRadius
|
|
14
14
|
--tag-box-shadow: none; // @presenter Shadow
|
|
15
|
-
--tag-border-radius-focused: var(--border-radius); // @presenter BorderRadius
|
|
15
|
+
--tag-border-radius-focused: var(--tag-border-radius); // @presenter BorderRadius
|
|
16
16
|
|
|
17
17
|
--tag-status-dot-color-default: var(--color-persian-green-7);
|
|
18
18
|
--tag-badge-size: var(--spacing-xs);
|
|
@@ -15,7 +15,7 @@ exports.httpTag = (0, styled_components_1.css) `
|
|
|
15
15
|
--http-tag-bg-color: none;
|
|
16
16
|
|
|
17
17
|
--counter-tag-padding: 0px var(--spacing-xxs);
|
|
18
|
-
--counter-tag-border-radius: var(--border-radius);
|
|
18
|
+
--counter-tag-border-radius: var(--tag-border-radius);
|
|
19
19
|
--counter-tag-min-width: var(--spacing-md);
|
|
20
20
|
`;
|
|
21
21
|
//# sourceMappingURL=variables.js.map
|