@redocly/theme 0.4.6 → 0.4.8
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/Button/Button.d.ts +3 -3
- package/Button/Button.js +3 -7
- package/Cards/Card.d.ts +1 -1
- package/Cards/Card.js +14 -7
- package/ColorModeSwitcher/ColorModeSwitcher.js +13 -25
- package/CopyButton/CopyButton.js +13 -24
- package/CopyButton/CopyButtonWrapper.d.ts +4 -3
- package/CopyButton/CopyButtonWrapper.js +15 -26
- package/EditPageButton/EditPageButton.js +13 -4
- package/Footer/CustomFooter.d.ts +1 -1
- package/Footer/CustomFooter.js +15 -6
- package/Footer/CustomFooterNavItem.js +13 -4
- package/Footer/Footer.js +13 -4
- package/Footer/FooterColumn.js +18 -9
- package/Footer/FooterColumns.js +13 -3
- package/Footer/FooterCopyright.js +13 -2
- package/JsonViewer/JsonViewer.d.ts +4 -3
- package/JsonViewer/JsonViewer.js +17 -34
- package/LastUpdated/LastUpdated.js +13 -4
- package/Layout/PageLayout.d.ts +3 -3
- package/Layout/PageLayout.js +13 -4
- package/Layout/RootLayout.d.ts +4 -4
- package/Layout/RootLayout.js +13 -5
- package/Markdown/Admonition.d.ts +2 -2
- package/Markdown/Admonition.js +13 -5
- package/Markdown/CodeSample/CodeSample.js +14 -7
- package/Markdown/Details.d.ts +2 -2
- package/Markdown/Details.js +2 -4
- package/Markdown/Heading.d.ts +1 -1
- package/Markdown/Heading.js +15 -29
- package/Markdown/MarkdownLayout.d.ts +3 -3
- package/Markdown/MarkdownLayout.js +13 -9
- package/Markdown/MarkdownWrapper.d.ts +1 -1
- package/Markdown/Mermaid.js +2 -2
- package/Markdown/Sup.d.ts +1 -1
- package/Markdown/Sup.js +13 -2
- package/Markdown/Tabs/Tab.js +13 -2
- package/Markdown/Tabs/Tabs.d.ts +1 -1
- package/Markdown/Tabs/Tabs.js +21 -34
- package/Navbar/MobileNavbarDropdown.js +13 -3
- package/Navbar/MobileNavbarItem.js +14 -31
- package/Navbar/MobileNavbarMenu.js +15 -6
- package/Navbar/Navbar.d.ts +5 -5
- package/Navbar/Navbar.js +13 -10
- package/Navbar/NavbarDropdown.js +13 -3
- package/Navbar/NavbarItem.js +14 -8
- package/Navbar/NavbarMenu.js +15 -4
- package/NavbarLogo/NavbarLogo.d.ts +1 -1
- package/NavbarLogo/NavbarLogo.js +14 -3
- package/PageNavigation/NextPageLink.js +14 -3
- package/PageNavigation/PageNavigation.js +13 -4
- package/PageNavigation/PreviousPageLink.js +14 -3
- package/Panel/Panel.js +1 -1
- package/Panel/PanelComponent.d.ts +3 -3
- package/Panel/PanelComponent.js +15 -32
- package/Panel/PanelHeader.d.ts +1 -1
- package/Profile/Profile.d.ts +2 -2
- package/Profile/Profile.js +15 -9
- package/Search/Autocomplete.d.ts +1 -1
- package/Search/Autocomplete.js +3 -30
- package/Search/ClearIcon.d.ts +1 -1
- package/Search/ClearIcon.js +2 -3
- package/Search/Parameters.js +17 -17
- package/Search/Search.js +13 -3
- package/Search/SearchIcon.d.ts +1 -1
- package/Search/SearchIcon.js +2 -3
- package/Search/SearchItem.js +13 -30
- package/Search/utils.js +2 -28
- package/Sidebar/ApiCallItem.d.ts +1 -1
- package/Sidebar/ApiCallItem.js +13 -7
- package/Sidebar/ArrowBack.js +13 -5
- package/Sidebar/BackButton.d.ts +2 -2
- package/Sidebar/BackButton.js +13 -4
- package/Sidebar/Drilldown.d.ts +3 -3
- package/Sidebar/Drilldown.js +2 -6
- package/Sidebar/DrilldownMenu.d.ts +3 -3
- package/Sidebar/DrilldownMenu.js +13 -10
- package/Sidebar/DrilldownMenuItem.d.ts +1 -1
- package/Sidebar/DrilldownMenuItem.js +13 -6
- package/Sidebar/ExternalIcon.js +13 -7
- package/Sidebar/MenuGroup.d.ts +3 -3
- package/Sidebar/MenuGroup.js +13 -8
- package/Sidebar/MenuItem.d.ts +1 -1
- package/Sidebar/MenuItem.js +13 -7
- package/Sidebar/MenuLink.d.ts +1 -1
- package/Sidebar/MenuLinkItem.d.ts +3 -3
- package/Sidebar/MenuLinkItem.js +2 -2
- package/Sidebar/Separator.d.ts +1 -1
- package/Sidebar/Separator.js +13 -4
- package/Sidebar/SidebarLayout.d.ts +3 -3
- package/Sidebar/SidebarLayout.js +13 -7
- package/Sidebar/types/DrilldownMenuProps.d.ts +1 -1
- package/Sidebar/types/ItemState.d.ts +2 -2
- package/Sidebar/types/MenuItemProps.d.ts +1 -1
- package/Sidebar/types/NavItem.d.ts +1 -1
- package/SidebarLogo/SidebarLogo.js +14 -3
- package/SourceCode/SourceCode.d.ts +2 -1
- package/SourceCode/SourceCode.js +19 -32
- package/TableOfContent/TableOfContent.d.ts +1 -1
- package/TableOfContent/TableOfContent.js +21 -35
- package/TableOfContent/utils.d.ts +1 -1
- package/TableOfContent/utils.js +1 -4
- package/Tooltip/Tooltip.d.ts +1 -2
- package/Tooltip/Tooltip.js +3 -4
- package/globalStyle.js +7 -6
- package/hooks/useFullHeight.d.ts +1 -1
- package/hooks/useMobileMenu.d.ts +1 -1
- package/hooks/useOutsideClick.d.ts +1 -1
- package/icons/AlertIcon/AlertIcon.js +17 -20
- package/icons/ArrowIcon/ArrowIcon.js +13 -4
- package/icons/ColorModeIcon/ColorModeIcon.js +15 -7
- package/icons/ShelfIcon/ShelfIcon.d.ts +2 -2
- package/icons/ShelfIcon/ShelfIcon.js +13 -4
- package/mocks/Link.js +2 -5
- package/package.json +1 -1
- package/src/Button/Button.tsx +4 -3
- package/src/Cards/Card.tsx +3 -3
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +8 -2
- package/src/EditPageButton/EditPageButton.tsx +0 -1
- package/src/Footer/CustomFooter.tsx +2 -2
- package/src/Footer/CustomFooterNavItem.tsx +0 -1
- package/src/Footer/Footer.tsx +0 -1
- package/src/Footer/FooterColumn.tsx +0 -1
- package/src/Footer/FooterColumns.tsx +0 -1
- package/src/Footer/FooterCopyright.tsx +0 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -2
- package/src/LastUpdated/LastUpdated.tsx +0 -1
- package/src/Layout/PageLayout.tsx +3 -6
- package/src/Layout/RootLayout.tsx +4 -4
- package/src/Markdown/Admonition.tsx +2 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +1 -1
- package/src/Markdown/Details.tsx +2 -2
- package/src/Markdown/Heading.tsx +2 -1
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/MarkdownWrapper.tsx +2 -1
- package/src/Markdown/Mermaid.tsx +0 -1
- package/src/Markdown/Sup.tsx +1 -1
- package/src/Markdown/Tabs/Tab.tsx +0 -1
- package/src/Markdown/Tabs/Tabs.tsx +2 -2
- package/src/Navbar/MobileNavbarDropdown.tsx +0 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -1
- package/src/Navbar/MobileNavbarMenu.tsx +0 -1
- package/src/Navbar/Navbar.tsx +6 -5
- package/src/Navbar/NavbarDropdown.tsx +0 -1
- package/src/Navbar/NavbarItem.tsx +0 -1
- package/src/Navbar/NavbarMenu.tsx +0 -1
- package/src/NavbarLogo/NavbarLogo.tsx +2 -2
- package/src/PageNavigation/NextPageLink.tsx +0 -1
- package/src/PageNavigation/PageNavigation.tsx +0 -1
- package/src/PageNavigation/PreviousPageLink.tsx +0 -1
- package/src/Panel/Panel.ts +2 -2
- package/src/Panel/PanelComponent.tsx +10 -9
- package/src/Panel/PanelHeader.ts +1 -1
- package/src/Profile/Profile.tsx +1 -1
- package/src/Search/Autocomplete.tsx +2 -8
- package/src/Search/ClearIcon.tsx +1 -1
- package/src/Search/Parameters.tsx +0 -1
- package/src/Search/Search.tsx +0 -1
- package/src/Search/SearchIcon.tsx +1 -1
- package/src/Search/SearchItem.tsx +1 -1
- package/src/Search/utils.tsx +0 -1
- package/src/Sidebar/ApiCallItem.tsx +2 -2
- package/src/Sidebar/ArrowBack.tsx +0 -1
- package/src/Sidebar/BackButton.tsx +2 -5
- package/src/Sidebar/Drilldown.tsx +4 -3
- package/src/Sidebar/DrilldownMenu.tsx +4 -3
- package/src/Sidebar/DrilldownMenuItem.tsx +1 -2
- package/src/Sidebar/ExternalIcon.tsx +0 -1
- package/src/Sidebar/MenuGroup.tsx +4 -3
- package/src/Sidebar/MenuItem.tsx +2 -2
- package/src/Sidebar/MenuLink.tsx +3 -1
- package/src/Sidebar/MenuLinkItem.tsx +4 -6
- package/src/Sidebar/Separator.tsx +2 -2
- package/src/Sidebar/SidebarLayout.tsx +3 -3
- package/src/Sidebar/types/DrilldownMenuProps.ts +1 -1
- package/src/Sidebar/types/ItemState.ts +2 -2
- package/src/Sidebar/types/MenuItemProps.ts +1 -1
- package/src/Sidebar/types/NavItem.ts +1 -1
- package/src/SidebarLogo/SidebarLogo.tsx +0 -1
- package/src/SourceCode/SourceCode.tsx +8 -2
- package/src/TableOfContent/TableOfContent.tsx +4 -4
- package/src/TableOfContent/utils.ts +2 -5
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/globalStyle.ts +12 -3
- package/src/hooks/useFullHeight.ts +2 -1
- package/src/hooks/useMobileMenu.ts +2 -1
- package/src/hooks/useOutsideClick.ts +2 -1
- package/src/icons/AlertIcon/AlertIcon.tsx +0 -1
- package/src/icons/ArrowIcon/ArrowIcon.tsx +0 -1
- package/src/icons/ColorModeIcon/ColorModeIcon.tsx +0 -1
- package/src/icons/ShelfIcon/ShelfIcon.tsx +2 -2
- package/src/mocks/Link.tsx +0 -1
- package/src/types/portal/src/shared/types.d.ts +2 -1
- package/src/ui/Box.tsx +2 -8
- package/src/ui/Burger.tsx +1 -1
- package/src/ui/Dropdown.tsx +3 -2
- package/src/ui/Flex.tsx +4 -3
- package/src/ui/Tiles/ThinTile.tsx +5 -4
- package/src/ui/Tiles/WideTile.tsx +6 -5
- package/src/ui/UniversalLink.tsx +11 -11
- package/src/ui/darkColors.tsx +56 -17
- package/src/ui/index.tsx +2 -3
- package/ui/Box.d.ts +1 -1
- package/ui/Burger.d.ts +1 -1
- package/ui/Burger.js +13 -5
- package/ui/Dropdown.d.ts +1 -1
- package/ui/Dropdown.js +14 -32
- package/ui/Flex.d.ts +3 -3
- package/ui/Flex.js +2 -2
- package/ui/Tiles/ThinTile.d.ts +2 -1
- package/ui/Tiles/ThinTile.js +15 -31
- package/ui/Tiles/WideTile.d.ts +1 -1
- package/ui/Tiles/WideTile.js +15 -31
- package/ui/UniversalLink.d.ts +5 -5
- package/ui/UniversalLink.js +3 -26
- package/ui/darkColors.js +1 -1
- package/ui/index.d.ts +3 -3
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
PropsWithChildren,
|
|
4
|
-
ReactNode,
|
|
5
|
-
useEffect,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
1
|
+
import type { BaseSyntheticEvent, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
8
3
|
import styled from 'styled-components';
|
|
9
4
|
|
|
5
|
+
import type { PanelHeaderProps } from '@theme/Panel/PanelHeader';
|
|
6
|
+
|
|
10
7
|
import { ShelfIcon } from '@theme/icons';
|
|
11
8
|
import { PanelBody } from '@theme/Panel/PanelBody';
|
|
12
|
-
import { PanelHeader
|
|
9
|
+
import { PanelHeader } from '@theme/Panel/PanelHeader';
|
|
13
10
|
import { PanelHeaderTitle } from '@theme/Panel/PanelHeaderTitle';
|
|
14
11
|
|
|
15
12
|
export interface PanelComponentProps {
|
|
@@ -18,7 +15,7 @@ export interface PanelComponentProps {
|
|
|
18
15
|
renderChildrenHidden?: boolean;
|
|
19
16
|
header?: ReactNode | ((props: PanelHeaderProps) => ReactNode);
|
|
20
17
|
onToggle?: (expanded: boolean) => void;
|
|
21
|
-
description?:
|
|
18
|
+
description?: ReactNode;
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
export function PanelComponent({
|
|
@@ -75,4 +72,8 @@ export function PanelComponent({
|
|
|
75
72
|
export const InlineBox = styled.div`
|
|
76
73
|
display: inline-flex;
|
|
77
74
|
align-items: center;
|
|
75
|
+
|
|
76
|
+
> span:last-child {
|
|
77
|
+
margin-left: 8px;
|
|
78
|
+
}
|
|
78
79
|
`;
|
package/src/Panel/PanelHeader.ts
CHANGED
package/src/Profile/Profile.tsx
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
KeyboardEvent,
|
|
4
|
-
ReactNode,
|
|
5
|
-
SyntheticEvent,
|
|
6
|
-
useEffect,
|
|
7
|
-
useState,
|
|
8
|
-
} from 'react';
|
|
1
|
+
import type { ChangeEvent, KeyboardEvent, ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
9
3
|
import { useLocation } from 'react-router-dom';
|
|
10
4
|
import styled from 'styled-components';
|
|
11
5
|
|
package/src/Search/ClearIcon.tsx
CHANGED
package/src/Search/Search.tsx
CHANGED
package/src/Search/utils.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
|
|
3
|
+
import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
4
|
+
|
|
4
5
|
import { OperationBadge } from '@theme/OperationBadge';
|
|
5
|
-
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
6
6
|
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
7
7
|
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
8
8
|
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
import { ArrowBack } from '@theme/Sidebar/ArrowBack';
|
|
5
5
|
|
|
@@ -7,10 +7,7 @@ interface BackButtonProps {
|
|
|
7
7
|
back: () => void;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function BackButton({
|
|
11
|
-
children,
|
|
12
|
-
back,
|
|
13
|
-
}: React.PropsWithChildren<BackButtonProps>): JSX.Element {
|
|
10
|
+
export function BackButton({ children, back }: PropsWithChildren<BackButtonProps>): JSX.Element {
|
|
14
11
|
return (
|
|
15
12
|
<Button onClick={back} data-component-name="Sidebar/BackButton">
|
|
16
13
|
<ArrowBack />
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
3
5
|
|
|
4
6
|
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
5
7
|
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
6
8
|
import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
|
|
7
9
|
import { DrilldownMenu } from '@theme/Sidebar/DrilldownMenu';
|
|
8
|
-
import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
9
10
|
|
|
10
11
|
interface DrilldownProps extends DrilldownMenuProps {
|
|
11
12
|
isExpanded: boolean;
|
|
@@ -17,7 +18,7 @@ export function Drilldown({
|
|
|
17
18
|
item,
|
|
18
19
|
expand,
|
|
19
20
|
...props
|
|
20
|
-
}:
|
|
21
|
+
}: PropsWithChildren<DrilldownProps>): JSX.Element {
|
|
21
22
|
return (
|
|
22
23
|
<Wrapper data-component-name="Sidebar/Drilldown">
|
|
23
24
|
<DrilldownLabel onClick={expand}>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled, { keyframes } from 'styled-components';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
3
5
|
|
|
4
|
-
import { DrilldownMenuProps } from '@theme/Sidebar/types/DrilldownMenuProps';
|
|
5
6
|
import { BackButton } from '@theme/Sidebar/BackButton';
|
|
6
7
|
import { DrilldownMenuItem } from '@theme/Sidebar/DrilldownMenuItem';
|
|
7
8
|
|
|
@@ -10,7 +11,7 @@ export function DrilldownMenu({
|
|
|
10
11
|
back,
|
|
11
12
|
prevActiveItem,
|
|
12
13
|
children,
|
|
13
|
-
}:
|
|
14
|
+
}: PropsWithChildren<DrilldownMenuProps>): JSX.Element {
|
|
14
15
|
return (
|
|
15
16
|
<MenuContainer data-component-name="Sidebar/DrilldownMenu">
|
|
16
17
|
<MenuContent>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
|
|
4
|
-
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
3
|
+
import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
5
4
|
|
|
6
5
|
export function DrilldownMenuItem({ item }: MenuItemProps): JSX.Element {
|
|
7
6
|
return (
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { ItemState } from '@theme/Sidebar/types/ItemState';
|
|
3
5
|
|
|
4
6
|
import { ArrowIcon } from '@theme/icons/ArrowIcon/ArrowIcon';
|
|
5
|
-
import { ItemState } from '@theme/Sidebar/types/ItemState';
|
|
6
7
|
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
7
8
|
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
|
8
9
|
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
@@ -18,7 +19,7 @@ export function MenuGroup({
|
|
|
18
19
|
isExpanded,
|
|
19
20
|
toggleExpanded,
|
|
20
21
|
children,
|
|
21
|
-
}:
|
|
22
|
+
}: PropsWithChildren<MenuGroupProps>): JSX.Element {
|
|
22
23
|
return (
|
|
23
24
|
<Wrapper data-component-name="Sidebar/MenuGroup">
|
|
24
25
|
<MenuLinkItem item={item}>
|
package/src/Sidebar/MenuItem.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
|
|
4
|
-
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
3
|
+
import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
4
|
+
|
|
5
5
|
import { MenuLinkItem } from '@theme/Sidebar/MenuLinkItem';
|
|
6
6
|
import { ExternalIcon } from '@theme/Sidebar/ExternalIcon';
|
|
7
7
|
import { MenuItemLabel } from '@theme/Sidebar/MenuItemLabel';
|
package/src/Sidebar/MenuLink.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { UniversalLinkProps } from '@theme/ui/UniversalLink';
|
|
4
|
+
|
|
5
|
+
import { UniversalLink } from '@theme/ui/UniversalLink';
|
|
4
6
|
|
|
5
7
|
export const MenuLink = styled(UniversalLink).attrs(() => ({
|
|
6
8
|
'data-component-name': 'Sidebar/MenuLink',
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
3
5
|
|
|
4
6
|
import { MenuLink } from '@theme/Sidebar/MenuLink';
|
|
5
|
-
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
6
7
|
|
|
7
|
-
export function MenuLinkItem({
|
|
8
|
-
item,
|
|
9
|
-
children,
|
|
10
|
-
}: React.PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
8
|
+
export function MenuLinkItem({ item, children }: PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
11
9
|
return (
|
|
12
10
|
<Wrapper data-component-name="Sidebar/MenuLinkItem">
|
|
13
11
|
{item.link ? (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
2
|
|
|
4
|
-
import { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
3
|
+
import type { MenuItemProps } from '@theme/Sidebar/types/MenuItemProps';
|
|
4
|
+
|
|
5
5
|
import { SeparatorLine } from '@theme/Sidebar/SeparatorLine';
|
|
6
6
|
import { SeparatorItem } from '@theme/Sidebar/SeparatorItem';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Sidebar } from '@theme/Sidebar/Sidebar';
|
|
5
5
|
import { useMobileMenu } from '@theme/hooks/useMobileMenu';
|
|
@@ -10,8 +10,8 @@ import { DEFAULT_THEME_NAME } from '@portal/constants';
|
|
|
10
10
|
import { SidebarSearch } from '@theme/Search/SidebarSearch';
|
|
11
11
|
|
|
12
12
|
interface SidebarLayoutProps {
|
|
13
|
-
versions:
|
|
14
|
-
menu:
|
|
13
|
+
versions: ReactNode;
|
|
14
|
+
menu: ReactNode;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function SidebarLayout({ versions, menu }: SidebarLayoutProps): JSX.Element | null {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NavItem } from '@theme/Sidebar/types/NavItem';
|
|
2
|
-
import { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
|
|
1
|
+
import type { NavItem } from '@theme/Sidebar/types/NavItem';
|
|
2
|
+
import type { MenuStyle } from '@theme/Sidebar/types/MenuStyle';
|
|
3
3
|
|
|
4
4
|
export interface ItemState extends NavItem {
|
|
5
5
|
items: ItemState[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { highlight, addLineNumbers } from '@theme/utils';
|
|
4
4
|
import {
|
|
@@ -17,6 +17,7 @@ export interface SourceCodeProps extends CommonCodeProps {
|
|
|
17
17
|
lang: string;
|
|
18
18
|
source?: string;
|
|
19
19
|
externalSource?: ExternalSource;
|
|
20
|
+
onCopyClick?: () => void;
|
|
20
21
|
withCopyButton?: boolean;
|
|
21
22
|
dataTestId?: string;
|
|
22
23
|
}
|
|
@@ -67,6 +68,7 @@ export function SourceCode({
|
|
|
67
68
|
lang,
|
|
68
69
|
source,
|
|
69
70
|
externalSource,
|
|
71
|
+
onCopyClick,
|
|
70
72
|
withCopyButton,
|
|
71
73
|
dataTestId = 'source-code',
|
|
72
74
|
withLineNumbers,
|
|
@@ -86,7 +88,11 @@ export function SourceCode({
|
|
|
86
88
|
|
|
87
89
|
if (withCopyButton) {
|
|
88
90
|
return (
|
|
89
|
-
<CopyButtonWrapper
|
|
91
|
+
<CopyButtonWrapper
|
|
92
|
+
data={sourceCode}
|
|
93
|
+
onCopyClick={onCopyClick}
|
|
94
|
+
data-component-name="SourceCode/SourceCode"
|
|
95
|
+
>
|
|
90
96
|
{({ renderCopyButton }) => (
|
|
91
97
|
<SampleControlsWrap>
|
|
92
98
|
<SampleControls data-cy="copy-button">{renderCopyButton()}</SampleControls>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
+
import type { MdHeading } from '@theme/types/portal';
|
|
5
|
+
|
|
4
6
|
import { getDisplayedHeadingsIds, getDisplayedHeadings, getLeastDepth } from './utils';
|
|
5
7
|
|
|
6
8
|
import { useFullHeight } from '@theme/hooks/useFullHeight';
|
|
7
9
|
import { useThemeSettings } from '@portal/hooks';
|
|
8
10
|
import { useActiveHeading } from '@theme/hooks/useActiveHeading';
|
|
9
|
-
import { MdHeading } from '@theme/types/portal';
|
|
10
11
|
import { DEFAULT_THEME_NAME } from '@portal/constants';
|
|
11
12
|
|
|
12
13
|
interface TableOfContentProps {
|
|
@@ -85,13 +86,12 @@ const MenuItem = styled.a<{ depth: number }>`
|
|
|
85
86
|
background-color: var(--toc-item-background-color);
|
|
86
87
|
cursor: pointer;
|
|
87
88
|
font-size: var(--toc-item-font-size);
|
|
88
|
-
font-family: var(--toc-item-font-family);
|
|
89
89
|
padding: var(--toc-item-padding-vertical) var(--toc-item-padding-horizontal);
|
|
90
90
|
padding-left: calc(var(--toc-item-nested-offset) * ${({ depth }) => depth});
|
|
91
91
|
transition: background-color 0.3s, color 0.3s;
|
|
92
92
|
text-decoration: none;
|
|
93
93
|
word-break: break-word;
|
|
94
|
-
font-family: var(--heading-font-family);
|
|
94
|
+
font-family: var(--heading-font-family, var(--toc-item-font-family));
|
|
95
95
|
|
|
96
96
|
:hover,
|
|
97
97
|
&.active {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MdHeading } from '@theme/types/portal';
|
|
1
|
+
import type { MdHeading } from '@theme/types/portal';
|
|
2
2
|
|
|
3
3
|
export function getDisplayedHeadings(
|
|
4
4
|
headings: Array<MdHeading | null> | null | undefined,
|
|
@@ -14,10 +14,7 @@ export function getDisplayedHeadings(
|
|
|
14
14
|
if (idx === 0 && heading.depth === 1) {
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
return true;
|
|
17
|
+
return !(heading.depth && heading.depth > tocMaxDepth);
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
20
|
|
package/src/Tooltip/Tooltip.tsx
CHANGED
package/src/globalStyle.ts
CHANGED
|
@@ -656,7 +656,7 @@ const responsePanelColors = css`
|
|
|
656
656
|
--panel-response-heading-line-height: 20px;
|
|
657
657
|
--panel-response-heading-font-weight: var(--font-weight-bold);
|
|
658
658
|
--panel-response-heading-text-color: var(--text-color);
|
|
659
|
-
|
|
659
|
+
|
|
660
660
|
--panel-response-body-text-color: var(--text-color);
|
|
661
661
|
|
|
662
662
|
/**
|
|
@@ -815,6 +815,7 @@ const apiReferencePanels = css`
|
|
|
815
815
|
--panel-font-weight-local: var(--panel-schemas-font-weight);
|
|
816
816
|
--panel-background-color: var(--panel-schemas-background-color); // @presenter Color
|
|
817
817
|
--panel-border-local: var(--panel-schemas-border);
|
|
818
|
+
--panel-border-radius-local: calc(1px + var(--panel-border-radius));
|
|
818
819
|
--panel-chevron-icon-color: var(--panel-schemas-chevron-icon-color); // @presenter Color
|
|
819
820
|
|
|
820
821
|
--panel-body-text-color: var(--panel-schemas-body-text-color); // @presenter Color
|
|
@@ -890,6 +891,7 @@ const apiReferencePanels = css`
|
|
|
890
891
|
--panel-font-weight-local: var(--panel-samples-font-weight);
|
|
891
892
|
--panel-background-color: var(--panel-samples-background-color); // @presenter Color
|
|
892
893
|
--panel-border-local: var(--panel-samples-border);
|
|
894
|
+
--panel-border-radius-local: calc(1px + var(--panel-border-radius));
|
|
893
895
|
--panel-chevron-icon-color: var(--panel-samples-chevron-icon-color); // @presenter Color
|
|
894
896
|
|
|
895
897
|
--panel-body-text-color: var(--panel-samples-body-text-color); // @presenter Color
|
|
@@ -923,6 +925,7 @@ const apiReferencePanels = css`
|
|
|
923
925
|
.panel-response-redirect,
|
|
924
926
|
.panel-response-callback {
|
|
925
927
|
--panel-body-text-color: var(--panel-response-body-text-color); // @presenter Color
|
|
928
|
+
--panel-border-radius-local: calc(1px + var(--panel-border-radius));
|
|
926
929
|
|
|
927
930
|
--panel-heading-text-color: var(--panel-response-heading-text-color); // @presenter Color
|
|
928
931
|
--panel-heading-font-size-local: var(--panel-response-heading-font-size);
|
|
@@ -1088,7 +1091,7 @@ const apiReferencePanels = css`
|
|
|
1088
1091
|
--panel-try-it-tabs-disabled-background-color: var(--color-secondary-500); // @presenter Color
|
|
1089
1092
|
|
|
1090
1093
|
--panel-try-it-tabs-border-color: transparent; // @presenter Color
|
|
1091
|
-
--panel-try-it-tabs-hover-border-color: var(--panel-try-it-tabs-active-
|
|
1094
|
+
--panel-try-it-tabs-hover-border-color: var(--panel-try-it-tabs-active-border-color); // @presenter Color
|
|
1092
1095
|
--panel-try-it-tabs-active-border-color: var(--color-accent-500); // @presenter Color
|
|
1093
1096
|
--panel-try-it-tabs-disabled-border-color: transparent; // @presenter Color
|
|
1094
1097
|
|
|
@@ -1323,7 +1326,7 @@ const apiReferenceDocs = css`
|
|
|
1323
1326
|
|
|
1324
1327
|
--schema-type-title-text-color: var(--text-color-secondary); // @presenter Color
|
|
1325
1328
|
--schema-type-text-color: var(--text-color-secondary); // @presenter Color
|
|
1326
|
-
--schema-labels-font-size:
|
|
1329
|
+
--schema-labels-font-size: 1em; // @presenter FontSize
|
|
1327
1330
|
|
|
1328
1331
|
/**
|
|
1329
1332
|
* @tokens API Reference Schemas Lines Color
|
|
@@ -1844,6 +1847,11 @@ const lastUpdated = css`
|
|
|
1844
1847
|
--last-updated-line-height: var(--line-height-base);
|
|
1845
1848
|
`;
|
|
1846
1849
|
|
|
1850
|
+
const tile = css`
|
|
1851
|
+
--wide-tile-background-color: var(--color-secondary-50);
|
|
1852
|
+
--thin-tile-background-color: var(--color-secondary-50);
|
|
1853
|
+
`
|
|
1854
|
+
|
|
1847
1855
|
export const styles = css`
|
|
1848
1856
|
:root {
|
|
1849
1857
|
${baseColors}
|
|
@@ -1870,6 +1878,7 @@ export const styles = css`
|
|
|
1870
1878
|
${apiReferencePanels}
|
|
1871
1879
|
${apiReferenceDocs}
|
|
1872
1880
|
${lastUpdated}
|
|
1881
|
+
${tile}
|
|
1873
1882
|
}
|
|
1874
1883
|
|
|
1875
1884
|
:root.dark {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { MutableRefObject } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
2
3
|
import throttle from 'lodash.throttle';
|
|
3
4
|
|
|
4
5
|
export function useFullHeight(element: MutableRefObject<HTMLElement | null>): void {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
2
3
|
import { useHistory } from 'react-router-dom';
|
|
3
4
|
|
|
4
5
|
export function useMobileMenu(initialState = false): [boolean, Dispatch<SetStateAction<boolean>>] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
import { getCssColorVariable } from '@theme/utils';
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ export interface ShelfIconProps {
|
|
|
16
16
|
size?: string;
|
|
17
17
|
color?: string;
|
|
18
18
|
direction: 'left' | 'right' | 'up' | 'down';
|
|
19
|
-
style?:
|
|
19
|
+
style?: CSSProperties;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const IntShelfIcon = ({ className, style }: ShelfIconProps): JSX.Element => (
|
package/src/mocks/Link.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PERMISSION_PROP_NAME } from './constants';
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
3
4
|
export declare type ResolvedNavLinkItem = {
|
|
4
5
|
type: 'link';
|
|
5
6
|
link: string;
|
|
@@ -73,7 +74,7 @@ export interface PageData {
|
|
|
73
74
|
versions?: Version[];
|
|
74
75
|
}
|
|
75
76
|
export interface CachedPageData extends PageData {
|
|
76
|
-
Template:
|
|
77
|
+
Template: ComponentType<{
|
|
77
78
|
pageProps: PageProps;
|
|
78
79
|
}>;
|
|
79
80
|
}
|
package/src/ui/Box.tsx
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
space,
|
|
3
|
-
position,
|
|
4
|
-
flex,
|
|
5
|
-
textAlign,
|
|
6
|
-
color,
|
|
7
|
-
border,
|
|
8
|
-
layout,
|
|
1
|
+
import type {
|
|
9
2
|
SpaceProps,
|
|
10
3
|
LayoutProps,
|
|
11
4
|
TextAlignProps,
|
|
@@ -14,6 +7,7 @@ import {
|
|
|
14
7
|
FlexProps,
|
|
15
8
|
BordersProps,
|
|
16
9
|
} from 'styled-system';
|
|
10
|
+
import { space, position, flex, textAlign, color, border, layout } from 'styled-system';
|
|
17
11
|
import styled from 'styled-components';
|
|
18
12
|
|
|
19
13
|
export interface BoxProps
|
package/src/ui/Burger.tsx
CHANGED
package/src/ui/Dropdown.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
+
import type { Version } from '@theme/types/portal';
|
|
5
|
+
|
|
4
6
|
import { Link } from '@portal/Link';
|
|
5
|
-
import { Version } from '@theme/types/portal';
|
|
6
7
|
|
|
7
8
|
type DropdownProps = {
|
|
8
9
|
items: Version[];
|
package/src/ui/Flex.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
2
|
+
import type { FlexboxProps, WidthProps } from 'styled-system';
|
|
3
|
+
import { flexbox, width } from 'styled-system';
|
|
4
|
+
import type { PropsWithChildren } from 'react';
|
|
4
5
|
|
|
5
6
|
import { Box } from '@theme/ui/Box';
|
|
6
7
|
|
|
@@ -13,7 +14,7 @@ export const Flex = styled(Box).attrs({ 'data-component-name': 'ui/Flex' })<Flex
|
|
|
13
14
|
${width}
|
|
14
15
|
`;
|
|
15
16
|
|
|
16
|
-
export function FlexSection(props:
|
|
17
|
+
export function FlexSection(props: PropsWithChildren<FlexProps>): JSX.Element {
|
|
17
18
|
return (
|
|
18
19
|
<Flex {...props} width={props.width || { xs: '90%', large: 910 }}>
|
|
19
20
|
{props.children}
|