@redocly/theme 0.1.6 → 0.1.9
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/Footer/Footer.d.ts +3 -0
- package/Footer/Footer.js +35 -0
- package/Footer/FooterColumn.d.ts +7 -0
- package/Footer/FooterColumn.js +39 -0
- package/Footer/FooterColumns.d.ts +7 -0
- package/Footer/FooterColumns.js +44 -0
- package/Footer/FooterCopyright.d.ts +5 -0
- package/Footer/FooterCopyright.js +30 -0
- package/Footer/index.d.ts +4 -0
- package/Footer/index.js +20 -0
- package/JsonViewer/JsonViewer.js +1 -1
- package/JsonViewer/index.d.ts +1 -0
- package/JsonViewer/index.js +1 -0
- package/Layout/PageLayout.d.ts +6 -0
- package/Layout/PageLayout.js +31 -0
- package/Layout/RootLayout.d.ts +7 -0
- package/Layout/RootLayout.js +32 -0
- package/Layout/index.d.ts +2 -0
- package/Layout/index.js +18 -0
- package/Logo/Logo.d.ts +1 -6
- package/Logo/index.d.ts +1 -0
- package/Logo/index.js +17 -0
- package/Markdown/Admonition.d.ts +9 -0
- package/Markdown/Admonition.js +39 -0
- package/Markdown/CodeSample/CodeSample.d.ts +8 -0
- package/Markdown/CodeSample/CodeSample.js +30 -0
- package/Markdown/CodeSample/index.d.ts +3 -0
- package/Markdown/CodeSample/index.js +19 -0
- package/Markdown/CodeSample/styled.d.ts +5 -0
- package/Markdown/CodeSample/styled.js +109 -0
- package/Markdown/CodeSample/types.d.ts +9 -0
- package/Markdown/CodeSample/types.js +2 -0
- package/Markdown/ContentWrapper.d.ts +5 -0
- package/Markdown/ContentWrapper.js +21 -0
- package/Markdown/Heading.d.ts +5 -0
- package/Markdown/Heading.js +23 -0
- package/Markdown/MarkdownLayout.d.ts +7 -0
- package/Markdown/MarkdownLayout.js +23 -0
- package/Markdown/Mermaid.d.ts +6 -0
- package/Markdown/Mermaid.js +19 -0
- package/Markdown/PageWrapper.d.ts +3 -0
- package/Markdown/PageWrapper.js +15 -0
- package/Markdown/StyledMarkdown.d.ts +8 -0
- package/Markdown/StyledMarkdown.js +54 -0
- package/Markdown/Tabs/Tab.d.ts +8 -0
- package/Markdown/Tabs/Tab.js +35 -0
- package/Markdown/Tabs/Tabs.d.ts +10 -0
- package/Markdown/Tabs/Tabs.js +43 -0
- package/Markdown/Tabs/index.d.ts +2 -0
- package/Markdown/Tabs/index.js +18 -0
- package/Markdown/index.d.ts +9 -0
- package/Markdown/index.js +25 -0
- package/Navbar/Navbar.d.ts +2 -1
- package/Navbar/Navbar.js +9 -3
- package/Navbar/NavbarItem.d.ts +1 -1
- package/Navbar/NavbarItem.js +3 -3
- package/Navbar/NavbarMenu.d.ts +1 -1
- package/Navbar/NavbarMenu.js +8 -4
- package/OperationBadge/OperationBadge.d.ts +5 -0
- package/OperationBadge/OperationBadge.js +15 -0
- package/OperationBadge/index.d.ts +1 -0
- package/OperationBadge/index.js +17 -0
- package/PageNavigation/NextPageLink.d.ts +2 -0
- package/PageNavigation/NextPageLink.js +25 -0
- package/PageNavigation/PageNavigation.d.ts +2 -0
- package/PageNavigation/PageNavigation.js +31 -0
- package/PageNavigation/PreviousPageLink.d.ts +2 -0
- package/PageNavigation/PreviousPageLink.js +25 -0
- package/Panel/CodePanel.js +6 -6
- package/Panel/ContentPanel.js +4 -4
- package/Panel/Panel.d.ts +1 -1
- package/Panel/Panel.js +3 -3
- package/Panel/PanelComponent.d.ts +1 -1
- package/Panel/PanelComponent.js +3 -3
- package/Panel/index.d.ts +1 -0
- package/Panel/index.js +1 -0
- package/Search/Autocomplete.d.ts +13 -0
- package/Search/Autocomplete.js +79 -0
- package/Search/ClearIcon.d.ts +2 -0
- package/Search/ClearIcon.js +29 -0
- package/Search/Input.d.ts +3 -0
- package/Search/Input.js +15 -0
- package/Search/Parameters.d.ts +7 -0
- package/Search/Parameters.js +42 -0
- package/Search/Popover.d.ts +3 -0
- package/Search/Popover.js +15 -0
- package/Search/Search.d.ts +2 -0
- package/Search/Search.js +39 -0
- package/Search/SearchIcon.d.ts +2 -0
- package/Search/SearchIcon.js +29 -0
- package/Search/SearchItem.d.ts +7 -0
- package/Search/SearchItem.js +47 -0
- package/Search/index.d.ts +9 -0
- package/Search/index.js +25 -0
- package/Search/utils.d.ts +2 -0
- package/Search/utils.js +21 -0
- package/Sidebar/ApiCallItem.d.ts +8 -0
- package/Sidebar/ApiCallItem.js +35 -0
- package/Sidebar/ArrowBack.d.ts +4 -0
- package/Sidebar/ArrowBack.js +29 -0
- package/Sidebar/BackButton.d.ts +6 -0
- package/Sidebar/BackButton.js +31 -0
- package/Sidebar/Drilldown.d.ts +8 -0
- package/Sidebar/Drilldown.js +46 -0
- package/Sidebar/DrilldownMenu.d.ts +3 -0
- package/Sidebar/DrilldownMenu.js +55 -0
- package/Sidebar/DrilldownMenuItem.d.ts +3 -0
- package/Sidebar/DrilldownMenuItem.js +32 -0
- package/Sidebar/ExternalIcon.d.ts +4 -0
- package/Sidebar/ExternalIcon.js +29 -0
- package/Sidebar/Menu.d.ts +3 -0
- package/Sidebar/Menu.js +15 -0
- package/Sidebar/MenuContainer.d.ts +1 -0
- package/Sidebar/MenuContainer.js +13 -0
- package/Sidebar/MenuGroup.d.ts +9 -0
- package/Sidebar/MenuGroup.js +37 -0
- package/Sidebar/MenuItem.d.ts +3 -0
- package/Sidebar/MenuItem.js +34 -0
- package/Sidebar/MenuItemLabel.d.ts +5 -0
- package/Sidebar/MenuItemLabel.js +19 -0
- package/Sidebar/MenuLink.d.ts +5 -0
- package/Sidebar/MenuLink.js +16 -0
- package/Sidebar/MenuLinkItem.d.ts +3 -0
- package/Sidebar/MenuLinkItem.js +31 -0
- package/Sidebar/MobileSidebarButton.d.ts +5 -0
- package/Sidebar/MobileSidebarButton.js +21 -0
- package/Sidebar/Separator.d.ts +3 -0
- package/Sidebar/Separator.js +32 -0
- package/Sidebar/SeparatorItem.d.ts +5 -0
- package/Sidebar/SeparatorItem.js +14 -0
- package/Sidebar/SeparatorLine.d.ts +3 -0
- package/Sidebar/SeparatorLine.js +15 -0
- package/Sidebar/Sidebar.d.ts +8 -0
- package/Sidebar/Sidebar.js +24 -0
- package/Sidebar/SidebarLayout.d.ts +7 -0
- package/Sidebar/SidebarLayout.js +36 -0
- package/Sidebar/index.d.ts +19 -0
- package/Sidebar/index.js +35 -0
- package/Sidebar/types/DrilldownMenuProps.d.ts +6 -0
- package/Sidebar/types/DrilldownMenuProps.js +2 -0
- package/Sidebar/types/ItemState.d.ts +8 -0
- package/Sidebar/types/ItemState.js +2 -0
- package/Sidebar/types/MenuItemProps.d.ts +5 -0
- package/Sidebar/types/MenuItemProps.js +2 -0
- package/Sidebar/types/MenuStyle.d.ts +3 -0
- package/Sidebar/types/MenuStyle.js +8 -0
- package/Sidebar/types/NavItem.d.ts +26 -0
- package/Sidebar/types/NavItem.js +2 -0
- package/Sidebar/types/index.d.ts +5 -0
- package/Sidebar/types/index.js +21 -0
- package/SourceCode/SourceCode.js +2 -2
- package/TableOfContent/TableOfContent.d.ts +9 -0
- package/TableOfContent/TableOfContent.js +65 -0
- package/TableOfContent/index.d.ts +1 -0
- package/TableOfContent/index.js +17 -0
- package/globalStyle.js +1 -1
- package/hooks/index.d.ts +4 -0
- package/hooks/index.js +4 -0
- package/hooks/useActiveHeading.d.ts +2 -0
- package/hooks/useActiveHeading.js +34 -0
- package/hooks/useActiveSectionId.d.ts +3 -0
- package/hooks/useActiveSectionId.js +48 -0
- package/hooks/useFullHeight.d.ts +2 -0
- package/hooks/useFullHeight.js +47 -0
- package/hooks/useMobileMenu.d.ts +2 -0
- package/hooks/useMobileMenu.js +13 -0
- package/hooks/useNavbarHeight.d.ts +3 -0
- package/hooks/useNavbarHeight.js +20 -0
- package/icons/ShelfIcon/ShelfIcon.js +2 -2
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/mocks/hooks/usePageData.d.ts +5 -0
- package/mocks/hooks/usePageData.js +7 -0
- package/mocks/models.d.ts +3 -0
- package/mocks/models.js +2 -0
- package/mocks/search.d.ts +22 -0
- package/mocks/search.js +13 -0
- package/mocks/types/index.d.ts +1 -0
- package/mocks/types/index.js +2 -0
- package/mocks/usePreloadHistory.d.ts +3 -0
- package/mocks/usePreloadHistory.js +12 -0
- package/package.json +5 -2
- package/src/Button/Button.stories.tsx +1 -1
- package/src/Button/__tests__/Button.test.tsx +1 -1
- package/src/CodeBlock/__tests__/CodeBlock.test.tsx +1 -1
- package/src/CopyButton/CopyButton.stories.tsx +1 -1
- package/src/CopyButton/CopyButton.tsx +1 -1
- package/src/CopyButton/CopyButtonWrapper.tsx +4 -4
- package/src/CopyButton/__tests__/CopyButton.test.tsx +1 -1
- package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +2 -1
- package/src/Footer/Footer.tsx +34 -0
- package/src/Footer/FooterColumn.tsx +62 -0
- package/src/Footer/FooterColumns.tsx +51 -0
- package/src/Footer/FooterCopyright.tsx +26 -0
- package/src/Footer/index.ts +4 -0
- package/src/Headings/Headings.stories.tsx +1 -1
- package/src/Headings/Headings.ts +1 -1
- package/src/Headings/__tests__/Headings.test.tsx +1 -1
- package/src/JsonViewer/JsonViewer.stories.tsx +1 -1
- package/src/JsonViewer/JsonViewer.tsx +6 -7
- package/src/JsonViewer/__tests__/JsonViewer.test.tsx +2 -1
- package/src/JsonViewer/index.ts +1 -0
- package/src/Layout/PageLayout.tsx +34 -0
- package/src/Layout/RootLayout.tsx +24 -0
- package/src/Layout/index.ts +2 -0
- package/src/Logo/Logo.tsx +1 -7
- package/src/Logo/index.ts +1 -0
- package/src/Markdown/Admonition.tsx +64 -0
- package/src/Markdown/CodeSample/CodeSample.tsx +39 -0
- package/src/Markdown/CodeSample/index.ts +3 -0
- package/src/Markdown/CodeSample/styled.ts +289 -0
- package/src/Markdown/CodeSample/types.ts +40 -0
- package/src/Markdown/ContentWrapper.tsx +20 -0
- package/src/Markdown/Heading.tsx +35 -0
- package/src/Markdown/MarkdownLayout.tsx +25 -0
- package/src/Markdown/Mermaid.tsx +23 -0
- package/src/Markdown/PageWrapper.tsx +9 -0
- package/src/Markdown/StyledMarkdown.tsx +312 -0
- package/src/Markdown/Tabs/Tab.tsx +37 -0
- package/src/Markdown/Tabs/Tabs.tsx +45 -0
- package/src/Markdown/Tabs/index.ts +2 -0
- package/src/Markdown/index.ts +9 -0
- package/src/Navbar/Navbar.stories.tsx +3 -13
- package/src/Navbar/Navbar.tsx +20 -26
- package/src/Navbar/NavbarItem.tsx +2 -2
- package/src/Navbar/NavbarMenu.tsx +6 -6
- package/src/OperationBadge/OperationBadge.stories.tsx +35 -0
- package/src/OperationBadge/OperationBadge.ts +59 -0
- package/src/OperationBadge/__tests__/OperationBadge.test.tsx +59 -0
- package/src/OperationBadge/__tests__/__snapshots__/OperationBadge.test.tsx.snap +651 -0
- package/src/OperationBadge/index.ts +1 -0
- package/src/PageNavigation/NextPageLink.tsx +22 -0
- package/src/PageNavigation/PageNavigation.tsx +20 -0
- package/src/PageNavigation/PreviousPageLink.tsx +22 -0
- package/src/Panel/CodePanel.stories.tsx +1 -2
- package/src/Panel/CodePanel.ts +8 -7
- package/src/Panel/ContentPanel.stories.tsx +1 -2
- package/src/Panel/ContentPanel.ts +5 -6
- package/src/Panel/Panel.stories.tsx +1 -3
- package/src/Panel/Panel.ts +3 -3
- package/src/Panel/PanelComponent.tsx +4 -5
- package/src/Panel/__tests__/CodePanel.test.tsx +1 -1
- package/src/Panel/__tests__/ContentPanel.test.tsx +1 -1
- package/src/Panel/__tests__/Panel.test.tsx +1 -2
- package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +8 -8
- package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +22 -22
- package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +16 -16
- package/src/Panel/index.ts +1 -0
- package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +1 -1
- package/src/Search/Autocomplete.tsx +128 -0
- package/src/Search/ClearIcon.tsx +31 -0
- package/src/Search/Input.tsx +19 -0
- package/src/Search/Parameters.tsx +62 -0
- package/src/Search/Popover.tsx +20 -0
- package/src/Search/Search.tsx +52 -0
- package/src/Search/SearchIcon.tsx +32 -0
- package/src/Search/SearchItem.tsx +85 -0
- package/src/Search/index.ts +9 -0
- package/src/Search/utils.tsx +19 -0
- package/src/Sidebar/ApiCallItem.tsx +33 -0
- package/src/Sidebar/ArrowBack.tsx +22 -0
- package/src/Sidebar/BackButton.tsx +44 -0
- package/src/Sidebar/Drilldown.tsx +46 -0
- package/src/Sidebar/DrilldownMenu.tsx +58 -0
- package/src/Sidebar/DrilldownMenuItem.tsx +40 -0
- package/src/Sidebar/ExternalIcon.tsx +37 -0
- package/src/Sidebar/Menu.tsx +11 -0
- package/src/Sidebar/MenuContainer.tsx +8 -0
- package/src/Sidebar/MenuGroup.tsx +55 -0
- package/src/Sidebar/MenuItem.tsx +25 -0
- package/src/Sidebar/MenuItemLabel.tsx +41 -0
- package/src/Sidebar/MenuLink.tsx +14 -0
- package/src/Sidebar/MenuLinkItem.tsx +24 -0
- package/src/Sidebar/MobileSidebarButton.tsx +44 -0
- package/src/Sidebar/Separator.tsx +17 -0
- package/src/Sidebar/SeparatorItem.tsx +14 -0
- package/src/Sidebar/SeparatorLine.tsx +9 -0
- package/src/Sidebar/Sidebar.tsx +54 -0
- package/src/Sidebar/SidebarLayout.tsx +30 -0
- package/src/Sidebar/index.ts +19 -0
- package/src/Sidebar/types/DrilldownMenuProps.ts +7 -0
- package/src/Sidebar/types/ItemState.ts +9 -0
- package/src/Sidebar/types/MenuItemProps.ts +6 -0
- package/src/Sidebar/types/MenuStyle.ts +4 -0
- package/src/Sidebar/types/NavItem.ts +27 -0
- package/src/Sidebar/types/index.ts +5 -0
- package/src/SidebarLogo/SidebarLogo.stories.tsx +1 -1
- package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +1 -1
- package/src/SourceCode/SourceCode.stories.tsx +1 -1
- package/src/SourceCode/SourceCode.tsx +7 -3
- package/src/SourceCode/__tests__/SourceCode.test.tsx +2 -1
- package/src/TableOfContent/TableOfContent.stories.tsx +39 -0
- package/src/TableOfContent/TableOfContent.tsx +112 -0
- package/src/TableOfContent/index.ts +1 -0
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +1 -1
- package/src/Tooltip/__tests__/Tooltip.test.tsx +1 -1
- package/src/globalStyle.ts +10 -73
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useActiveHeading.ts +46 -0
- package/src/hooks/useActiveSectionId.ts +53 -0
- package/src/hooks/useFullHeight.ts +47 -0
- package/src/hooks/useMobileMenu.ts +11 -0
- package/src/hooks/useNavbarHeight.ts +24 -0
- package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +1 -1
- package/src/icons/ShelfIcon/ShelfIcon.tsx +1 -1
- package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/mocks/hooks/usePageData.ts +8 -0
- package/src/mocks/models.ts +3 -0
- package/src/mocks/search.ts +31 -0
- package/src/mocks/types/index.ts +1 -0
- package/src/mocks/usePreloadHistory.ts +9 -0
- package/src/types/portal/index.d.ts +6 -0
- package/src/types/portal/src/client/app/Sidebar/types.d.ts +50 -0
- package/src/types/portal/src/client/app/media-css.d.ts +7 -0
- package/src/types/portal/src/client/styling/default.d.ts +407 -0
- package/src/types/portal/src/client/styling/index.d.ts +14 -0
- package/src/types/portal/src/client/styling/resolve.d.ts +1 -0
- package/src/types/portal/src/server/constants.d.ts +11 -0
- package/src/types/portal/src/server/plugins/markdown/types.d.ts +28 -0
- package/src/types/portal/src/server/plugins/nav-utils.d.ts +19 -0
- package/src/types/portal/src/server/plugins/portal-config/types.d.ts +23 -0
- package/src/types/portal/src/server/plugins/sidebars/index.d.ts +16 -0
- package/src/types/portal/src/server/plugins/versions/index.d.ts +15 -0
- package/src/types/portal/src/server/plugins/versions/types.d.ts +23 -0
- package/src/types/portal/src/server/plugins/versions/utils.d.ts +10 -0
- package/src/types/portal/src/server/store.d.ts +101 -0
- package/src/types/portal/src/server/utils/async.d.ts +5 -0
- package/src/types/portal/src/server/utils/crypto.d.ts +3 -0
- package/src/types/portal/src/server/utils/fs.d.ts +3 -0
- package/src/types/portal/src/server/utils/index.d.ts +6 -0
- package/src/types/portal/src/server/utils/paths.d.ts +16 -0
- package/src/types/portal/src/server/utils/reporter/formatter.d.ts +11 -0
- package/src/types/portal/src/server/utils/reporter/reporter.d.ts +17 -0
- package/src/types/portal/src/server/utils/watcher.d.ts +16 -0
- package/src/types/portal/src/server/utils/yaml.d.ts +1 -0
- package/src/types/portal/src/shared/constants.d.ts +8 -0
- package/src/types/portal/src/shared/types.d.ts +77 -0
- package/src/types/portal/src/shared/urls.d.ts +7 -0
- package/src/types/portal/src/shared/utils.d.ts +10 -0
- package/src/ui/AlertIcon.tsx +110 -0
- package/src/ui/Arrow.tsx +36 -0
- package/src/ui/Background.tsx +16 -0
- package/src/ui/Box.tsx +39 -0
- package/src/ui/Button.tsx +19 -0
- package/src/ui/Dropdown.tsx +132 -0
- package/src/ui/Flex.tsx +21 -0
- package/src/ui/Jumbotron.tsx +57 -0
- package/src/ui/Tiles/ThinTile.tsx +151 -0
- package/src/ui/Tiles/TileHeader.ts +13 -0
- package/src/ui/Tiles/TileText.tsx +12 -0
- package/src/ui/Tiles/WideTile.tsx +138 -0
- package/src/ui/Tiles/index.ts +4 -0
- package/src/ui/Typography.tsx +167 -0
- package/src/ui/UniversalLink.tsx +100 -0
- package/src/ui/index.tsx +17 -0
- package/src/utils/__tests__/ClipboardService.test.ts +1 -1
- package/src/utils/__tests__/css-variables.test.ts +1 -1
- package/src/utils/__tests__/highlight.test.ts +1 -1
- package/src/utils/__tests__/jsonToHtml.test.ts +1 -1
- package/src/utils/__tests__/media-css.test.ts +1 -1
- package/src/utils/__tests__/theme-helpers.test.ts +1 -1
- package/src/utils/getNavbarElement.ts +10 -0
- package/src/utils/isUrl.ts +42 -0
- package/src/utils/replaceHashInColor.ts +3 -0
- package/ui/AlertIcon.d.ts +9 -0
- package/ui/AlertIcon.js +45 -0
- package/ui/Arrow.d.ts +7 -0
- package/ui/Arrow.js +42 -0
- package/ui/Background.d.ts +7 -0
- package/ui/Background.js +16 -0
- package/ui/Box.d.ts +6 -0
- package/ui/Box.js +16 -0
- package/ui/Button.d.ts +7 -0
- package/ui/Button.js +27 -0
- package/ui/Dropdown.d.ts +8 -0
- package/ui/Dropdown.js +55 -0
- package/ui/Flex.d.ts +10 -0
- package/ui/Flex.js +31 -0
- package/ui/Jumbotron.d.ts +18 -0
- package/ui/Jumbotron.js +44 -0
- package/ui/Tiles/ThinTile.d.ts +21 -0
- package/ui/Tiles/ThinTile.js +98 -0
- package/ui/Tiles/TileHeader.d.ts +5 -0
- package/ui/Tiles/TileHeader.js +15 -0
- package/ui/Tiles/TileText.d.ts +5 -0
- package/ui/Tiles/TileText.js +15 -0
- package/ui/Tiles/WideTile.d.ts +7 -0
- package/ui/Tiles/WideTile.js +93 -0
- package/ui/Tiles/index.d.ts +4 -0
- package/ui/Tiles/index.js +20 -0
- package/ui/Typography.d.ts +110 -0
- package/ui/Typography.js +137 -0
- package/ui/UniversalLink.d.ts +17 -0
- package/ui/UniversalLink.js +62 -0
- package/ui/index.d.ts +14 -0
- package/ui/index.js +34 -0
- package/utils/getNavbarElement.d.ts +1 -0
- package/utils/getNavbarElement.js +14 -0
- package/utils/isUrl.d.ts +12 -0
- package/utils/isUrl.js +36 -0
- package/utils/replaceHashInColor.d.ts +1 -0
- package/utils/replaceHashInColor.js +7 -0
package/hooks/index.js
CHANGED
|
@@ -17,3 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./useControl"), exports);
|
|
18
18
|
__exportStar(require("./useMount"), exports);
|
|
19
19
|
__exportStar(require("./useUnmount"), exports);
|
|
20
|
+
__exportStar(require("./useActiveHeading"), exports);
|
|
21
|
+
__exportStar(require("./useActiveSectionId"), exports);
|
|
22
|
+
__exportStar(require("./useFullHeight"), exports);
|
|
23
|
+
__exportStar(require("./useNavbarHeight"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useActiveHeading = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
function useActiveHeading(contentElement) {
|
|
6
|
+
var _a = (0, react_1.useState)(undefined), heading = _a[0], setHeading = _a[1];
|
|
7
|
+
var headings = (0, react_1.useMemo)(function () { return contentElement && contentElement.querySelectorAll('.heading-anchor'); }, [contentElement]);
|
|
8
|
+
var handler = (0, react_1.useCallback)(
|
|
9
|
+
// throttle(
|
|
10
|
+
function () {
|
|
11
|
+
if (!headings) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
for (var i = 0; i < headings.length; i++) {
|
|
15
|
+
if (headings[i].offsetTop > window.scrollY) {
|
|
16
|
+
var newHeading = i === 0 ? undefined : headings[i - 1].getAttribute('id') || undefined;
|
|
17
|
+
setHeading(newHeading);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}, [headings]);
|
|
22
|
+
(0, react_1.useEffect)(function () {
|
|
23
|
+
if (typeof window === 'undefined' || !headings || !headings.length) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
window.addEventListener('scroll', handler, {
|
|
27
|
+
capture: false,
|
|
28
|
+
});
|
|
29
|
+
handler();
|
|
30
|
+
return function () { return window.removeEventListener('scroll', handler); };
|
|
31
|
+
}, [handler, headings]);
|
|
32
|
+
return heading;
|
|
33
|
+
}
|
|
34
|
+
exports.useActiveHeading = useActiveHeading;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.useActiveSectionId = void 0;
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var lodash_throttle_1 = __importDefault(require("lodash.throttle"));
|
|
9
|
+
var useNavbarHeight_1 = require("../hooks/useNavbarHeight");
|
|
10
|
+
function useActiveSectionId(location, hasOverviewPage) {
|
|
11
|
+
var _a = (0, react_1.useState)(''), itemId = _a[0], setItemId = _a[1];
|
|
12
|
+
var navbarHeight = (0, useNavbarHeight_1.useNavbarHeight)(location);
|
|
13
|
+
var scrollListener = (0, react_1.useMemo)(function () {
|
|
14
|
+
return (0, lodash_throttle_1.default)(function () {
|
|
15
|
+
var sections = document.querySelectorAll('[data-section-id]');
|
|
16
|
+
if (sections.length < 2) {
|
|
17
|
+
setItemId('');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
for (var i = 0; i < sections.length; i++) {
|
|
21
|
+
var section = sections[i];
|
|
22
|
+
var rect = section.getBoundingClientRect();
|
|
23
|
+
if (rect.y < navbarHeight + 5 && rect.bottom > navbarHeight + 5) {
|
|
24
|
+
// use small padding 5px to account for rounding
|
|
25
|
+
setItemId(section.getAttribute('data-section-id') || '');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (hasOverviewPage) {
|
|
30
|
+
setItemId('');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
setItemId((sections[0] && sections[0].getAttribute('data-section-id')) || '');
|
|
34
|
+
}
|
|
35
|
+
}, 150);
|
|
36
|
+
}, [navbarHeight, hasOverviewPage]);
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
window.addEventListener('scroll', scrollListener, { capture: false });
|
|
39
|
+
setTimeout(function () {
|
|
40
|
+
scrollListener();
|
|
41
|
+
}, 0);
|
|
42
|
+
return function () {
|
|
43
|
+
window.removeEventListener('scroll', scrollListener); // TODO: add throttle
|
|
44
|
+
};
|
|
45
|
+
}, [location, navbarHeight, scrollListener]);
|
|
46
|
+
return itemId;
|
|
47
|
+
}
|
|
48
|
+
exports.useActiveSectionId = useActiveSectionId;
|
|
@@ -0,0 +1,47 @@
|
|
|
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.useFullHeight = void 0;
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var lodash_throttle_1 = __importDefault(require("lodash.throttle"));
|
|
9
|
+
function useFullHeight(element) {
|
|
10
|
+
var handler = (0, react_1.useCallback)(function () {
|
|
11
|
+
if (!element.current) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
var footer = document.querySelector('footer');
|
|
15
|
+
if (!footer) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
var elementTop = element.current.getBoundingClientRect().top;
|
|
19
|
+
var footerOffset = footer.offsetTop - window.scrollY - elementTop;
|
|
20
|
+
if (footerOffset > window.innerHeight) {
|
|
21
|
+
element.current.style.maxHeight = "".concat(window.innerHeight - elementTop, "px");
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
element.current.style.maxHeight = "".concat(footerOffset, "px");
|
|
25
|
+
}
|
|
26
|
+
}, [element]);
|
|
27
|
+
var throttledHandler = (0, react_1.useMemo)(function () { return (0, lodash_throttle_1.default)(handler, 150); }, [handler]);
|
|
28
|
+
(0, react_1.useEffect)(function () {
|
|
29
|
+
if (typeof window === 'undefined' || !element.current) {
|
|
30
|
+
return function () {
|
|
31
|
+
// nope
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
window.addEventListener('scroll', throttledHandler, {
|
|
35
|
+
capture: false,
|
|
36
|
+
});
|
|
37
|
+
window.addEventListener('resize', throttledHandler, {
|
|
38
|
+
capture: false,
|
|
39
|
+
});
|
|
40
|
+
handler();
|
|
41
|
+
return function () {
|
|
42
|
+
window.removeEventListener('scroll', throttledHandler);
|
|
43
|
+
window.removeEventListener('resize', throttledHandler);
|
|
44
|
+
};
|
|
45
|
+
}, [throttledHandler, element, handler]);
|
|
46
|
+
}
|
|
47
|
+
exports.useFullHeight = useFullHeight;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMobileMenu = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var react_router_dom_1 = require("react-router-dom");
|
|
6
|
+
function useMobileMenu(initialState) {
|
|
7
|
+
if (initialState === void 0) { initialState = false; }
|
|
8
|
+
var location = (0, react_router_dom_1.useHistory)().location;
|
|
9
|
+
var _a = (0, react_1.useState)(initialState), isOpen = _a[0], setIsOpen = _a[1];
|
|
10
|
+
(0, react_1.useEffect)(function () { return setIsOpen(false); }, [location.pathname]);
|
|
11
|
+
return [isOpen, setIsOpen];
|
|
12
|
+
}
|
|
13
|
+
exports.useMobileMenu = useMobileMenu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNavbarHeight = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var getNavbarElement_1 = require("../utils/getNavbarElement");
|
|
6
|
+
function useNavbarHeight(location) {
|
|
7
|
+
var _a = (0, react_1.useState)(0), height = _a[0], setHeight = _a[1];
|
|
8
|
+
(0, react_1.useEffect)(function () {
|
|
9
|
+
var navbar = (0, getNavbarElement_1.getNavbarElement)();
|
|
10
|
+
setHeight((navbar && navbar.clientHeight) || 0);
|
|
11
|
+
}, [location.pathname]);
|
|
12
|
+
(0, react_1.useEffect)(function () {
|
|
13
|
+
window.requestAnimationFrame(function () {
|
|
14
|
+
var navbar = (0, getNavbarElement_1.getNavbarElement)();
|
|
15
|
+
setHeight((navbar && navbar.clientHeight) || 0);
|
|
16
|
+
});
|
|
17
|
+
}, []);
|
|
18
|
+
return height;
|
|
19
|
+
}
|
|
20
|
+
exports.useNavbarHeight = useNavbarHeight;
|
|
@@ -41,7 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.ShelfIcon = void 0;
|
|
42
42
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
43
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
44
|
-
var
|
|
44
|
+
var utils_1 = require("../../utils");
|
|
45
45
|
var directionMap = {
|
|
46
46
|
right: '0deg',
|
|
47
47
|
down: '90deg',
|
|
@@ -54,6 +54,6 @@ var IntShelfIcon = function (_a) {
|
|
|
54
54
|
};
|
|
55
55
|
exports.ShelfIcon = (0, styled_components_1.default)(IntShelfIcon)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n vertical-align: middle;\n transition: transform 0.2s ease-out;\n"], ["\n ", "\n vertical-align: middle;\n transition: transform 0.2s ease-out;\n"])), function (_a) {
|
|
56
56
|
var _b = _a.size, size = _b === void 0 ? '9px' : _b, _c = _a.float, float = _c === void 0 ? '' : _c, direction = _a.direction, color = _a.color;
|
|
57
|
-
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n width: ", ";\n float: ", ";\n transform: rotateZ(", ");\n fill: ", ";\n "], ["\n height: ", ";\n width: ", ";\n float: ", ";\n transform: rotateZ(", ");\n fill: ", ";\n "])), size, size, float, directionMap[direction], (0,
|
|
57
|
+
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", ";\n width: ", ";\n float: ", ";\n transform: rotateZ(", ");\n fill: ", ";\n "], ["\n height: ", ";\n width: ", ";\n float: ", ";\n transform: rotateZ(", ");\n fill: ", ";\n "])), size, size, float, directionMap[direction], (0, utils_1.getCssColorVariable)(color));
|
|
58
58
|
});
|
|
59
59
|
var templateObject_1, templateObject_2;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -28,3 +28,5 @@ __exportStar(require("./icons"), exports);
|
|
|
28
28
|
__exportStar(require("./hooks"), exports);
|
|
29
29
|
__exportStar(require("./utils"), exports);
|
|
30
30
|
__exportStar(require("./globalStyle"), exports);
|
|
31
|
+
__exportStar(require("./OperationBadge"), exports);
|
|
32
|
+
__exportStar(require("./TableOfContent"), exports);
|
package/mocks/models.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface OperationParameter {
|
|
2
|
+
name: string | string[];
|
|
3
|
+
description: string | string[];
|
|
4
|
+
place: string;
|
|
5
|
+
path?: string[];
|
|
6
|
+
}
|
|
7
|
+
interface SearchDocument {
|
|
8
|
+
id: string;
|
|
9
|
+
url: string;
|
|
10
|
+
title: string | string[];
|
|
11
|
+
text: string | string[];
|
|
12
|
+
path?: string[];
|
|
13
|
+
httpVerb?: string;
|
|
14
|
+
pathName?: string | string[];
|
|
15
|
+
parameters?: OperationParameter[];
|
|
16
|
+
}
|
|
17
|
+
export declare function useFuseSearch(): {
|
|
18
|
+
query: string;
|
|
19
|
+
setQuery: (val: string) => void;
|
|
20
|
+
items: SearchDocument[];
|
|
21
|
+
};
|
|
22
|
+
export {};
|
package/mocks/search.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFuseSearch = void 0;
|
|
4
|
+
function useFuseSearch() {
|
|
5
|
+
return {
|
|
6
|
+
query: '',
|
|
7
|
+
setQuery: function (val) {
|
|
8
|
+
this.query = val;
|
|
9
|
+
},
|
|
10
|
+
items: [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.useFuseSearch = useFuseSearch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type ResolvedNavLinkItem = any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePreloadHistory = void 0;
|
|
4
|
+
function usePreloadHistory() {
|
|
5
|
+
var history = [];
|
|
6
|
+
return {
|
|
7
|
+
push: function (url) {
|
|
8
|
+
history.push(url);
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.usePreloadHistory = usePreloadHistory;
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Shared UI components",
|
|
5
5
|
"author": "team@redocly.com",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"typings": "index.d.ts",
|
|
9
9
|
"peerDependencies": {
|
|
10
|
+
"lodash.throttle": "^4.1.1",
|
|
10
11
|
"prismjs": "^1.28.0",
|
|
11
12
|
"react": "^17.0.2",
|
|
12
13
|
"react-dom": "^17.0.2",
|
|
13
|
-
"
|
|
14
|
+
"react-router-dom": "^5.3.0",
|
|
15
|
+
"styled-components": "^5.3.1",
|
|
16
|
+
"styled-system": "^5.1.5"
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
|
|
3
|
-
import { SamplesControlButton } from '
|
|
4
|
-
import { Tooltip } from '
|
|
5
|
-
import { useControl } from '
|
|
6
|
-
import { ClipboardService } from '
|
|
3
|
+
import { SamplesControlButton } from '@theme/SamplesPanelControls';
|
|
4
|
+
import { Tooltip } from '@theme/Tooltip';
|
|
5
|
+
import { useControl } from '@theme/hooks';
|
|
6
|
+
import { ClipboardService } from '@theme/utils';
|
|
7
7
|
|
|
8
8
|
export interface CopyButtonWrapperProps {
|
|
9
9
|
data: unknown;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { renderWithTheme } from '../../../tests/utils';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { CopyButtonWrapper } from '@theme/CopyButton';
|
|
5
6
|
|
|
6
7
|
describe('CopyButtonWrapper', () => {
|
|
7
8
|
it('renders', () => {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { FooterColumns } from '@theme/Footer/FooterColumns';
|
|
5
|
+
import { FooterCopyright } from '@theme/Footer/FooterCopyright';
|
|
6
|
+
import type { FooterConfig } from '@theme/types/portal';
|
|
7
|
+
|
|
8
|
+
export function Footer({
|
|
9
|
+
columns,
|
|
10
|
+
copyrightText,
|
|
11
|
+
}: React.PropsWithChildren<FooterConfig>): JSX.Element | null {
|
|
12
|
+
if (!(columns?.length || copyrightText)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<FooterContainer data-component-name="Footer/Footer">
|
|
18
|
+
<FooterColumns columns={columns} />
|
|
19
|
+
<FooterCopyright copyrightText={copyrightText} />
|
|
20
|
+
</FooterContainer>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const FooterContainer = styled.footer`
|
|
25
|
+
font-size: 1rem;
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
background-color: var(--footer-color-background);
|
|
28
|
+
color: var(--footer-color-text);
|
|
29
|
+
font-family: var(--font-family-primary);
|
|
30
|
+
a,
|
|
31
|
+
a:hover {
|
|
32
|
+
color: var(--footer-color-text);
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { Link } from '@portal/Link';
|
|
5
|
+
import type { FooterColumn as Column } from '@theme/types/portal';
|
|
6
|
+
|
|
7
|
+
interface FooterColumnProps {
|
|
8
|
+
column: Column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function FooterColumn({ column }: FooterColumnProps): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<FooterColumnContainer data-component-name="Footer/FooterColumn">
|
|
14
|
+
<FooterColumnTitle>{column.group || column.label}</FooterColumnTitle>
|
|
15
|
+
{column.items.map((columnItem, columnItemInex) => {
|
|
16
|
+
if (columnItem.type === 'error') {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return columnItem.type === 'separator' ? (
|
|
21
|
+
<FooterSeparator key={columnItem.label + '_' + columnItemInex}>
|
|
22
|
+
{columnItem.label}
|
|
23
|
+
</FooterSeparator>
|
|
24
|
+
) : (
|
|
25
|
+
<FooterLink key={columnItemInex} to={columnItem.link} data-cy={columnItem.label}>
|
|
26
|
+
{columnItem.label}
|
|
27
|
+
</FooterLink>
|
|
28
|
+
);
|
|
29
|
+
})}
|
|
30
|
+
</FooterColumnContainer>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const FooterColumnTitle = styled.p`
|
|
35
|
+
display: inline-block;
|
|
36
|
+
font-weight: var(--font-weight-regular);
|
|
37
|
+
font-size: 24px;
|
|
38
|
+
margin-bottom: 1.5em;
|
|
39
|
+
font-family: var(--font-family-h);
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const FooterSeparator = styled.div`
|
|
43
|
+
opacity: 0.75;
|
|
44
|
+
margin: 10px 0 5px 0;
|
|
45
|
+
font-size: 0.75em;
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
font-family: var(--font-family-h);
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
const FooterColumnContainer = styled.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
text-align: left;
|
|
54
|
+
margin: 0px 30px;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const FooterLink = styled(Link)`
|
|
58
|
+
font-weight: var(--font-weight-bold);
|
|
59
|
+
padding-bottom: 0.75em;
|
|
60
|
+
color: var(--footer-color-text);
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
`;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { FooterColumn } from '@theme/Footer/FooterColumn';
|
|
5
|
+
import type { FooterConfig } from '@theme/types/portal';
|
|
6
|
+
|
|
7
|
+
export function FooterColumns({
|
|
8
|
+
columns = [],
|
|
9
|
+
}: React.PropsWithChildren<{ columns?: FooterConfig['columns'] }>): JSX.Element | null {
|
|
10
|
+
if (!columns?.length) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<FooterColumnsContainer data-component-name="Footer/FooterColumns">
|
|
16
|
+
<FooterRow>
|
|
17
|
+
{columns.map((column, index) => (
|
|
18
|
+
<FooterColumn key={index} column={column} />
|
|
19
|
+
))}
|
|
20
|
+
</FooterRow>
|
|
21
|
+
</FooterColumnsContainer>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const FooterColumnsContainer = styled.div`
|
|
26
|
+
padding: 3em 20px 1em 20px;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
max-width: 1200px;
|
|
31
|
+
margin: 0 auto;
|
|
32
|
+
|
|
33
|
+
${({ theme }) => theme.mediaQueries.small} {
|
|
34
|
+
padding: 5.625em 20px 3.9375em 20px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
${({ theme }) => theme.mediaQueries.print} {
|
|
38
|
+
color: black;
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
export const FooterRow = styled.div`
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
justify-content: flex-start;
|
|
47
|
+
|
|
48
|
+
${({ theme }) => theme.mediaQueries.small} {
|
|
49
|
+
justify-content: space-evenly;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { FooterConfig } from '@theme/types/portal';
|
|
5
|
+
|
|
6
|
+
export function FooterCopyright({
|
|
7
|
+
copyrightText = '',
|
|
8
|
+
}: React.PropsWithChildren<{ copyrightText?: FooterConfig['copyrightText'] }>): JSX.Element | null {
|
|
9
|
+
return copyrightText ? (
|
|
10
|
+
<Wrapper data-component-name="Footer/FooterCopyright">{copyrightText}</Wrapper>
|
|
11
|
+
) : null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const Wrapper = styled.section`
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
font-size: 0.875em;
|
|
18
|
+
padding: 1.5em 3em;
|
|
19
|
+
font-weight: var(--font-weight-bold);
|
|
20
|
+
background-color: var(--footer-color-background);
|
|
21
|
+
color: var(--footer-color-text);
|
|
22
|
+
text-align: center;
|
|
23
|
+
span {
|
|
24
|
+
max-width: 1200px;
|
|
25
|
+
}
|
|
26
|
+
`;
|
package/src/Headings/Headings.ts
CHANGED