@redocly/theme 0.15.1 → 0.16.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/lib/I18n/LanguagePicker.js +2 -1
- package/lib/components/Breadcrumbs/Breadcrumb.js +0 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +6 -0
- package/lib/components/Cards/Card.d.ts +1 -0
- package/lib/components/Cards/Card.js +1 -1
- package/lib/components/Cards/CardsBlock.d.ts +1 -3
- package/lib/components/Cards/CardsBlock.js +2 -1
- package/lib/components/Catalog/Catalog.js +1 -1
- package/lib/components/CodeBlock/CodeBlock.d.ts +1 -3
- package/lib/components/CodeBlock/CodeBlock.js +2 -1
- package/lib/components/CodeSample/CodeSample.d.ts +2 -1
- package/lib/components/CodeSample/CodeSample.js +3 -2
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.d.ts +5 -1
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.js +3 -2
- package/lib/components/Feedback/Comment.d.ts +1 -1
- package/lib/components/Feedback/Comment.js +3 -3
- package/lib/components/Feedback/Rating.d.ts +1 -1
- package/lib/components/Feedback/Rating.js +2 -2
- package/lib/components/Feedback/Reasons.d.ts +1 -1
- package/lib/components/Feedback/Reasons.js +2 -2
- package/lib/components/Feedback/ReportDialog.js +1 -1
- package/lib/components/Feedback/Sentiment.d.ts +1 -1
- package/lib/components/Feedback/Sentiment.js +2 -2
- package/lib/components/Feedback/types.d.ts +5 -0
- package/lib/components/Footer/CustomFooter.d.ts +2 -1
- package/lib/components/Footer/CustomFooter.js +2 -2
- package/lib/components/Footer/CustomFooterNavItem.d.ts +2 -1
- package/lib/components/Footer/CustomFooterNavItem.js +2 -2
- package/lib/components/Footer/Footer.d.ts +2 -1
- package/lib/components/Footer/Footer.js +2 -2
- package/lib/components/Footer/FooterColumn.d.ts +2 -1
- package/lib/components/Footer/FooterColumn.js +2 -2
- package/lib/components/Footer/FooterColumns.d.ts +2 -1
- package/lib/components/Footer/FooterColumns.js +2 -2
- package/lib/components/Footer/FooterCopyright.d.ts +2 -1
- package/lib/components/Footer/FooterCopyright.js +2 -2
- package/lib/components/JsonViewer/JsonViewer.d.ts +1 -3
- package/lib/components/LastUpdated/LastUpdated.d.ts +1 -0
- package/lib/components/LastUpdated/LastUpdated.js +1 -1
- package/lib/components/Markdown/ContainerWrapper.d.ts +1 -3
- package/lib/components/Markdown/ContainerWrapper.js +2 -1
- package/lib/components/Markdown/Heading.d.ts +2 -1
- package/lib/components/Markdown/Heading.js +2 -2
- package/lib/components/Markdown/MarkdownLayout.d.ts +2 -1
- package/lib/components/Markdown/MarkdownLayout.js +2 -2
- package/lib/components/Markdown/MarkdownWrapper.d.ts +1 -3
- package/lib/components/Markdown/MarkdownWrapper.js +2 -1
- package/lib/components/Markdown/Mermaid.d.ts +2 -1
- package/lib/components/Markdown/Mermaid.js +3 -2
- package/lib/components/Markdown/PageWrapper.d.ts +1 -3
- package/lib/components/Markdown/PageWrapper.js +2 -1
- package/lib/components/Markdown/Sup.d.ts +3 -1
- package/lib/components/Markdown/Sup.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +6 -4
- package/lib/components/Menu/MenuContainer.d.ts +1 -0
- package/lib/components/Menu/MenuContainer.js +2 -1
- package/lib/components/Menu/MenuGroup.d.ts +2 -1
- package/lib/components/Menu/MenuGroup.js +3 -3
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +19 -3
- package/lib/components/Menu/MenuItemLabel.d.ts +1 -3
- package/lib/components/Menu/MenuItemLabel.js +18 -9
- package/lib/components/Menu/MenuItemSwitch.js +4 -2
- package/lib/components/Menu/MenuLink.d.ts +1 -3
- package/lib/components/Menu/MenuLink.js +2 -1
- package/lib/components/Menu/MenuLinkItem.d.ts +1 -1
- package/lib/components/Menu/MenuLinkItem.js +2 -2
- package/lib/components/Menu/MobileMenu.d.ts +11 -0
- package/lib/components/Menu/MobileMenu.js +179 -0
- package/lib/components/Menu/MobileMenuGroup.d.ts +9 -0
- package/lib/components/Menu/MobileMenuGroup.js +53 -0
- package/lib/components/Menu/index.d.ts +1 -0
- package/lib/components/Menu/index.js +1 -0
- package/lib/components/Navbar/BurgerButton.d.ts +5 -0
- package/lib/components/Navbar/BurgerButton.js +29 -0
- package/lib/components/Navbar/MobileUserProfile.d.ts +2 -0
- package/lib/components/Navbar/MobileUserProfile.js +78 -0
- package/lib/components/Navbar/Navbar.d.ts +1 -0
- package/lib/components/Navbar/Navbar.js +29 -9
- package/lib/components/Navbar/NavbarDropdown.d.ts +2 -1
- package/lib/components/Navbar/NavbarDropdown.js +2 -2
- package/lib/components/Navbar/NavbarMenu.d.ts +2 -1
- package/lib/components/Navbar/NavbarMenu.js +2 -2
- package/lib/components/NavbarLogo/NavbarLogo.d.ts +2 -1
- package/lib/components/NavbarLogo/NavbarLogo.js +2 -2
- package/lib/components/OpenApiDocs/DevOnboardingTryItSecurity.d.ts +1 -1
- package/lib/components/OpenApiDocs/DevOnboardingTryItSecurity.js +1 -1
- package/lib/components/PageNavigation/NextButton.d.ts +2 -1
- package/lib/components/PageNavigation/NextButton.js +2 -2
- package/lib/components/PageNavigation/PageNavigation.d.ts +2 -1
- package/lib/components/PageNavigation/PageNavigation.js +2 -2
- package/lib/components/PageNavigation/PreviousButton.d.ts +2 -1
- package/lib/components/PageNavigation/PreviousButton.js +2 -2
- package/lib/components/Panel/PanelBody.d.ts +1 -3
- package/lib/components/Panel/PanelBody.js +2 -1
- package/lib/components/Panel/PanelHeader.d.ts +1 -3
- package/lib/components/Panel/PanelHeader.js +2 -1
- package/lib/components/Panel/PanelHeaderTitle.d.ts +1 -3
- package/lib/components/Panel/PanelHeaderTitle.js +2 -1
- package/lib/components/Profile/Profile.d.ts +6 -0
- package/lib/components/Profile/Profile.js +7 -7
- package/lib/components/Profile/types.d.ts +1 -0
- package/lib/components/SamplesPanelControls/SamplesPanelControls.d.ts +2 -6
- package/lib/components/SamplesPanelControls/SamplesPanelControls.js +2 -1
- package/lib/components/Search/CancelSearch.d.ts +2 -1
- package/lib/components/Search/CancelSearch.js +2 -2
- package/lib/components/Search/ClearIcon.d.ts +1 -3
- package/lib/components/Search/ClearIcon.js +2 -1
- package/lib/components/Search/ClockBackwardsIcon.d.ts +1 -4
- package/lib/components/Search/Input.d.ts +1 -3
- package/lib/components/Search/Input.js +2 -1
- package/lib/components/Search/InputWrapper.d.ts +2 -1
- package/lib/components/Search/InputWrapper.js +2 -2
- package/lib/components/Search/MobileSearchTrigger.d.ts +2 -1
- package/lib/components/Search/MobileSearchTrigger.js +6 -5
- package/lib/components/Search/Popover.d.ts +1 -3
- package/lib/components/Search/Popover.js +3 -2
- package/lib/components/Search/RecentSearches.d.ts +2 -1
- package/lib/components/Search/RecentSearches.js +3 -3
- package/lib/components/Search/Search.d.ts +3 -1
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Search/SearchDialog.d.ts +2 -1
- package/lib/components/Search/SearchDialog.js +4 -3
- package/lib/components/Search/SearchIcon.d.ts +1 -3
- package/lib/components/Search/SearchIcon.js +2 -1
- package/lib/components/Search/SearchItem.d.ts +2 -1
- package/lib/components/Search/SearchItem.js +3 -3
- package/lib/components/Search/SearchTrigger.d.ts +2 -1
- package/lib/components/Search/SearchTrigger.js +2 -2
- package/lib/components/Search/Shortcut.d.ts +2 -1
- package/lib/components/Search/Shortcut.js +2 -2
- package/lib/components/Search/ShortcutKey.d.ts +1 -0
- package/lib/components/Search/ShortcutKey.js +1 -1
- package/lib/components/Search/SidebarSearch.d.ts +1 -3
- package/lib/components/Search/SidebarSearch.js +2 -1
- package/lib/components/Search/SuggestedPages.d.ts +3 -1
- package/lib/components/Search/SuggestedPages.js +2 -2
- package/lib/components/Separator/Separator.d.ts +1 -1
- package/lib/components/Separator/Separator.js +2 -2
- package/lib/components/Separator/SeparatorItem.d.ts +1 -5
- package/lib/components/Separator/SeparatorItem.js +7 -2
- package/lib/components/Separator/SeparatorLine.d.ts +1 -3
- package/lib/components/Separator/SeparatorLine.js +2 -1
- package/lib/components/Sidebar/ApiCallItem.d.ts +1 -1
- package/lib/components/Sidebar/ApiCallItem.js +10 -3
- package/lib/components/Sidebar/BackButton.d.ts +2 -1
- package/lib/components/Sidebar/BackButton.js +2 -2
- package/lib/components/Sidebar/Drilldown.d.ts +2 -1
- package/lib/components/Sidebar/Drilldown.js +2 -2
- package/lib/components/Sidebar/DrilldownMenu.d.ts +1 -1
- package/lib/components/Sidebar/DrilldownMenu.js +3 -3
- package/lib/components/Sidebar/DrilldownMenuItem.d.ts +1 -1
- package/lib/components/Sidebar/DrilldownMenuItem.js +2 -2
- package/lib/components/Sidebar/HeaderWrapper.d.ts +1 -3
- package/lib/components/Sidebar/HeaderWrapper.js +2 -1
- package/lib/components/Sidebar/MobileSidebarButton.d.ts +1 -3
- package/lib/components/Sidebar/MobileSidebarButton.js +3 -2
- package/lib/components/Sidebar/Sidebar.d.ts +1 -3
- package/lib/components/Sidebar/Sidebar.js +2 -1
- package/lib/components/Sidebar/SidebarLayout.d.ts +2 -1
- package/lib/components/Sidebar/SidebarLayout.js +2 -4
- package/lib/components/Sidebar/types.d.ts +3 -0
- package/lib/components/SidebarActions/SidebarActions.d.ts +2 -1
- package/lib/components/SidebarActions/SidebarActions.js +2 -2
- package/lib/components/SidebarLogo/SidebarLogo.d.ts +2 -1
- package/lib/components/SidebarLogo/SidebarLogo.js +2 -2
- package/lib/components/TableOfContent/TableOfContent.d.ts +1 -0
- package/lib/components/TableOfContent/TableOfContent.js +2 -2
- package/lib/components/Tags/Tags.d.ts +2 -1
- package/lib/components/Tags/Tags.js +2 -2
- package/lib/components/Tiles/TileHeader.d.ts +1 -3
- package/lib/components/Tiles/TileHeader.js +2 -1
- package/lib/components/Tiles/TileText.d.ts +1 -3
- package/lib/components/Tiles/TileText.js +2 -1
- package/lib/components/Typography/CompactTypography.d.ts +1 -3
- package/lib/components/Typography/Emphasis.d.ts +1 -3
- package/lib/components/Typography/Emphasis.js +2 -1
- package/lib/components/Typography/H1.d.ts +1 -3
- package/lib/components/Typography/H1.js +2 -1
- package/lib/components/Typography/H2.d.ts +1 -3
- package/lib/components/Typography/H2.js +2 -1
- package/lib/components/Typography/H3.d.ts +1 -3
- package/lib/components/Typography/H3.js +2 -1
- package/lib/components/Typography/SectionHeader.d.ts +1 -3
- package/lib/components/Typography/SectionHeader.js +2 -1
- package/lib/components/Typography/Typography.d.ts +1 -3
- package/lib/components/Typography/Typography.js +2 -1
- package/lib/globalStyle.js +62 -2
- package/lib/hooks/useMobileMenu.js +7 -1
- package/lib/icons/BurgerIcon/BurgerIcon.d.ts +5 -0
- package/lib/icons/BurgerIcon/BurgerIcon.js +15 -0
- package/lib/icons/BurgerIcon/index.d.ts +1 -0
- package/lib/icons/BurgerIcon/index.js +6 -0
- package/lib/icons/CloseIcon/CloseIcon.d.ts +5 -0
- package/lib/icons/CloseIcon/CloseIcon.js +16 -0
- package/lib/icons/CloseIcon/index.d.ts +1 -0
- package/lib/icons/CloseIcon/index.js +6 -0
- package/lib/icons/ColorModeIcon/ColorModeIcon.js +5 -1
- package/lib/icons/ExpandIcon/ExpandIcon.d.ts +8 -0
- package/lib/icons/ExpandIcon/ExpandIcon.js +31 -0
- package/lib/icons/ExpandIcon/index.d.ts +1 -0
- package/lib/icons/ExpandIcon/index.js +6 -0
- package/lib/icons/LogoutIcon/LogoutIcon.d.ts +5 -0
- package/lib/icons/LogoutIcon/LogoutIcon.js +17 -0
- package/lib/icons/LogoutIcon/index.d.ts +1 -0
- package/lib/icons/LogoutIcon/index.js +6 -0
- package/lib/icons/index.d.ts +4 -0
- package/lib/icons/index.js +4 -0
- package/lib/mocks/Sidebar/useSidebarItems.d.ts +3 -0
- package/lib/mocks/Sidebar/useSidebarItems.js +8 -0
- package/lib/mocks/hooks/index.d.ts +4 -1
- package/lib/mocks/hooks/index.js +16 -1
- package/lib/mocks/media-css.d.ts +5 -0
- package/lib/mocks/media-css.js +5 -0
- package/lib/ui/Dropdown.js +1 -1
- package/lib/ui/darkColors.js +11 -3
- package/package.json +4 -3
- package/src/I18n/LanguagePicker.tsx +2 -1
- package/src/components/Breadcrumbs/Breadcrumb.tsx +0 -1
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +6 -0
- package/src/components/Cards/Card.tsx +2 -1
- package/src/components/Cards/CardsBlock.tsx +2 -1
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/CodeBlock/CodeBlock.ts +2 -1
- package/src/components/CodeSample/CodeSample.tsx +4 -1
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +7 -1
- package/src/components/Feedback/Comment.tsx +3 -3
- package/src/components/Feedback/Rating.tsx +2 -2
- package/src/components/Feedback/Reasons.tsx +6 -2
- package/src/components/Feedback/ReportDialog.tsx +1 -1
- package/src/components/Feedback/Sentiment.tsx +2 -2
- package/src/components/Feedback/types.ts +5 -0
- package/src/components/Footer/CustomFooter.tsx +3 -2
- package/src/components/Footer/CustomFooterNavItem.tsx +3 -2
- package/src/components/Footer/Footer.tsx +3 -1
- package/src/components/Footer/FooterColumn.tsx +3 -2
- package/src/components/Footer/FooterColumns.tsx +3 -2
- package/src/components/Footer/FooterCopyright.tsx +6 -1
- package/src/components/LastUpdated/LastUpdated.tsx +2 -0
- package/src/components/Markdown/ContainerWrapper.tsx +2 -1
- package/src/components/Markdown/Heading.tsx +3 -1
- package/src/components/Markdown/MarkdownLayout.tsx +3 -1
- package/src/components/Markdown/MarkdownWrapper.tsx +2 -1
- package/src/components/Markdown/Mermaid.tsx +5 -1
- package/src/components/Markdown/PageWrapper.tsx +2 -1
- package/src/components/Markdown/Sup.tsx +9 -2
- package/src/components/Menu/Menu.tsx +16 -5
- package/src/components/Menu/MenuContainer.tsx +3 -1
- package/src/components/Menu/MenuGroup.tsx +4 -5
- package/src/components/Menu/MenuItem.tsx +22 -4
- package/src/components/Menu/MenuItemLabel.tsx +19 -10
- package/src/components/Menu/MenuItemSwitch.tsx +7 -5
- package/src/components/Menu/MenuLink.tsx +2 -1
- package/src/components/Menu/MenuLinkItem.tsx +2 -1
- package/src/components/Menu/MobileMenu.tsx +209 -0
- package/src/components/Menu/MobileMenuGroup.tsx +73 -0
- package/src/components/Menu/index.ts +1 -0
- package/src/components/Navbar/BurgerButton.tsx +34 -0
- package/src/components/Navbar/MobileUserProfile.tsx +90 -0
- package/src/components/Navbar/Navbar.tsx +43 -14
- package/src/components/Navbar/NavbarDropdown.tsx +3 -2
- package/src/components/Navbar/NavbarMenu.tsx +8 -2
- package/src/components/NavbarLogo/NavbarLogo.tsx +11 -3
- package/src/components/OpenApiDocs/DevOnboardingTryItSecurity.tsx +2 -4
- package/src/components/PageNavigation/NextButton.tsx +3 -1
- package/src/components/PageNavigation/PageNavigation.tsx +10 -2
- package/src/components/PageNavigation/PreviousButton.tsx +3 -1
- package/src/components/Panel/PanelBody.ts +2 -1
- package/src/components/Panel/PanelHeader.ts +2 -1
- package/src/components/Panel/PanelHeaderTitle.ts +2 -1
- package/src/components/Profile/Profile.tsx +2 -2
- package/src/components/Profile/types.ts +1 -0
- package/src/components/SamplesPanelControls/SamplesPanelControls.ts +6 -3
- package/src/components/Search/CancelSearch.tsx +8 -2
- package/src/components/Search/ClearIcon.tsx +2 -1
- package/src/components/Search/ClockBackwardsIcon.tsx +1 -1
- package/src/components/Search/Input.tsx +2 -1
- package/src/components/Search/InputWrapper.tsx +3 -1
- package/src/components/Search/MobileSearchTrigger.tsx +16 -5
- package/src/components/Search/Popover.tsx +3 -2
- package/src/components/Search/RecentSearches.tsx +9 -3
- package/src/components/Search/Search.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +10 -3
- package/src/components/Search/SearchIcon.tsx +2 -1
- package/src/components/Search/SearchItem.tsx +4 -1
- package/src/components/Search/SearchTrigger.tsx +8 -2
- package/src/components/Search/Shortcut.tsx +3 -1
- package/src/components/Search/ShortcutKey.tsx +2 -1
- package/src/components/Search/SidebarSearch.tsx +2 -1
- package/src/components/Search/SuggestedPages.tsx +2 -2
- package/src/components/Separator/Separator.tsx +2 -2
- package/src/components/Separator/SeparatorItem.tsx +11 -4
- package/src/components/Separator/SeparatorLine.tsx +2 -1
- package/src/components/Sidebar/ApiCallItem.tsx +12 -4
- package/src/components/Sidebar/BackButton.tsx +3 -1
- package/src/components/Sidebar/Drilldown.tsx +3 -1
- package/src/components/Sidebar/DrilldownMenu.tsx +3 -2
- package/src/components/Sidebar/DrilldownMenuItem.tsx +2 -2
- package/src/components/Sidebar/HeaderWrapper.tsx +2 -1
- package/src/components/Sidebar/MobileSidebarButton.tsx +3 -2
- package/src/components/Sidebar/Sidebar.tsx +2 -1
- package/src/components/Sidebar/SidebarLayout.tsx +3 -4
- package/src/components/Sidebar/types.ts +3 -0
- package/src/components/SidebarActions/SidebarActions.tsx +3 -0
- package/src/components/SidebarLogo/SidebarLogo.tsx +3 -0
- package/src/components/TableOfContent/TableOfContent.tsx +3 -2
- package/src/components/Tags/Tags.tsx +2 -2
- package/src/components/Tiles/TileHeader.ts +2 -1
- package/src/components/Tiles/TileText.tsx +2 -1
- package/src/components/Typography/Emphasis.ts +2 -1
- package/src/components/Typography/H1.ts +2 -1
- package/src/components/Typography/H2.ts +2 -1
- package/src/components/Typography/H3.ts +2 -1
- package/src/components/Typography/SectionHeader.ts +2 -1
- package/src/components/Typography/Typography.ts +2 -1
- package/src/globalStyle.ts +66 -3
- package/src/hooks/useMobileMenu.ts +5 -1
- package/src/icons/BurgerIcon/BurgerIcon.tsx +12 -0
- package/src/icons/BurgerIcon/index.ts +1 -0
- package/src/icons/CloseIcon/CloseIcon.tsx +13 -0
- package/src/icons/CloseIcon/index.ts +1 -0
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +5 -1
- package/src/icons/ExpandIcon/ExpandIcon.tsx +46 -0
- package/src/icons/ExpandIcon/index.ts +1 -0
- package/src/icons/LogoutIcon/LogoutIcon.tsx +20 -0
- package/src/icons/LogoutIcon/index.ts +1 -0
- package/src/icons/index.ts +4 -0
- package/src/mocks/Sidebar/useSidebarItems.tsx +7 -0
- package/src/mocks/hooks/index.ts +16 -1
- package/src/mocks/media-css.ts +1 -0
- package/src/ui/Dropdown.tsx +1 -1
- package/src/ui/darkColors.tsx +11 -3
- package/lib/components/Navbar/MobileNavbarDropdown.d.ts +0 -8
- package/lib/components/Navbar/MobileNavbarDropdown.js +0 -30
- package/lib/components/Navbar/MobileNavbarItem.d.ts +0 -15
- package/lib/components/Navbar/MobileNavbarItem.js +0 -110
- package/lib/components/Navbar/MobileNavbarMenu.d.ts +0 -6
- package/lib/components/Navbar/MobileNavbarMenu.js +0 -92
- package/lib/components/Navbar/MobileNavbarMenuButton.d.ts +0 -4
- package/lib/components/Navbar/MobileNavbarMenuButton.js +0 -18
- package/src/components/Navbar/MobileNavbarDropdown.tsx +0 -37
- package/src/components/Navbar/MobileNavbarItem.tsx +0 -121
- package/src/components/Navbar/MobileNavbarMenu.tsx +0 -111
- package/src/components/Navbar/MobileNavbarMenuButton.tsx +0 -13
|
@@ -5,13 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Popover = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.Popover = styled_components_1.default.div.attrs(() => ({
|
|
8
|
+
exports.Popover = styled_components_1.default.div.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Search/Popover',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
position: absolute;
|
|
12
13
|
top: calc(100% + 10px);
|
|
13
14
|
right: 0;
|
|
14
|
-
z-index:
|
|
15
|
+
z-index: var(--z-index-raised);
|
|
15
16
|
min-width: 100%;
|
|
16
17
|
max-width: 90vw;
|
|
17
18
|
max-height: 400px;
|
|
@@ -33,7 +33,7 @@ const ClockBackwardsIcon_1 = require("../../components/Search/ClockBackwardsIcon
|
|
|
33
33
|
const ClearIcon_1 = require("../../components/Search/ClearIcon");
|
|
34
34
|
const search_1 = require("../../mocks/search");
|
|
35
35
|
const hooks_1 = require("../../mocks/hooks");
|
|
36
|
-
function RecentSearches({ onSelect }) {
|
|
36
|
+
function RecentSearches({ onSelect, className, }) {
|
|
37
37
|
const { items, removeSearchHistoryItem } = (0, search_1.useRecentSearches)();
|
|
38
38
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
39
39
|
const translationKeys = {
|
|
@@ -50,7 +50,7 @@ function RecentSearches({ onSelect }) {
|
|
|
50
50
|
onSelect(item);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
return (React.createElement(Wrapper, { "data-component-name": "Search/RecentSearches" },
|
|
53
|
+
return (React.createElement(Wrapper, { "data-component-name": "Search/RecentSearches", className: className },
|
|
54
54
|
React.createElement(Title, { "data-translation-key": translationKeys.title }, translate(translationKeys.title, 'Recent searches')),
|
|
55
55
|
React.createElement(RecentItems, null, items.map((item) => (React.createElement(Item, { key: item, onClick: () => onSelect(item), onKeyDown: (e) => handleKeyDown(e, item), tabIndex: 0, role: "link" },
|
|
56
56
|
React.createElement(Group, null,
|
|
@@ -85,7 +85,7 @@ const ClearIcon = (0, styled_components_1.default)(ClearIcon_1.ClearIcon) `
|
|
|
85
85
|
display: inline;
|
|
86
86
|
width: 10px;
|
|
87
87
|
height: 10px;
|
|
88
|
-
fill: var(--search-item-active-text-color)
|
|
88
|
+
fill: var(--search-item-active-text-color);
|
|
89
89
|
`;
|
|
90
90
|
const Item = styled_components_1.default.div `
|
|
91
91
|
display: flex;
|
|
@@ -35,7 +35,7 @@ const SearchTrigger_1 = require("../../components/Search/SearchTrigger");
|
|
|
35
35
|
const MobileSearchTrigger_1 = require("../../components/Search/MobileSearchTrigger");
|
|
36
36
|
const SearchDialog_1 = require("../../components/Search/SearchDialog");
|
|
37
37
|
const hooks_1 = require("../../hooks");
|
|
38
|
-
function Search() {
|
|
38
|
+
function Search({ className }) {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
41
41
|
const themeSettings = (0, hooks_1.useThemeConfig)();
|
|
@@ -55,7 +55,7 @@ function Search() {
|
|
|
55
55
|
setIsOpen(false);
|
|
56
56
|
}, []);
|
|
57
57
|
(0, react_1.useEffect)(onClose, [location, onClose]);
|
|
58
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Search/Search" },
|
|
58
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Search/Search", className: className },
|
|
59
59
|
react_1.default.createElement(SearchTrigger_1.SearchTrigger, { onClick: () => setIsOpen(true) }),
|
|
60
60
|
react_1.default.createElement(MobileSearchTrigger_1.MobileSearchTrigger, { onClick: () => setIsOpen(true) }),
|
|
61
61
|
isOpen && react_1.default.createElement(SearchDialog_1.SearchDialog, { onClose: onClose })));
|
|
@@ -29,6 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.SearchDialog = void 0;
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
+
const utils_1 = require("../../utils");
|
|
32
33
|
const search_1 = require("../../mocks/search");
|
|
33
34
|
const InputWrapper_1 = require("../../components/Search/InputWrapper");
|
|
34
35
|
const SearchItem_1 = require("../../components/Search/SearchItem");
|
|
@@ -38,7 +39,7 @@ const RecentSearches_1 = require("../../components/Search/RecentSearches");
|
|
|
38
39
|
const SuggestedPages_1 = require("../../components/Search/SuggestedPages");
|
|
39
40
|
const CancelSearch_1 = require("../../components/Search/CancelSearch");
|
|
40
41
|
const useDialogHotKeys_1 = require("../../hooks/useDialogHotKeys");
|
|
41
|
-
const SearchDialog = ({ onClose }) => {
|
|
42
|
+
const SearchDialog = ({ onClose, className, }) => {
|
|
42
43
|
const { query, setQuery, items, isLoading } = (0, search_1.useFuseSearch)();
|
|
43
44
|
const modalRef = (0, react_1.useRef)(null);
|
|
44
45
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
@@ -61,7 +62,7 @@ const SearchDialog = ({ onClose }) => {
|
|
|
61
62
|
const mapItem = (item) => {
|
|
62
63
|
return react_1.default.createElement(SearchItem_1.SearchItem, { key: item.id, item: item });
|
|
63
64
|
};
|
|
64
|
-
return (react_1.default.createElement(Overlay, { "data-component-name": "Search/SearchDialog", ref: modalRef, onClick: handleOverlayClick, className:
|
|
65
|
+
return (react_1.default.createElement(Overlay, { "data-component-name": "Search/SearchDialog", ref: modalRef, onClick: handleOverlayClick, className: (0, utils_1.concatClassNames)('overlay', className) },
|
|
65
66
|
react_1.default.createElement(Container, null,
|
|
66
67
|
react_1.default.createElement(TopContainer, null,
|
|
67
68
|
react_1.default.createElement(InputWrapper_1.InputWrapper, { value: query, change: setQuery, placeholder: translate('theme.search.label', 'Search docs...'), isLoading: isLoading })),
|
|
@@ -84,7 +85,7 @@ const Overlay = styled_components_1.default.div `
|
|
|
84
85
|
width: 100vw;
|
|
85
86
|
height: 100vh;
|
|
86
87
|
background: var(--modal-overlay-background-color);
|
|
87
|
-
z-index:
|
|
88
|
+
z-index: var(--z-index-overlay);
|
|
88
89
|
display: flex;
|
|
89
90
|
align-items: center;
|
|
90
91
|
justify-content: center;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const SearchIcon: import("styled-components").StyledComponent<(props: SVGProps<SVGSVGElement>) => JSX.Element, any, {
|
|
3
|
-
'data-component-name': string;
|
|
4
|
-
}, "data-component-name">;
|
|
2
|
+
export declare const SearchIcon: import("styled-components").StyledComponent<(props: SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
|
|
@@ -8,8 +8,9 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", version: "1.1", x: "0", y: "0", viewBox: "0 0 490 490", "data-component-name": "Search/SearchIcon" }, props),
|
|
10
10
|
react_1.default.createElement("path", { d: "M484 455.2L366.2 337.4c29.2-35.6 46.8-81.2 46.8-130.9C413 92.5 320.5 0 206.5 0 92.4 0 0 92.5 0 206.5S92.4 413 206.5 413c49.7 0 95.2-17.5 130.8-46.7L455.1 484c8 8 20.9 8 28.9 0C492 476.1 492 463.1 484 455.2zM206.5 371.9C115.2 371.9 41 297.7 41 206.5S115.2 41 206.5 41C297.7 41 372 115.3 372 206.5S297.7 371.9 206.5 371.9z" })));
|
|
11
|
-
exports.SearchIcon = (0, styled_components_1.default)(Icon).attrs(() => ({
|
|
11
|
+
exports.SearchIcon = (0, styled_components_1.default)(Icon).attrs(({ className }) => ({
|
|
12
12
|
'data-component-name': 'Search/SearchIcon',
|
|
13
|
+
className,
|
|
13
14
|
})) `
|
|
14
15
|
cursor: pointer;
|
|
15
16
|
width: 1em;
|
|
@@ -3,6 +3,7 @@ import type { ActiveItem } from '../../types/portal/src/shared/types/activeItem'
|
|
|
3
3
|
import type { SearchDocument } from '../../types/portal/src/shared/types/searchDocument';
|
|
4
4
|
interface SearchItemProps {
|
|
5
5
|
item: ActiveItem<SearchDocument>;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function SearchItem({ item }: SearchItemProps): JSX.Element;
|
|
8
|
+
export declare function SearchItem({ item, className }: SearchItemProps): JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -32,7 +32,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
32
32
|
const OperationBadge_1 = require("../../components/OperationBadge");
|
|
33
33
|
const Link_1 = require("../../mocks/Link");
|
|
34
34
|
const utils_1 = require("../../components/Search/utils");
|
|
35
|
-
function SearchItem({ item }) {
|
|
35
|
+
function SearchItem({ item, className }) {
|
|
36
36
|
var _a, _b;
|
|
37
37
|
const ref = (0, react_1.useRef)();
|
|
38
38
|
(0, react_1.useEffect)(() => {
|
|
@@ -50,14 +50,14 @@ function SearchItem({ item }) {
|
|
|
50
50
|
return (react_1.default.createElement(react_1.default.Fragment, null, ((_a = item.parameters) === null || _a === void 0 ? void 0 : _a.length) ? (react_1.default.createElement(react_1.default.Fragment, null, item.parameters.map((param, index) => {
|
|
51
51
|
var _a, _b;
|
|
52
52
|
const path = `${param.place} → ${((_a = param.path) === null || _a === void 0 ? void 0 : _a.length) ? ((_b = param.path) === null || _b === void 0 ? void 0 : _b.join(' → ')) + ' → ' : ''}`;
|
|
53
|
-
return (react_1.default.createElement(SearchLink, { key: `${item.id}-${index}`, to: item.url, tabIndex: 0, innerRef: ref, "data-component-name": "Search/SearchItem" },
|
|
53
|
+
return (react_1.default.createElement(SearchLink, { className: className, key: `${item.id}-${index}`, to: item.url, tabIndex: 0, innerRef: ref, "data-component-name": "Search/SearchItem" },
|
|
54
54
|
header,
|
|
55
55
|
react_1.default.createElement(Place, null,
|
|
56
56
|
react_1.default.createElement("div", null,
|
|
57
57
|
path,
|
|
58
58
|
(0, utils_1.highlight)(param.name)),
|
|
59
59
|
react_1.default.createElement("div", null, (0, utils_1.highlight)(param.description)))));
|
|
60
|
-
}))) : (react_1.default.createElement(SearchLink, { to: item.url, tabIndex: 0, innerRef: ref, "data-component-name": "Search/SearchItem" },
|
|
60
|
+
}))) : (react_1.default.createElement(SearchLink, { className: className, to: item.url, tabIndex: 0, innerRef: ref, "data-component-name": "Search/SearchItem" },
|
|
61
61
|
header,
|
|
62
62
|
react_1.default.createElement(Path, null, (_b = item.path) === null || _b === void 0 ? void 0 : _b.join(' → '))))));
|
|
63
63
|
}
|
|
@@ -30,7 +30,7 @@ const hooks_1 = require("../../hooks");
|
|
|
30
30
|
const hooks_2 = require("../../mocks/hooks");
|
|
31
31
|
const SearchIcon_1 = require("../../components/Search/SearchIcon");
|
|
32
32
|
const ShortcutKey_1 = require("../../components/Search/ShortcutKey");
|
|
33
|
-
function SearchTrigger({ onClick }) {
|
|
33
|
+
function SearchTrigger({ onClick, className, }) {
|
|
34
34
|
var _a, _b;
|
|
35
35
|
const themeSettings = (0, hooks_1.useThemeConfig)();
|
|
36
36
|
const { translate } = (0, hooks_2.useTranslate)();
|
|
@@ -38,7 +38,7 @@ function SearchTrigger({ onClick }) {
|
|
|
38
38
|
label: 'theme.search.navbar.label',
|
|
39
39
|
};
|
|
40
40
|
const keyShortcuts = (_b = (_a = themeSettings === null || themeSettings === void 0 ? void 0 : themeSettings.search) === null || _a === void 0 ? void 0 : _a.shortcuts) !== null && _b !== void 0 ? _b : ['/'];
|
|
41
|
-
return (React.createElement(Wrapper, { "data-component-name": "Search/SearchTrigger", onClick: onClick },
|
|
41
|
+
return (React.createElement(Wrapper, { "data-component-name": "Search/SearchTrigger", onClick: onClick, className: className },
|
|
42
42
|
React.createElement(SearchIconSmall, null),
|
|
43
43
|
React.createElement(Label, { "data-translation-key": translationKeys.label }, translate(translationKeys.label, 'Search')),
|
|
44
44
|
React.createElement(ShortcutKey_1.ShortcutKey, { keyShortcuts: keyShortcuts })));
|
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.Shortcut = void 0;
|
|
30
30
|
const React = __importStar(require("react"));
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
-
function Shortcut({ combination, text, }) {
|
|
33
|
-
return (React.createElement(Wrapper, { "data-component-name": "Search/Shortcut" },
|
|
32
|
+
function Shortcut({ combination, text, className, }) {
|
|
33
|
+
return (React.createElement(Wrapper, { "data-component-name": "Search/Shortcut", className: className },
|
|
34
34
|
React.createElement(Key, null, combination),
|
|
35
35
|
text));
|
|
36
36
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface ShortcutKeyProps {
|
|
3
3
|
keyShortcuts?: string | string[];
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function ShortcutKey(props: ShortcutKeyProps): JSX.Element;
|
|
6
7
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -17,7 +17,7 @@ function ShortcutKey(props) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
mainShortcutKey = mainShortcutKey === null || mainShortcutKey === void 0 ? void 0 : mainShortcutKey.toUpperCase();
|
|
20
|
-
return react_1.default.createElement(exports.Wrapper,
|
|
20
|
+
return react_1.default.createElement(exports.Wrapper, { className: props.className }, mainShortcutKey);
|
|
21
21
|
}
|
|
22
22
|
exports.ShortcutKey = ShortcutKey;
|
|
23
23
|
exports.Wrapper = styled_components_1.default.div `
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { Search } from '../../components/Search/Search';
|
|
2
|
-
export declare const SidebarSearch: import("styled-components").StyledComponent<typeof Search, any, {
|
|
3
|
-
'data-component-name': string;
|
|
4
|
-
}, "data-component-name">;
|
|
2
|
+
export declare const SidebarSearch: import("styled-components").StyledComponent<typeof Search, any, {}, never>;
|
|
@@ -7,8 +7,9 @@ exports.SidebarSearch = void 0;
|
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const Search_1 = require("../../components/Search/Search");
|
|
9
9
|
const Popover_1 = require("../../components/Search/Popover");
|
|
10
|
-
exports.SidebarSearch = (0, styled_components_1.default)(Search_1.Search).attrs(() => ({
|
|
10
|
+
exports.SidebarSearch = (0, styled_components_1.default)(Search_1.Search).attrs(({ className }) => ({
|
|
11
11
|
'data-component-name': 'Search/SidebarSearch',
|
|
12
|
+
className,
|
|
12
13
|
})) `
|
|
13
14
|
--search-input-text-color: var(--sidebar-item-active-color);
|
|
14
15
|
|
|
@@ -33,7 +33,7 @@ const ClockBackwardsIcon_1 = require("../../components/Search/ClockBackwardsIcon
|
|
|
33
33
|
const search_1 = require("../../mocks/search");
|
|
34
34
|
const Link_1 = require("../../mocks/Link");
|
|
35
35
|
const hooks_1 = require("../../mocks/hooks");
|
|
36
|
-
function SuggestedPages() {
|
|
36
|
+
function SuggestedPages({ className }) {
|
|
37
37
|
const pages = (0, search_1.useSuggestedPages)();
|
|
38
38
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
39
39
|
const translationKeys = {
|
|
@@ -41,7 +41,7 @@ function SuggestedPages() {
|
|
|
41
41
|
};
|
|
42
42
|
if (!pages.length)
|
|
43
43
|
return null;
|
|
44
|
-
return (React.createElement(Wrapper, { "data-component-name": "Search/SuggestedPages" },
|
|
44
|
+
return (React.createElement(Wrapper, { "data-component-name": "Search/SuggestedPages", className: className },
|
|
45
45
|
React.createElement(Title, { "data-translation-key": translationKeys.title }, translate(translationKeys.title, 'Suggested pages')),
|
|
46
46
|
React.createElement(SuggestedItems, null, pages.map((page) => page.link && (React.createElement(Item, { key: page.label },
|
|
47
47
|
React.createElement(PageLink, Object.assign({ to: page.link }, page),
|
|
@@ -9,9 +9,9 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
10
10
|
const SeparatorItem_1 = require("../../components/Separator/SeparatorItem");
|
|
11
11
|
const hooks_1 = require("../../mocks/hooks");
|
|
12
|
-
function Separator({ item }) {
|
|
12
|
+
function Separator({ item, className }) {
|
|
13
13
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
14
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/Separator" },
|
|
14
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/Separator", className: className },
|
|
15
15
|
react_1.default.createElement(SeparatorItem_1.SeparatorItem, null, translate(item.labelTranslationKey, item.label)),
|
|
16
16
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
17
17
|
}
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.SeparatorItem = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
9
|
-
exports.SeparatorItem = (0, styled_components_1.default)(MenuItemLabel_1.MenuItemLabel).attrs(() => ({
|
|
9
|
+
exports.SeparatorItem = (0, styled_components_1.default)(MenuItemLabel_1.MenuItemLabel).attrs(({ className }) => ({
|
|
10
10
|
'data-component-name': 'Sidebar/SeparatorItem',
|
|
11
|
+
className,
|
|
11
12
|
})) `
|
|
12
13
|
cursor: default;
|
|
13
14
|
font-weight: var(--font-weight-bold);
|
|
@@ -15,7 +16,11 @@ exports.SeparatorItem = (0, styled_components_1.default)(MenuItemLabel_1.MenuIte
|
|
|
15
16
|
font-family: var(--sidebar-item-separator-font-family);
|
|
16
17
|
font-size: var(--sidebar-item-separator-font-size);
|
|
17
18
|
text-transform: var(--sidebar-item-separator-text-transform);
|
|
18
|
-
background: var(--
|
|
19
|
+
background: var(--mobile-menu-background);
|
|
20
|
+
|
|
21
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
22
|
+
background: var(--sidebar-item-separator-background-color);
|
|
23
|
+
}
|
|
19
24
|
|
|
20
25
|
*:not(:first-child) > & {
|
|
21
26
|
margin-top: var(--sidebar-item-separator-offset);
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SeparatorLine = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.SeparatorLine = styled_components_1.default.div.attrs(() => ({
|
|
8
|
+
exports.SeparatorLine = styled_components_1.default.div.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Sidebar/SeparatorLine',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
height: 1px;
|
|
12
13
|
background-color: var(--sidebar-item-separator-line-color);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MenuItemProps } from '../../components/Sidebar/types';
|
|
3
|
-
export declare function ApiCallItem({ item }: MenuItemProps): JSX.Element;
|
|
3
|
+
export declare function ApiCallItem({ item, className }: MenuItemProps): JSX.Element;
|
|
4
4
|
export declare const Badge: import("styled-components").StyledComponent<"span", any, {
|
|
5
5
|
className: `operation-type ${string}`;
|
|
6
6
|
'data-component-name': string;
|
|
@@ -10,15 +10,22 @@ const OperationBadge_1 = require("../../components/OperationBadge");
|
|
|
10
10
|
const MenuLinkItem_1 = require("../../components/Menu/MenuLinkItem");
|
|
11
11
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
12
12
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
13
|
-
function ApiCallItem({ item }) {
|
|
14
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/ApiCallItem" },
|
|
13
|
+
function ApiCallItem({ item, className }) {
|
|
14
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/ApiCallItem", className: className },
|
|
15
15
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
16
|
-
react_1.default.createElement(
|
|
16
|
+
react_1.default.createElement(Label, { active: item.active },
|
|
17
17
|
react_1.default.createElement(exports.Badge, { type: item.httpVerb || '' }, item.httpVerb === 'hook' ? 'event' : item.httpVerb),
|
|
18
18
|
item.label)),
|
|
19
19
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
20
20
|
}
|
|
21
21
|
exports.ApiCallItem = ApiCallItem;
|
|
22
|
+
const Label = (0, styled_components_1.default)(MenuItemLabel_1.MenuItemLabel) `
|
|
23
|
+
color: var(--mobile-menu-item-text-color);
|
|
24
|
+
|
|
25
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
26
|
+
color: var(--sidebar-item-text-color);
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
22
29
|
const Wrapper = styled_components_1.default.div ``;
|
|
23
30
|
exports.Badge = (0, styled_components_1.default)(OperationBadge_1.OperationBadge) `
|
|
24
31
|
flex-shrink: 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface BackButtonProps {
|
|
3
3
|
back: () => void;
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function BackButton({ children, back, }: React.PropsWithChildren<BackButtonProps>): JSX.Element;
|
|
6
|
+
export declare function BackButton({ children, back, className, }: React.PropsWithChildren<BackButtonProps>): JSX.Element;
|
|
6
7
|
export {};
|
|
@@ -7,8 +7,8 @@ exports.BackButton = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const ArrowBack_1 = require("../../ui/ArrowBack");
|
|
10
|
-
function BackButton({ children, back, }) {
|
|
11
|
-
return (react_1.default.createElement(Button, { onClick: back, "data-component-name": "Sidebar/BackButton" },
|
|
10
|
+
function BackButton({ children, back, className, }) {
|
|
11
|
+
return (react_1.default.createElement(Button, { onClick: back, "data-component-name": "Sidebar/BackButton", className: className },
|
|
12
12
|
react_1.default.createElement(ArrowBack_1.ArrowBack, { dataComponentName: "Sidebar/ArrowBack" }),
|
|
13
13
|
children));
|
|
14
14
|
}
|
|
@@ -3,6 +3,7 @@ import type { DrilldownMenuProps } from '../../components/Sidebar/types';
|
|
|
3
3
|
interface DrilldownProps extends DrilldownMenuProps {
|
|
4
4
|
isExpanded: boolean;
|
|
5
5
|
expand: () => void;
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function Drilldown({ isExpanded, item, expand, ...props }: React.PropsWithChildren<DrilldownProps>): JSX.Element;
|
|
8
|
+
export declare function Drilldown({ isExpanded, item, expand, className, ...props }: React.PropsWithChildren<DrilldownProps>): JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -22,8 +22,8 @@ const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
|
22
22
|
const DrilldownMenuItem_1 = require("../../components/Sidebar/DrilldownMenuItem");
|
|
23
23
|
const DrilldownMenu_1 = require("../../components/Sidebar/DrilldownMenu");
|
|
24
24
|
function Drilldown(_a) {
|
|
25
|
-
var { isExpanded, item, expand } = _a, props = __rest(_a, ["isExpanded", "item", "expand"]);
|
|
26
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/Drilldown" },
|
|
25
|
+
var { isExpanded, item, expand, className } = _a, props = __rest(_a, ["isExpanded", "item", "expand", "className"]);
|
|
26
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/Drilldown", className: className },
|
|
27
27
|
react_1.default.createElement(DrilldownLabel, { onClick: expand },
|
|
28
28
|
react_1.default.createElement(DrilldownMenuItem_1.DrilldownMenuItem, { item: item })),
|
|
29
29
|
isExpanded ? react_1.default.createElement(DrilldownMenu_1.DrilldownMenu, Object.assign({ item: item }, props)) : null,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DrilldownMenuProps } from '../../components/Sidebar/types';
|
|
3
|
-
export declare function DrilldownMenu({ item, back, prevActiveItem, children, }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element;
|
|
3
|
+
export declare function DrilldownMenu({ item, back, prevActiveItem, children, className, }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element;
|
|
@@ -32,12 +32,12 @@ const styled_components_1 = __importStar(require("styled-components"));
|
|
|
32
32
|
const BackButton_1 = require("../../components/Sidebar/BackButton");
|
|
33
33
|
const DrilldownMenuItem_1 = require("../../components/Sidebar/DrilldownMenuItem");
|
|
34
34
|
const hooks_1 = require("../../mocks/hooks");
|
|
35
|
-
function DrilldownMenu({ item, back, prevActiveItem, children, }) {
|
|
35
|
+
function DrilldownMenu({ item, back, prevActiveItem, children, className, }) {
|
|
36
36
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
37
37
|
const translationKeys = {
|
|
38
38
|
backLabel: 'theme.sidebar.menu.backLabel',
|
|
39
39
|
};
|
|
40
|
-
return (react_1.default.createElement(MenuContainer, { "data-component-name": "Sidebar/DrilldownMenu" },
|
|
40
|
+
return (react_1.default.createElement(MenuContainer, { "data-component-name": "Sidebar/DrilldownMenu", className: className },
|
|
41
41
|
react_1.default.createElement(MenuContent, null,
|
|
42
42
|
react_1.default.createElement(MenuWrapper, null,
|
|
43
43
|
react_1.default.createElement(BackButton_1.BackButton, { back: back, "data-translation-key": translationKeys.backLabel }, (prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label) || translate(translationKeys.backLabel, 'Back')),
|
|
@@ -50,7 +50,7 @@ const MenuContainer = styled_components_1.default.div `
|
|
|
50
50
|
top: 0;
|
|
51
51
|
bottom: 0;
|
|
52
52
|
width: 100%;
|
|
53
|
-
z-index:
|
|
53
|
+
z-index: var(--z-index-raised);
|
|
54
54
|
background-color: var(--sidebar-item-drilldown-background-color);
|
|
55
55
|
`;
|
|
56
56
|
const slideInAnimation = (0, styled_components_1.keyframes) `
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { MenuItemProps } from '../../components/Sidebar/types';
|
|
3
|
-
export declare function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element;
|
|
3
|
+
export declare function DrilldownMenuItem({ item, className }: MenuItemProps): JSX.Element;
|
|
@@ -7,9 +7,9 @@ exports.DrilldownMenuItem = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const hooks_1 = require("../../mocks/hooks");
|
|
10
|
-
function DrilldownMenuItem({ item }) {
|
|
10
|
+
function DrilldownMenuItem({ item, className }) {
|
|
11
11
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
12
|
-
return (react_1.default.createElement(Container, { "data-component-name": "Sidebar/DrilldownMenuItem" },
|
|
12
|
+
return (react_1.default.createElement(Container, { "data-component-name": "Sidebar/DrilldownMenuItem", className: className },
|
|
13
13
|
item.icon ? react_1.default.createElement(Icon, { src: item.icon }) : null,
|
|
14
14
|
react_1.default.createElement("div", null,
|
|
15
15
|
translate(item.labelTranslationKey, item.label),
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HeaderWrapper = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.HeaderWrapper = styled_components_1.default.div.attrs(() => ({
|
|
8
|
+
exports.HeaderWrapper = styled_components_1.default.div.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Sidebar/HeaderWrapper',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
margin: var(--sidebar-offset-top) 0 0 var(--sidebar-offset-left);
|
|
12
13
|
padding-bottom: var(--sidebar-spacing-unit);
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MobileSidebarButton = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.MobileSidebarButton = styled_components_1.default.span.attrs(() => ({
|
|
8
|
+
exports.MobileSidebarButton = styled_components_1.default.span.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Sidebar/MobileSidebarButton',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
background-color: var(
|
|
12
13
|
${(props) => (props.opened ? '--fab-active-background' : '--fab-background-color')}
|
|
@@ -18,7 +19,7 @@ exports.MobileSidebarButton = styled_components_1.default.span.attrs(() => ({
|
|
|
18
19
|
cursor: pointer;
|
|
19
20
|
position: fixed;
|
|
20
21
|
right: 20px;
|
|
21
|
-
z-index:
|
|
22
|
+
z-index: var(--z-index-surface);
|
|
22
23
|
box-shadow: ${(props) => props.opened ? 'var(--fab-active-box-shadow)' : 'var(--fab-box-shadow)'};
|
|
23
24
|
border-radius: 50%;
|
|
24
25
|
transform: ${(props) => (props.opened ? 'rotate(180deg)' : 'rotate(0deg)')};
|
|
@@ -2,7 +2,5 @@ interface SidebarProps {
|
|
|
2
2
|
opened?: boolean;
|
|
3
3
|
animate?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare const Sidebar: import("styled-components").StyledComponent<"aside", any,
|
|
6
|
-
'data-component-name': string;
|
|
7
|
-
} & SidebarProps, "data-component-name">;
|
|
5
|
+
export declare const Sidebar: import("styled-components").StyledComponent<"aside", any, SidebarProps, never>;
|
|
8
6
|
export {};
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Sidebar = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.Sidebar = styled_components_1.default.aside.attrs(() => ({
|
|
8
|
+
exports.Sidebar = styled_components_1.default.aside.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Sidebar/Sidebar',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
border-right: 1px solid var(--sidebar-border-color);
|
|
12
13
|
position: fixed;
|
|
@@ -12,6 +12,7 @@ interface SidebarLayoutProps {
|
|
|
12
12
|
growContent?: boolean;
|
|
13
13
|
collapsed?: boolean;
|
|
14
14
|
onToggleMenu?: (isOpen: boolean) => void;
|
|
15
|
+
className?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare function SidebarLayout({ versions, menu, footer, header, growContent, collapsed, onToggleMenu, }: SidebarLayoutProps): JSX.Element | null;
|
|
17
|
+
export declare function SidebarLayout({ versions, menu, footer, header, growContent, collapsed, onToggleMenu, className, }: SidebarLayoutProps): JSX.Element | null;
|
|
17
18
|
export {};
|
|
@@ -45,7 +45,7 @@ const StyledFooterWrapper = (0, styled_components_1.default)(FooterWrapper_1.Foo
|
|
|
45
45
|
display: flex;
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
function SidebarLayout({ versions, menu, footer, header, growContent, collapsed, onToggleMenu, }) {
|
|
48
|
+
function SidebarLayout({ versions, menu, footer, header, growContent, collapsed, onToggleMenu, className, }) {
|
|
49
49
|
const [isOpen, setIsOpen] = (0, useMobileMenu_1.useMobileMenu)();
|
|
50
50
|
const [mappedCollapsed, setMappedCollapsed] = react_1.default.useState(collapsed);
|
|
51
51
|
(0, react_1.useEffect)(() => {
|
|
@@ -62,9 +62,7 @@ function SidebarLayout({ versions, menu, footer, header, growContent, collapsed,
|
|
|
62
62
|
return (react_1.default.createElement(react_1.default.Fragment, null, mappedCollapsed ? (footer ? (react_1.default.createElement(Wrapper, { collapsed: true },
|
|
63
63
|
react_1.default.createElement(StyledFooterWrapper, { "data-component-name": "Sidebar/FooterWrapper", collapsed: true }, footer),
|
|
64
64
|
react_1.default.createElement(MobileSidebarButton_1.MobileSidebarButton, { opened: isOpen, onClick: toggleMenu },
|
|
65
|
-
react_1.default.createElement(MobileSidebarIcon_1.MobileSidebarIcon, null)))) : null) : (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/SidebarLayout" },
|
|
66
|
-
react_1.default.createElement(MobileSidebarButton_1.MobileSidebarButton, { opened: isOpen, onClick: toggleMenu },
|
|
67
|
-
react_1.default.createElement(MobileSidebarIcon_1.MobileSidebarIcon, null)),
|
|
65
|
+
react_1.default.createElement(MobileSidebarIcon_1.MobileSidebarIcon, null)))) : null) : (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/SidebarLayout", className: className },
|
|
68
66
|
!(search === null || search === void 0 ? void 0 : search.hide) && (search === null || search === void 0 ? void 0 : search.placement) === 'sidebar' ? react_1.default.createElement(SidebarSearch_1.SidebarSearch, null) : null,
|
|
69
67
|
react_1.default.createElement(Sidebar_1.Sidebar, { animate: true, opened: isOpen },
|
|
70
68
|
header ? react_1.default.createElement(HeaderWrapper_1.HeaderWrapper, null, header) : null,
|