@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CloseIcon } from '@theme/icons/CloseIcon/CloseIcon';
|
|
@@ -47,7 +47,11 @@ function Icon({ mode, className }: ColorModeIconProps) {
|
|
|
47
47
|
export const ColorModeIcon = styled(Icon).attrs(() => ({
|
|
48
48
|
'data-component-name': 'icons/ColorModeIcon/ColorModeIcon',
|
|
49
49
|
}))`
|
|
50
|
-
width: var(--
|
|
50
|
+
width: var(--mobile-menu-icons-size);
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
fill: var(--navbar-text-color);
|
|
53
|
+
|
|
54
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
55
|
+
width: var(--navbar-item-font-size);
|
|
56
|
+
}
|
|
53
57
|
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ArrowIconProps {
|
|
5
|
+
direction?: 'up' | 'right' | 'left' | 'down';
|
|
6
|
+
visibility?: 'visible' | 'hidden';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function directionToTransform({ direction }: ArrowIconProps) {
|
|
10
|
+
switch (direction) {
|
|
11
|
+
case 'up':
|
|
12
|
+
return 180;
|
|
13
|
+
case 'right':
|
|
14
|
+
return -90;
|
|
15
|
+
case 'left':
|
|
16
|
+
return 90;
|
|
17
|
+
default:
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Icon = ({ className }: { className?: string }) => (
|
|
23
|
+
<span data-component-name="icons/ExpandIcon/ExpandIcon">
|
|
24
|
+
<svg
|
|
25
|
+
width="16"
|
|
26
|
+
height="16"
|
|
27
|
+
viewBox="0 0 16 16"
|
|
28
|
+
fill="none"
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
className={className}
|
|
31
|
+
>
|
|
32
|
+
<path
|
|
33
|
+
d="M8 11L3 5.99999L3.7 5.29999L8 9.59999L12.3 5.29999L13 5.99999L8 11Z"
|
|
34
|
+
fill="inherit"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
</span>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const ExpandIcon = styled(Icon)`
|
|
41
|
+
fill: var(--sidebar-group-item-chevron-color);
|
|
42
|
+
transform: rotate(${directionToTransform}deg);
|
|
43
|
+
visibility: ${({ visibility = 'visible' }) => visibility};
|
|
44
|
+
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ExpandIcon } from '@theme/icons/ExpandIcon/ExpandIcon';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const Icon = () => (
|
|
5
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<rect width="18" height="18" transform="translate(11 11)" />
|
|
7
|
+
<path
|
|
8
|
+
d="M14.375 27.875H21.125C21.4233 27.8747 21.7092 27.756 21.9201 27.5451C22.131 27.3342 22.2497 27.0483 22.25 26.75V25.0625H21.125V26.75H14.375V13.25H21.125V14.9375H22.25V13.25C22.2497 12.9517 22.131 12.6658 21.9201 12.4549C21.7092 12.244 21.4233 12.1253 21.125 12.125H14.375C14.0767 12.1253 13.7908 12.244 13.5799 12.4549C13.369 12.6658 13.2503 12.9517 13.25 13.25V26.75C13.2503 27.0483 13.369 27.3342 13.5799 27.5451C13.7908 27.756 14.0767 27.8747 14.375 27.875Z"
|
|
9
|
+
fill="#FF4D6D"
|
|
10
|
+
/>
|
|
11
|
+
<path
|
|
12
|
+
d="M22.5796 22.5796L24.5968 20.5625H16.625V19.4375H24.5968L22.5796 17.4204L23.375 16.625L26.75 20L23.375 23.375L22.5796 22.5796Z"
|
|
13
|
+
fill="#FF4D6D"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export const LogoutIcon = styled(Icon).attrs(() => ({
|
|
19
|
+
'data-component-name': 'icons/LogoutIcon/LogoutIcon',
|
|
20
|
+
}))``;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LogoutIcon } from '@theme/icons/LogoutIcon/LogoutIcon';
|
package/src/icons/index.ts
CHANGED
|
@@ -5,3 +5,7 @@ export * from '@theme/icons/ColorModeIcon';
|
|
|
5
5
|
export * from '@theme/icons/AnchorIcon';
|
|
6
6
|
export * from '@theme/icons/ExternalIcon';
|
|
7
7
|
export * from '@theme/icons/SpinnerIcon';
|
|
8
|
+
export * from '@theme/icons/BurgerIcon';
|
|
9
|
+
export * from '@theme/icons/CloseIcon';
|
|
10
|
+
export * from '@theme/icons/LogoutIcon';
|
|
11
|
+
export * from '@theme/icons/ExpandIcon';
|
package/src/mocks/hooks/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThemeUIConfig } from '@theme/config';
|
|
2
|
-
import type { ResolvedNavItem, TFunction } from '@theme/types/portal';
|
|
2
|
+
import type { ResolvedNavItem, TFunction, Version } from '@theme/types/portal';
|
|
3
3
|
import type { CatalogConfig, FilteredCatalog } from '@theme/types/portal/src/shared/types/catalog';
|
|
4
4
|
interface PageLink {
|
|
5
5
|
label: string;
|
|
@@ -95,3 +95,18 @@ export function useI18nConfig() {
|
|
|
95
95
|
locales: [{ code: 'en', name: 'en' }],
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
+
|
|
99
|
+
export function usePageVersions(): { versions: Version[] } {
|
|
100
|
+
return {
|
|
101
|
+
versions: [
|
|
102
|
+
{
|
|
103
|
+
version: '1.0',
|
|
104
|
+
label: 'First',
|
|
105
|
+
link: '',
|
|
106
|
+
default: true,
|
|
107
|
+
active: true,
|
|
108
|
+
folderId: 'id',
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const breakpoints = { small: '550px', medium: '900px', large: '1200px' };
|
package/src/ui/Dropdown.tsx
CHANGED
package/src/ui/darkColors.tsx
CHANGED
|
@@ -5,9 +5,17 @@ export const darkMode = css`
|
|
|
5
5
|
* @tokens Dark Colors
|
|
6
6
|
* @presenter Color
|
|
7
7
|
*/
|
|
8
|
-
--background-color: #
|
|
9
|
-
--footer-background-color: #
|
|
10
|
-
--navbar-background-color: #
|
|
8
|
+
--background-color: #141414;
|
|
9
|
+
--footer-background-color: #1F1F1F;
|
|
10
|
+
--navbar-background-color: #1F1F1F;
|
|
11
|
+
--mobile-menu-background: #141414;
|
|
12
|
+
--mobile-menu-profile-background: var(--mobile-menu-background);
|
|
13
|
+
--mobile-menu-login-button-background: var(--mobile-menu-profile-background); rgba(255, 255, 255, 0.6);
|
|
14
|
+
--mobile-menu-item-text-color: rgba(255, 255, 255, 0.6);
|
|
15
|
+
--mobile-menu-item-active-color: #1F1F1F;
|
|
16
|
+
--mobile-menu-item-active-text-color: rgba(255, 255, 255, 0.85);
|
|
17
|
+
--mobile-menu-control-button-color: #ffffff;
|
|
18
|
+
--mobile-menu-profile-border-color: #222222;
|
|
11
19
|
--color-primary-500: #57a5fd;
|
|
12
20
|
--color-primary-300: #15396e;
|
|
13
21
|
--color-secondary-300: #22262e;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ResolvedNavLinkItem } from '../../types/portal';
|
|
3
|
-
interface NavbarDropdownProps {
|
|
4
|
-
items: ResolvedNavLinkItem[];
|
|
5
|
-
}
|
|
6
|
-
export declare function MobileNavbarDropdown({ items }: NavbarDropdownProps): JSX.Element;
|
|
7
|
-
export declare const MobileDropdownWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MobileDropdownWrapper = exports.MobileNavbarDropdown = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const Link_1 = require("../../mocks/Link");
|
|
10
|
-
function MobileNavbarDropdown({ items }) {
|
|
11
|
-
return (react_1.default.createElement(exports.MobileDropdownWrapper, { "data-component-name": "Navbar/MobileNavbarDropdown" }, items.map((item, index) => (react_1.default.createElement("div", { key: `${item.label}_${index}` },
|
|
12
|
-
react_1.default.createElement(Link_1.Link, { to: item.link }, item.label))))));
|
|
13
|
-
}
|
|
14
|
-
exports.MobileNavbarDropdown = MobileNavbarDropdown;
|
|
15
|
-
exports.MobileDropdownWrapper = styled_components_1.default.div `
|
|
16
|
-
padding: 0 15px;
|
|
17
|
-
width: max-content;
|
|
18
|
-
transition: all 0.2s ease-in-out;
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
box-shadow: var(--navbar-dropdown-shadow);
|
|
21
|
-
& > div {
|
|
22
|
-
padding: 10px 0;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
a {
|
|
25
|
-
color: var(--navbar-text-color);
|
|
26
|
-
text-decoration: none;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
//# sourceMappingURL=MobileNavbarDropdown.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Link } from '../../mocks/Link';
|
|
3
|
-
import type { ResolvedNavItem } from '../../types/portal';
|
|
4
|
-
export interface NavbarItemProps {
|
|
5
|
-
navItem: ResolvedNavItem;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function MobileNavbarItem({ navItem, className }: NavbarItemProps): JSX.Element | null;
|
|
9
|
-
export declare const NavMenuItem: import("styled-components").StyledComponent<"li", any, {
|
|
10
|
-
active?: boolean | undefined;
|
|
11
|
-
}, never>;
|
|
12
|
-
export declare const NavMenuItemWithDropdownWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
13
|
-
expanded: boolean;
|
|
14
|
-
}, never>;
|
|
15
|
-
export declare const NavLink: import("styled-components").StyledComponent<typeof Link, any, {}, never>;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.NavLink = exports.NavMenuItemWithDropdownWrapper = exports.NavMenuItem = exports.MobileNavbarItem = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
33
|
-
const Link_1 = require("../../mocks/Link");
|
|
34
|
-
const hooks_1 = require("../../mocks/hooks");
|
|
35
|
-
const utils_1 = require("../../mocks/utils");
|
|
36
|
-
const utils_2 = require("../../utils");
|
|
37
|
-
const MobileNavbarDropdown_1 = require("./MobileNavbarDropdown");
|
|
38
|
-
function MobileNavbarItem({ navItem, className }) {
|
|
39
|
-
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
40
|
-
const [expandedDropdown, setExpandedDropdown] = (0, react_1.useState)(false);
|
|
41
|
-
const toggleDropdown = () => setExpandedDropdown(!expandedDropdown);
|
|
42
|
-
const { defaultLocale, currentLocale, locales } = (0, hooks_1.useI18nConfig)();
|
|
43
|
-
if (navItem.link) {
|
|
44
|
-
const item = navItem;
|
|
45
|
-
const isActive = pathname ===
|
|
46
|
-
(0, utils_2.withPathPrefix)((0, utils_1.getPathnameForLocale)(item.link, defaultLocale, currentLocale, locales));
|
|
47
|
-
return (react_1.default.createElement(exports.NavMenuItem, { active: isActive, "data-component-name": "Navbar/MobileNavbarItem", className: className },
|
|
48
|
-
react_1.default.createElement(exports.NavLink, { to: item.link, active: isActive },
|
|
49
|
-
react_1.default.createElement(NavLabel, null, item.label))));
|
|
50
|
-
}
|
|
51
|
-
if (navItem.items) {
|
|
52
|
-
const item = navItem;
|
|
53
|
-
return (react_1.default.createElement(exports.NavMenuItemWithDropdownWrapper, { expanded: expandedDropdown },
|
|
54
|
-
react_1.default.createElement(exports.NavMenuItem, { active: false, onClick: toggleDropdown, "data-component-name": "Navbar/MobileNavbarItem", className: className },
|
|
55
|
-
react_1.default.createElement(NavLabel, null, item.label),
|
|
56
|
-
react_1.default.createElement(ExpandedArrow, null)),
|
|
57
|
-
react_1.default.createElement(MobileNavbarDropdown_1.MobileNavbarDropdown, { items: item.items })));
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
exports.MobileNavbarItem = MobileNavbarItem;
|
|
62
|
-
const ExpandedArrow = styled_components_1.default.div `
|
|
63
|
-
width: 5px;
|
|
64
|
-
height: 5px;
|
|
65
|
-
border: 1px solid;
|
|
66
|
-
border-left: none;
|
|
67
|
-
border-top: none;
|
|
68
|
-
transition: all 0.3s ease-out;
|
|
69
|
-
`;
|
|
70
|
-
exports.NavMenuItem = styled_components_1.default.li `
|
|
71
|
-
display: flex;
|
|
72
|
-
justify-content: space-between;
|
|
73
|
-
align-items: center;
|
|
74
|
-
padding: var(--navbar-item-padding-horizontal);
|
|
75
|
-
text-align: left;
|
|
76
|
-
line-height: 1;
|
|
77
|
-
font-size: var(--navbar-item-font-size);
|
|
78
|
-
font-weight: var(--navbar-item-font-weight);
|
|
79
|
-
background: ${({ active }) => (active ? 'var(--navbar-item-active-background-color)' : 'none')};
|
|
80
|
-
&:not(:last-child) {
|
|
81
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
exports.NavMenuItemWithDropdownWrapper = styled_components_1.default.div `
|
|
85
|
-
display: inline-block;
|
|
86
|
-
position: relative;
|
|
87
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
88
|
-
|
|
89
|
-
${ExpandedArrow} {
|
|
90
|
-
transform: rotate(${({ expanded }) => (expanded ? '' : '-')}45deg);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
${MobileNavbarDropdown_1.MobileDropdownWrapper} {
|
|
94
|
-
height: ${({ expanded }) => (expanded ? '100%' : '0')};
|
|
95
|
-
opacity: ${({ expanded }) => (expanded ? '1' : '0')};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
${exports.NavMenuItem} {
|
|
99
|
-
border-bottom: none;
|
|
100
|
-
}
|
|
101
|
-
`;
|
|
102
|
-
exports.NavLink = (0, styled_components_1.default)(Link_1.Link) `
|
|
103
|
-
color: ${({ active }) => active ? 'var(--navbar-item-active-text-color)' : 'var(--navbar-text-color)'};
|
|
104
|
-
text-decoration: ${({ active }) => active ? 'var(--navbar-item-active-text-decoration)' : 'none'};
|
|
105
|
-
`;
|
|
106
|
-
const NavLabel = styled_components_1.default.span `
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
vertical-align: middle;
|
|
109
|
-
`;
|
|
110
|
-
//# sourceMappingURL=MobileNavbarItem.js.map
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MobileNavbarMenu = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
const NavbarItem_1 = require("../../components/Navbar/NavbarItem");
|
|
10
|
-
const MobileNavbarItem_1 = require("../../components/Navbar/MobileNavbarItem");
|
|
11
|
-
const NavbarDropdown_1 = require("../../components/Navbar/NavbarDropdown");
|
|
12
|
-
const utils_1 = require("../../utils");
|
|
13
|
-
function MobileNavbarMenu({ menuItems, closeMenu, }) {
|
|
14
|
-
if ((0, utils_1.isPrimitive)(menuItems) || (0, utils_1.isEmptyArray)(menuItems)) {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
return (react_1.default.createElement(NavbarItemsWrapper, { "data-component-name": "Navbar/MobileNavbarMenu" },
|
|
18
|
-
react_1.default.createElement(NavbarItemsContainer, null, menuItems.map((navItem, index) => {
|
|
19
|
-
return (react_1.default.createElement(MobileNavbarItem_1.MobileNavbarItem, { key: `${navItem.label}_${index}`, "data-cy": navItem.label, navItem: navItem }));
|
|
20
|
-
})),
|
|
21
|
-
react_1.default.createElement(NavbarItemsClosableArea, { onClick: closeMenu })));
|
|
22
|
-
}
|
|
23
|
-
exports.MobileNavbarMenu = MobileNavbarMenu;
|
|
24
|
-
const NavbarItemsWrapper = styled_components_1.default.div `
|
|
25
|
-
height: 100%;
|
|
26
|
-
width: 100%;
|
|
27
|
-
position: fixed;
|
|
28
|
-
z-index: 201; //more than Search
|
|
29
|
-
left: 0;
|
|
30
|
-
top: 0;
|
|
31
|
-
overflow-x: hidden;
|
|
32
|
-
transition: 0.5s;
|
|
33
|
-
display: flex;
|
|
34
|
-
${NavbarDropdown_1.DropdownWrapper} {
|
|
35
|
-
& > div {
|
|
36
|
-
text-align: center;
|
|
37
|
-
padding: 10px 0;
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
a {
|
|
40
|
-
color: var(--navbar-text-color);
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
}
|
|
43
|
-
:hover {
|
|
44
|
-
text-decoration: underline;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
`;
|
|
49
|
-
const NavbarItemsClosableArea = styled_components_1.default.div `
|
|
50
|
-
display: flex;
|
|
51
|
-
flex: 1;
|
|
52
|
-
min-width: 50px;
|
|
53
|
-
height: 100%;
|
|
54
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
55
|
-
`;
|
|
56
|
-
const NavbarItemsContainer = styled_components_1.default.ul `
|
|
57
|
-
width: 70%;
|
|
58
|
-
list-style: none;
|
|
59
|
-
margin: 0;
|
|
60
|
-
padding: 0;
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
background: var(--navbar-background-color);
|
|
64
|
-
|
|
65
|
-
${NavbarItem_1.NavbarMenuItem} {
|
|
66
|
-
&:not(:last-child) {
|
|
67
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
68
|
-
}
|
|
69
|
-
border-radius: 0;
|
|
70
|
-
padding: 1em 0;
|
|
71
|
-
width: 100%;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
${NavbarItem_1.NavbarMenuItemWithDropdownWrapper} {
|
|
75
|
-
display: block;
|
|
76
|
-
&:not(:last-child) {
|
|
77
|
-
border-bottom: 1px solid var(--navbar-item-separator-line-color, #dadada);
|
|
78
|
-
border-radius: 0;
|
|
79
|
-
}
|
|
80
|
-
${NavbarItem_1.NavbarMenuItem} {
|
|
81
|
-
border-bottom: none;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
${NavbarDropdown_1.DropdownWrapper} {
|
|
86
|
-
background-color: var(--navbar-background-color);
|
|
87
|
-
width: 100%;
|
|
88
|
-
padding: 0;
|
|
89
|
-
position: relative;
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
92
|
-
//# sourceMappingURL=MobileNavbarMenu.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MobileNavbarMenuButton = void 0;
|
|
7
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
const Burger_1 = require("../../ui/Burger");
|
|
9
|
-
exports.MobileNavbarMenuButton = (0, styled_components_1.default)(Burger_1.Burger).attrs(() => ({
|
|
10
|
-
'data-component-name': 'Navbar/MobileNavbarMenuButton',
|
|
11
|
-
})) `
|
|
12
|
-
display: block;
|
|
13
|
-
|
|
14
|
-
${({ theme }) => theme.mediaQueries.medium} {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
//# sourceMappingURL=MobileNavbarMenuButton.js.map
|
|
@@ -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
|
-
`;
|