@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
|
@@ -3,6 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
interface ShortcutKeyProps {
|
|
5
5
|
keyShortcuts?: string | string[];
|
|
6
|
+
className?: string;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export function ShortcutKey(props: ShortcutKeyProps): JSX.Element {
|
|
@@ -18,7 +19,7 @@ export function ShortcutKey(props: ShortcutKeyProps): JSX.Element {
|
|
|
18
19
|
|
|
19
20
|
mainShortcutKey = mainShortcutKey?.toUpperCase();
|
|
20
21
|
|
|
21
|
-
return <Wrapper>{mainShortcutKey}</Wrapper>;
|
|
22
|
+
return <Wrapper className={props.className}>{mainShortcutKey}</Wrapper>;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export const Wrapper = styled.div`
|
|
@@ -3,8 +3,9 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { Search } from '@theme/components/Search/Search';
|
|
4
4
|
import { Popover } from '@theme/components/Search/Popover';
|
|
5
5
|
|
|
6
|
-
export const SidebarSearch = styled(Search).attrs(() => ({
|
|
6
|
+
export const SidebarSearch = styled(Search).attrs<{ className?: string }>(({ className }) => ({
|
|
7
7
|
'data-component-name': 'Search/SidebarSearch',
|
|
8
|
+
className,
|
|
8
9
|
}))`
|
|
9
10
|
--search-input-text-color: var(--sidebar-item-active-color);
|
|
10
11
|
|
|
@@ -6,7 +6,7 @@ import { useSuggestedPages } from '@portal/search';
|
|
|
6
6
|
import { Link } from '@portal/Link';
|
|
7
7
|
import { useTranslate } from '@portal/hooks';
|
|
8
8
|
|
|
9
|
-
export function SuggestedPages() {
|
|
9
|
+
export function SuggestedPages({ className }: { className?: string }) {
|
|
10
10
|
const pages = useSuggestedPages();
|
|
11
11
|
const { translate } = useTranslate();
|
|
12
12
|
const translationKeys = {
|
|
@@ -16,7 +16,7 @@ export function SuggestedPages() {
|
|
|
16
16
|
if (!pages.length) return null;
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<Wrapper data-component-name="Search/SuggestedPages">
|
|
19
|
+
<Wrapper data-component-name="Search/SuggestedPages" className={className}>
|
|
20
20
|
<Title data-translation-key={translationKeys.title}>
|
|
21
21
|
{translate(translationKeys.title, 'Suggested pages')}
|
|
22
22
|
</Title>
|
|
@@ -6,11 +6,11 @@ import { SeparatorItem } from '@theme/components/Separator/SeparatorItem';
|
|
|
6
6
|
import type { MenuItemProps } from '@theme/components/Sidebar/types';
|
|
7
7
|
import { useTranslate } from '@portal/hooks';
|
|
8
8
|
|
|
9
|
-
export function Separator({ item }: MenuItemProps): JSX.Element {
|
|
9
|
+
export function Separator({ item, className }: MenuItemProps): JSX.Element {
|
|
10
10
|
const { translate } = useTranslate();
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
|
-
<Wrapper data-component-name="Sidebar/Separator">
|
|
13
|
+
<Wrapper data-component-name="Sidebar/Separator" className={className}>
|
|
14
14
|
<SeparatorItem>{translate(item.labelTranslationKey, item.label)}</SeparatorItem>
|
|
15
15
|
{item.separatorLine ? <SeparatorLine /> : null}
|
|
16
16
|
</Wrapper>
|
|
@@ -2,16 +2,23 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import { MenuItemLabel } from '@theme/components/Menu/MenuItemLabel';
|
|
4
4
|
|
|
5
|
-
export const SeparatorItem = styled(MenuItemLabel).attrs
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export const SeparatorItem = styled(MenuItemLabel).attrs<{ className?: string }>(
|
|
6
|
+
({ className }) => ({
|
|
7
|
+
'data-component-name': 'Sidebar/SeparatorItem',
|
|
8
|
+
className,
|
|
9
|
+
}),
|
|
10
|
+
)`
|
|
8
11
|
cursor: default;
|
|
9
12
|
font-weight: var(--font-weight-bold);
|
|
10
13
|
color: var(--sidebar-separator-item-color);
|
|
11
14
|
font-family: var(--sidebar-item-separator-font-family);
|
|
12
15
|
font-size: var(--sidebar-item-separator-font-size);
|
|
13
16
|
text-transform: var(--sidebar-item-separator-text-transform);
|
|
14
|
-
background: var(--
|
|
17
|
+
background: var(--mobile-menu-background);
|
|
18
|
+
|
|
19
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
20
|
+
background: var(--sidebar-item-separator-background-color);
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
*:not(:first-child) > & {
|
|
17
24
|
margin-top: var(--sidebar-item-separator-offset);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const SeparatorLine = styled.div.attrs(() => ({
|
|
3
|
+
export const SeparatorLine = styled.div.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'Sidebar/SeparatorLine',
|
|
5
|
+
className,
|
|
5
6
|
}))`
|
|
6
7
|
height: 1px;
|
|
7
8
|
background-color: var(--sidebar-item-separator-line-color);
|
|
@@ -7,16 +7,16 @@ import { SeparatorLine } from '@theme/components/Separator/SeparatorLine';
|
|
|
7
7
|
import { MenuItemLabel } from '@theme/components/Menu/MenuItemLabel';
|
|
8
8
|
import type { MenuItemProps } from '@theme/components/Sidebar/types';
|
|
9
9
|
|
|
10
|
-
export function ApiCallItem({ item }: MenuItemProps): JSX.Element {
|
|
10
|
+
export function ApiCallItem({ item, className }: MenuItemProps): JSX.Element {
|
|
11
11
|
return (
|
|
12
|
-
<Wrapper data-component-name="Sidebar/ApiCallItem">
|
|
12
|
+
<Wrapper data-component-name="Sidebar/ApiCallItem" className={className}>
|
|
13
13
|
<MenuLinkItem item={item}>
|
|
14
|
-
<
|
|
14
|
+
<Label active={item.active}>
|
|
15
15
|
<Badge type={item.httpVerb || ''}>
|
|
16
16
|
{item.httpVerb === 'hook' ? 'event' : item.httpVerb}
|
|
17
17
|
</Badge>
|
|
18
18
|
{item.label}
|
|
19
|
-
</
|
|
19
|
+
</Label>
|
|
20
20
|
</MenuLinkItem>
|
|
21
21
|
|
|
22
22
|
{item.separatorLine ? <SeparatorLine /> : null}
|
|
@@ -24,6 +24,14 @@ export function ApiCallItem({ item }: MenuItemProps): JSX.Element {
|
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
const Label = styled(MenuItemLabel)`
|
|
28
|
+
color: var(--mobile-menu-item-text-color);
|
|
29
|
+
|
|
30
|
+
${({ theme }) => theme.mediaQueries.medium} {
|
|
31
|
+
color: var(--sidebar-item-text-color);
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
27
35
|
const Wrapper = styled.div``;
|
|
28
36
|
|
|
29
37
|
export const Badge = styled(OperationBadge)`
|
|
@@ -5,14 +5,16 @@ import { ArrowBack } from '@theme/ui/ArrowBack';
|
|
|
5
5
|
|
|
6
6
|
interface BackButtonProps {
|
|
7
7
|
back: () => void;
|
|
8
|
+
className?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export function BackButton({
|
|
11
12
|
children,
|
|
12
13
|
back,
|
|
14
|
+
className,
|
|
13
15
|
}: React.PropsWithChildren<BackButtonProps>): JSX.Element {
|
|
14
16
|
return (
|
|
15
|
-
<Button onClick={back} data-component-name="Sidebar/BackButton">
|
|
17
|
+
<Button onClick={back} data-component-name="Sidebar/BackButton" className={className}>
|
|
16
18
|
<ArrowBack dataComponentName="Sidebar/ArrowBack" />
|
|
17
19
|
{children}
|
|
18
20
|
</Button>
|
|
@@ -10,16 +10,18 @@ import type { DrilldownMenuProps } from '@theme/components/Sidebar/types';
|
|
|
10
10
|
interface DrilldownProps extends DrilldownMenuProps {
|
|
11
11
|
isExpanded: boolean;
|
|
12
12
|
expand: () => void;
|
|
13
|
+
className?: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export function Drilldown({
|
|
16
17
|
isExpanded,
|
|
17
18
|
item,
|
|
18
19
|
expand,
|
|
20
|
+
className,
|
|
19
21
|
...props
|
|
20
22
|
}: React.PropsWithChildren<DrilldownProps>): JSX.Element {
|
|
21
23
|
return (
|
|
22
|
-
<Wrapper data-component-name="Sidebar/Drilldown">
|
|
24
|
+
<Wrapper data-component-name="Sidebar/Drilldown" className={className}>
|
|
23
25
|
<DrilldownLabel onClick={expand}>
|
|
24
26
|
<DrilldownMenuItem item={item} />
|
|
25
27
|
</DrilldownLabel>
|
|
@@ -11,13 +11,14 @@ export function DrilldownMenu({
|
|
|
11
11
|
back,
|
|
12
12
|
prevActiveItem,
|
|
13
13
|
children,
|
|
14
|
+
className,
|
|
14
15
|
}: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element {
|
|
15
16
|
const { translate } = useTranslate();
|
|
16
17
|
const translationKeys = {
|
|
17
18
|
backLabel: 'theme.sidebar.menu.backLabel',
|
|
18
19
|
};
|
|
19
20
|
return (
|
|
20
|
-
<MenuContainer data-component-name="Sidebar/DrilldownMenu">
|
|
21
|
+
<MenuContainer data-component-name="Sidebar/DrilldownMenu" className={className}>
|
|
21
22
|
<MenuContent>
|
|
22
23
|
<MenuWrapper>
|
|
23
24
|
<BackButton back={back} data-translation-key={translationKeys.backLabel}>
|
|
@@ -37,7 +38,7 @@ const MenuContainer = styled.div`
|
|
|
37
38
|
top: 0;
|
|
38
39
|
bottom: 0;
|
|
39
40
|
width: 100%;
|
|
40
|
-
z-index:
|
|
41
|
+
z-index: var(--z-index-raised);
|
|
41
42
|
background-color: var(--sidebar-item-drilldown-background-color);
|
|
42
43
|
`;
|
|
43
44
|
|
|
@@ -4,11 +4,11 @@ import styled from 'styled-components';
|
|
|
4
4
|
import type { MenuItemProps } from '@theme/components/Sidebar/types';
|
|
5
5
|
import { useTranslate } from '@portal/hooks';
|
|
6
6
|
|
|
7
|
-
export function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element {
|
|
7
|
+
export function DrilldownMenuItem({ item, className }: MenuItemProps): JSX.Element {
|
|
8
8
|
const { translate } = useTranslate();
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<Container data-component-name="Sidebar/DrilldownMenuItem">
|
|
11
|
+
<Container data-component-name="Sidebar/DrilldownMenuItem" className={className}>
|
|
12
12
|
{item.icon ? <Icon src={item.icon} /> : null}
|
|
13
13
|
<div>
|
|
14
14
|
{translate(item.labelTranslationKey, item.label)}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const HeaderWrapper = styled.div.attrs(() => ({
|
|
3
|
+
export const HeaderWrapper = styled.div.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'Sidebar/HeaderWrapper',
|
|
5
|
+
className,
|
|
5
6
|
}))`
|
|
6
7
|
margin: var(--sidebar-offset-top) 0 0 var(--sidebar-offset-left);
|
|
7
8
|
padding-bottom: var(--sidebar-spacing-unit);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const MobileSidebarButton = styled.span.attrs(() => ({
|
|
3
|
+
export const MobileSidebarButton = styled.span.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'Sidebar/MobileSidebarButton',
|
|
5
|
+
className,
|
|
5
6
|
}))<{ opened?: boolean }>`
|
|
6
7
|
background-color: var(
|
|
7
8
|
${(props) => (props.opened ? '--fab-active-background' : '--fab-background-color')}
|
|
@@ -13,7 +14,7 @@ export const MobileSidebarButton = styled.span.attrs(() => ({
|
|
|
13
14
|
cursor: pointer;
|
|
14
15
|
position: fixed;
|
|
15
16
|
right: 20px;
|
|
16
|
-
z-index:
|
|
17
|
+
z-index: var(--z-index-surface);
|
|
17
18
|
box-shadow: ${(props) =>
|
|
18
19
|
props.opened ? 'var(--fab-active-box-shadow)' : 'var(--fab-box-shadow)'};
|
|
19
20
|
border-radius: 50%;
|
|
@@ -5,8 +5,9 @@ interface SidebarProps {
|
|
|
5
5
|
animate?: boolean;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const Sidebar = styled.aside.attrs(() => ({
|
|
8
|
+
export const Sidebar = styled.aside.attrs<{ className?: string }>(({ className }) => ({
|
|
9
9
|
'data-component-name': 'Sidebar/Sidebar',
|
|
10
|
+
className,
|
|
10
11
|
}))<SidebarProps>`
|
|
11
12
|
border-right: 1px solid var(--sidebar-border-color);
|
|
12
13
|
position: fixed;
|
|
@@ -25,6 +25,7 @@ interface SidebarLayoutProps {
|
|
|
25
25
|
growContent?: boolean;
|
|
26
26
|
collapsed?: boolean;
|
|
27
27
|
onToggleMenu?: (isOpen: boolean) => void;
|
|
28
|
+
className?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const StyledFooterWrapper = styled(FooterWrapper)`
|
|
@@ -43,6 +44,7 @@ export function SidebarLayout({
|
|
|
43
44
|
growContent,
|
|
44
45
|
collapsed,
|
|
45
46
|
onToggleMenu,
|
|
47
|
+
className,
|
|
46
48
|
}: SidebarLayoutProps): JSX.Element | null {
|
|
47
49
|
const [isOpen, setIsOpen] = useMobileMenu();
|
|
48
50
|
const [mappedCollapsed, setMappedCollapsed] = React.useState(collapsed);
|
|
@@ -76,10 +78,7 @@ export function SidebarLayout({
|
|
|
76
78
|
</Wrapper>
|
|
77
79
|
) : null
|
|
78
80
|
) : (
|
|
79
|
-
<Wrapper data-component-name="Sidebar/SidebarLayout">
|
|
80
|
-
<MobileSidebarButton opened={isOpen} onClick={toggleMenu}>
|
|
81
|
-
<MobileSidebarIcon />
|
|
82
|
-
</MobileSidebarButton>
|
|
81
|
+
<Wrapper data-component-name="Sidebar/SidebarLayout" className={className}>
|
|
83
82
|
{!search?.hide && search?.placement === 'sidebar' ? <SidebarSearch /> : null}
|
|
84
83
|
<Sidebar animate={true} opened={isOpen}>
|
|
85
84
|
{header ? <HeaderWrapper>{header}</HeaderWrapper> : null}
|
|
@@ -13,11 +13,14 @@ export interface DrilldownMenuProps {
|
|
|
13
13
|
back: () => void;
|
|
14
14
|
item: ItemState;
|
|
15
15
|
prevActiveItem?: ItemState;
|
|
16
|
+
className?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface MenuItemProps {
|
|
19
20
|
item: ItemState;
|
|
20
21
|
activeItem?: ItemState;
|
|
22
|
+
className?: string;
|
|
23
|
+
isMobile?: boolean;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export interface NavItem {
|
|
@@ -25,6 +25,7 @@ interface SidebarActionsProps {
|
|
|
25
25
|
onChangeViewClick: () => void;
|
|
26
26
|
onChangeCollapseSidebarClick: () => void;
|
|
27
27
|
requestAccessButton?: React.ReactElement | null;
|
|
28
|
+
className?: string;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export const SidebarActions = ({
|
|
@@ -39,9 +40,11 @@ export const SidebarActions = ({
|
|
|
39
40
|
onChangeViewClick,
|
|
40
41
|
onChangeCollapseSidebarClick,
|
|
41
42
|
requestAccessButton,
|
|
43
|
+
className,
|
|
42
44
|
}: SidebarActionsProps) => {
|
|
43
45
|
return (
|
|
44
46
|
<ControlsWrap
|
|
47
|
+
className={className}
|
|
45
48
|
isOpenapiDocs={isOpenapiDocs}
|
|
46
49
|
isCollapsed={collapsedSidebar}
|
|
47
50
|
data-component-name="Sidebar/Actions"
|
|
@@ -7,6 +7,7 @@ export interface LogoProps {
|
|
|
7
7
|
altText?: string;
|
|
8
8
|
dataTestId?: string;
|
|
9
9
|
backgroundColor?: string;
|
|
10
|
+
className?: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function SidebarLogo({
|
|
@@ -15,6 +16,7 @@ export function SidebarLogo({
|
|
|
15
16
|
altText,
|
|
16
17
|
backgroundColor,
|
|
17
18
|
dataTestId,
|
|
19
|
+
className,
|
|
18
20
|
}: LogoProps = {}): JSX.Element | null {
|
|
19
21
|
if (!imageUrl) {
|
|
20
22
|
return null;
|
|
@@ -27,6 +29,7 @@ export function SidebarLogo({
|
|
|
27
29
|
data-cy={dataTestId}
|
|
28
30
|
style={{ backgroundColor }}
|
|
29
31
|
data-component-name="SidebarLogo/SidebarLogo"
|
|
32
|
+
className={className}
|
|
30
33
|
>
|
|
31
34
|
{href ? <Link href={href}>{logo}</Link> : logo}
|
|
32
35
|
</LogoWrap>
|
|
@@ -15,10 +15,11 @@ import {
|
|
|
15
15
|
interface TableOfContentProps {
|
|
16
16
|
headings?: Array<MdHeading | null> | null | undefined;
|
|
17
17
|
contentWrapper: HTMLDivElement | null;
|
|
18
|
+
className?: string;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
|
|
21
|
-
const { headings, contentWrapper } = props;
|
|
22
|
+
const { headings, contentWrapper, className } = props;
|
|
22
23
|
|
|
23
24
|
const sidebar = React.useRef<HTMLDivElement | null>(null);
|
|
24
25
|
useFullHeight(sidebar);
|
|
@@ -43,7 +44,7 @@ export function TableOfContent(props: TableOfContentProps): JSX.Element | null {
|
|
|
43
44
|
|
|
44
45
|
return (
|
|
45
46
|
<>
|
|
46
|
-
<TableOfContentMenu data-component-name="TableOfContent/TableOfContent">
|
|
47
|
+
<TableOfContentMenu data-component-name="TableOfContent/TableOfContent" className={className}>
|
|
47
48
|
<TableOfContentItems ref={sidebar}>
|
|
48
49
|
{displayedHeadings.length ? (
|
|
49
50
|
<TocHeader data-translation-key={translationKeys.header}>
|
|
@@ -3,9 +3,9 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { Highlight } from '@theme/ui/Highlight';
|
|
5
5
|
|
|
6
|
-
export function Tags({ tags }: { tags: string[] }) {
|
|
6
|
+
export function Tags({ tags, className }: { tags: string[]; className?: string }) {
|
|
7
7
|
return (
|
|
8
|
-
<TagsWrapper>
|
|
8
|
+
<TagsWrapper className={className}>
|
|
9
9
|
{tags.map((tag) => (
|
|
10
10
|
<Tag key={tag} className={'tag-' + slug(tag)}>
|
|
11
11
|
<Highlight>{tag}</Highlight>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const TileHeader = styled.h3.attrs(() => ({
|
|
3
|
+
export const TileHeader = styled.h3.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'ui/Tiles/TileHeader',
|
|
5
|
+
className,
|
|
5
6
|
}))<{ color?: string }>`
|
|
6
7
|
font-weight: var(--h3-font-weight);
|
|
7
8
|
line-height: var(--h3-line-height);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const TileText = styled.span.attrs(() => ({
|
|
3
|
+
export const TileText = styled.span.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'ui/Tiles/TileText',
|
|
5
|
+
className,
|
|
5
6
|
}))<{ color?: string }>`
|
|
6
7
|
display: inline-block;
|
|
7
8
|
font-weight: var(--font-weight-regular);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const Emphasis = styled.strong.attrs(() => ({
|
|
3
|
+
export const Emphasis = styled.strong.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'Typography/Emphasis',
|
|
5
|
+
className,
|
|
5
6
|
}))`
|
|
6
7
|
font-weight: var(--font-weight-bold);
|
|
7
8
|
`;
|
|
@@ -2,8 +2,9 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import { typography } from '@theme/utils';
|
|
4
4
|
|
|
5
|
-
export const H1 = styled.h1.attrs(() => ({
|
|
5
|
+
export const H1 = styled.h1.attrs<{ className?: string }>(({ className }) => ({
|
|
6
6
|
'data-component-name': 'Typography/H1',
|
|
7
|
+
className,
|
|
7
8
|
}))`
|
|
8
9
|
color: var(--h1-text-color);
|
|
9
10
|
margin: var(--h1-margin-top) 0 var(--h1-margin-bottom);
|
|
@@ -2,8 +2,9 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import { typography } from '@theme/utils';
|
|
4
4
|
|
|
5
|
-
export const H2 = styled.h2.attrs(() => ({
|
|
5
|
+
export const H2 = styled.h2.attrs<{ className?: string }>(({ className }) => ({
|
|
6
6
|
'data-component-name': 'Typography/H2',
|
|
7
|
+
className,
|
|
7
8
|
}))`
|
|
8
9
|
color: var(--h2-text-color);
|
|
9
10
|
margin: var(--h2-margin-top) 0 var(--h2-margin-bottom);
|
|
@@ -2,8 +2,9 @@ import styled from 'styled-components';
|
|
|
2
2
|
|
|
3
3
|
import { typography } from '@theme/utils';
|
|
4
4
|
|
|
5
|
-
export const H3 = styled.h3.attrs(() => ({
|
|
5
|
+
export const H3 = styled.h3.attrs<{ className?: string }>(({ className }) => ({
|
|
6
6
|
'data-component-name': 'Typography/H3',
|
|
7
|
+
className,
|
|
7
8
|
}))`
|
|
8
9
|
color: var(--h3-text-color);
|
|
9
10
|
margin: var(--h3-margin-top) 0 var(--h3-margin-bottom);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const SectionHeader = styled.h2.attrs(() => ({
|
|
3
|
+
export const SectionHeader = styled.h2.attrs<{ className?: string }>(({ className }) => ({
|
|
4
4
|
'data-component-name': 'Typography/SectionHeader',
|
|
5
|
+
className,
|
|
5
6
|
}))`
|
|
6
7
|
color: var(--h2-color);
|
|
7
8
|
font-size: var(--h2-font-size);
|
|
@@ -13,8 +13,9 @@ export interface TypographyProps {
|
|
|
13
13
|
textAlign?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const Typography = styled.div.attrs(() => ({
|
|
16
|
+
export const Typography = styled.div.attrs<{ className?: string }>(({ className }) => ({
|
|
17
17
|
'data-component-name': 'Typography/Typography',
|
|
18
|
+
className,
|
|
18
19
|
}))<TypographyProps>`
|
|
19
20
|
color: ${({ color }) => color || 'var(--text-color)'};
|
|
20
21
|
font-family: ${({ fontFamily }) => fontFamily || 'var(--font-family-base)'};
|
package/src/globalStyle.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createGlobalStyle, css } from 'styled-components';
|
|
2
2
|
|
|
3
|
+
import { breakpoints } from '@portal/media-css';
|
|
4
|
+
|
|
3
5
|
import { darkMode } from './ui/darkColors';
|
|
4
6
|
|
|
5
7
|
const baseColors = css`
|
|
@@ -1618,6 +1620,7 @@ const breadcrumbs = css`
|
|
|
1618
1620
|
*/
|
|
1619
1621
|
|
|
1620
1622
|
--breadcrumbs-text-color: var(--text-color-secondary); // @presenter Color
|
|
1623
|
+
--breadcrumbs-font-size: var(--font-size-base); // @presenter FontSize
|
|
1621
1624
|
--breadcrumbs-active-text-color: var(--text-color); // @presenter Color
|
|
1622
1625
|
--breadcrumbs-hover-text-decoration: underline;
|
|
1623
1626
|
--breadcrumbs-padding-horizontal: 8px; // @presenter Spacing
|
|
@@ -1626,6 +1629,51 @@ const breadcrumbs = css`
|
|
|
1626
1629
|
// @tokens End
|
|
1627
1630
|
`
|
|
1628
1631
|
|
|
1632
|
+
const mobileMenu = css`
|
|
1633
|
+
/**
|
|
1634
|
+
* @tokens Mobile Menu icons
|
|
1635
|
+
*/
|
|
1636
|
+
--mobile-menu-icons-size: 20px; // @presenter Spacing
|
|
1637
|
+
--mobile-menu-search-icon-size: 18px; // @presenter Spacing
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* @tokens Mobile Menu
|
|
1641
|
+
* */
|
|
1642
|
+
--mobile-menu-padding-top: 13px; // @presenter Spacing
|
|
1643
|
+
--mobile-menu-items-margin-top: 5px; // @presenter Spacing
|
|
1644
|
+
--mobile-menu-burger-button-margin: 8px; // @presenter Spacing
|
|
1645
|
+
--mobile-menu-background: #ffffff; // @presenter Color
|
|
1646
|
+
--mobile-menu-profile-background: #ffffff; // @presenter Color
|
|
1647
|
+
--mobile-menu-profile-border-color: #e3e3e3; // @presenter Color
|
|
1648
|
+
--mobile-menu-group-padding-right: 16px; // @presenter Spacing
|
|
1649
|
+
--mobile-menu-horizontal-margin: 8px; // @presenter Spacing
|
|
1650
|
+
--mobile-menu-item-nested-offset: 8px; // @presenter Spacing
|
|
1651
|
+
--mobile-menu-item-radius: 6px; // @presenter Spacing
|
|
1652
|
+
--mobile-menu-item-text-color: #525252;// @presenter Color
|
|
1653
|
+
--mobile-menu-item-active-color: #FAFAFA; // @presenter Color
|
|
1654
|
+
--mobile-menu-item-active-text-color: #161616; // @presenter Color
|
|
1655
|
+
|
|
1656
|
+
/**
|
|
1657
|
+
* @tokens Mobile Menu control button
|
|
1658
|
+
* */
|
|
1659
|
+
--mobile-menu-control-button-padding-vertical: 0; // @presenter Spacing
|
|
1660
|
+
--mobile-menu-control-button-padding-horizontal: 4px; // @presenter Spacing
|
|
1661
|
+
--mobile-menu-control-button-margin-vertical: 0; // @presenter Spacing
|
|
1662
|
+
--mobile-menu-control-button-margin-horizontal: 8px; // @presenter Spacing
|
|
1663
|
+
--mobile-menu-control-button-font-size: var(--font-size-base); // @presenter FontSize
|
|
1664
|
+
--mobile-menu-control-button-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
1665
|
+
--mobile-menu-control-button-color: var(--mobile-menu-item-text-color); // @presenter Color
|
|
1666
|
+
--mobile-menu-control-button-hover-color: var(--text-color); // @presenter Color
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* @tokens Mobile Menu Login button
|
|
1670
|
+
* */
|
|
1671
|
+
--mobile-menu-login-button-background: #1c1c1c; // @presenter Color
|
|
1672
|
+
--mobile-menu-login-button-color: #ffffff; // @presenter Color
|
|
1673
|
+
|
|
1674
|
+
// @tokens End
|
|
1675
|
+
`;
|
|
1676
|
+
|
|
1629
1677
|
const toc = css`
|
|
1630
1678
|
/**
|
|
1631
1679
|
* @tokens TOC
|
|
@@ -1689,7 +1737,7 @@ const loadProgressBar = css`
|
|
|
1689
1737
|
background: var(--load-progress-bar-color);
|
|
1690
1738
|
|
|
1691
1739
|
position: fixed;
|
|
1692
|
-
z-index:
|
|
1740
|
+
z-index: var(--z-index-popover);
|
|
1693
1741
|
top: 0;
|
|
1694
1742
|
left: 0;
|
|
1695
1743
|
|
|
@@ -2025,7 +2073,7 @@ const userProfile = css`
|
|
|
2025
2073
|
--profile-avatar-border-radius: 50%; // @presenter BorderRadius
|
|
2026
2074
|
|
|
2027
2075
|
--profile-avatar-font-family: var(--navbar-item-font-family); // @presenter FontFamily
|
|
2028
|
-
--profile-avatar-font-size: var(--navbar-item-font-size) // @presenter FontSize
|
|
2076
|
+
--profile-avatar-font-size: var(--navbar-item-font-size); // @presenter FontSize
|
|
2029
2077
|
--profile-avatar-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
2030
2078
|
--profile-avatar-line-height: var(--line-height-base); // @presenter LineHeight
|
|
2031
2079
|
|
|
@@ -2073,7 +2121,14 @@ const modal = css`
|
|
|
2073
2121
|
--modal-box-shadow: 0px 8px 12px rgba(51, 51, 51, 0.15), 0px 0px 1px rgba(51, 51, 51, 0.31);
|
|
2074
2122
|
--modal-overlay-background-color: rgba(206, 206, 206, 0.49);
|
|
2075
2123
|
--modal-background-color: var(--background-color);
|
|
2076
|
-
|
|
2124
|
+
`;
|
|
2125
|
+
|
|
2126
|
+
const zIndexDepth = css`
|
|
2127
|
+
--z-index-surface: 10;
|
|
2128
|
+
--z-index-raised: 100;
|
|
2129
|
+
--z-index-popover: 200;
|
|
2130
|
+
--z-index-overlay: 1000;
|
|
2131
|
+
`;
|
|
2077
2132
|
|
|
2078
2133
|
export const styles = css`
|
|
2079
2134
|
:root {
|
|
@@ -2087,6 +2142,7 @@ export const styles = css`
|
|
|
2087
2142
|
${buttons}
|
|
2088
2143
|
${sidebar}
|
|
2089
2144
|
${navbar}
|
|
2145
|
+
${mobileMenu}
|
|
2090
2146
|
${footer}
|
|
2091
2147
|
${logo}
|
|
2092
2148
|
${badges}
|
|
@@ -2107,6 +2163,7 @@ export const styles = css`
|
|
|
2107
2163
|
${pages}
|
|
2108
2164
|
${modal}
|
|
2109
2165
|
${userProfile}
|
|
2166
|
+
${zIndexDepth}
|
|
2110
2167
|
|
|
2111
2168
|
--api-onboarding-table-text-color: #4e5356;
|
|
2112
2169
|
--api-catalog-card-min-width: 250px;
|
|
@@ -2125,6 +2182,12 @@ export const styles = css`
|
|
|
2125
2182
|
:root.notransition * {
|
|
2126
2183
|
transition: none !important;
|
|
2127
2184
|
}
|
|
2185
|
+
|
|
2186
|
+
@media screen and (max-width: ${breakpoints.medium}) {
|
|
2187
|
+
body.overflow-hidden {
|
|
2188
|
+
overflow: hidden;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2128
2191
|
`;
|
|
2129
2192
|
|
|
2130
2193
|
export const GlobalStyle = createGlobalStyle`
|
|
@@ -7,7 +7,11 @@ export function useMobileMenu(initialState = false): [boolean, Dispatch<SetState
|
|
|
7
7
|
const location = useLocation();
|
|
8
8
|
const [isOpen, setIsOpen] = useState(initialState);
|
|
9
9
|
|
|
10
|
-
useEffect(() => setIsOpen(false), [location.pathname]);
|
|
10
|
+
useEffect(() => setIsOpen(false), [location.pathname, location.hash]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (isOpen) document.body.classList.add('overflow-hidden');
|
|
13
|
+
else document.body.classList.remove('overflow-hidden');
|
|
14
|
+
}, [isOpen]);
|
|
11
15
|
|
|
12
16
|
return [isOpen, setIsOpen];
|
|
13
17
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const Icon = () => (
|
|
5
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="inherit" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M21.1875 3.75H2.8125C2.70937 3.75 2.625 3.83437 2.625 3.9375V5.4375C2.625 5.54062 2.70937 5.625 2.8125 5.625H21.1875C21.2906 5.625 21.375 5.54062 21.375 5.4375V3.9375C21.375 3.83437 21.2906 3.75 21.1875 3.75ZM21.1875 18.375H2.8125C2.70937 18.375 2.625 18.4594 2.625 18.5625V20.0625C2.625 20.1656 2.70937 20.25 2.8125 20.25H21.1875C21.2906 20.25 21.375 20.1656 21.375 20.0625V18.5625C21.375 18.4594 21.2906 18.375 21.1875 18.375ZM21.1875 11.0625H2.8125C2.70937 11.0625 2.625 11.1469 2.625 11.25V12.75C2.625 12.8531 2.70937 12.9375 2.8125 12.9375H21.1875C21.2906 12.9375 21.375 12.8531 21.375 12.75V11.25C21.375 11.1469 21.2906 11.0625 21.1875 11.0625Z" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export const BurgerIcon = styled(Icon).attrs(() => ({
|
|
11
|
+
'data-component-name': 'icons/BurgerIcon/BurgerIcon',
|
|
12
|
+
}))``;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BurgerIcon } from '@theme/icons/BurgerIcon/BurgerIcon';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export const Icon = () => (
|
|
5
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="inherit" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<rect width="24" height="24" fill="none" />
|
|
7
|
+
<path d="M18 7.05L16.95 6L12 10.95L7.05 6L6 7.05L10.95 12L6 16.95L7.05 18L12 13.05L16.95 18L18 16.95L13.05 12L18 7.05Z" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const CloseIcon = styled(Icon).attrs(() => ({
|
|
12
|
+
'data-component-name': 'icons/CloseIcon/CloseIcon',
|
|
13
|
+
}))``;
|