@diplodoc/components 4.9.3 → 4.11.0
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/build/cjs/components/BookmarkButton/BookmarkButton.css.map +1 -1
- package/build/cjs/components/BookmarkButton/BookmarkButton.js.map +2 -2
- package/build/cjs/components/Breadcrumbs/Breadcrumbs.css.map +1 -1
- package/build/cjs/components/Breadcrumbs/Breadcrumbs.js.map +2 -2
- package/build/cjs/components/ConsentPopup/ConsentPopup.js +6 -1
- package/build/cjs/components/ConsentPopup/ConsentPopup.js.map +2 -2
- package/build/cjs/components/ContributorAvatars/Avatars/Avatar.js.map +2 -2
- package/build/cjs/components/ContributorAvatars/Avatars/Details.js.map +2 -2
- package/build/cjs/components/ContributorAvatars/Avatars/HiddenAvatars.js.map +2 -2
- package/build/cjs/components/ContributorAvatars/ContributorAvatars.css.map +1 -1
- package/build/cjs/components/ContributorAvatars/ContributorAvatars.js.map +2 -2
- package/build/cjs/components/ContributorAvatars/models.d.ts +0 -1
- package/build/cjs/components/Contributors/Contributors.css.map +1 -1
- package/build/cjs/components/Contributors/Contributors.js.map +2 -2
- package/build/cjs/components/Control/Control.css.map +1 -1
- package/build/cjs/components/Control/Control.js.map +2 -2
- package/build/cjs/components/Controls/Controls.css.map +1 -1
- package/build/cjs/components/Controls/Controls.js.map +2 -2
- package/build/cjs/components/Controls/ControlsLayout.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/DividerControl/DividerControl.css.map +1 -1
- package/build/cjs/components/Controls/single-controls/DividerControl/DividerControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/EditControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/FullScreenControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/LangControl/LangControl.css.map +1 -1
- package/build/cjs/components/Controls/single-controls/LangControl/LangControl.js +3 -0
- package/build/cjs/components/Controls/single-controls/LangControl/LangControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/PdfControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/SettingsControl/SettingsControl.css +1 -3
- package/build/cjs/components/Controls/single-controls/SettingsControl/SettingsControl.css.map +2 -2
- package/build/cjs/components/Controls/single-controls/SettingsControl/SettingsControl.js.map +2 -2
- package/build/cjs/components/Controls/single-controls/SinglePageControl.js.map +2 -2
- package/build/cjs/components/DocContentPage/DocContentPage.js.map +2 -2
- package/build/cjs/components/DocLayout/DocLayout.css +3 -2
- package/build/cjs/components/DocLayout/DocLayout.css.map +3 -3
- package/build/cjs/components/DocLayout/DocLayout.d.ts +3 -3
- package/build/cjs/components/DocLayout/DocLayout.js +1 -1
- package/build/cjs/components/DocLayout/DocLayout.js.map +2 -2
- package/build/cjs/components/DocLeadingPage/DocLeadingPage.css.map +1 -1
- package/build/cjs/components/DocLeadingPage/DocLeadingPage.js.map +2 -2
- package/build/cjs/components/DocPage/DocPage.css.map +1 -1
- package/build/cjs/components/DocPage/DocPage.js +2 -2
- package/build/cjs/components/DocPage/DocPage.js.map +2 -2
- package/build/cjs/components/DocPageTitle/DocPageTitle.css.map +1 -1
- package/build/cjs/components/DocPageTitle/DocPageTitle.js.map +2 -2
- package/build/cjs/components/ErrorBoundary/ErrorBoundary.js.map +2 -2
- package/build/cjs/components/ErrorPage/ErrorPage.css.map +1 -1
- package/build/cjs/components/ErrorPage/ErrorPage.js.map +2 -2
- package/build/cjs/components/Feedback/Feedback.css +0 -4
- package/build/cjs/components/Feedback/Feedback.css.map +2 -2
- package/build/cjs/components/Feedback/Feedback.js +5 -2
- package/build/cjs/components/Feedback/Feedback.js.map +2 -2
- package/build/cjs/components/Feedback/controls/DislikeControl.d.ts +1 -0
- package/build/cjs/components/Feedback/controls/DislikeControl.js +34 -19
- package/build/cjs/components/Feedback/controls/DislikeControl.js.map +2 -2
- package/build/cjs/components/Feedback/controls/DislikeVariantsPopup.js.map +2 -2
- package/build/cjs/components/Feedback/controls/LikeControl.d.ts +2 -1
- package/build/cjs/components/Feedback/controls/LikeControl.js +32 -27
- package/build/cjs/components/Feedback/controls/LikeControl.js.map +2 -2
- package/build/cjs/components/Feedback/controls/SuccessPopup.js.map +2 -2
- package/build/cjs/components/Mark/Mark.css.map +1 -1
- package/build/cjs/components/Mark/Mark.js.map +2 -2
- package/build/cjs/components/MiniToc/MiniToc.css.map +3 -3
- package/build/cjs/components/MiniToc/MiniToc.js.map +2 -2
- package/build/cjs/components/Paginator/Paginator.css.map +1 -1
- package/build/cjs/components/Paginator/Paginator.js.map +2 -2
- package/build/cjs/components/Scrollspy/Scrollspy.js.map +2 -2
- package/build/cjs/components/SearchBar/SearchBar.css.map +1 -1
- package/build/cjs/components/SearchBar/SearchBar.js.map +2 -2
- package/build/cjs/components/SearchBar/hooks.js +2 -2
- package/build/cjs/components/SearchBar/hooks.js.map +2 -2
- package/build/cjs/components/SearchItem/SearchItem.css.map +1 -1
- package/build/cjs/components/SearchItem/SearchItem.js.map +2 -2
- package/build/cjs/components/SearchPage/SearchPage.css.map +1 -1
- package/build/cjs/components/SearchPage/SearchPage.js.map +2 -2
- package/build/cjs/components/SearchSuggest/SearchInput.d.ts +19 -0
- package/build/cjs/components/SearchSuggest/SearchInput.js +96 -0
- package/build/cjs/components/SearchSuggest/SearchInput.js.map +7 -0
- package/build/cjs/components/SearchSuggest/Suggest.d.ts +18 -0
- package/build/cjs/components/SearchSuggest/Suggest.js +112 -0
- package/build/cjs/components/SearchSuggest/Suggest.js.map +7 -0
- package/build/cjs/components/SearchSuggest/SuggestItem.d.ts +3 -0
- package/build/cjs/components/SearchSuggest/SuggestItem.js +60 -0
- package/build/cjs/components/SearchSuggest/SuggestItem.js.map +7 -0
- package/build/cjs/components/SearchSuggest/index.css +132 -0
- package/build/cjs/components/SearchSuggest/index.css.map +7 -0
- package/build/cjs/components/SearchSuggest/index.d.ts +18 -0
- package/build/cjs/components/SearchSuggest/index.js +150 -0
- package/build/cjs/components/SearchSuggest/index.js.map +7 -0
- package/build/cjs/components/SearchSuggest/types.d.ts +53 -0
- package/build/cjs/components/SearchSuggest/types.js +34 -0
- package/build/cjs/components/SearchSuggest/types.js.map +7 -0
- package/build/cjs/components/SearchSuggest/useFocus.d.ts +14 -0
- package/build/cjs/components/SearchSuggest/useFocus.js +48 -0
- package/build/cjs/components/SearchSuggest/useFocus.js.map +7 -0
- package/build/cjs/components/SearchSuggest/useProvider.d.ts +6 -0
- package/build/cjs/components/SearchSuggest/useProvider.js +133 -0
- package/build/cjs/components/SearchSuggest/useProvider.js.map +7 -0
- package/build/cjs/components/Subscribe/Subscribe.css +0 -4
- package/build/cjs/components/Subscribe/Subscribe.css.map +2 -2
- package/build/cjs/components/Subscribe/Subscribe.js +32 -25
- package/build/cjs/components/Subscribe/Subscribe.js.map +2 -2
- package/build/cjs/components/Subscribe/SubscribeSuccessPopup/SubscribeSuccessPopup.d.ts +1 -1
- package/build/cjs/components/Subscribe/SubscribeSuccessPopup/SubscribeSuccessPopup.js.map +2 -2
- package/build/cjs/components/Subscribe/SubscribeVariantsPopup/SubscribeVariantsPopup.d.ts +2 -2
- package/build/cjs/components/Subscribe/SubscribeVariantsPopup/SubscribeVariantsPopup.js.map +2 -2
- package/build/cjs/components/Subscribe/utils.d.ts +1 -1
- package/build/cjs/components/Toc/Toc.css.map +1 -1
- package/build/cjs/components/Toc/Toc.d.ts +2 -2
- package/build/cjs/components/Toc/Toc.js +21 -2
- package/build/cjs/components/Toc/Toc.js.map +2 -2
- package/build/cjs/components/TocItem/TocItem.css.map +1 -1
- package/build/cjs/components/TocItem/TocItem.d.ts +1 -6
- package/build/cjs/components/TocItem/TocItem.js +20 -39
- package/build/cjs/components/TocItem/TocItem.js.map +2 -2
- package/build/cjs/components/TocLable/TocLabel.css.map +1 -1
- package/build/cjs/components/TocLable/TocLabel.js.map +2 -2
- package/build/cjs/components/TocNavPanel/TocNavPanel.css.map +1 -1
- package/build/cjs/components/TocNavPanel/TocNavPanel.js.map +2 -2
- package/build/cjs/components/ToggleArrow/ToggleArrow.css.map +1 -1
- package/build/cjs/components/ToggleArrow/ToggleArrow.js.map +2 -2
- package/build/cjs/components/UpdatedAtDate/UpdatedAtDate.css.map +1 -1
- package/build/cjs/components/UpdatedAtDate/UpdatedAtDate.js.map +2 -2
- package/build/cjs/hooks/index.d.ts +1 -0
- package/build/cjs/hooks/index.js +1 -0
- package/build/cjs/hooks/index.js.map +2 -2
- package/build/cjs/hooks/useAnalytics.d.ts +1 -0
- package/build/cjs/hooks/useAnalytics.js +0 -1
- package/build/cjs/hooks/useAnalytics.js.map +2 -2
- package/build/cjs/hooks/usePopper.js.map +2 -2
- package/build/cjs/hooks/usePopupState.d.ts +1 -1
- package/build/cjs/hooks/useVirtualElementRef.d.ts +32 -0
- package/build/cjs/hooks/useVirtualElementRef.js +107 -0
- package/build/cjs/hooks/useVirtualElementRef.js.map +7 -0
- package/build/cjs/i18n/index.d.ts +18 -0
- package/build/cjs/i18n/index.js +11 -2
- package/build/cjs/i18n/index.js.map +2 -2
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +2 -2
- package/build/cjs/models/index.d.ts +3 -4
- package/build/cjs/models/index.js.map +1 -1
- package/build/cjs/utils/index.d.ts +1 -2
- package/build/cjs/utils/index.js.map +2 -2
- package/build/esm/components/BookmarkButton/BookmarkButton.css.map +1 -1
- package/build/esm/components/BookmarkButton/BookmarkButton.js.map +2 -2
- package/build/esm/components/Breadcrumbs/Breadcrumbs.css.map +1 -1
- package/build/esm/components/Breadcrumbs/Breadcrumbs.js.map +2 -2
- package/build/esm/components/ConsentPopup/ConsentPopup.js +6 -1
- package/build/esm/components/ConsentPopup/ConsentPopup.js.map +2 -2
- package/build/esm/components/ContributorAvatars/Avatars/Avatar.js.map +2 -2
- package/build/esm/components/ContributorAvatars/Avatars/Details.js.map +2 -2
- package/build/esm/components/ContributorAvatars/Avatars/HiddenAvatars.js.map +2 -2
- package/build/esm/components/ContributorAvatars/ContributorAvatars.css.map +1 -1
- package/build/esm/components/ContributorAvatars/ContributorAvatars.js.map +2 -2
- package/build/esm/components/ContributorAvatars/models.d.ts +0 -1
- package/build/esm/components/Contributors/Contributors.css.map +1 -1
- package/build/esm/components/Contributors/Contributors.js.map +2 -2
- package/build/esm/components/Control/Control.css.map +1 -1
- package/build/esm/components/Control/Control.js.map +2 -2
- package/build/esm/components/Controls/Controls.css.map +1 -1
- package/build/esm/components/Controls/Controls.js.map +2 -2
- package/build/esm/components/Controls/ControlsLayout.js.map +2 -2
- package/build/esm/components/Controls/single-controls/DividerControl/DividerControl.css.map +1 -1
- package/build/esm/components/Controls/single-controls/DividerControl/DividerControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/EditControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/FullScreenControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/LangControl/LangControl.css.map +1 -1
- package/build/esm/components/Controls/single-controls/LangControl/LangControl.js +3 -0
- package/build/esm/components/Controls/single-controls/LangControl/LangControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/PdfControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/SettingsControl/SettingsControl.css +1 -3
- package/build/esm/components/Controls/single-controls/SettingsControl/SettingsControl.css.map +2 -2
- package/build/esm/components/Controls/single-controls/SettingsControl/SettingsControl.js.map +2 -2
- package/build/esm/components/Controls/single-controls/SinglePageControl.js.map +2 -2
- package/build/esm/components/DocContentPage/DocContentPage.js.map +2 -2
- package/build/esm/components/DocLayout/DocLayout.css +3 -2
- package/build/esm/components/DocLayout/DocLayout.css.map +3 -3
- package/build/esm/components/DocLayout/DocLayout.d.ts +3 -3
- package/build/esm/components/DocLayout/DocLayout.js +1 -1
- package/build/esm/components/DocLayout/DocLayout.js.map +2 -2
- package/build/esm/components/DocLeadingPage/DocLeadingPage.css.map +1 -1
- package/build/esm/components/DocLeadingPage/DocLeadingPage.js.map +2 -2
- package/build/esm/components/DocPage/DocPage.css.map +1 -1
- package/build/esm/components/DocPage/DocPage.js +2 -2
- package/build/esm/components/DocPage/DocPage.js.map +2 -2
- package/build/esm/components/DocPageTitle/DocPageTitle.css.map +1 -1
- package/build/esm/components/DocPageTitle/DocPageTitle.js.map +2 -2
- package/build/esm/components/ErrorBoundary/ErrorBoundary.js.map +2 -2
- package/build/esm/components/ErrorPage/ErrorPage.css.map +1 -1
- package/build/esm/components/ErrorPage/ErrorPage.js.map +2 -2
- package/build/esm/components/Feedback/Feedback.css +0 -4
- package/build/esm/components/Feedback/Feedback.css.map +2 -2
- package/build/esm/components/Feedback/Feedback.js +5 -2
- package/build/esm/components/Feedback/Feedback.js.map +2 -2
- package/build/esm/components/Feedback/controls/DislikeControl.d.ts +1 -0
- package/build/esm/components/Feedback/controls/DislikeControl.js +34 -19
- package/build/esm/components/Feedback/controls/DislikeControl.js.map +2 -2
- package/build/esm/components/Feedback/controls/DislikeVariantsPopup.js.map +2 -2
- package/build/esm/components/Feedback/controls/LikeControl.d.ts +2 -1
- package/build/esm/components/Feedback/controls/LikeControl.js +32 -27
- package/build/esm/components/Feedback/controls/LikeControl.js.map +2 -2
- package/build/esm/components/Feedback/controls/SuccessPopup.js.map +2 -2
- package/build/esm/components/Mark/Mark.css.map +1 -1
- package/build/esm/components/Mark/Mark.js.map +2 -2
- package/build/esm/components/MiniToc/MiniToc.css.map +3 -3
- package/build/esm/components/MiniToc/MiniToc.js.map +2 -2
- package/build/esm/components/Paginator/Paginator.css.map +1 -1
- package/build/esm/components/Paginator/Paginator.js.map +2 -2
- package/build/esm/components/Scrollspy/Scrollspy.js.map +2 -2
- package/build/esm/components/SearchBar/SearchBar.css.map +1 -1
- package/build/esm/components/SearchBar/SearchBar.js.map +2 -2
- package/build/esm/components/SearchBar/hooks.js +2 -2
- package/build/esm/components/SearchBar/hooks.js.map +2 -2
- package/build/esm/components/SearchItem/SearchItem.css.map +1 -1
- package/build/esm/components/SearchItem/SearchItem.js.map +2 -2
- package/build/esm/components/SearchPage/SearchPage.css.map +1 -1
- package/build/esm/components/SearchPage/SearchPage.js.map +2 -2
- package/build/esm/components/SearchSuggest/SearchInput.d.ts +19 -0
- package/build/esm/components/SearchSuggest/SearchInput.js +68 -0
- package/build/esm/components/SearchSuggest/SearchInput.js.map +7 -0
- package/build/esm/components/SearchSuggest/Suggest.d.ts +18 -0
- package/build/esm/components/SearchSuggest/Suggest.js +84 -0
- package/build/esm/components/SearchSuggest/Suggest.js.map +7 -0
- package/build/esm/components/SearchSuggest/SuggestItem.d.ts +3 -0
- package/build/esm/components/SearchSuggest/SuggestItem.js +29 -0
- package/build/esm/components/SearchSuggest/SuggestItem.js.map +7 -0
- package/build/esm/components/SearchSuggest/index.css +132 -0
- package/build/esm/components/SearchSuggest/index.css.map +7 -0
- package/build/esm/components/SearchSuggest/index.d.ts +18 -0
- package/build/esm/components/SearchSuggest/index.js +129 -0
- package/build/esm/components/SearchSuggest/index.js.map +7 -0
- package/build/esm/components/SearchSuggest/types.d.ts +53 -0
- package/build/esm/components/SearchSuggest/types.js +13 -0
- package/build/esm/components/SearchSuggest/types.js.map +7 -0
- package/build/esm/components/SearchSuggest/useFocus.d.ts +14 -0
- package/build/esm/components/SearchSuggest/useFocus.js +27 -0
- package/build/esm/components/SearchSuggest/useFocus.js.map +7 -0
- package/build/esm/components/SearchSuggest/useProvider.d.ts +6 -0
- package/build/esm/components/SearchSuggest/useProvider.js +102 -0
- package/build/esm/components/SearchSuggest/useProvider.js.map +7 -0
- package/build/esm/components/Subscribe/Subscribe.css +0 -4
- package/build/esm/components/Subscribe/Subscribe.css.map +2 -2
- package/build/esm/components/Subscribe/Subscribe.js +32 -25
- package/build/esm/components/Subscribe/Subscribe.js.map +2 -2
- package/build/esm/components/Subscribe/SubscribeSuccessPopup/SubscribeSuccessPopup.d.ts +1 -1
- package/build/esm/components/Subscribe/SubscribeSuccessPopup/SubscribeSuccessPopup.js.map +2 -2
- package/build/esm/components/Subscribe/SubscribeVariantsPopup/SubscribeVariantsPopup.d.ts +2 -2
- package/build/esm/components/Subscribe/SubscribeVariantsPopup/SubscribeVariantsPopup.js.map +2 -2
- package/build/esm/components/Subscribe/utils.d.ts +1 -1
- package/build/esm/components/Toc/Toc.css.map +1 -1
- package/build/esm/components/Toc/Toc.d.ts +2 -2
- package/build/esm/components/Toc/Toc.js +21 -2
- package/build/esm/components/Toc/Toc.js.map +2 -2
- package/build/esm/components/TocItem/TocItem.css.map +1 -1
- package/build/esm/components/TocItem/TocItem.d.ts +1 -6
- package/build/esm/components/TocItem/TocItem.js +20 -39
- package/build/esm/components/TocItem/TocItem.js.map +2 -2
- package/build/esm/components/TocLable/TocLabel.css.map +1 -1
- package/build/esm/components/TocLable/TocLabel.js.map +2 -2
- package/build/esm/components/TocNavPanel/TocNavPanel.css.map +1 -1
- package/build/esm/components/TocNavPanel/TocNavPanel.js.map +2 -2
- package/build/esm/components/ToggleArrow/ToggleArrow.css.map +1 -1
- package/build/esm/components/ToggleArrow/ToggleArrow.js.map +2 -2
- package/build/esm/components/UpdatedAtDate/UpdatedAtDate.css.map +1 -1
- package/build/esm/components/UpdatedAtDate/UpdatedAtDate.js.map +2 -2
- package/build/esm/hooks/index.d.ts +1 -0
- package/build/esm/hooks/index.js +1 -0
- package/build/esm/hooks/index.js.map +2 -2
- package/build/esm/hooks/useAnalytics.d.ts +1 -0
- package/build/esm/hooks/useAnalytics.js +0 -2
- package/build/esm/hooks/useAnalytics.js.map +2 -2
- package/build/esm/hooks/usePopper.js.map +2 -2
- package/build/esm/hooks/usePopupState.d.ts +1 -1
- package/build/esm/hooks/useVirtualElementRef.d.ts +32 -0
- package/build/esm/hooks/useVirtualElementRef.js +89 -0
- package/build/esm/hooks/useVirtualElementRef.js.map +7 -0
- package/build/esm/i18n/index.d.ts +18 -0
- package/build/esm/i18n/index.js +11 -2
- package/build/esm/i18n/index.js.map +2 -2
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +2 -2
- package/build/esm/models/index.d.ts +3 -4
- package/build/esm/models/index.js.map +1 -1
- package/build/esm/utils/index.d.ts +1 -2
- package/build/esm/utils/index.js.map +2 -2
- package/build/index.css.map +1 -1
- package/build/themes/common/index.css.map +1 -1
- package/package.json +10 -45
- package/src/i18n/en.json +10 -1
- package/src/i18n/ru.json +10 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b2) => {
|
|
7
|
+
for (var prop in b2 || (b2 = {}))
|
|
8
|
+
if (__hasOwnProp.call(b2, prop))
|
|
9
|
+
__defNormalProp(a, prop, b2[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
12
|
+
if (__propIsEnum.call(b2, prop))
|
|
13
|
+
__defNormalProp(a, prop, b2[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/components/SearchSuggest/Suggest.tsx
|
|
19
|
+
import React, { forwardRef, memo, useEffect } from "react";
|
|
20
|
+
import { List, Loader } from "@gravity-ui/uikit";
|
|
21
|
+
import block from "bem-cn-lite";
|
|
22
|
+
import pick from "lodash/pick";
|
|
23
|
+
import { useTranslation } from "../../hooks";
|
|
24
|
+
import { useProvider } from "./useProvider";
|
|
25
|
+
import "./index.css";
|
|
26
|
+
var b = block("dc-search-suggest");
|
|
27
|
+
var SuggestLoader = memo(() => {
|
|
28
|
+
return /* @__PURE__ */ React.createElement("div", { className: b("loader") }, /* @__PURE__ */ React.createElement(Loader, null));
|
|
29
|
+
});
|
|
30
|
+
SuggestLoader.displayName = "SuggestLoader";
|
|
31
|
+
var SuggestEmpty = memo(({ query }) => {
|
|
32
|
+
const { t } = useTranslation("search-suggest");
|
|
33
|
+
return /* @__PURE__ */ React.createElement("div", { className: b("list", { empty: true }) }, t("search-suggest_not-found", { query }));
|
|
34
|
+
});
|
|
35
|
+
SuggestEmpty.displayName = "SuggestEmpty";
|
|
36
|
+
var SuggestList = memo(
|
|
37
|
+
forwardRef((props, ref) => {
|
|
38
|
+
const { id, items, renderItem, onItemClick, onChangeActive } = props;
|
|
39
|
+
return /* @__PURE__ */ React.createElement(
|
|
40
|
+
List,
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
id,
|
|
44
|
+
className: b("list"),
|
|
45
|
+
role: "listbox",
|
|
46
|
+
filterable: false,
|
|
47
|
+
virtualized: false,
|
|
48
|
+
items,
|
|
49
|
+
renderItem,
|
|
50
|
+
onItemClick,
|
|
51
|
+
onChangeActive
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
SuggestList.displayName = "SuggestList";
|
|
57
|
+
var Suggest = memo(
|
|
58
|
+
forwardRef((props, ref) => {
|
|
59
|
+
const { query, provider } = props;
|
|
60
|
+
const [items, suggest] = useProvider(provider);
|
|
61
|
+
useEffect(() => suggest(query), [query, suggest]);
|
|
62
|
+
if (!items) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
if (items instanceof Promise) {
|
|
66
|
+
return /* @__PURE__ */ React.createElement(SuggestLoader, null);
|
|
67
|
+
}
|
|
68
|
+
if (Array.isArray(items) && !items.length) {
|
|
69
|
+
return /* @__PURE__ */ React.createElement(SuggestEmpty, { query });
|
|
70
|
+
}
|
|
71
|
+
return /* @__PURE__ */ React.createElement(
|
|
72
|
+
SuggestList,
|
|
73
|
+
__spreadValues({
|
|
74
|
+
ref,
|
|
75
|
+
items
|
|
76
|
+
}, pick(props, ["id", "renderItem", "onItemClick", "onChangeActive"]))
|
|
77
|
+
);
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
Suggest.displayName = "Suggest";
|
|
81
|
+
export {
|
|
82
|
+
Suggest
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=Suggest.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/Suggest.tsx"],
|
|
4
|
+
"sourcesContent": ["import type {ReactNode} from 'react';\nimport type {SearchProvider, SearchSuggestItem} from './types';\n\nimport React, {forwardRef, memo, useEffect} from 'react';\nimport {List, ListItemData, Loader} from '@gravity-ui/uikit';\nimport block from 'bem-cn-lite';\nimport pick from 'lodash/pick';\n\nimport {useTranslation} from '../../hooks';\n\nimport {useProvider} from './useProvider';\nimport './index.scss';\n\nconst b = block('dc-search-suggest');\n\nconst SuggestLoader = memo(() => {\n return (\n <div className={b('loader')}>\n <Loader />\n </div>\n );\n});\n\nSuggestLoader.displayName = 'SuggestLoader';\n\nconst SuggestEmpty = memo<{query: string}>(({query}) => {\n const {t} = useTranslation('search-suggest');\n\n return (\n <div className={b('list', {empty: true})}>\n {t<string>('search-suggest_not-found', {query})}\n </div>\n );\n});\n\nSuggestEmpty.displayName = 'SuggestEmpty';\n\ntype SuggestListProps = {\n id: string;\n items: SearchSuggestItem[];\n renderItem: (item: SearchSuggestItem) => ReactNode;\n onItemClick: (\n item: ListItemData<SearchSuggestItem>,\n index?: number,\n fromKeyboard?: boolean,\n ) => boolean | void;\n onChangeActive: (index?: number) => void;\n};\n\nconst SuggestList = memo(\n forwardRef<List<SearchSuggestItem>, SuggestListProps>((props, ref) => {\n const {id, items, renderItem, onItemClick, onChangeActive} = props;\n\n return (\n <List\n ref={ref}\n id={id}\n className={b('list')}\n role={'listbox'}\n filterable={false}\n virtualized={false}\n items={items}\n renderItem={renderItem}\n onItemClick={onItemClick}\n onChangeActive={onChangeActive}\n />\n );\n }),\n);\n\nSuggestList.displayName = 'SuggestList';\n\ntype SuggestProps = {\n id: string;\n query: string;\n provider: SearchProvider;\n} & Omit<SuggestListProps, 'items'>;\n\nexport const Suggest = memo(\n forwardRef<List<SearchSuggestItem>, SuggestProps>((props, ref) => {\n const {query, provider} = props;\n const [items, suggest] = useProvider(provider);\n\n useEffect(() => suggest(query), [query, suggest]);\n\n if (!items) {\n return null;\n }\n\n if (items instanceof Promise) {\n return <SuggestLoader />;\n }\n\n if (Array.isArray(items) && !items.length) {\n return <SuggestEmpty query={query} />;\n }\n\n return (\n <SuggestList\n ref={ref}\n items={items}\n {...pick(props, ['id', 'renderItem', 'onItemClick', 'onChangeActive'])}\n />\n );\n }),\n);\n\nSuggest.displayName = 'Suggest';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAGA,OAAO,SAAQ,YAAY,MAAM,iBAAgB;AACjD,SAAQ,MAAoB,cAAa;AACzC,OAAO,WAAW;AAClB,OAAO,UAAU;AAEjB,SAAQ,sBAAqB;AAE7B,SAAQ,mBAAkB;AAC1B,OAAO;AAEP,IAAM,IAAI,MAAM,mBAAmB;AAEnC,IAAM,gBAAgB,KAAK,MAAM;AAC7B,SACI,oCAAC,SAAI,WAAW,EAAE,QAAQ,KACtB,oCAAC,YAAO,CACZ;AAER,CAAC;AAED,cAAc,cAAc;AAE5B,IAAM,eAAe,KAAsB,CAAC,EAAC,MAAK,MAAM;AACpD,QAAM,EAAC,EAAC,IAAI,eAAe,gBAAgB;AAE3C,SACI,oCAAC,SAAI,WAAW,EAAE,QAAQ,EAAC,OAAO,KAAI,CAAC,KAClC,EAAU,4BAA4B,EAAC,MAAK,CAAC,CAClD;AAER,CAAC;AAED,aAAa,cAAc;AAc3B,IAAM,cAAc;AAAA,EAChB,WAAsD,CAAC,OAAO,QAAQ;AAClE,UAAM,EAAC,IAAI,OAAO,YAAY,aAAa,eAAc,IAAI;AAE7D,WACI;AAAA,MAAC;AAAA;AAAA,QACG;AAAA,QACA;AAAA,QACA,WAAW,EAAE,MAAM;AAAA,QACnB,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,aAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACJ;AAAA,EAER,CAAC;AACL;AAEA,YAAY,cAAc;AAQnB,IAAM,UAAU;AAAA,EACnB,WAAkD,CAAC,OAAO,QAAQ;AAC9D,UAAM,EAAC,OAAO,SAAQ,IAAI;AAC1B,UAAM,CAAC,OAAO,OAAO,IAAI,YAAY,QAAQ;AAE7C,cAAU,MAAM,QAAQ,KAAK,GAAG,CAAC,OAAO,OAAO,CAAC;AAEhD,QAAI,CAAC,OAAO;AACR,aAAO;AAAA,IACX;AAEA,QAAI,iBAAiB,SAAS;AAC1B,aAAO,oCAAC,mBAAc;AAAA,IAC1B;AAEA,QAAI,MAAM,QAAQ,KAAK,KAAK,CAAC,MAAM,QAAQ;AACvC,aAAO,oCAAC,gBAAa,OAAc;AAAA,IACvC;AAEA,WACI;AAAA,MAAC;AAAA;AAAA,QACG;AAAA,QACA;AAAA,SACI,KAAK,OAAO,CAAC,MAAM,cAAc,eAAe,gBAAgB,CAAC;AAAA,IACzE;AAAA,EAER,CAAC;AACL;AAEA,QAAQ,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/components/SearchSuggest/SuggestItem.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ChevronRight } from "@gravity-ui/icons";
|
|
4
|
+
import { Link } from "@gravity-ui/uikit";
|
|
5
|
+
import block from "bem-cn-lite";
|
|
6
|
+
import { HTML } from "../HTML";
|
|
7
|
+
import { SuggestItemType } from "./types";
|
|
8
|
+
var b = block("dc-search-suggest");
|
|
9
|
+
var BasicSuggestItem = ({ item, children }) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("div", { className: b("item", { type: item.type }) }, children);
|
|
11
|
+
};
|
|
12
|
+
var SuggestItem = (item) => {
|
|
13
|
+
switch (item.type) {
|
|
14
|
+
case SuggestItemType.Delimiter:
|
|
15
|
+
return /* @__PURE__ */ React.createElement(BasicSuggestItem, { item }, null);
|
|
16
|
+
case SuggestItemType.Link:
|
|
17
|
+
return /* @__PURE__ */ React.createElement(Link, { className: b("item", { type: item.type }), view: "primary", href: item.link }, /* @__PURE__ */ React.createElement("span", null, item.title), /* @__PURE__ */ React.createElement(ChevronRight, { width: 13, height: 13, viewBox: "0 0 13 13" }));
|
|
18
|
+
case SuggestItemType.Page:
|
|
19
|
+
return /* @__PURE__ */ React.createElement(Link, { className: b("item", { type: item.type }), view: "primary", href: item.link }, /* @__PURE__ */ React.createElement("span", { className: b("item-title") }, /* @__PURE__ */ React.createElement(HTML, null, item.title)), /* @__PURE__ */ React.createElement("span", { className: b("item-description") }, /* @__PURE__ */ React.createElement(HTML, null, item.description)));
|
|
20
|
+
case SuggestItemType.Group:
|
|
21
|
+
return /* @__PURE__ */ React.createElement(BasicSuggestItem, { item }, /* @__PURE__ */ React.createElement("h5", null, /* @__PURE__ */ React.createElement(HTML, null, item.title)));
|
|
22
|
+
default:
|
|
23
|
+
return /* @__PURE__ */ React.createElement(BasicSuggestItem, { item }, /* @__PURE__ */ React.createElement(HTML, null, item.title));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
SuggestItem
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=SuggestItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/SuggestItem.tsx"],
|
|
4
|
+
"sourcesContent": ["import type {SearchSuggestItem} from './types';\n\nimport React, {FC, PropsWithChildren} from 'react';\nimport {ChevronRight} from '@gravity-ui/icons';\nimport {Link} from '@gravity-ui/uikit';\nimport block from 'bem-cn-lite';\n\nimport {HTML} from '../HTML';\n\nimport {SuggestItemType} from './types';\n\nconst b = block('dc-search-suggest');\n\nconst BasicSuggestItem: FC<PropsWithChildren<{item: SearchSuggestItem}>> = ({item, children}) => {\n return <div className={b('item', {type: item.type})}>{children}</div>;\n};\n\nexport const SuggestItem: React.FC<SearchSuggestItem> = (item) => {\n switch (item.type) {\n case SuggestItemType.Delimiter:\n return <BasicSuggestItem item={item}>{null}</BasicSuggestItem>;\n case SuggestItemType.Link:\n return (\n <Link className={b('item', {type: item.type})} view={'primary'} href={item.link}>\n <span>{item.title}</span>\n <ChevronRight width={13} height={13} viewBox={'0 0 13 13'} />\n </Link>\n );\n case SuggestItemType.Page:\n return (\n <Link className={b('item', {type: item.type})} view={'primary'} href={item.link}>\n <span className={b('item-title')}>\n <HTML>{item.title}</HTML>\n </span>\n <span className={b('item-description')}>\n <HTML>{item.description}</HTML>\n </span>\n </Link>\n );\n case SuggestItemType.Group:\n return (\n <BasicSuggestItem item={item}>\n <h5>\n <HTML>{item.title}</HTML>\n </h5>\n </BasicSuggestItem>\n );\n default:\n return (\n <BasicSuggestItem item={item}>\n <HTML>{item.title}</HTML>\n </BasicSuggestItem>\n );\n }\n};\n"],
|
|
5
|
+
"mappings": ";AAEA,OAAO,WAAoC;AAC3C,SAAQ,oBAAmB;AAC3B,SAAQ,YAAW;AACnB,OAAO,WAAW;AAElB,SAAQ,YAAW;AAEnB,SAAQ,uBAAsB;AAE9B,IAAM,IAAI,MAAM,mBAAmB;AAEnC,IAAM,mBAAqE,CAAC,EAAC,MAAM,SAAQ,MAAM;AAC7F,SAAO,oCAAC,SAAI,WAAW,EAAE,QAAQ,EAAC,MAAM,KAAK,KAAI,CAAC,KAAI,QAAS;AACnE;AAEO,IAAM,cAA2C,CAAC,SAAS;AAC9D,UAAQ,KAAK,MAAM;AAAA,IACf,KAAK,gBAAgB;AACjB,aAAO,oCAAC,oBAAiB,QAAa,IAAK;AAAA,IAC/C,KAAK,gBAAgB;AACjB,aACI,oCAAC,QAAK,WAAW,EAAE,QAAQ,EAAC,MAAM,KAAK,KAAI,CAAC,GAAG,MAAM,WAAW,MAAM,KAAK,QACvE,oCAAC,cAAM,KAAK,KAAM,GAClB,oCAAC,gBAAa,OAAO,IAAI,QAAQ,IAAI,SAAS,aAAa,CAC/D;AAAA,IAER,KAAK,gBAAgB;AACjB,aACI,oCAAC,QAAK,WAAW,EAAE,QAAQ,EAAC,MAAM,KAAK,KAAI,CAAC,GAAG,MAAM,WAAW,MAAM,KAAK,QACvE,oCAAC,UAAK,WAAW,EAAE,YAAY,KAC3B,oCAAC,YAAM,KAAK,KAAM,CACtB,GACA,oCAAC,UAAK,WAAW,EAAE,kBAAkB,KACjC,oCAAC,YAAM,KAAK,WAAY,CAC5B,CACJ;AAAA,IAER,KAAK,gBAAgB;AACjB,aACI,oCAAC,oBAAiB,QACd,oCAAC,YACG,oCAAC,YAAM,KAAK,KAAM,CACtB,CACJ;AAAA,IAER;AACI,aACI,oCAAC,oBAAiB,QACd,oCAAC,YAAM,KAAK,KAAM,CACtB;AAAA,EAEZ;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* src/components/SearchSuggest/index.scss */
|
|
2
|
+
.dc-search-suggest__wrapper {
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
.dc-search-suggest__loader {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: 10px;
|
|
9
|
+
}
|
|
10
|
+
.dc-search-suggest__list {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
max-height: 60vh;
|
|
14
|
+
overflow-x: hidden;
|
|
15
|
+
overflow-y: auto;
|
|
16
|
+
overflow: hidden auto;
|
|
17
|
+
}
|
|
18
|
+
.dc-search-suggest__list_empty {
|
|
19
|
+
text-align: center;
|
|
20
|
+
padding: 12px;
|
|
21
|
+
word-break: break-word;
|
|
22
|
+
}
|
|
23
|
+
.dc-search-suggest__item {
|
|
24
|
+
font-size: var(--g-text-body-1-font-size);
|
|
25
|
+
line-height: var(--g-text-body-1-line-height);
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: block;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
padding: 12px 20px;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
}
|
|
35
|
+
.dc-search-suggest__item-title,
|
|
36
|
+
.dc-search-suggest__item-description,
|
|
37
|
+
.dc-search-suggest__item-breadcrumbs > * {
|
|
38
|
+
display: block;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-overflow: ellipsis;
|
|
41
|
+
}
|
|
42
|
+
.dc-search-suggest__item-description {
|
|
43
|
+
margin-top: 4px;
|
|
44
|
+
color: var(--g-color-text-secondary);
|
|
45
|
+
}
|
|
46
|
+
.dc-search-suggest__item_type_page {
|
|
47
|
+
outline: none;
|
|
48
|
+
color: var(--g-color-text-link);
|
|
49
|
+
-webkit-text-decoration: none;
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
border-radius: var(--g-focus-border-radius);
|
|
53
|
+
padding-bottom: 9px;
|
|
54
|
+
}
|
|
55
|
+
.utilityfocus .dc-search-suggest__item_type_page:focus {
|
|
56
|
+
outline: 2px solid #ffdb4d;
|
|
57
|
+
}
|
|
58
|
+
.dc-search-suggest__item_type_page:focus {
|
|
59
|
+
box-shadow: 0 0 0 2px var(--g-color-line-focus);
|
|
60
|
+
outline: 0;
|
|
61
|
+
}
|
|
62
|
+
.dc-search-suggest__item_type_page:focus:not(:focus-visible) {
|
|
63
|
+
box-shadow: none;
|
|
64
|
+
}
|
|
65
|
+
.dc-search-suggest__item_type_page:hover,
|
|
66
|
+
.dc-search-suggest__item_type_page:active {
|
|
67
|
+
color: var(--g-color-text-link-hover);
|
|
68
|
+
}
|
|
69
|
+
.dc-search-suggest__item_type_page .dc-search-suggest__item-breadcrumbs {
|
|
70
|
+
padding-top: 2px;
|
|
71
|
+
color: var(--g-color-text-secondary);
|
|
72
|
+
}
|
|
73
|
+
.dc-search-suggest__item_type_service,
|
|
74
|
+
.dc-search-suggest__item_type_marketplace {
|
|
75
|
+
display: flex;
|
|
76
|
+
padding-top: 9px;
|
|
77
|
+
padding-bottom: 11px;
|
|
78
|
+
}
|
|
79
|
+
.dc-search-suggest__item_type_service .dc-search-suggest__item-logo,
|
|
80
|
+
.dc-search-suggest__item_type_marketplace .dc-search-suggest__item-logo {
|
|
81
|
+
margin-right: 16px;
|
|
82
|
+
padding: 3px 0 1px;
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
.dc-search-suggest__item_type_service .dc-search-suggest__item-icon,
|
|
86
|
+
.dc-search-suggest__item_type_marketplace .dc-search-suggest__item-icon {
|
|
87
|
+
width: 16px;
|
|
88
|
+
height: var(--g-text-body-3-line-height);
|
|
89
|
+
}
|
|
90
|
+
.dc-search-suggest__item_type_service .dc-search-suggest__item-text,
|
|
91
|
+
.dc-search-suggest__item_type_marketplace .dc-search-suggest__item-text {
|
|
92
|
+
min-width: 0;
|
|
93
|
+
}
|
|
94
|
+
.dc-search-suggest__item_type_service .dc-search-suggest__item-title,
|
|
95
|
+
.dc-search-suggest__item_type_marketplace .dc-search-suggest__item-title {
|
|
96
|
+
padding: 3px 0 1px;
|
|
97
|
+
}
|
|
98
|
+
.dc-search-suggest__item_type_group {
|
|
99
|
+
padding: 16px 20px 4px;
|
|
100
|
+
color: var(--www-text-content-color);
|
|
101
|
+
}
|
|
102
|
+
.dc-search-suggest__item_type_link {
|
|
103
|
+
display: flex;
|
|
104
|
+
padding: 22px 20px;
|
|
105
|
+
color: var(--g-color-text-link);
|
|
106
|
+
border-top: 1px solid var(--g-color-line-generic);
|
|
107
|
+
}
|
|
108
|
+
.dc-search-suggest__item_type_delimiter {
|
|
109
|
+
height: 1px;
|
|
110
|
+
padding: 0;
|
|
111
|
+
background-color: var(--g-color-line-generic);
|
|
112
|
+
}
|
|
113
|
+
.dc-search-suggest__item h5 {
|
|
114
|
+
margin: 0;
|
|
115
|
+
font-weight: 700;
|
|
116
|
+
font-size: 16px;
|
|
117
|
+
line-height: 25px;
|
|
118
|
+
}
|
|
119
|
+
.dc-search-suggest__item em {
|
|
120
|
+
position: relative;
|
|
121
|
+
font-style: inherit;
|
|
122
|
+
}
|
|
123
|
+
.dc-search-suggest__item em::before {
|
|
124
|
+
position: absolute;
|
|
125
|
+
z-index: -1;
|
|
126
|
+
top: -3px;
|
|
127
|
+
bottom: -1px;
|
|
128
|
+
width: 100%;
|
|
129
|
+
content: "";
|
|
130
|
+
background-color: var(--g-color-base-selection);
|
|
131
|
+
}
|
|
132
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/home/runner/work/components/components/src/components/SearchSuggest/index.scss", "../../../../src/components/SearchSuggest/%3Cinput%20css%20zwu6Il%3E", "../../../../src/components/SearchSuggest/home/runner/work/components/components/src/styles/mixins.scss"],
|
|
4
|
+
"sourcesContent": ["@import '../../styles/variables';\n@import '../../styles/mixins';\n\n.dc-search-suggest {\n $block: &;\n\n &__wrapper {\n position: relative;\n }\n\n &__loader {\n display: flex;\n justify-content: center;\n padding: 10px;\n }\n\n &__list {\n box-sizing: border-box;\n display: flex;\n max-height: 60vh;\n overflow: hidden auto;\n\n &_empty {\n text-align: center;\n padding: 12px;\n word-break: break-word;\n }\n }\n\n &__item {\n @include text-size(body-1);\n\n width: 100%;\n display: block;\n overflow: hidden;\n padding: 12px 20px;\n box-sizing: border-box;\n\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n\n &-title,\n &-description,\n &-breadcrumbs > * {\n display: block;\n overflow: hidden;\n\n text-overflow: ellipsis;\n }\n\n &-description {\n margin-top: 4px;\n\n color: var(--g-color-text-secondary);\n }\n\n &_type {\n &_page {\n @include link();\n\n padding-bottom: 9px;\n\n #{$block}__item {\n &-breadcrumbs {\n padding-top: 2px;\n\n color: var(--g-color-text-secondary);\n }\n }\n }\n\n &_service,\n &_marketplace {\n display: flex;\n\n padding-top: 9px;\n padding-bottom: 11px;\n\n #{$block}__item {\n &-logo {\n margin-right: 16px;\n padding: 3px 0 1px;\n\n text-align: center;\n }\n\n &-icon {\n width: 16px;\n height: var(--g-text-body-3-line-height);\n }\n\n &-text {\n min-width: 0;\n }\n\n &-title {\n padding: 3px 0 1px;\n }\n }\n }\n\n &_group {\n padding: 16px 20px 4px;\n\n color: var(--www-text-content-color);\n }\n\n &_link {\n display: flex;\n\n padding: 22px 20px;\n\n color: var(--g-color-text-link);\n border-top: 1px solid var(--g-color-line-generic);\n }\n\n &_delimiter {\n height: 1px;\n padding: 0;\n\n background-color: var(--g-color-line-generic);\n }\n }\n\n h5 {\n margin: 0;\n font-weight: 700;\n font-size: 16px;\n line-height: 25px;\n }\n\n em {\n position: relative;\n\n font-style: inherit;\n\n &::before {\n position: absolute;\n z-index: -1;\n top: -3px;\n bottom: -1px;\n\n width: 100%;\n\n content: '';\n\n background-color: var(--g-color-base-selection);\n }\n }\n }\n}\n", ".dc-search-suggest__wrapper {\n position: relative;\n}\n.dc-search-suggest__loader {\n display: flex;\n justify-content: center;\n padding: 10px;\n}\n.dc-search-suggest__list {\n box-sizing: border-box;\n display: flex;\n max-height: 60vh;\n overflow: hidden auto;\n}\n.dc-search-suggest__list_empty {\n text-align: center;\n padding: 12px;\n word-break: break-word;\n}\n.dc-search-suggest__item {\n font-size: var(--g-text-body-1-font-size);\n line-height: var(--g-text-body-1-line-height);\n width: 100%;\n display: block;\n overflow: hidden;\n padding: 12px 20px;\n box-sizing: border-box;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.dc-search-suggest__item-title, .dc-search-suggest__item-description, .dc-search-suggest__item-breadcrumbs > * {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.dc-search-suggest__item-description {\n margin-top: 4px;\n color: var(--g-color-text-secondary);\n}\n.dc-search-suggest__item_type_page {\n outline: none;\n color: var(--g-color-text-link);\n text-decoration: none;\n cursor: pointer;\n border-radius: var(--g-focus-border-radius);\n padding-bottom: 9px;\n}\n.utilityfocus .dc-search-suggest__item_type_page:focus {\n outline: 2px solid #ffdb4d;\n}\n.dc-search-suggest__item_type_page:focus {\n box-shadow: 0 0 0 2px var(--g-color-line-focus);\n outline: 0;\n}\n.dc-search-suggest__item_type_page:focus:not(:focus-visible) {\n box-shadow: none;\n}\n.dc-search-suggest__item_type_page:hover, .dc-search-suggest__item_type_page:active {\n color: var(--g-color-text-link-hover);\n}\n.dc-search-suggest__item_type_page .dc-search-suggest__item-breadcrumbs {\n padding-top: 2px;\n color: var(--g-color-text-secondary);\n}\n.dc-search-suggest__item_type_service, .dc-search-suggest__item_type_marketplace {\n display: flex;\n padding-top: 9px;\n padding-bottom: 11px;\n}\n.dc-search-suggest__item_type_service .dc-search-suggest__item-logo, .dc-search-suggest__item_type_marketplace .dc-search-suggest__item-logo {\n margin-right: 16px;\n padding: 3px 0 1px;\n text-align: center;\n}\n.dc-search-suggest__item_type_service .dc-search-suggest__item-icon, .dc-search-suggest__item_type_marketplace .dc-search-suggest__item-icon {\n width: 16px;\n height: var(--g-text-body-3-line-height);\n}\n.dc-search-suggest__item_type_service .dc-search-suggest__item-text, .dc-search-suggest__item_type_marketplace .dc-search-suggest__item-text {\n min-width: 0;\n}\n.dc-search-suggest__item_type_service .dc-search-suggest__item-title, .dc-search-suggest__item_type_marketplace .dc-search-suggest__item-title {\n padding: 3px 0 1px;\n}\n.dc-search-suggest__item_type_group {\n padding: 16px 20px 4px;\n color: var(--www-text-content-color);\n}\n.dc-search-suggest__item_type_link {\n display: flex;\n padding: 22px 20px;\n color: var(--g-color-text-link);\n border-top: 1px solid var(--g-color-line-generic);\n}\n.dc-search-suggest__item_type_delimiter {\n height: 1px;\n padding: 0;\n background-color: var(--g-color-line-generic);\n}\n.dc-search-suggest__item h5 {\n margin: 0;\n font-weight: 700;\n font-size: 16px;\n line-height: 25px;\n}\n.dc-search-suggest__item em {\n position: relative;\n font-style: inherit;\n}\n.dc-search-suggest__item em::before {\n position: absolute;\n z-index: -1;\n top: -3px;\n bottom: -1px;\n width: 100%;\n content: \"\";\n background-color: var(--g-color-base-selection);\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiL2hvbWUvcnVubmVyL3dvcmsvY29tcG9uZW50cy9jb21wb25lbnRzL3NyYy9jb21wb25lbnRzL1NlYXJjaFN1Z2dlc3QiLCJzb3VyY2VzIjpbImluZGV4LnNjc3MiLCIuLi8uLi9zdHlsZXMvbWl4aW5zLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTUk7RUFDSTs7QUFHSjtFQUNJO0VBQ0E7RUFDQTs7QUFHSjtFQUNJO0VBQ0E7RUFDQTtFQUNBOztBQUVBO0VBQ0k7RUFDQTtFQUNBOztBQUlSO0VDMUJBO0VBQ0E7RUQ0Qkk7RUFDQTtFQUNBO0VBQ0E7RUFDQTtFQUVBO0VBQ0E7RUFDQTs7QUFFQTtFQUdJO0VBQ0E7RUFFQTs7QUFHSjtFQUNJO0VBRUE7O0FBSUE7RUNsQ1I7RUFpQ0E7RUFDQTtFQUNBO0VBQ0E7RURDWTs7QUNuQ1o7RUFDSTs7QUFnQkE7RUFDSTtFQUNBOztBQUVKO0VBQ0k7O0FBY1I7RUFFSTs7QURBWTtFQUNJO0VBRUE7O0FBS1o7RUFFSTtFQUVBO0VBQ0E7O0FBR0k7RUFDSTtFQUNBO0VBRUE7O0FBR0o7RUFDSTtFQUNBOztBQUdKO0VBQ0k7O0FBR0o7RUFDSTs7QUFLWjtFQUNJO0VBRUE7O0FBR0o7RUFDSTtFQUVBO0VBRUE7RUFDQTs7QUFHSjtFQUNJO0VBQ0E7RUFFQTs7QUFJUjtFQUNJO0VBQ0E7RUFDQTtFQUNBOztBQUdKO0VBQ0k7RUFFQTs7QUFFQTtFQUNJO0VBQ0E7RUFDQTtFQUNBO0VBRUE7RUFFQTtFQUVBIiwic291cmNlc0NvbnRlbnQiOlsiQGltcG9ydCAnLi4vLi4vc3R5bGVzL3ZhcmlhYmxlcyc7XG5AaW1wb3J0ICcuLi8uLi9zdHlsZXMvbWl4aW5zJztcblxuLmRjLXNlYXJjaC1zdWdnZXN0IHtcbiAgICAkYmxvY2s6ICY7XG5cbiAgICAmX193cmFwcGVyIHtcbiAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgIH1cblxuICAgICZfX2xvYWRlciB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgICBwYWRkaW5nOiAxMHB4O1xuICAgIH1cblxuICAgICZfX2xpc3Qge1xuICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICBtYXgtaGVpZ2h0OiA2MHZoO1xuICAgICAgICBvdmVyZmxvdzogaGlkZGVuIGF1dG87XG5cbiAgICAgICAgJl9lbXB0eSB7XG4gICAgICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgICAgICAgICBwYWRkaW5nOiAxMnB4O1xuICAgICAgICAgICAgd29yZC1icmVhazogYnJlYWstd29yZDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgICZfX2l0ZW0ge1xuICAgICAgICBAaW5jbHVkZSB0ZXh0LXNpemUoYm9keS0xKTtcblxuICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgICAgIHBhZGRpbmc6IDEycHggMjBweDtcbiAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDtcblxuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuXG4gICAgICAgICYtdGl0bGUsXG4gICAgICAgICYtZGVzY3JpcHRpb24sXG4gICAgICAgICYtYnJlYWRjcnVtYnMgPiAqIHtcbiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICAgb3ZlcmZsb3c6IGhpZGRlbjtcblxuICAgICAgICAgICAgdGV4dC1vdmVyZmxvdzogZWxsaXBzaXM7XG4gICAgICAgIH1cblxuICAgICAgICAmLWRlc2NyaXB0aW9uIHtcbiAgICAgICAgICAgIG1hcmdpbi10b3A6IDRweDtcblxuICAgICAgICAgICAgY29sb3I6IHZhcigtLWctY29sb3ItdGV4dC1zZWNvbmRhcnkpO1xuICAgICAgICB9XG5cbiAgICAgICAgJl90eXBlIHtcbiAgICAgICAgICAgICZfcGFnZSB7XG4gICAgICAgICAgICAgICAgQGluY2x1ZGUgbGluaygpO1xuXG4gICAgICAgICAgICAgICAgcGFkZGluZy1ib3R0b206IDlweDtcblxuICAgICAgICAgICAgICAgICN7JGJsb2NrfV9faXRlbSB7XG4gICAgICAgICAgICAgICAgICAgICYtYnJlYWRjcnVtYnMge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6IDJweDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHZhcigtLWctY29sb3ItdGV4dC1zZWNvbmRhcnkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmX3NlcnZpY2UsXG4gICAgICAgICAgICAmX21hcmtldHBsYWNlIHtcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuXG4gICAgICAgICAgICAgICAgcGFkZGluZy10b3A6IDlweDtcbiAgICAgICAgICAgICAgICBwYWRkaW5nLWJvdHRvbTogMTFweDtcblxuICAgICAgICAgICAgICAgICN7JGJsb2NrfV9faXRlbSB7XG4gICAgICAgICAgICAgICAgICAgICYtbG9nbyB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4tcmlnaHQ6IDE2cHg7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAzcHggMCAxcHg7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICYtaWNvbiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTZweDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdmFyKC0tZy10ZXh0LWJvZHktMy1saW5lLWhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAmLXRleHQge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWluLXdpZHRoOiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgJi10aXRsZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAzcHggMCAxcHg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZfZ3JvdXAge1xuICAgICAgICAgICAgICAgIHBhZGRpbmc6IDE2cHggMjBweCA0cHg7XG5cbiAgICAgICAgICAgICAgICBjb2xvcjogdmFyKC0td3d3LXRleHQtY29udGVudC1jb2xvcik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZfbGluayB7XG4gICAgICAgICAgICAgICAgZGlzcGxheTogZmxleDtcblxuICAgICAgICAgICAgICAgIHBhZGRpbmc6IDIycHggMjBweDtcblxuICAgICAgICAgICAgICAgIGNvbG9yOiB2YXIoLS1nLWNvbG9yLXRleHQtbGluayk7XG4gICAgICAgICAgICAgICAgYm9yZGVyLXRvcDogMXB4IHNvbGlkIHZhcigtLWctY29sb3ItbGluZS1nZW5lcmljKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJl9kZWxpbWl0ZXIge1xuICAgICAgICAgICAgICAgIGhlaWdodDogMXB4O1xuICAgICAgICAgICAgICAgIHBhZGRpbmc6IDA7XG5cbiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiB2YXIoLS1nLWNvbG9yLWxpbmUtZ2VuZXJpYyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBoNSB7XG4gICAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgICAgICBmb250LXdlaWdodDogNzAwO1xuICAgICAgICAgICAgZm9udC1zaXplOiAxNnB4O1xuICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDI1cHg7XG4gICAgICAgIH1cblxuICAgICAgICBlbSB7XG4gICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG5cbiAgICAgICAgICAgIGZvbnQtc3R5bGU6IGluaGVyaXQ7XG5cbiAgICAgICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgICAgICAgIHotaW5kZXg6IC0xO1xuICAgICAgICAgICAgICAgIHRvcDogLTNweDtcbiAgICAgICAgICAgICAgICBib3R0b206IC0xcHg7XG5cbiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcblxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICcnO1xuXG4gICAgICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tZy1jb2xvci1iYXNlLXNlbGVjdGlvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG4iLCJAaW1wb3J0ICcuL3ZhcmlhYmxlcyc7XG5cbkBtaXhpbiB0ZXh0LXNpemUoJG5hbWUpIHtcbiAgICBmb250LXNpemU6IHZhcigtLWctdGV4dC0jeyRuYW1lfS1mb250LXNpemUpO1xuICAgIGxpbmUtaGVpZ2h0OiB2YXIoLS1nLXRleHQtI3skbmFtZX0tbGluZS1oZWlnaHQpO1xufVxuXG5AbWl4aW4gcmVzZXQtbGlzdC1zdHlsZSgpIHtcbiAgICBtYXJnaW46IDA7XG4gICAgcGFkZGluZzogMDtcbiAgICBsaXN0LXN0eWxlOiBub25lO1xufVxuXG5AbWl4aW4gZml4QW5jaG9yUG9zaXRpb24oJG9mZnNldDogMHB4KSB7XG4gICAgcGFkZGluZy10b3A6IGNhbGModmFyKC0tZGMtaGVhZGVyLWhlaWdodCwgI3skaGVhZGVySGVpZ2h0fSkpO1xuICAgIG1hcmdpbi10b3A6IGNhbGMoI3skb2Zmc2V0fSAtIHZhcigtLWRjLWhlYWRlci1oZWlnaHQsICN7JGhlYWRlckhlaWdodH0pKTtcbn1cblxuQG1peGluIHJlc2V0LWxpbmstc3R5bGUoKSB7XG4gICAgY29sb3I6IGluaGVyaXQ7XG4gICAgdGV4dC1kZWNvcmF0aW9uOiBub25lO1xufVxuXG5AbWl4aW4gaXNsYW5kcy1mb2N1cygpIHtcbiAgICBvdXRsaW5lOiBub25lO1xuXG4gICAgLnV0aWxpdHlmb2N1cyAmOmZvY3VzIHtcbiAgICAgICAgb3V0bGluZTogMnB4IHNvbGlkICNmZmRiNGQ7XG4gICAgfVxufVxuXG5AbWl4aW4gZm9jdXNhYmxlKCRvZmZzZXQ6IDAsICRtb2RlOiAnb3V0bGluZScpIHtcbiAgICBAaWYgJG1vZGUgPT0gJ291dGxpbmUnIHtcbiAgICAgICAgJjpmb2N1cyB7XG4gICAgICAgICAgICBvdXRsaW5lOiAycHggc29saWQgdmFyKC0tZy1jb2xvci1saW5lLWZvY3VzKTtcbiAgICAgICAgICAgIG91dGxpbmUtb2Zmc2V0OiAkb2Zmc2V0O1xuICAgICAgICB9XG4gICAgICAgICY6Zm9jdXM6bm90KDpmb2N1cy12aXNpYmxlKSB7XG4gICAgICAgICAgICBvdXRsaW5lOiAwO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgQGlmICRtb2RlID09ICdib3gtc2hhZG93JyB7XG4gICAgICAgICY6Zm9jdXMge1xuICAgICAgICAgICAgYm94LXNoYWRvdzogMCAwIDAgMnB4IHZhcigtLWctY29sb3ItbGluZS1mb2N1cyk7XG4gICAgICAgICAgICBvdXRsaW5lOiAwO1xuICAgICAgICB9XG4gICAgICAgICY6Zm9jdXM6bm90KDpmb2N1cy12aXNpYmxlKSB7XG4gICAgICAgICAgICBib3gtc2hhZG93OiBub25lO1xuICAgICAgICB9XG4gICAgfVxufVxuXG5AbWl4aW4gbGluaygpIHtcbiAgICBAaW5jbHVkZSBpc2xhbmRzLWZvY3VzKCk7XG4gICAgQGluY2x1ZGUgZm9jdXNhYmxlKDAsICdib3gtc2hhZG93Jyk7XG5cbiAgICBjb2xvcjogdmFyKC0tZy1jb2xvci10ZXh0LWxpbmspO1xuICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgYm9yZGVyLXJhZGl1czogdmFyKC0tZy1mb2N1cy1ib3JkZXItcmFkaXVzKTtcblxuICAgICY6aG92ZXIsXG4gICAgJjphY3RpdmUge1xuICAgICAgICBjb2xvcjogdmFyKC0tZy1jb2xvci10ZXh0LWxpbmstaG92ZXIpO1xuICAgIH1cbn1cblxuQG1peGluIGhlYWRpbmcxKCkge1xuICAgIEBpbmNsdWRlIHRleHQtc2l6ZShkaXNwbGF5LTMpO1xuICAgIGZvbnQtd2VpZ2h0OiA1MDA7XG5cbiAgICBAbWVkaWEgKG1heC13aWR0aDogbWFwLWdldCgkc2NyZWVuQnJlYWtwb2ludHMsICdtZCcpIC0gMSkge1xuICAgICAgICBAaW5jbHVkZSB0ZXh0LXNpemUoZGlzcGxheS0yKTtcbiAgICB9XG59XG5cbkBtaXhpbiBoZWFkaW5nMigpIHtcbiAgICBAaW5jbHVkZSB0ZXh0LXNpemUoZGlzcGxheS0xKTtcbiAgICBmb250LXdlaWdodDogNTAwO1xufVxuXG5AbWl4aW4gaGVhZGluZzMoKSB7XG4gICAgQGluY2x1ZGUgdGV4dC1zaXplKGhlYWRlci0yKTtcbiAgICBmb250LXdlaWdodDogNTAwO1xufVxuXG5AbWl4aW4gaGVhZGluZzQoKSB7XG4gICAgQGluY2x1ZGUgdGV4dC1zaXplKGhlYWRlci0xKTtcbiAgICBmb250LXdlaWdodDogNTAwO1xufVxuXG5AbWl4aW4gaGVhZGluZzUoKSB7XG4gICAgQGluY2x1ZGUgdGV4dC1zaXplKGJvZHktMyk7XG4gICAgZm9udC13ZWlnaHQ6IDUwMDtcbn1cblxuQG1peGluIGhlYWRpbmc2KCkge1xuICAgIEBpbmNsdWRlIHRleHQtc2l6ZShib2R5LTMpO1xuICAgIGZvbnQtd2VpZ2h0OiA0MDA7XG59XG5cbkBtaXhpbiBjb250cmlidXRvcnMtdGV4dCgpIHtcbiAgICBmb250LXNpemU6IDEzcHg7XG4gICAgZm9udC13ZWlnaHQ6IDQwMDtcbiAgICBtYXJnaW4tcmlnaHQ6IDVweDtcbiAgICBhbGlnbi1zZWxmOiBjZW50ZXI7XG59XG5cbkBtaXhpbiB0ZXh0LWJvZHktMSgpIHtcbiAgICBmb250LXNpemU6IHZhcigtLWctdGV4dC1ib2R5LTEtZm9udC1zaXplKTtcbiAgICBsaW5lLWhlaWdodDogdmFyKC0tZy10ZXh0LWJvZHktMS1saW5lLWhlaWdodCk7XG4gICAgZm9udC13ZWlnaHQ6IHZhcigtLWctdGV4dC1ib2R5LWZvbnQtd2VpZ2h0KTtcbn1cblxuQG1peGluIGRlc2t0b3Atb25seSgpIHtcbiAgICBAbWVkaWEgKG1heC13aWR0aDogbWFwLWdldCgkc2NyZWVuQnJlYWtwb2ludHMsICdtZCcpIC0gMSkge1xuICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgIH1cbn1cblxuQG1peGluIGRlc2t0b3AtdGFibGV0LW9ubHkoKSB7XG4gICAgQG1lZGlhIChtYXgtd2lkdGg6IG1hcC1nZXQoJHNjcmVlbkJyZWFrcG9pbnRzLCAnc20nKSAtIDEpIHtcbiAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICB9XG59XG5cbkBtaXhpbiBtb2JpbGUtdGFibGV0LW9ubHkoKSB7XG4gICAgQG1lZGlhIChtaW4td2lkdGg6IG1hcC1nZXQoJHNjcmVlbkJyZWFrcG9pbnRzLCAnbWQnKSkge1xuICAgICAgICBkaXNwbGF5OiBub25lO1xuICAgIH1cbn1cblxuQG1peGluIG1vYmlsZS1vbmx5KCkge1xuICAgIEBtZWRpYSAobWluLXdpZHRoOiBtYXAtZ2V0KCRzY3JlZW5CcmVha3BvaW50cywgJ3NtJykpIHtcbiAgICAgICAgZGlzcGxheTogbm9uZTtcbiAgICB9XG59XG4iXX0= */", "@import './variables';\n\n@mixin text-size($name) {\n font-size: var(--g-text-#{$name}-font-size);\n line-height: var(--g-text-#{$name}-line-height);\n}\n\n@mixin reset-list-style() {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n@mixin fixAnchorPosition($offset: 0px) {\n padding-top: calc(var(--dc-header-height, #{$headerHeight}));\n margin-top: calc(#{$offset} - var(--dc-header-height, #{$headerHeight}));\n}\n\n@mixin reset-link-style() {\n color: inherit;\n text-decoration: none;\n}\n\n@mixin islands-focus() {\n outline: none;\n\n .utilityfocus &:focus {\n outline: 2px solid #ffdb4d;\n }\n}\n\n@mixin focusable($offset: 0, $mode: 'outline') {\n @if $mode == 'outline' {\n &:focus {\n outline: 2px solid var(--g-color-line-focus);\n outline-offset: $offset;\n }\n &:focus:not(:focus-visible) {\n outline: 0;\n }\n }\n\n @if $mode == 'box-shadow' {\n &:focus {\n box-shadow: 0 0 0 2px var(--g-color-line-focus);\n outline: 0;\n }\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n}\n\n@mixin link() {\n @include islands-focus();\n @include focusable(0, 'box-shadow');\n\n color: var(--g-color-text-link);\n text-decoration: none;\n cursor: pointer;\n border-radius: var(--g-focus-border-radius);\n\n &:hover,\n &:active {\n color: var(--g-color-text-link-hover);\n }\n}\n\n@mixin heading1() {\n @include text-size(display-3);\n font-weight: 500;\n\n @media (max-width: map-get($screenBreakpoints, 'md') - 1) {\n @include text-size(display-2);\n }\n}\n\n@mixin heading2() {\n @include text-size(display-1);\n font-weight: 500;\n}\n\n@mixin heading3() {\n @include text-size(header-2);\n font-weight: 500;\n}\n\n@mixin heading4() {\n @include text-size(header-1);\n font-weight: 500;\n}\n\n@mixin heading5() {\n @include text-size(body-3);\n font-weight: 500;\n}\n\n@mixin heading6() {\n @include text-size(body-3);\n font-weight: 400;\n}\n\n@mixin contributors-text() {\n font-size: 13px;\n font-weight: 400;\n margin-right: 5px;\n align-self: center;\n}\n\n@mixin text-body-1() {\n font-size: var(--g-text-body-1-font-size);\n line-height: var(--g-text-body-1-line-height);\n font-weight: var(--g-text-body-font-weight);\n}\n\n@mixin desktop-only() {\n @media (max-width: map-get($screenBreakpoints, 'md') - 1) {\n display: none;\n }\n}\n\n@mixin desktop-tablet-only() {\n @media (max-width: map-get($screenBreakpoints, 'sm') - 1) {\n display: none;\n }\n}\n\n@mixin mobile-tablet-only() {\n @media (min-width: map-get($screenBreakpoints, 'md')) {\n display: none;\n }\n}\n\n@mixin mobile-only() {\n @media (min-width: map-get($screenBreakpoints, 'sm')) {\n display: none;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAMI,CAAA;AACI,YAAA;ACLR;ADQI,CAAA;AACI,WAAA;AACA,mBAAA;AACA,WAAA;ACNR;ADSI,CAAA;AACI,cAAA;AACA,WAAA;AACA,cAAA;AACA,cAAA;AAAA,cAAA;AAAA,YAAA,OAAA;ACPR;ADSQ,CAAA;AACI,cAAA;AACA,WAAA;AACA,cAAA;ACPZ;ADWI,CAAA;AE1BA,aAAA,IAAA;AACA,eAAA,IAAA;AF4BI,SAAA;AACA,WAAA;AACA,YAAA;AACA,WAAA,KAAA;AACA,cAAA;AAEA,UAAA;AACA,eAAA;AACA,iBAAA;ACVR;ADYQ,CAAA;AAAA,CAAA;AAAA,CAAA,oCAAA,EAAA;AAGI,WAAA;AACA,YAAA;AAEA,iBAAA;ACbZ;ADgBQ,CATA;AAUI,cAAA;AAEA,SAAA,IAAA;ACfZ;ADmBY,CAAA;AElCR,WAAA;AAiCA,SAAA,IAAA;AACA,2BAAA;AAAA,mBAAA;AACA,UAAA;AACA,iBAAA,IAAA;AFCY,kBAAA;ACdhB;ACrBI,CAAA,aAAA,CFgCQ,iCEhCR;AACI,WAAA,IAAA,MAAA;ADuBR;ACPQ,CFeI,iCEfJ;AACI,cAAA,EAAA,EAAA,EAAA,IAAA,IAAA;AACA,WAAA;ADSZ;ACPQ,CFWI,iCEXJ,MAAA,KAAA;AACI,cAAA;ADSZ;ACKI,CFJQ,iCEIR;AAAA,CFJQ,iCEIR;AAEI,SAAA,IAAA;ADJR;ADIoB,CANR,kCAMQ,CAtBZ;AAuBgB,eAAA;AAEA,SAAA,IAAA;ACHxB;ADQY,CAAA;AAAA,CAAA;AAEI,WAAA;AAEA,eAAA;AACA,kBAAA;ACRhB;ADWoB,CARR,qCAQQ,CAAA;AAAA,CARR,yCAQQ,CAAA;AACI,gBAAA;AACA,WAAA,IAAA,EAAA;AAEA,cAAA;ACVxB;ADaoB,CAfR,qCAeQ,CAAA;AAAA,CAfR,yCAeQ,CAAA;AACI,SAAA;AACA,UAAA,IAAA;ACXxB;ADcoB,CApBR,qCAoBQ,CAAA;AAAA,CApBR,yCAoBQ,CAAA;AACI,aAAA;ACZxB;ADeoB,CAxBR,qCAwBQ,CAtDZ;AAsDY,CAxBR,yCAwBQ,CAtDZ;AAuDgB,WAAA,IAAA,EAAA;ACbxB;ADkBY,CAAA;AACI,WAAA,KAAA,KAAA;AAEA,SAAA,IAAA;ACjBhB;ADoBY,CAAA;AACI,WAAA;AAEA,WAAA,KAAA;AAEA,SAAA,IAAA;AACA,cAAA,IAAA,MAAA,IAAA;ACpBhB;ADuBY,CAAA;AACI,UAAA;AACA,WAAA;AAEA,oBAAA,IAAA;ACtBhB;AD0BQ,CAhGJ,wBAgGI;AACI,UAAA;AACA,eAAA;AACA,aAAA;AACA,eAAA;ACxBZ;AD2BQ,CAvGJ,wBAuGI;AACI,YAAA;AAEA,cAAA;AC1BZ;AD4BY,CA5GR,wBA4GQ,EAAA;AACI,YAAA;AACA,WAAA;AACA,OAAA;AACA,UAAA;AAEA,SAAA;AAEA,WAAA;AAEA,oBAAA,IAAA;AC7BhB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SearchProvider, SearchResult } from './types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
export type { SearchProvider, SearchResult };
|
|
5
|
+
export interface SearchSuggestProps {
|
|
6
|
+
provider: SearchProvider;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
containerClass?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
onFocus?: () => void;
|
|
11
|
+
onBlur?: () => void;
|
|
12
|
+
endContent?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchSuggestApi {
|
|
15
|
+
open(): void;
|
|
16
|
+
close(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare const SearchSuggest: React.ForwardRefExoticComponent<SearchSuggestProps & React.RefAttributes<SearchSuggestApi>>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b2) => {
|
|
7
|
+
for (var prop in b2 || (b2 = {}))
|
|
8
|
+
if (__hasOwnProp.call(b2, prop))
|
|
9
|
+
__defNormalProp(a, prop, b2[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
12
|
+
if (__propIsEnum.call(b2, prop))
|
|
13
|
+
__defNormalProp(a, prop, b2[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/components/SearchSuggest/index.tsx
|
|
19
|
+
import React, {
|
|
20
|
+
forwardRef,
|
|
21
|
+
useCallback,
|
|
22
|
+
useImperativeHandle,
|
|
23
|
+
useMemo,
|
|
24
|
+
useRef,
|
|
25
|
+
useState
|
|
26
|
+
} from "react";
|
|
27
|
+
import { Popup } from "@gravity-ui/uikit";
|
|
28
|
+
import block from "bem-cn-lite";
|
|
29
|
+
import uniqueId from "lodash/uniqueId";
|
|
30
|
+
import { useVirtualElementRef } from "../../hooks";
|
|
31
|
+
import { SearchInput } from "./SearchInput";
|
|
32
|
+
import { Suggest } from "./Suggest";
|
|
33
|
+
import { SuggestItem } from "./SuggestItem";
|
|
34
|
+
import { useFocus } from "./useFocus";
|
|
35
|
+
import "./index.css";
|
|
36
|
+
var b = block("dc-search-suggest");
|
|
37
|
+
var SearchSuggest = forwardRef((props, api) => {
|
|
38
|
+
const { provider, className, placeholder, endContent, containerClass } = props;
|
|
39
|
+
const href = useRef(null);
|
|
40
|
+
const input = useRef(null);
|
|
41
|
+
const suggest = useRef(null);
|
|
42
|
+
const id = useMemo(uniqueId, []);
|
|
43
|
+
const [query, setQuery] = useState("");
|
|
44
|
+
const [active, setActive] = useState(void 0);
|
|
45
|
+
const [focused, setFocused, handlers] = useFocus(props);
|
|
46
|
+
const box = useVirtualElementRef(input.current);
|
|
47
|
+
const submitItem = useCallback(
|
|
48
|
+
(link) => {
|
|
49
|
+
if (href.current) {
|
|
50
|
+
href.current.href = link;
|
|
51
|
+
href.current.click();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[href]
|
|
55
|
+
);
|
|
56
|
+
const onKeyDown = useCallback(
|
|
57
|
+
(event) => {
|
|
58
|
+
if (event.key === "Enter" && active === void 0) {
|
|
59
|
+
submitItem(`/search?query=${query}`);
|
|
60
|
+
} else if (suggest.current) {
|
|
61
|
+
suggest.current.onKeyDown(event);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[suggest, query, active, submitItem]
|
|
65
|
+
);
|
|
66
|
+
const open = useCallback(() => {
|
|
67
|
+
setFocused(true);
|
|
68
|
+
}, [setFocused]);
|
|
69
|
+
const close = useCallback(() => {
|
|
70
|
+
setFocused(false);
|
|
71
|
+
setQuery("");
|
|
72
|
+
}, [setFocused, setQuery]);
|
|
73
|
+
const onSubmit = useCallback(
|
|
74
|
+
(item, _index, fromKeyboard) => {
|
|
75
|
+
if (!fromKeyboard) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
submitItem(item.link);
|
|
79
|
+
},
|
|
80
|
+
[submitItem]
|
|
81
|
+
);
|
|
82
|
+
useImperativeHandle(api, () => ({ open, close }), [open, close]);
|
|
83
|
+
return /* @__PURE__ */ React.createElement("div", __spreadValues({ className: b("wrapper", containerClass) }, handlers), /* @__PURE__ */ React.createElement("a", { ref: href, href: "#", hidden: true, "aria-hidden": true }), /* @__PURE__ */ React.createElement(
|
|
84
|
+
SearchInput,
|
|
85
|
+
{
|
|
86
|
+
ref: input,
|
|
87
|
+
id: `dc-${id}-input`,
|
|
88
|
+
size: "l",
|
|
89
|
+
className: b(null, className),
|
|
90
|
+
text: query,
|
|
91
|
+
onUpdate: setQuery,
|
|
92
|
+
onKeyDown,
|
|
93
|
+
autoFocus: focused,
|
|
94
|
+
placeholder,
|
|
95
|
+
endContent,
|
|
96
|
+
controlProps: {
|
|
97
|
+
"aria-controls": `dc-popup-${id}`,
|
|
98
|
+
"aria-expanded": Boolean(input.current && focused),
|
|
99
|
+
"aria-activedescendant": active === void 0 ? void 0 : `dc-${id}-list-item-${active}`
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
), input.current && /* @__PURE__ */ React.createElement(
|
|
103
|
+
Popup,
|
|
104
|
+
{
|
|
105
|
+
open: Boolean(query && focused),
|
|
106
|
+
id: `dc-popup-${id}`,
|
|
107
|
+
contentClassName: b("popup"),
|
|
108
|
+
style: { width: box.width },
|
|
109
|
+
anchorRef: box
|
|
110
|
+
},
|
|
111
|
+
/* @__PURE__ */ React.createElement(
|
|
112
|
+
Suggest,
|
|
113
|
+
{
|
|
114
|
+
ref: suggest,
|
|
115
|
+
id: `dc-${id}-list`,
|
|
116
|
+
query,
|
|
117
|
+
provider,
|
|
118
|
+
renderItem: SuggestItem,
|
|
119
|
+
onItemClick: onSubmit,
|
|
120
|
+
onChangeActive: setActive
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
));
|
|
124
|
+
});
|
|
125
|
+
SearchSuggest.displayName = "SearchSuggest";
|
|
126
|
+
export {
|
|
127
|
+
SearchSuggest
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import type {KeyboardEvent} from 'react';\nimport type {\n SearchProvider,\n SearchResult,\n SearchSuggestItem,\n SearchSuggestLinkableItem,\n} from './types';\n\nimport React, {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {List, Popup} from '@gravity-ui/uikit';\nimport block from 'bem-cn-lite';\nimport uniqueId from 'lodash/uniqueId';\n\nimport {useVirtualElementRef} from '../../hooks';\n\nimport {SearchInput} from './SearchInput';\nimport {Suggest} from './Suggest';\nimport {SuggestItem} from './SuggestItem';\nimport {useFocus} from './useFocus';\nimport './index.scss';\n\nconst b = block('dc-search-suggest');\n\nexport type {SearchProvider, SearchResult};\n\nexport interface SearchSuggestProps {\n provider: SearchProvider;\n placeholder?: string;\n containerClass?: string;\n className?: string;\n onFocus?: () => void;\n onBlur?: () => void;\n endContent?: React.ReactNode;\n}\n\nexport interface SearchSuggestApi {\n open(): void;\n\n close(): void;\n}\n\nexport const SearchSuggest = forwardRef<SearchSuggestApi, SearchSuggestProps>((props, api) => {\n const {provider, className, placeholder, endContent, containerClass} = props;\n const href = useRef<HTMLAnchorElement>(null);\n const input = useRef<HTMLElement>(null);\n const suggest = useRef<List<SearchSuggestItem>>(null);\n const id = useMemo(uniqueId, []);\n const [query, setQuery] = useState('');\n const [active, setActive] = useState<undefined | number>(undefined);\n const [focused, setFocused, handlers] = useFocus(props);\n const box = useVirtualElementRef(input.current);\n\n const submitItem = useCallback(\n (link: string) => {\n if (href.current) {\n href.current.href = link;\n href.current.click();\n }\n },\n [href],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Enter' && active === undefined) {\n submitItem(`/search?query=${query}`);\n } else if (suggest.current) {\n suggest.current.onKeyDown(event);\n }\n },\n [suggest, query, active, submitItem],\n );\n\n const open = useCallback(() => {\n setFocused(true);\n }, [setFocused]);\n\n const close = useCallback(() => {\n setFocused(false);\n setQuery('');\n }, [setFocused, setQuery]);\n\n const onSubmit = useCallback(\n (item: SearchSuggestItem, _index?: number, fromKeyboard?: boolean) => {\n if (!fromKeyboard) {\n return;\n }\n\n submitItem((item as SearchSuggestLinkableItem).link);\n },\n [submitItem],\n );\n\n useImperativeHandle(api, () => ({open, close}), [open, close]);\n\n return (\n <div className={b('wrapper', containerClass)} {...handlers}>\n <a ref={href} href=\"#\" hidden aria-hidden />\n <SearchInput\n ref={input}\n id={`dc-${id}-input`}\n size=\"l\"\n className={b(null, className)}\n text={query}\n onUpdate={setQuery}\n onKeyDown={onKeyDown}\n autoFocus={focused}\n placeholder={placeholder}\n endContent={endContent}\n controlProps={{\n 'aria-controls': `dc-popup-${id}`,\n 'aria-expanded': Boolean(input.current && focused),\n 'aria-activedescendant':\n active === undefined ? undefined : `dc-${id}-list-item-${active}`,\n }}\n />\n {input.current && (\n <Popup\n open={Boolean(query && focused)}\n id={`dc-popup-${id}`}\n contentClassName={b('popup')}\n style={{width: box.width}}\n anchorRef={box}\n >\n <Suggest\n ref={suggest}\n id={`dc-${id}-list`}\n query={query}\n provider={provider}\n renderItem={SuggestItem}\n onItemClick={onSubmit}\n onChangeActive={setActive}\n />\n </Popup>\n )}\n </div>\n );\n});\n\nSearchSuggest.displayName = 'SearchSuggest';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAQA,OAAO;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAc,aAAY;AAC1B,OAAO,WAAW;AAClB,OAAO,cAAc;AAErB,SAAQ,4BAA2B;AAEnC,SAAQ,mBAAkB;AAC1B,SAAQ,eAAc;AACtB,SAAQ,mBAAkB;AAC1B,SAAQ,gBAAe;AACvB,OAAO;AAEP,IAAM,IAAI,MAAM,mBAAmB;AAoB5B,IAAM,gBAAgB,WAAiD,CAAC,OAAO,QAAQ;AAC1F,QAAM,EAAC,UAAU,WAAW,aAAa,YAAY,eAAc,IAAI;AACvE,QAAM,OAAO,OAA0B,IAAI;AAC3C,QAAM,QAAQ,OAAoB,IAAI;AACtC,QAAM,UAAU,OAAgC,IAAI;AACpD,QAAM,KAAK,QAAQ,UAAU,CAAC,CAAC;AAC/B,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA6B,MAAS;AAClE,QAAM,CAAC,SAAS,YAAY,QAAQ,IAAI,SAAS,KAAK;AACtD,QAAM,MAAM,qBAAqB,MAAM,OAAO;AAE9C,QAAM,aAAa;AAAA,IACf,CAAC,SAAiB;AACd,UAAI,KAAK,SAAS;AACd,aAAK,QAAQ,OAAO;AACpB,aAAK,QAAQ,MAAM;AAAA,MACvB;AAAA,IACJ;AAAA,IACA,CAAC,IAAI;AAAA,EACT;AAEA,QAAM,YAAY;AAAA,IACd,CAAC,UAAsC;AACnC,UAAI,MAAM,QAAQ,WAAW,WAAW,QAAW;AAC/C,mBAAW,iBAAiB,KAAK,EAAE;AAAA,MACvC,WAAW,QAAQ,SAAS;AACxB,gBAAQ,QAAQ,UAAU,KAAK;AAAA,MACnC;AAAA,IACJ;AAAA,IACA,CAAC,SAAS,OAAO,QAAQ,UAAU;AAAA,EACvC;AAEA,QAAM,OAAO,YAAY,MAAM;AAC3B,eAAW,IAAI;AAAA,EACnB,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,QAAQ,YAAY,MAAM;AAC5B,eAAW,KAAK;AAChB,aAAS,EAAE;AAAA,EACf,GAAG,CAAC,YAAY,QAAQ,CAAC;AAEzB,QAAM,WAAW;AAAA,IACb,CAAC,MAAyB,QAAiB,iBAA2B;AAClE,UAAI,CAAC,cAAc;AACf;AAAA,MACJ;AAEA,iBAAY,KAAmC,IAAI;AAAA,IACvD;AAAA,IACA,CAAC,UAAU;AAAA,EACf;AAEA,sBAAoB,KAAK,OAAO,EAAC,MAAM,MAAK,IAAI,CAAC,MAAM,KAAK,CAAC;AAE7D,SACI,oCAAC,wBAAI,WAAW,EAAE,WAAW,cAAc,KAAO,WAC9C,oCAAC,OAAE,KAAK,MAAM,MAAK,KAAI,QAAM,MAAC,eAAW,MAAC,GAC1C;AAAA,IAAC;AAAA;AAAA,MACG,KAAK;AAAA,MACL,IAAI,MAAM,EAAE;AAAA,MACZ,MAAK;AAAA,MACL,WAAW,EAAE,MAAM,SAAS;AAAA,MAC5B,MAAM;AAAA,MACN,UAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,cAAc;AAAA,QACV,iBAAiB,YAAY,EAAE;AAAA,QAC/B,iBAAiB,QAAQ,MAAM,WAAW,OAAO;AAAA,QACjD,yBACI,WAAW,SAAY,SAAY,MAAM,EAAE,cAAc,MAAM;AAAA,MACvE;AAAA;AAAA,EACJ,GACC,MAAM,WACH;AAAA,IAAC;AAAA;AAAA,MACG,MAAM,QAAQ,SAAS,OAAO;AAAA,MAC9B,IAAI,YAAY,EAAE;AAAA,MAClB,kBAAkB,EAAE,OAAO;AAAA,MAC3B,OAAO,EAAC,OAAO,IAAI,MAAK;AAAA,MACxB,WAAW;AAAA;AAAA,IAEX;AAAA,MAAC;AAAA;AAAA,QACG,KAAK;AAAA,QACL,IAAI,MAAM,EAAE;AAAA,QACZ;AAAA,QACA;AAAA,QACA,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,gBAAgB;AAAA;AAAA,IACpB;AAAA,EACJ,CAER;AAER,CAAC;AAED,cAAc,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BreadcrumbItem } from '../../models';
|
|
2
|
+
export declare enum SuggestItemType {
|
|
3
|
+
Text = "text",
|
|
4
|
+
Page = "page",
|
|
5
|
+
Group = "group",
|
|
6
|
+
Delimiter = "delimiter",
|
|
7
|
+
Link = "link"
|
|
8
|
+
}
|
|
9
|
+
interface SearchSuggestBaseItem {
|
|
10
|
+
type: SuggestItemType;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface SearchSuggestTextItem extends SearchSuggestBaseItem {
|
|
14
|
+
type: SuggestItemType.Text;
|
|
15
|
+
title: string;
|
|
16
|
+
}
|
|
17
|
+
interface SearchSuggestPageItem extends SearchSuggestBaseItem {
|
|
18
|
+
type: SuggestItemType.Page;
|
|
19
|
+
title: string;
|
|
20
|
+
link: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
23
|
+
}
|
|
24
|
+
interface SearchSuggestGroupItem extends SearchSuggestBaseItem {
|
|
25
|
+
type: SuggestItemType.Group;
|
|
26
|
+
title: string;
|
|
27
|
+
}
|
|
28
|
+
interface SearchSuggestDelimiterItem extends SearchSuggestBaseItem {
|
|
29
|
+
type: SuggestItemType.Delimiter;
|
|
30
|
+
}
|
|
31
|
+
interface SearchSuggestLinkItem extends SearchSuggestBaseItem {
|
|
32
|
+
type: SuggestItemType.Link;
|
|
33
|
+
title: string;
|
|
34
|
+
link: string;
|
|
35
|
+
}
|
|
36
|
+
export type SearchSuggestLinkableItem = SearchSuggestPageItem | SearchSuggestLinkItem;
|
|
37
|
+
export type SearchSuggestItem = SearchSuggestLinkableItem | SearchSuggestTextItem | SearchSuggestGroupItem | SearchSuggestDelimiterItem;
|
|
38
|
+
export type SearchResult = {
|
|
39
|
+
type: SuggestItemType;
|
|
40
|
+
title: string;
|
|
41
|
+
link: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
44
|
+
};
|
|
45
|
+
export type SearchGroup = {
|
|
46
|
+
type: SuggestItemType;
|
|
47
|
+
items: SearchSuggestItem[];
|
|
48
|
+
};
|
|
49
|
+
export type SearchProvider = {
|
|
50
|
+
suggest(query: string): Promise<SearchResult[]>;
|
|
51
|
+
link(query: string): string;
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/components/SearchSuggest/types.ts
|
|
2
|
+
var SuggestItemType = /* @__PURE__ */ ((SuggestItemType2) => {
|
|
3
|
+
SuggestItemType2["Text"] = "text";
|
|
4
|
+
SuggestItemType2["Page"] = "page";
|
|
5
|
+
SuggestItemType2["Group"] = "group";
|
|
6
|
+
SuggestItemType2["Delimiter"] = "delimiter";
|
|
7
|
+
SuggestItemType2["Link"] = "link";
|
|
8
|
+
return SuggestItemType2;
|
|
9
|
+
})(SuggestItemType || {});
|
|
10
|
+
export {
|
|
11
|
+
SuggestItemType
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type {BreadcrumbItem} from '../../models';\n\nexport enum SuggestItemType {\n Text = 'text',\n Page = 'page',\n Group = 'group',\n Delimiter = 'delimiter',\n Link = 'link',\n}\n\ninterface SearchSuggestBaseItem {\n type: SuggestItemType;\n disabled?: boolean;\n}\n\ninterface SearchSuggestTextItem extends SearchSuggestBaseItem {\n type: SuggestItemType.Text;\n title: string;\n}\n\ninterface SearchSuggestPageItem extends SearchSuggestBaseItem {\n type: SuggestItemType.Page;\n title: string;\n link: string;\n description?: string;\n breadcrumbs?: BreadcrumbItem[];\n}\n\ninterface SearchSuggestGroupItem extends SearchSuggestBaseItem {\n type: SuggestItemType.Group;\n title: string;\n}\n\ninterface SearchSuggestDelimiterItem extends SearchSuggestBaseItem {\n type: SuggestItemType.Delimiter;\n}\n\ninterface SearchSuggestLinkItem extends SearchSuggestBaseItem {\n type: SuggestItemType.Link;\n title: string;\n link: string;\n}\n\nexport type SearchSuggestLinkableItem = SearchSuggestPageItem | SearchSuggestLinkItem;\n\nexport type SearchSuggestItem =\n | SearchSuggestLinkableItem\n | SearchSuggestTextItem\n | SearchSuggestGroupItem\n | SearchSuggestDelimiterItem;\n\nexport type SearchResult = {\n type: SuggestItemType;\n title: string;\n link: string;\n description?: string;\n breadcrumbs?: BreadcrumbItem[];\n};\n\nexport type SearchGroup = {\n type: SuggestItemType;\n items: SearchSuggestItem[];\n};\n\nexport type SearchProvider = {\n suggest(query: string): Promise<SearchResult[]>;\n link(query: string): string;\n};\n"],
|
|
5
|
+
"mappings": ";AAEO,IAAK,kBAAL,kBAAKA,qBAAL;AACH,EAAAA,iBAAA,UAAO;AACP,EAAAA,iBAAA,UAAO;AACP,EAAAA,iBAAA,WAAQ;AACR,EAAAA,iBAAA,eAAY;AACZ,EAAAA,iBAAA,UAAO;AALC,SAAAA;AAAA,GAAA;",
|
|
6
|
+
"names": ["SuggestItemType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
onFocus?: () => void;
|
|
3
|
+
onBlur?: () => void;
|
|
4
|
+
};
|
|
5
|
+
type Result = [
|
|
6
|
+
boolean,
|
|
7
|
+
(value: boolean) => void,
|
|
8
|
+
{
|
|
9
|
+
onFocus?: () => void;
|
|
10
|
+
onBlur?: () => void;
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
export declare function useFocus({ onFocus, onBlur }: Props): Result;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/components/SearchSuggest/useFocus.ts
|
|
2
|
+
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
function useFocus({ onFocus, onBlur }) {
|
|
4
|
+
const [focused, setFocused] = useState(false);
|
|
5
|
+
const _onFocus = useCallback(() => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
setFocused(true);
|
|
8
|
+
if (onFocus) {
|
|
9
|
+
onFocus();
|
|
10
|
+
}
|
|
11
|
+
}, 100);
|
|
12
|
+
}, [onFocus, setFocused]);
|
|
13
|
+
const _onBlur = useCallback(() => {
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
setFocused(false);
|
|
16
|
+
if (onBlur) {
|
|
17
|
+
onBlur();
|
|
18
|
+
}
|
|
19
|
+
}, 100);
|
|
20
|
+
}, [onBlur, setFocused]);
|
|
21
|
+
const handlers = useMemo(() => ({ onFocus: _onFocus, onBlur: _onBlur }), [_onFocus, _onBlur]);
|
|
22
|
+
return [focused, setFocused, handlers];
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
useFocus
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=useFocus.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/SearchSuggest/useFocus.ts"],
|
|
4
|
+
"sourcesContent": ["import {useCallback, useMemo, useState} from 'react';\n\ntype Props = {\n onFocus?: () => void;\n onBlur?: () => void;\n};\n\ntype Result = [\n boolean,\n (value: boolean) => void,\n {\n onFocus?: () => void;\n onBlur?: () => void;\n },\n];\n\nexport function useFocus({onFocus, onBlur}: Props): Result {\n const [focused, setFocused] = useState(false);\n const _onFocus = useCallback(() => {\n setTimeout(() => {\n setFocused(true);\n if (onFocus) {\n onFocus();\n }\n }, 100);\n }, [onFocus, setFocused]);\n\n const _onBlur = useCallback(() => {\n setTimeout(() => {\n setFocused(false);\n if (onBlur) {\n onBlur();\n }\n }, 100);\n }, [onBlur, setFocused]);\n\n const handlers = useMemo(() => ({onFocus: _onFocus, onBlur: _onBlur}), [_onFocus, _onBlur]);\n\n return [focused, setFocused, handlers];\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAQ,aAAa,SAAS,gBAAe;AAgBtC,SAAS,SAAS,EAAC,SAAS,OAAM,GAAkB;AACvD,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,WAAW,YAAY,MAAM;AAC/B,eAAW,MAAM;AACb,iBAAW,IAAI;AACf,UAAI,SAAS;AACT,gBAAQ;AAAA,MACZ;AAAA,IACJ,GAAG,GAAG;AAAA,EACV,GAAG,CAAC,SAAS,UAAU,CAAC;AAExB,QAAM,UAAU,YAAY,MAAM;AAC9B,eAAW,MAAM;AACb,iBAAW,KAAK;AAChB,UAAI,QAAQ;AACR,eAAO;AAAA,MACX;AAAA,IACJ,GAAG,GAAG;AAAA,EACV,GAAG,CAAC,QAAQ,UAAU,CAAC;AAEvB,QAAM,WAAW,QAAQ,OAAO,EAAC,SAAS,UAAU,QAAQ,QAAO,IAAI,CAAC,UAAU,OAAO,CAAC;AAE1F,SAAO,CAAC,SAAS,YAAY,QAAQ;AACzC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SearchProvider, SearchSuggestItem } from './types';
|
|
2
|
+
type Zalgo<T> = Promise<T> | T;
|
|
3
|
+
type Items = Zalgo<SearchSuggestItem[] | null>;
|
|
4
|
+
type Request = (query: string) => () => void;
|
|
5
|
+
export declare function useProvider(provider: SearchProvider): [Items, Request];
|
|
6
|
+
export {};
|