@redocly/theme 0.15.0 → 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 +5 -4
- 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 +11 -5
- 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 +6 -4
- 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 +5 -4
- package/src/components/Markdown/Heading.tsx +3 -1
- package/src/components/Markdown/MarkdownLayout.tsx +3 -1
- package/src/components/Markdown/MarkdownWrapper.tsx +11 -5
- 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
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
|
|
4
|
-
import { Link } from '@portal/Link';
|
|
5
|
-
import type { ResolvedNavLinkItem } from '@theme/types/portal';
|
|
6
|
-
|
|
7
|
-
interface NavbarDropdownProps {
|
|
8
|
-
items: ResolvedNavLinkItem[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function MobileNavbarDropdown({ items }: NavbarDropdownProps): JSX.Element {
|
|
12
|
-
return (
|
|
13
|
-
<MobileDropdownWrapper data-component-name="Navbar/MobileNavbarDropdown">
|
|
14
|
-
{items.map((item, index) => (
|
|
15
|
-
<div key={`${item.label}_${index}`}>
|
|
16
|
-
<Link to={item.link}>{item.label}</Link>
|
|
17
|
-
</div>
|
|
18
|
-
))}
|
|
19
|
-
</MobileDropdownWrapper>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const MobileDropdownWrapper = styled.div`
|
|
24
|
-
padding: 0 15px;
|
|
25
|
-
width: max-content;
|
|
26
|
-
transition: all 0.2s ease-in-out;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
box-shadow: var(--navbar-dropdown-shadow);
|
|
29
|
-
& > div {
|
|
30
|
-
padding: 10px 0;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
a {
|
|
33
|
-
color: var(--navbar-text-color);
|
|
34
|
-
text-decoration: none;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { useLocation } from 'react-router-dom';
|
|
4
|
-
|
|
5
|
-
import { Link } from '@portal/Link';
|
|
6
|
-
import { useI18nConfig } from '@portal/hooks';
|
|
7
|
-
import { getPathnameForLocale } from '@portal/utils';
|
|
8
|
-
import type {
|
|
9
|
-
ResolvedNavItem,
|
|
10
|
-
ResolvedNavLinkItem,
|
|
11
|
-
ResolvedNavGroupItem,
|
|
12
|
-
} from '@theme/types/portal';
|
|
13
|
-
import { withPathPrefix } from '@theme/utils';
|
|
14
|
-
|
|
15
|
-
import { MobileNavbarDropdown, MobileDropdownWrapper } from './MobileNavbarDropdown';
|
|
16
|
-
|
|
17
|
-
export interface NavbarItemProps {
|
|
18
|
-
navItem: ResolvedNavItem;
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function MobileNavbarItem({ navItem, className }: NavbarItemProps): JSX.Element | null {
|
|
23
|
-
const { pathname } = useLocation();
|
|
24
|
-
const [expandedDropdown, setExpandedDropdown] = useState(false);
|
|
25
|
-
const toggleDropdown = () => setExpandedDropdown(!expandedDropdown);
|
|
26
|
-
const { defaultLocale, currentLocale, locales } = useI18nConfig();
|
|
27
|
-
|
|
28
|
-
if ((navItem as ResolvedNavLinkItem).link) {
|
|
29
|
-
const item = navItem as ResolvedNavLinkItem;
|
|
30
|
-
const isActive =
|
|
31
|
-
pathname ===
|
|
32
|
-
withPathPrefix(getPathnameForLocale(item.link, defaultLocale, currentLocale, locales));
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<NavMenuItem
|
|
36
|
-
active={isActive}
|
|
37
|
-
data-component-name="Navbar/MobileNavbarItem"
|
|
38
|
-
className={className}
|
|
39
|
-
>
|
|
40
|
-
<NavLink to={item.link} active={isActive}>
|
|
41
|
-
<NavLabel>{item.label}</NavLabel>
|
|
42
|
-
</NavLink>
|
|
43
|
-
</NavMenuItem>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if ((navItem as ResolvedNavGroupItem).items) {
|
|
48
|
-
const item = navItem as ResolvedNavGroupItem;
|
|
49
|
-
return (
|
|
50
|
-
<NavMenuItemWithDropdownWrapper expanded={expandedDropdown}>
|
|
51
|
-
<NavMenuItem
|
|
52
|
-
active={false}
|
|
53
|
-
onClick={toggleDropdown}
|
|
54
|
-
data-component-name="Navbar/MobileNavbarItem"
|
|
55
|
-
className={className}
|
|
56
|
-
>
|
|
57
|
-
<NavLabel>{item.label}</NavLabel>
|
|
58
|
-
<ExpandedArrow />
|
|
59
|
-
</NavMenuItem>
|
|
60
|
-
<MobileNavbarDropdown items={item.items as ResolvedNavLinkItem[]} />
|
|
61
|
-
</NavMenuItemWithDropdownWrapper>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const ExpandedArrow = styled.div`
|
|
69
|
-
width: 5px;
|
|
70
|
-
height: 5px;
|
|
71
|
-
border: 1px solid;
|
|
72
|
-
border-left: none;
|
|
73
|
-
border-top: none;
|
|
74
|
-
transition: all 0.3s ease-out;
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
|
-
export const NavMenuItem = styled.li<{ active?: boolean }>`
|
|
78
|
-
display: flex;
|
|
79
|
-
justify-content: space-between;
|
|
80
|
-
align-items: center;
|
|
81
|
-
padding: var(--navbar-item-padding-horizontal);
|
|
82
|
-
text-align: left;
|
|
83
|
-
line-height: 1;
|
|
84
|
-
font-size: var(--navbar-item-font-size);
|
|
85
|
-
font-weight: var(--navbar-item-font-weight);
|
|
86
|
-
background: ${({ active }) => (active ? 'var(--navbar-item-active-background-color)' : 'none')};
|
|
87
|
-
&:not(:last-child) {
|
|
88
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
89
|
-
}
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
export const NavMenuItemWithDropdownWrapper = styled.div<{ expanded: boolean }>`
|
|
93
|
-
display: inline-block;
|
|
94
|
-
position: relative;
|
|
95
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
96
|
-
|
|
97
|
-
${ExpandedArrow} {
|
|
98
|
-
transform: rotate(${({ expanded }) => (expanded ? '' : '-')}45deg);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
${MobileDropdownWrapper} {
|
|
102
|
-
height: ${({ expanded }) => (expanded ? '100%' : '0')};
|
|
103
|
-
opacity: ${({ expanded }) => (expanded ? '1' : '0')};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
${NavMenuItem} {
|
|
107
|
-
border-bottom: none;
|
|
108
|
-
}
|
|
109
|
-
`;
|
|
110
|
-
|
|
111
|
-
export const NavLink = styled(Link)`
|
|
112
|
-
color: ${({ active }) =>
|
|
113
|
-
active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
114
|
-
text-decoration: ${({ active }) =>
|
|
115
|
-
active ? 'var(--navbar-item-active-text-decoration)' : 'none'};
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
const NavLabel = styled.span`
|
|
119
|
-
cursor: pointer;
|
|
120
|
-
vertical-align: middle;
|
|
121
|
-
`;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
NavbarMenuItem,
|
|
6
|
-
NavbarMenuItemWithDropdownWrapper,
|
|
7
|
-
} from '@theme/components/Navbar/NavbarItem';
|
|
8
|
-
import { MobileNavbarItem } from '@theme/components/Navbar/MobileNavbarItem';
|
|
9
|
-
import { DropdownWrapper } from '@theme/components/Navbar/NavbarDropdown';
|
|
10
|
-
import { isPrimitive, isEmptyArray } from '@theme/utils';
|
|
11
|
-
import type { ResolvedConfigLinks, ResolvedNavItem } from '@theme/types/portal';
|
|
12
|
-
|
|
13
|
-
export function MobileNavbarMenu({
|
|
14
|
-
menuItems,
|
|
15
|
-
closeMenu,
|
|
16
|
-
}: {
|
|
17
|
-
menuItems: ResolvedConfigLinks;
|
|
18
|
-
closeMenu: () => void;
|
|
19
|
-
}): JSX.Element | null {
|
|
20
|
-
if (isPrimitive(menuItems) || isEmptyArray(menuItems)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<NavbarItemsWrapper data-component-name="Navbar/MobileNavbarMenu">
|
|
26
|
-
<NavbarItemsContainer>
|
|
27
|
-
{(menuItems as ResolvedNavItem[]).map((navItem, index) => {
|
|
28
|
-
return (
|
|
29
|
-
<MobileNavbarItem
|
|
30
|
-
key={`${navItem.label}_${index}`}
|
|
31
|
-
data-cy={navItem.label}
|
|
32
|
-
navItem={navItem}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
})}
|
|
36
|
-
</NavbarItemsContainer>
|
|
37
|
-
<NavbarItemsClosableArea onClick={closeMenu} />
|
|
38
|
-
</NavbarItemsWrapper>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const NavbarItemsWrapper = styled.div`
|
|
43
|
-
height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
position: fixed;
|
|
46
|
-
z-index: 201; //more than Search
|
|
47
|
-
left: 0;
|
|
48
|
-
top: 0;
|
|
49
|
-
overflow-x: hidden;
|
|
50
|
-
transition: 0.5s;
|
|
51
|
-
display: flex;
|
|
52
|
-
${DropdownWrapper} {
|
|
53
|
-
& > div {
|
|
54
|
-
text-align: center;
|
|
55
|
-
padding: 10px 0;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
a {
|
|
58
|
-
color: var(--navbar-text-color);
|
|
59
|
-
text-decoration: none;
|
|
60
|
-
}
|
|
61
|
-
:hover {
|
|
62
|
-
text-decoration: underline;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
const NavbarItemsClosableArea = styled.div`
|
|
69
|
-
display: flex;
|
|
70
|
-
flex: 1;
|
|
71
|
-
min-width: 50px;
|
|
72
|
-
height: 100%;
|
|
73
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
const NavbarItemsContainer = styled.ul`
|
|
77
|
-
width: 70%;
|
|
78
|
-
list-style: none;
|
|
79
|
-
margin: 0;
|
|
80
|
-
padding: 0;
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
background: var(--navbar-background-color);
|
|
84
|
-
|
|
85
|
-
${NavbarMenuItem} {
|
|
86
|
-
&:not(:last-child) {
|
|
87
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
88
|
-
}
|
|
89
|
-
border-radius: 0;
|
|
90
|
-
padding: 1em 0;
|
|
91
|
-
width: 100%;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
${NavbarMenuItemWithDropdownWrapper} {
|
|
95
|
-
display: block;
|
|
96
|
-
&:not(:last-child) {
|
|
97
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
98
|
-
border-radius: 0;
|
|
99
|
-
}
|
|
100
|
-
${NavbarMenuItem} {
|
|
101
|
-
border-bottom: none;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
${DropdownWrapper} {
|
|
106
|
-
background-color: var(--navbar-background-color);
|
|
107
|
-
width: 100%;
|
|
108
|
-
padding: 0;
|
|
109
|
-
position: relative;
|
|
110
|
-
}
|
|
111
|
-
`;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
import { Burger } from '@theme/ui/Burger';
|
|
4
|
-
|
|
5
|
-
export const MobileNavbarMenuButton = styled(Burger).attrs(() => ({
|
|
6
|
-
'data-component-name': 'Navbar/MobileNavbarMenuButton',
|
|
7
|
-
}))`
|
|
8
|
-
display: block;
|
|
9
|
-
|
|
10
|
-
${({ theme }) => theme.mediaQueries.medium} {
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
`;
|