@redocly/theme 0.15.1 → 0.17.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/config.d.ts +496 -1
- package/lib/config.js +134 -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 +5 -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 +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/config.ts +150 -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
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Mermaid = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
function Mermaid({ diagramHtml, 'data-source': dataSource, 'data-hash': dataHash, className, }) {
|
|
11
|
+
return (react_1.default.createElement(Wrapper, { className: (0, utils_1.concatClassNames)('mermaid-wrapper', className), dangerouslySetInnerHTML: { __html: diagramHtml }, "data-component-name": "Markdown/Mermaid", "data-source": dataSource, "data-hash": dataHash }));
|
|
11
12
|
}
|
|
12
13
|
exports.Mermaid = Mermaid;
|
|
13
14
|
const Wrapper = styled_components_1.default.div `
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PageWrapper = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.PageWrapper = styled_components_1.default.div.attrs(() => ({
|
|
8
|
+
exports.PageWrapper = styled_components_1.default.div.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Markdown/PageWrapper',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
display: flex;
|
|
12
13
|
flex: 1;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Sup = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
function Sup({ children }) {
|
|
10
|
-
return react_1.default.createElement(Wrapper, { "data-component-name": "Markdown/Sup" }, children);
|
|
9
|
+
function Sup({ children, className, }) {
|
|
10
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Markdown/Sup", className: className }, children));
|
|
11
11
|
}
|
|
12
12
|
exports.Sup = Sup;
|
|
13
13
|
const Wrapper = styled_components_1.default.sup ``;
|
|
@@ -3,8 +3,10 @@ import type { ItemState } from '../../mocks/Sidebar/types';
|
|
|
3
3
|
export interface MenuListProps {
|
|
4
4
|
items: ItemState[];
|
|
5
5
|
depth?: number;
|
|
6
|
+
isMobile?: boolean;
|
|
7
|
+
className?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare function Menu({ depth, items }: MenuListProps): JSX.Element;
|
|
9
|
+
export declare function Menu({ depth, items, className, isMobile }: MenuListProps): JSX.Element;
|
|
8
10
|
export declare const ThemeMenu: import("styled-components").StyledComponent<"ul", any, {
|
|
9
11
|
'data-component-name': string;
|
|
10
12
|
}, "data-component-name">;
|
|
@@ -7,12 +7,12 @@ exports.ThemeMenu = exports.Menu = void 0;
|
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const MenuItemSwitch_1 = require("./MenuItemSwitch");
|
|
10
|
-
function Menu({ depth = 0, items }) {
|
|
10
|
+
function Menu({ depth = 0, items, className, isMobile }) {
|
|
11
11
|
// TODO: provide active section via MenuContext
|
|
12
12
|
const activeItem = items.find(({ active }) => active);
|
|
13
|
-
return (react_1.default.createElement(exports.ThemeMenu,
|
|
13
|
+
return (react_1.default.createElement(exports.ThemeMenu, { className: className }, items.map((item, index) => {
|
|
14
14
|
var _a;
|
|
15
|
-
return (react_1.default.createElement(MenuItemSwitch_1.MenuItemSwitch, { item: item, key: `${item.pageId}-${index}`, activeItem: activeItem }, ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) ? react_1.default.createElement(Menu, { items: item.items, depth: depth + 1 }) : null));
|
|
15
|
+
return (react_1.default.createElement(MenuItemSwitch_1.MenuItemSwitch, { item: item, key: `${item.pageId}-${index}`, activeItem: activeItem, isMobile: isMobile }, ((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) ? (react_1.default.createElement(Menu, { items: item.items, depth: depth + 1, isMobile: isMobile })) : null));
|
|
16
16
|
})));
|
|
17
17
|
}
|
|
18
18
|
exports.Menu = Menu;
|
|
@@ -23,6 +23,8 @@ exports.ThemeMenu = styled_components_1.default.ul.attrs(() => ({
|
|
|
23
23
|
margin: 0;
|
|
24
24
|
list-style: none;
|
|
25
25
|
color: var(--sidebar-item-text-color);
|
|
26
|
-
|
|
26
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
27
29
|
`;
|
|
28
30
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MenuContainer = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.MenuContainer = styled_components_1.default.div.attrs(({ growContent }) => ({
|
|
8
|
+
exports.MenuContainer = styled_components_1.default.div.attrs(({ growContent, className }) => ({
|
|
9
9
|
'data-component-name': 'Menu/MenuContainer',
|
|
10
10
|
growContent: growContent === undefined ? true : growContent,
|
|
11
|
+
className,
|
|
11
12
|
})) `
|
|
12
13
|
position: relative;
|
|
13
14
|
overflow-y: auto;
|
|
@@ -4,6 +4,7 @@ interface MenuGroupProps {
|
|
|
4
4
|
item: ItemState;
|
|
5
5
|
isExpanded: boolean;
|
|
6
6
|
toggleExpanded: () => void;
|
|
7
|
+
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function MenuGroup({ item, isExpanded, toggleExpanded, children, }: React.PropsWithChildren<MenuGroupProps>): JSX.Element;
|
|
9
|
+
export declare function MenuGroup({ item, isExpanded, toggleExpanded, children, className, }: React.PropsWithChildren<MenuGroupProps>): JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -34,7 +34,7 @@ const MenuLinkItem_1 = require("../../components/Menu/MenuLinkItem");
|
|
|
34
34
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
35
35
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
36
36
|
const hooks_1 = require("../../mocks/hooks");
|
|
37
|
-
function MenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
37
|
+
function MenuGroup({ item, isExpanded, toggleExpanded, children, className, }) {
|
|
38
38
|
const [showChildren, setShowChildren] = (0, react_1.useState)(isExpanded);
|
|
39
39
|
const timer = (0, react_1.useRef)(null);
|
|
40
40
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
@@ -52,10 +52,10 @@ function MenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
|
52
52
|
timer.current && clearTimeout(timer.current);
|
|
53
53
|
};
|
|
54
54
|
}, [isExpanded]);
|
|
55
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Menu/MenuGroup" },
|
|
55
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Menu/MenuGroup", className: className },
|
|
56
56
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
57
57
|
react_1.default.createElement(MenuGroupLabel, { onClick: toggleExpanded, isAlwaysExpanded: item.expanded === 'always', active: item.active, role: !item.link ? 'link' : 'none' },
|
|
58
|
-
react_1.default.createElement(MenuGroupArrow, {
|
|
58
|
+
!!item.items.length && react_1.default.createElement(MenuGroupArrow, { direction: isExpanded ? 'down' : 'right' }),
|
|
59
59
|
translate(item.labelTranslationKey, item.label))),
|
|
60
60
|
react_1.default.createElement(MenuWrapper, { isExpanded: isExpanded }, showChildren ? children : null),
|
|
61
61
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
@@ -11,15 +11,31 @@ const ExternalIcon_1 = require("../../icons/ExternalIcon");
|
|
|
11
11
|
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
12
12
|
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
13
13
|
const hooks_1 = require("../../mocks/hooks");
|
|
14
|
-
function MenuItem({ item }) {
|
|
14
|
+
function MenuItem({ item, className }) {
|
|
15
15
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
16
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuItem" },
|
|
16
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuItem", className: className },
|
|
17
17
|
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
18
|
-
react_1.default.createElement(
|
|
18
|
+
react_1.default.createElement(Label, { active: item.active },
|
|
19
19
|
translate(item.labelTranslationKey, item.label),
|
|
20
20
|
item.external ? react_1.default.createElement(ExternalIcon_1.ExternalIcon, { dataComponentName: "Sidebar/ExternalIcon" }) : null)),
|
|
21
21
|
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
22
22
|
}
|
|
23
23
|
exports.MenuItem = MenuItem;
|
|
24
24
|
const Wrapper = styled_components_1.default.div ``;
|
|
25
|
+
const Label = (0, styled_components_1.default)(MenuItemLabel_1.MenuItemLabel) `
|
|
26
|
+
color: var(--mobile-menu-item-text-color);
|
|
27
|
+
|
|
28
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
29
|
+
color: var(--sidebar-item-text-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
${({ active, theme }) => active &&
|
|
33
|
+
`
|
|
34
|
+
color: var(--mobile-menu-item-active-text-color);
|
|
35
|
+
|
|
36
|
+
${theme.mediaQueries.medium} {
|
|
37
|
+
color: var(--sidebar-item-active-color);
|
|
38
|
+
}
|
|
39
|
+
`};
|
|
40
|
+
`;
|
|
25
41
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.MenuItemLabel = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
exports.MenuItemLabel = styled_components_1.default.li.attrs(() => ({
|
|
8
|
+
exports.MenuItemLabel = styled_components_1.default.li.attrs(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Menu/MenuItemLabel',
|
|
10
|
+
className,
|
|
10
11
|
})) `
|
|
11
12
|
display: flex;
|
|
12
13
|
align-items: center;
|
|
@@ -27,16 +28,24 @@ exports.MenuItemLabel = styled_components_1.default.li.attrs(() => ({
|
|
|
27
28
|
);
|
|
28
29
|
border-radius: var(--sidebar-item-border-radius);
|
|
29
30
|
|
|
30
|
-
${(
|
|
31
|
-
|
|
32
|
-
color: var(--
|
|
33
|
-
background-color: var(--
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
${({ active, theme }) => active &&
|
|
32
|
+
`
|
|
33
|
+
color: var(--mobile-menu-item-active-text-color);
|
|
34
|
+
background-color: var(--mobile-menu-item-active-color);
|
|
35
|
+
|
|
36
|
+
${theme.mediaQueries.medium} {
|
|
37
|
+
color: var(--sidebar-item-active-color);
|
|
38
|
+
background-color: var(--sidebar-item-active-background-color);
|
|
39
|
+
}
|
|
40
|
+
`};
|
|
36
41
|
|
|
37
42
|
:hover {
|
|
38
|
-
color: var(--
|
|
39
|
-
|
|
43
|
+
color: var(--mobile-menu-item-active-text-color);
|
|
44
|
+
|
|
45
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
46
|
+
color: var(--sidebar-item-hover-color);
|
|
47
|
+
background-color: var(--sidebar-item-hover-background-color);
|
|
48
|
+
}
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
:empty {
|
|
@@ -10,6 +10,7 @@ const types_1 = require("../../mocks/Sidebar/types");
|
|
|
10
10
|
const getMenuType_1 = require("../../mocks/Sidebar/getMenuType");
|
|
11
11
|
const useDrilldown_1 = require("../../mocks/Sidebar/useDrilldown");
|
|
12
12
|
const useMenuGroup_1 = require("../../mocks/Sidebar/useMenuGroup");
|
|
13
|
+
const MobileMenuGroup_1 = require("../../components/Menu/MobileMenuGroup");
|
|
13
14
|
function MenuItemSwitch(props) {
|
|
14
15
|
var _a;
|
|
15
16
|
const type = (0, getMenuType_1.getMenuType)(props.item);
|
|
@@ -24,11 +25,12 @@ function MenuItemSwitch(props) {
|
|
|
24
25
|
case types_1.MenuType.Operation:
|
|
25
26
|
return react_1.default.createElement(_theme_1.ApiCallItem, Object.assign({}, props));
|
|
26
27
|
case types_1.MenuType.Group:
|
|
28
|
+
const Group = props.isMobile ? MobileMenuGroup_1.MobileMenuGroup : MenuGroup;
|
|
27
29
|
if (!((_a = props.item.items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
28
30
|
// Needed for OpenApi docs model items
|
|
29
|
-
return (react_1.default.createElement(
|
|
31
|
+
return (react_1.default.createElement(Group, { item: props.item, isExpanded: false, toggleExpanded: () => { } }, props.children));
|
|
30
32
|
}
|
|
31
|
-
return (react_1.default.createElement(
|
|
33
|
+
return (react_1.default.createElement(Group, { item: props.item, isExpanded: isExpanded, toggleExpanded: handleGroupClick }, props.children));
|
|
32
34
|
case types_1.MenuType.DrillDown:
|
|
33
35
|
return (react_1.default.createElement(Drilldown, { item: props.item, isExpanded: drilldownIsExpanded, back: handleBack, expand: handleExpand, prevActiveItem: prevActiveItem }, props.children));
|
|
34
36
|
default:
|
|
@@ -1,4 +1,2 @@
|
|
|
1
1
|
import { Link } from '../../mocks/Link';
|
|
2
|
-
export declare const MenuLink: import("styled-components").StyledComponent<typeof Link, any, {
|
|
3
|
-
'data-component-name': string;
|
|
4
|
-
}, "data-component-name">;
|
|
2
|
+
export declare const MenuLink: import("styled-components").StyledComponent<typeof Link, any, {}, never>;
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.MenuLink = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
const Link_1 = require("../../mocks/Link");
|
|
9
|
-
exports.MenuLink = (0, styled_components_1.default)(Link_1.Link).attrs(() => ({
|
|
9
|
+
exports.MenuLink = (0, styled_components_1.default)(Link_1.Link).attrs(({ className }) => ({
|
|
10
10
|
'data-component-name': 'Sidebar/MenuLink',
|
|
11
|
+
className,
|
|
11
12
|
})) `
|
|
12
13
|
text-decoration: none;
|
|
13
14
|
color: var(--sidebar-item-text-color);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MenuItemProps } from '../../components/Sidebar/types';
|
|
3
|
-
export declare function MenuLinkItem({ item, children, }: React.PropsWithChildren<MenuItemProps>): JSX.Element;
|
|
3
|
+
export declare function MenuLinkItem({ item, children, className, }: React.PropsWithChildren<MenuItemProps>): JSX.Element;
|
|
@@ -7,8 +7,8 @@ exports.MenuLinkItem = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const MenuLink_1 = require("../../components/Menu/MenuLink");
|
|
10
|
-
function MenuLinkItem({ item, children, }) {
|
|
11
|
-
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuLinkItem" }, item.link ? (react_1.default.createElement(MenuLink_1.MenuLink, Object.assign({ to: item.link }, item), children)) : (children)));
|
|
10
|
+
function MenuLinkItem({ item, children, className, }) {
|
|
11
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Sidebar/MenuLinkItem", className: className }, item.link ? (react_1.default.createElement(MenuLink_1.MenuLink, Object.assign({ to: item.link }, item), children)) : (children)));
|
|
12
12
|
}
|
|
13
13
|
exports.MenuLinkItem = MenuLinkItem;
|
|
14
14
|
const Wrapper = styled_components_1.default.span ``;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ResolvedNavItem } from '../../types/portal';
|
|
3
|
+
import type { ItemState } from '../../mocks/Sidebar/types';
|
|
4
|
+
interface MobileMenuProps {
|
|
5
|
+
navItems: ResolvedNavItem[];
|
|
6
|
+
sidebarItems: ItemState[];
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MobileMenu({ navItems, sidebarItems, className, }: MobileMenuProps): JSX.Element | null;
|
|
10
|
+
export declare const ControlButton: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,179 @@
|
|
|
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.ControlButton = exports.MobileMenu = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
32
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
|
+
const NavbarDropdown_1 = require("../../components/Navbar/NavbarDropdown");
|
|
34
|
+
const utils_1 = require("../../utils");
|
|
35
|
+
const index_1 = require("../../components/Menu/index");
|
|
36
|
+
const MobileUserProfile_1 = require("../../components/Navbar/MobileUserProfile");
|
|
37
|
+
const utils_2 = require("../../mocks/utils");
|
|
38
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
39
|
+
const icons_1 = require("../../icons");
|
|
40
|
+
var MenuLevel;
|
|
41
|
+
(function (MenuLevel) {
|
|
42
|
+
MenuLevel["NAVBAR"] = "NAVBAR";
|
|
43
|
+
MenuLevel["SIDEBAR"] = "SIDEBAR";
|
|
44
|
+
})(MenuLevel || (MenuLevel = {}));
|
|
45
|
+
function MobileMenu({ navItems, sidebarItems, className, }) {
|
|
46
|
+
const [menuLevel, setMenuLevel] = (0, react_1.useState)(sidebarItems.length ? MenuLevel.SIDEBAR : MenuLevel.NAVBAR);
|
|
47
|
+
const { pathname, hash } = (0, react_router_dom_1.useLocation)();
|
|
48
|
+
const pathHash = pathname + hash;
|
|
49
|
+
const { defaultLocale, currentLocale, locales } = (0, hooks_1.useI18nConfig)();
|
|
50
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
51
|
+
if ((0, utils_1.isPrimitive)(navItems) || (0, utils_1.isEmptyArray)(navItems)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const isItemActive = (item) => {
|
|
55
|
+
return (pathHash ===
|
|
56
|
+
(0, utils_1.withPathPrefix)((0, utils_2.getPathnameForLocale)(item.link || '/', defaultLocale, currentLocale, locales)));
|
|
57
|
+
};
|
|
58
|
+
const mapNavbarItems = (items) => {
|
|
59
|
+
return items.map((navItem) => {
|
|
60
|
+
var _a;
|
|
61
|
+
return (Object.assign(Object.assign(Object.assign(Object.assign({}, navItem), (navItem.items && { items: mapNavbarItems(navItem.items) })), ('link' in navItem && { link: navItem.link || '/' })), { active: 'link' in navItem && isItemActive(navItem), hasActiveSubItem: !!((_a = navItem.items) === null || _a === void 0 ? void 0 : _a.find(isItemActive)) }));
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
let menuItems;
|
|
65
|
+
switch (menuLevel) {
|
|
66
|
+
case MenuLevel.SIDEBAR:
|
|
67
|
+
menuItems = sidebarItems;
|
|
68
|
+
break;
|
|
69
|
+
default:
|
|
70
|
+
menuItems = mapNavbarItems(navItems);
|
|
71
|
+
}
|
|
72
|
+
const isMenuButtonVisible = menuLevel === MenuLevel.SIDEBAR;
|
|
73
|
+
const isPreviousButtonVisible = menuLevel === MenuLevel.NAVBAR && !!sidebarItems.length;
|
|
74
|
+
const isButtonsSectionVisible = isMenuButtonVisible || isPreviousButtonVisible;
|
|
75
|
+
const translationKeys = {
|
|
76
|
+
mainMenu: 'theme.mobileMenu.mainMenu',
|
|
77
|
+
previous: 'theme.mobileMenu.previous',
|
|
78
|
+
};
|
|
79
|
+
return (react_1.default.createElement(MobileMenuWrapper, { "data-component-name": "Menu/MobileMenu", className: className },
|
|
80
|
+
react_1.default.createElement(ScrollableArea, null,
|
|
81
|
+
isButtonsSectionVisible && (react_1.default.createElement(ButtonsSection, { alignRight: isPreviousButtonVisible },
|
|
82
|
+
isMenuButtonVisible && (react_1.default.createElement(exports.ControlButton, { "data-component-name": "Menu/ControlButton", onClick: () => setMenuLevel(MenuLevel.NAVBAR) },
|
|
83
|
+
react_1.default.createElement(icons_1.ExpandIcon, { direction: "left" }),
|
|
84
|
+
react_1.default.createElement(ControlButtonLabel, { paddingDirection: "left" }, translate(translationKeys.mainMenu, 'Main Menu')))),
|
|
85
|
+
isPreviousButtonVisible && (react_1.default.createElement(exports.ControlButton, { "data-component-name": "Menu/ControlButton", onClick: () => setMenuLevel(MenuLevel.SIDEBAR) },
|
|
86
|
+
react_1.default.createElement(ControlButtonLabel, { paddingDirection: "right" }, translate(translationKeys.previous, 'Previous')),
|
|
87
|
+
react_1.default.createElement(icons_1.ExpandIcon, { direction: "right" }))))),
|
|
88
|
+
react_1.default.createElement(MenuWrapper, null,
|
|
89
|
+
react_1.default.createElement(index_1.Menu, { items: menuItems, isMobile: true }))),
|
|
90
|
+
react_1.default.createElement(MobileUserProfile_1.MobileUserProfile, null)));
|
|
91
|
+
}
|
|
92
|
+
exports.MobileMenu = MobileMenu;
|
|
93
|
+
const MobileMenuWrapper = styled_components_1.default.div `
|
|
94
|
+
height: 100%;
|
|
95
|
+
width: 100%;
|
|
96
|
+
position: fixed;
|
|
97
|
+
z-index: var(--z-index-raised);
|
|
98
|
+
left: 0;
|
|
99
|
+
top: var(--navbar-height);
|
|
100
|
+
overflow-x: hidden;
|
|
101
|
+
transition: 0.5s;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
background: var(--mobile-menu-background);
|
|
105
|
+
|
|
106
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
${NavbarDropdown_1.DropdownWrapper} {
|
|
111
|
+
& > div {
|
|
112
|
+
text-align: center;
|
|
113
|
+
padding: 10px 0;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
a {
|
|
116
|
+
color: var(--navbar-text-color);
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
}
|
|
119
|
+
:hover {
|
|
120
|
+
text-decoration: underline;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
const ButtonsSection = styled_components_1.default.div `
|
|
126
|
+
align-items: center;
|
|
127
|
+
display: flex;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
${({ alignRight }) => alignRight && 'justify-content: flex-end'};
|
|
130
|
+
`;
|
|
131
|
+
const ScrollableArea = styled_components_1.default.div `
|
|
132
|
+
padding-top: var(--mobile-menu-padding-top);
|
|
133
|
+
flex: 1;
|
|
134
|
+
overflow-y: scroll;
|
|
135
|
+
margin-bottom: 140px;
|
|
136
|
+
`;
|
|
137
|
+
const MenuWrapper = styled_components_1.default.div `
|
|
138
|
+
margin: 0 var(--mobile-menu-horizontal-margin);
|
|
139
|
+
margin-top: var(--mobile-menu-items-margin-top);
|
|
140
|
+
line-height: 22px;
|
|
141
|
+
background: var(--mobile-menu-background);
|
|
142
|
+
|
|
143
|
+
${index_1.MenuItemLabel} {
|
|
144
|
+
margin: 0;
|
|
145
|
+
border-radius: var(--mobile-menu-item-radius);
|
|
146
|
+
padding-left: var(--sidebar-item-padding-horizontal);
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
exports.ControlButton = styled_components_1.default.li `
|
|
150
|
+
display: inline-block;
|
|
151
|
+
padding: var(--mobile-menu-control-button-padding-vertical)
|
|
152
|
+
var(--mobile-menu-control-button-padding-horizontal);
|
|
153
|
+
margin: var(--mobile-menu-control-button-margin-vertical)
|
|
154
|
+
var(--mobile-menu-control-button-margin-horizontal);
|
|
155
|
+
text-align: center;
|
|
156
|
+
font-size: var(--mobile-menu-control-button-font-size);
|
|
157
|
+
line-height: 22px;
|
|
158
|
+
font-weight: var(--mobile-menu-control-button-weight);
|
|
159
|
+
color: var(--mobile-menu-control-button-color);
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
|
|
162
|
+
svg {
|
|
163
|
+
fill: var(--mobile-menu-control-button-color);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:hover {
|
|
167
|
+
color: var(--mobile-menu-control-button-hover-color);
|
|
168
|
+
|
|
169
|
+
svg {
|
|
170
|
+
fill: var(--mobile-menu-control-button-hover-color);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
`;
|
|
174
|
+
const ControlButtonLabel = styled_components_1.default.span `
|
|
175
|
+
vertical-align: middle;
|
|
176
|
+
${({ paddingDirection }) => paddingDirection === 'left' && 'padding-left: 8px'};
|
|
177
|
+
${({ paddingDirection }) => paddingDirection === 'right' && 'padding-right: 8px'};
|
|
178
|
+
`;
|
|
179
|
+
//# sourceMappingURL=MobileMenu.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ItemState } from '../../components/Sidebar/types';
|
|
3
|
+
interface MenuGroupProps {
|
|
4
|
+
item: ItemState;
|
|
5
|
+
isExpanded: boolean;
|
|
6
|
+
toggleExpanded: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function MobileMenuGroup({ item, isExpanded, toggleExpanded, children, }: React.PropsWithChildren<MenuGroupProps>): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
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.MobileMenuGroup = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const MenuLinkItem_1 = require("../../components/Menu/MenuLinkItem");
|
|
10
|
+
const MenuItemLabel_1 = require("../../components/Menu/MenuItemLabel");
|
|
11
|
+
const SeparatorLine_1 = require("../../components/Separator/SeparatorLine");
|
|
12
|
+
const hooks_1 = require("../../mocks/hooks");
|
|
13
|
+
const icons_1 = require("../../icons");
|
|
14
|
+
function MobileMenuGroup({ item, isExpanded, toggleExpanded, children, }) {
|
|
15
|
+
const { translate } = (0, hooks_1.useTranslate)();
|
|
16
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "Menu/MobileMenuGroup" },
|
|
17
|
+
react_1.default.createElement(MenuLinkItem_1.MenuLinkItem, { item: item },
|
|
18
|
+
react_1.default.createElement(MenuGroupLabel, { onClick: toggleExpanded, active: item.active, expanded: isExpanded },
|
|
19
|
+
react_1.default.createElement(LabelContainer, null,
|
|
20
|
+
react_1.default.createElement(Label, null, translate(item.labelTranslationKey, item.label))),
|
|
21
|
+
!!item.items.length && react_1.default.createElement(icons_1.ExpandIcon, { direction: isExpanded ? 'down' : 'right' }))),
|
|
22
|
+
react_1.default.createElement(MenuWrapper, { isExpanded: isExpanded }, children),
|
|
23
|
+
item.separatorLine ? react_1.default.createElement(SeparatorLine_1.SeparatorLine, null) : null));
|
|
24
|
+
}
|
|
25
|
+
exports.MobileMenuGroup = MobileMenuGroup;
|
|
26
|
+
const LabelContainer = styled_components_1.default.div `
|
|
27
|
+
display: flex;
|
|
28
|
+
`;
|
|
29
|
+
const Label = styled_components_1.default.div ``;
|
|
30
|
+
const Wrapper = styled_components_1.default.div ``;
|
|
31
|
+
const MenuWrapper = styled_components_1.default.div `
|
|
32
|
+
padding-left: var(--mobile-menu-item-nested-offset);
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
${(props) => !props.isExpanded && 'max-height: 0'}
|
|
35
|
+
`;
|
|
36
|
+
const MenuGroupLabel = (0, styled_components_1.default)(MenuItemLabel_1.MenuItemLabel) `
|
|
37
|
+
color: var(--mobile-menu-item-text-color);
|
|
38
|
+
background: var(--mobile-menu-background);
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
|
|
42
|
+
${({ active }) => active &&
|
|
43
|
+
`
|
|
44
|
+
color: var(--mobile-menu-item-active-text-color);
|
|
45
|
+
background-color: var(--mobile-menu-item-active-color);
|
|
46
|
+
`}
|
|
47
|
+
|
|
48
|
+
${({ expanded }) => expanded &&
|
|
49
|
+
`
|
|
50
|
+
color: var(--mobile-menu-item-active-text-color);
|
|
51
|
+
`}
|
|
52
|
+
`;
|
|
53
|
+
//# sourceMappingURL=MobileMenuGroup.js.map
|
|
@@ -21,4 +21,5 @@ __exportStar(require("../../components/Menu/MenuContainer"), exports);
|
|
|
21
21
|
__exportStar(require("../../components/Menu/MenuItemLabel"), exports);
|
|
22
22
|
__exportStar(require("../../components/Menu/MenuLink"), exports);
|
|
23
23
|
__exportStar(require("../../components/Menu/MenuLinkItem"), exports);
|
|
24
|
+
__exportStar(require("../../components/Menu/MobileMenuGroup"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
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.BurgerButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const icons_1 = require("../../icons");
|
|
10
|
+
function BurgerButton({ isOpen, onClick, }) {
|
|
11
|
+
return (react_1.default.createElement(Wrapper, { "data-component-name": "BurgerButton/BurgerButton", onClick: onClick }, isOpen ? react_1.default.createElement(icons_1.CloseIcon, null) : react_1.default.createElement(icons_1.BurgerIcon, null)));
|
|
12
|
+
}
|
|
13
|
+
exports.BurgerButton = BurgerButton;
|
|
14
|
+
const Wrapper = styled_components_1.default.div `
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
user-select: none;
|
|
19
|
+
fill: var(--navbar-text-color);
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
margin: var(--mobile-menu-burger-button-margin);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
//# sourceMappingURL=BurgerButton.js.map
|