@redocly/theme 0.4.14 → 0.4.16
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/{REAMDE.md → README.md} +0 -0
- package/{Button → lib/Button}/Button.d.ts +0 -0
- package/lib/Button/Button.js +156 -0
- package/{Button → lib/Button}/index.d.ts +0 -0
- package/{Button → lib/Button}/index.js +1 -0
- package/{Cards → lib/Cards}/Card.d.ts +0 -0
- package/lib/Cards/Card.js +36 -0
- package/{Cards → lib/Cards}/CardsBlock.d.ts +0 -0
- package/lib/Cards/CardsBlock.js +15 -0
- package/{CodeBlock → lib/CodeBlock}/CodeBlock.d.ts +0 -0
- package/lib/CodeBlock/CodeBlock.js +103 -0
- package/{CodeBlock → lib/CodeBlock}/index.d.ts +0 -0
- package/{CodeBlock → lib/CodeBlock}/index.js +1 -0
- package/{ColorModeSwitcher → lib/ColorModeSwitcher}/ColorModeSwitcher.d.ts +0 -0
- package/{ColorModeSwitcher → lib/ColorModeSwitcher}/ColorModeSwitcher.js +22 -36
- package/{ColorModeSwitcher → lib/ColorModeSwitcher}/index.d.ts +0 -0
- package/{ColorModeSwitcher → lib/ColorModeSwitcher}/index.js +1 -0
- package/{CopyButton → lib/CopyButton}/CopyButton.d.ts +0 -0
- package/lib/CopyButton/CopyButton.js +50 -0
- package/{CopyButton → lib/CopyButton}/CopyButtonWrapper.d.ts +0 -0
- package/{CopyButton → lib/CopyButton}/CopyButtonWrapper.js +14 -15
- package/{CopyButton → lib/CopyButton}/index.d.ts +0 -0
- package/{CopyButton → lib/CopyButton}/index.js +1 -0
- package/{EditPageButton → lib/EditPageButton}/EditPageButton.d.ts +0 -0
- package/lib/EditPageButton/EditPageButton.js +32 -0
- package/{EditPageButton → lib/EditPageButton}/index.d.ts +0 -0
- package/{EditPageButton → lib/EditPageButton}/index.js +1 -0
- package/{Footer → lib/Footer}/CustomFooter.d.ts +0 -0
- package/lib/Footer/CustomFooter.js +35 -0
- package/{Footer → lib/Footer}/CustomFooterNavItem.d.ts +0 -0
- package/lib/Footer/CustomFooterNavItem.js +33 -0
- package/{Footer → lib/Footer}/Footer.d.ts +0 -0
- package/lib/Footer/Footer.js +35 -0
- package/{Footer → lib/Footer}/FooterColumn.d.ts +0 -0
- package/lib/Footer/FooterColumn.js +54 -0
- package/{Footer → lib/Footer}/FooterColumns.d.ts +0 -0
- package/lib/Footer/FooterColumns.js +44 -0
- package/{Footer → lib/Footer}/FooterCopyright.d.ts +0 -0
- package/lib/Footer/FooterCopyright.js +26 -0
- package/{Footer → lib/Footer}/index.d.ts +0 -0
- package/{Footer → lib/Footer}/index.js +1 -0
- package/{JsonViewer → lib/JsonViewer}/JsonViewer.d.ts +0 -0
- package/lib/JsonViewer/JsonViewer.js +240 -0
- package/{JsonViewer → lib/JsonViewer}/index.d.ts +0 -0
- package/{JsonViewer → lib/JsonViewer}/index.js +1 -0
- package/lib/LastUpdated/LastUpdated.d.ts +14 -0
- package/lib/LastUpdated/LastUpdated.js +52 -0
- package/{Layout → lib/Layout}/PageLayout.d.ts +0 -0
- package/lib/Layout/PageLayout.js +29 -0
- package/{Layout → lib/Layout}/RootLayout.d.ts +0 -0
- package/lib/Layout/RootLayout.js +19 -0
- package/{Layout → lib/Layout}/index.d.ts +0 -0
- package/{Layout → lib/Layout}/index.js +1 -0
- package/{Markdown → lib/Markdown}/Admonition.d.ts +0 -0
- package/lib/Markdown/Admonition.js +53 -0
- package/{Markdown → lib/Markdown}/CodeSample/CodeSample.d.ts +0 -0
- package/lib/Markdown/CodeSample/CodeSample.js +211 -0
- package/{Markdown → lib/Markdown}/CodeSample/index.d.ts +0 -0
- package/{Markdown → lib/Markdown}/CodeSample/index.js +1 -0
- package/{Markdown → lib/Markdown}/ContainerWrapper.d.ts +0 -0
- package/lib/Markdown/ContainerWrapper.js +26 -0
- package/{Markdown → lib/Markdown}/Details.d.ts +0 -0
- package/lib/Markdown/Details.js +17 -0
- package/{Markdown → lib/Markdown}/Heading.d.ts +0 -0
- package/{Markdown → lib/Markdown}/Heading.js +9 -9
- package/{Markdown → lib/Markdown}/MarkdownLayout.d.ts +2 -3
- package/lib/Markdown/MarkdownLayout.js +30 -0
- package/{Markdown → lib/Markdown}/MarkdownWrapper.d.ts +0 -0
- package/lib/Markdown/MarkdownWrapper.js +391 -0
- package/{Markdown → lib/Markdown}/Mermaid.d.ts +0 -0
- package/lib/Markdown/Mermaid.js +19 -0
- package/{Markdown → lib/Markdown}/PageWrapper.d.ts +0 -0
- package/lib/Markdown/PageWrapper.js +15 -0
- package/{Markdown → lib/Markdown}/Sup.d.ts +0 -0
- package/lib/Markdown/Sup.js +14 -0
- package/{Markdown → lib/Markdown}/Tabs/Tab.d.ts +0 -0
- package/lib/Markdown/Tabs/Tab.js +28 -0
- package/{Markdown → lib/Markdown}/Tabs/Tabs.d.ts +0 -0
- package/lib/Markdown/Tabs/Tabs.js +62 -0
- package/{Markdown → lib/Markdown}/Tabs/index.d.ts +0 -0
- package/{Markdown → lib/Markdown}/Tabs/index.js +1 -0
- package/{Markdown → lib/Markdown}/index.d.ts +0 -0
- package/{Markdown → lib/Markdown}/index.js +1 -0
- package/{Navbar → lib/Navbar}/MobileNavbarDropdown.d.ts +0 -0
- package/lib/Navbar/MobileNavbarDropdown.js +30 -0
- package/{Navbar → lib/Navbar}/MobileNavbarItem.d.ts +1 -1
- package/lib/Navbar/MobileNavbarItem.js +106 -0
- package/{Navbar → lib/Navbar}/MobileNavbarMenu.d.ts +0 -0
- package/lib/Navbar/MobileNavbarMenu.js +92 -0
- package/{Navbar → lib/Navbar}/MobileNavbarMenuButton.d.ts +0 -0
- package/lib/Navbar/MobileNavbarMenuButton.js +18 -0
- package/{Navbar → lib/Navbar}/Navbar.d.ts +0 -0
- package/lib/Navbar/Navbar.js +75 -0
- package/{Navbar → lib/Navbar}/NavbarDropdown.d.ts +0 -0
- package/lib/Navbar/NavbarDropdown.js +38 -0
- package/{Navbar → lib/Navbar}/NavbarItem.d.ts +1 -1
- package/lib/Navbar/NavbarItem.js +72 -0
- package/{Navbar → lib/Navbar}/NavbarMenu.d.ts +0 -0
- package/lib/Navbar/NavbarMenu.js +34 -0
- package/{Navbar → lib/Navbar}/index.d.ts +0 -0
- package/{Navbar → lib/Navbar}/index.js +1 -0
- package/{NavbarLogo → lib/NavbarLogo}/NavbarLogo.d.ts +0 -0
- package/lib/NavbarLogo/NavbarLogo.js +24 -0
- package/{NavbarLogo → lib/NavbarLogo}/index.d.ts +0 -0
- package/{NavbarLogo → lib/NavbarLogo}/index.js +1 -0
- package/{OperationBadge → lib/OperationBadge}/OperationBadge.d.ts +0 -0
- package/lib/OperationBadge/OperationBadge.js +68 -0
- package/{OperationBadge → lib/OperationBadge}/index.d.ts +0 -0
- package/{OperationBadge → lib/OperationBadge}/index.js +1 -0
- package/{PageNavigation → lib/PageNavigation}/NextPageLink.d.ts +0 -0
- package/lib/PageNavigation/NextPageLink.js +26 -0
- package/lib/PageNavigation/PageNavigation.d.ts +2 -0
- package/lib/PageNavigation/PageNavigation.js +27 -0
- package/{PageNavigation → lib/PageNavigation}/PreviousPageLink.d.ts +0 -0
- package/lib/PageNavigation/PreviousPageLink.js +26 -0
- package/{PageNavigation → lib/PageNavigation}/index.d.ts +0 -0
- package/{PageNavigation → lib/PageNavigation}/index.js +1 -0
- package/{Panel → lib/Panel}/Panel.d.ts +0 -0
- package/lib/Panel/Panel.js +39 -0
- package/{Panel → lib/Panel}/PanelBody.d.ts +0 -0
- package/lib/Panel/PanelBody.js +59 -0
- package/{Panel → lib/Panel}/PanelComponent.d.ts +1 -1
- package/{Panel → lib/Panel}/PanelComponent.js +21 -36
- package/{Panel → lib/Panel}/PanelHeader.d.ts +0 -0
- package/lib/Panel/PanelHeader.js +33 -0
- package/{Panel → lib/Panel}/PanelHeaderTitle.d.ts +0 -0
- package/lib/Panel/PanelHeaderTitle.js +21 -0
- package/{Panel → lib/Panel}/index.d.ts +0 -0
- package/{Panel → lib/Panel}/index.js +1 -0
- package/{Profile → lib/Profile}/Profile.d.ts +0 -0
- package/lib/Profile/Profile.js +87 -0
- package/{Profile → lib/Profile}/index.d.ts +0 -0
- package/{Profile → lib/Profile}/index.js +1 -0
- package/{SamplesPanelControls → lib/SamplesPanelControls}/SamplesPanelControls.d.ts +0 -0
- package/lib/SamplesPanelControls/SamplesPanelControls.js +74 -0
- package/{SamplesPanelControls → lib/SamplesPanelControls}/index.d.ts +0 -0
- package/{SamplesPanelControls → lib/SamplesPanelControls}/index.js +1 -0
- package/{Search → lib/Search}/Autocomplete.d.ts +0 -0
- package/lib/Search/Autocomplete.js +105 -0
- package/{Search → lib/Search}/ClearIcon.d.ts +0 -0
- package/lib/Search/ClearIcon.js +26 -0
- package/{Search → lib/Search}/Input.d.ts +0 -0
- package/lib/Search/Input.js +30 -0
- package/{Search → lib/Search}/Parameters.d.ts +0 -0
- package/lib/Search/Parameters.js +55 -0
- package/{Search → lib/Search}/Popover.d.ts +0 -0
- package/lib/Search/Popover.js +26 -0
- package/{Search → lib/Search}/Search.d.ts +0 -0
- package/lib/Search/Search.js +27 -0
- package/{Search → lib/Search}/SearchIcon.d.ts +0 -0
- package/lib/Search/SearchIcon.js +27 -0
- package/{Search → lib/Search}/SearchItem.d.ts +0 -0
- package/lib/Search/SearchItem.js +98 -0
- package/{Search → lib/Search}/SidebarSearch.d.ts +0 -0
- package/lib/Search/SidebarSearch.js +20 -0
- package/{Search → lib/Search}/index.d.ts +0 -0
- package/{Search → lib/Search}/index.js +1 -0
- package/{Search → lib/Search}/utils.d.ts +0 -0
- package/{Search → lib/Search}/utils.js +8 -26
- package/{Sidebar → lib/Sidebar}/ApiCallItem.d.ts +0 -0
- package/lib/Sidebar/ApiCallItem.js +34 -0
- package/{Sidebar → lib/Sidebar}/ArrowBack.d.ts +0 -0
- package/lib/Sidebar/ArrowBack.js +22 -0
- package/{Sidebar → lib/Sidebar}/BackButton.d.ts +0 -0
- package/lib/Sidebar/BackButton.js +39 -0
- package/{Sidebar → lib/Sidebar}/Drilldown.d.ts +0 -0
- package/lib/Sidebar/Drilldown.js +43 -0
- package/{Sidebar → lib/Sidebar}/DrilldownMenu.d.ts +0 -0
- package/lib/Sidebar/DrilldownMenu.js +71 -0
- package/{Sidebar → lib/Sidebar}/DrilldownMenuItem.d.ts +0 -0
- package/lib/Sidebar/DrilldownMenuItem.js +42 -0
- package/{Sidebar → lib/Sidebar}/ExternalIcon.d.ts +0 -0
- package/lib/Sidebar/ExternalIcon.js +21 -0
- package/{Sidebar → lib/Sidebar}/Menu.d.ts +0 -0
- package/lib/Sidebar/Menu.js +17 -0
- package/{Sidebar → lib/Sidebar}/MenuContainer.d.ts +0 -0
- package/lib/Sidebar/MenuContainer.js +16 -0
- package/{Sidebar → lib/Sidebar}/MenuGroup.d.ts +0 -0
- package/lib/Sidebar/MenuGroup.js +88 -0
- package/{Sidebar → lib/Sidebar}/MenuItem.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/MenuItem.js +9 -14
- package/{Sidebar → lib/Sidebar}/MenuItemLabel.d.ts +0 -0
- package/lib/Sidebar/MenuItemLabel.js +46 -0
- package/{Sidebar → lib/Sidebar}/MenuLink.d.ts +0 -0
- package/lib/Sidebar/MenuLink.js +19 -0
- package/{Sidebar → lib/Sidebar}/MenuLinkItem.d.ts +0 -0
- package/lib/Sidebar/MenuLinkItem.js +15 -0
- package/{Sidebar → lib/Sidebar}/MobileSidebarButton.d.ts +0 -0
- package/lib/Sidebar/MobileSidebarButton.js +46 -0
- package/{Sidebar → lib/Sidebar}/Separator.d.ts +0 -0
- package/lib/Sidebar/Separator.js +18 -0
- package/{Sidebar → lib/Sidebar}/SeparatorItem.d.ts +0 -0
- package/lib/Sidebar/SeparatorItem.js +25 -0
- package/{Sidebar → lib/Sidebar}/SeparatorLine.d.ts +0 -0
- package/lib/Sidebar/SeparatorLine.js +15 -0
- package/{Sidebar → lib/Sidebar}/Sidebar.d.ts +0 -0
- package/lib/Sidebar/Sidebar.js +55 -0
- package/{Sidebar → lib/Sidebar}/SidebarLayout.d.ts +0 -0
- package/lib/Sidebar/SidebarLayout.js +31 -0
- package/{Sidebar → lib/Sidebar}/index.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/index.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/DrilldownMenuProps.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/DrilldownMenuProps.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/ItemState.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/ItemState.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/MenuItemProps.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/MenuItemProps.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/MenuStyle.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/MenuStyle.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/NavItem.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/NavItem.js +1 -0
- package/{Sidebar → lib/Sidebar}/types/index.d.ts +0 -0
- package/{Sidebar → lib/Sidebar}/types/index.js +1 -0
- package/{SidebarLogo → lib/SidebarLogo}/SidebarLogo.d.ts +0 -0
- package/lib/SidebarLogo/SidebarLogo.js +31 -0
- package/{SidebarLogo → lib/SidebarLogo}/index.d.ts +0 -0
- package/{SidebarLogo → lib/SidebarLogo}/index.js +1 -0
- package/{SourceCode → lib/SourceCode}/SourceCode.d.ts +0 -0
- package/{SourceCode → lib/SourceCode}/SourceCode.js +14 -34
- package/{SourceCode → lib/SourceCode}/index.d.ts +0 -0
- package/{SourceCode → lib/SourceCode}/index.js +1 -0
- package/{TableOfContent → lib/TableOfContent}/TableOfContent.d.ts +0 -0
- package/lib/TableOfContent/TableOfContent.js +116 -0
- package/{TableOfContent → lib/TableOfContent}/index.d.ts +0 -0
- package/{TableOfContent → lib/TableOfContent}/index.js +1 -0
- package/{TableOfContent → lib/TableOfContent}/utils.d.ts +0 -0
- package/lib/TableOfContent/utils.js +41 -0
- package/{Tooltip → lib/Tooltip}/Tooltip.d.ts +0 -0
- package/lib/Tooltip/Tooltip.js +173 -0
- package/{Tooltip → lib/Tooltip}/index.d.ts +0 -0
- package/{Tooltip → lib/Tooltip}/index.js +1 -0
- package/{Typography → lib/Typography}/CompactTypography.d.ts +0 -0
- package/lib/Typography/CompactTypography.js +14 -0
- package/{Typography → lib/Typography}/Emphasis.d.ts +0 -0
- package/lib/Typography/Emphasis.js +13 -0
- package/{Typography → lib/Typography}/H1.d.ts +0 -0
- package/lib/Typography/H1.js +17 -0
- package/{Typography → lib/Typography}/H2.d.ts +0 -0
- package/lib/Typography/H2.js +17 -0
- package/{Typography → lib/Typography}/H3.d.ts +0 -0
- package/lib/Typography/H3.js +17 -0
- package/{Typography → lib/Typography}/SectionHeader.d.ts +0 -0
- package/lib/Typography/SectionHeader.js +19 -0
- package/{Typography → lib/Typography}/Typography.d.ts +0 -0
- package/lib/Typography/Typography.js +22 -0
- package/{Typography → lib/Typography}/index.d.ts +0 -0
- package/{Typography → lib/Typography}/index.js +1 -0
- package/{globalStyle.d.ts → lib/globalStyle.d.ts} +0 -0
- package/lib/globalStyle.js +1924 -0
- package/{hooks → lib/hooks}/__tests__/mocks/MockIntersectionObserver.d.ts +0 -0
- package/lib/hooks/__tests__/mocks/MockIntersectionObserver.js +79 -0
- package/{hooks → lib/hooks}/index.d.ts +0 -0
- package/{hooks → lib/hooks}/index.js +1 -0
- package/{hooks → lib/hooks}/useActiveHeading.d.ts +0 -0
- package/lib/hooks/useActiveHeading.js +85 -0
- package/{hooks → lib/hooks}/useActiveSectionId.d.ts +0 -0
- package/lib/hooks/useActiveSectionId.js +47 -0
- package/{hooks → lib/hooks}/useControl.d.ts +0 -0
- package/lib/hooks/useControl.js +16 -0
- package/{hooks → lib/hooks}/useDefaultThemeSettings.d.ts +0 -0
- package/{hooks → lib/hooks}/useDefaultThemeSettings.js +3 -2
- package/{hooks → lib/hooks}/useFullHeight.d.ts +0 -0
- package/{hooks → lib/hooks}/useFullHeight.js +13 -12
- package/{hooks → lib/hooks}/useMobileMenu.d.ts +0 -0
- package/lib/hooks/useMobileMenu.js +13 -0
- package/{hooks → lib/hooks}/useMount.d.ts +0 -0
- package/{hooks → lib/hooks}/useMount.js +4 -3
- package/{hooks → lib/hooks}/useNavbarHeight.d.ts +0 -0
- package/lib/hooks/useNavbarHeight.js +21 -0
- package/{hooks → lib/hooks}/useOutsideClick.d.ts +0 -0
- package/{hooks → lib/hooks}/useOutsideClick.js +5 -4
- package/{hooks → lib/hooks}/useUnmount.d.ts +0 -0
- package/{hooks → lib/hooks}/useUnmount.js +5 -4
- package/{icons → lib/icons}/AlertIcon/AlertIcon.d.ts +0 -0
- package/{icons → lib/icons}/AlertIcon/AlertIcon.js +22 -17
- package/{icons → lib/icons}/AlertIcon/index.d.ts +0 -0
- package/{icons → lib/icons}/AlertIcon/index.js +1 -0
- package/{icons → lib/icons}/ArrowIcon/ArrowIcon.d.ts +0 -0
- package/lib/icons/ArrowIcon/ArrowIcon.js +32 -0
- package/{icons → lib/icons}/ArrowIcon/index.d.ts +0 -0
- package/{icons → lib/icons}/ArrowIcon/index.js +1 -0
- package/{icons → lib/icons}/ColorModeIcon/ColorModeIcon.d.ts +0 -0
- package/{icons → lib/icons}/ColorModeIcon/ColorModeIcon.js +10 -11
- package/{icons → lib/icons}/ColorModeIcon/index.d.ts +0 -0
- package/{icons → lib/icons}/ColorModeIcon/index.js +1 -0
- package/{icons → lib/icons}/ShelfIcon/ShelfIcon.d.ts +0 -0
- package/lib/icons/ShelfIcon/ShelfIcon.js +52 -0
- package/{icons → lib/icons}/ShelfIcon/index.d.ts +0 -0
- package/{icons → lib/icons}/ShelfIcon/index.js +1 -0
- package/{icons → lib/icons}/index.d.ts +0 -0
- package/{icons → lib/icons}/index.js +1 -0
- package/{index.d.ts → lib/index.d.ts} +0 -0
- package/{index.js → lib/index.js} +1 -0
- package/{mocks → lib/mocks}/Link.d.ts +0 -0
- package/lib/mocks/Link.js +17 -0
- package/{mocks → lib/mocks}/constants/index.d.ts +0 -0
- package/{mocks → lib/mocks}/constants/index.js +1 -0
- package/{mocks → lib/mocks}/hooks/index.d.ts +0 -0
- package/{mocks → lib/mocks}/hooks/index.js +3 -2
- package/{mocks → lib/mocks}/hooks/usePageData.d.ts +0 -0
- package/{mocks → lib/mocks}/hooks/usePageData.js +1 -0
- package/{mocks → lib/mocks}/search.d.ts +0 -0
- package/{mocks → lib/mocks}/search.js +2 -1
- package/{mocks → lib/mocks}/types/index.d.ts +0 -0
- package/{mocks → lib/mocks}/types/index.js +1 -0
- package/lib/mocks/types.d.ts +14 -0
- package/{mocks → lib/mocks}/types.js +1 -0
- package/{mocks → lib/mocks}/usePreloadHistory.d.ts +0 -0
- package/{mocks → lib/mocks}/usePreloadHistory.js +3 -2
- package/{mocks → lib/mocks}/utils.d.ts +0 -0
- package/{mocks → lib/mocks}/utils.js +3 -2
- package/{ui → lib/ui}/Background.d.ts +0 -0
- package/lib/ui/Background.js +21 -0
- package/{ui → lib/ui}/Box.d.ts +0 -0
- package/lib/ui/Box.js +21 -0
- package/{ui → lib/ui}/Burger.d.ts +0 -0
- package/lib/ui/Burger.js +31 -0
- package/{ui → lib/ui}/Dropdown.d.ts +0 -0
- package/lib/ui/Dropdown.js +115 -0
- package/{ui → lib/ui}/Flex.d.ts +0 -0
- package/lib/ui/Flex.js +21 -0
- package/{ui → lib/ui}/Jumbotron.d.ts +0 -0
- package/lib/ui/Jumbotron.js +51 -0
- package/{ui → lib/ui}/Tiles/ThinTile.d.ts +1 -1
- package/lib/ui/Tiles/ThinTile.js +124 -0
- package/{ui → lib/ui}/Tiles/TileHeader.d.ts +0 -0
- package/lib/ui/Tiles/TileHeader.js +19 -0
- package/{ui → lib/ui}/Tiles/TileText.d.ts +0 -0
- package/lib/ui/Tiles/TileText.js +18 -0
- package/{ui → lib/ui}/Tiles/WideTile.d.ts +0 -0
- package/lib/ui/Tiles/WideTile.js +114 -0
- package/{ui → lib/ui}/Tiles/index.d.ts +0 -0
- package/{ui → lib/ui}/Tiles/index.js +1 -0
- package/{ui → lib/ui}/UniversalLink.d.ts +0 -0
- package/lib/ui/UniversalLink.js +79 -0
- package/{ui → lib/ui}/darkColors.d.ts +0 -0
- package/lib/ui/darkColors.js +70 -0
- package/{ui → lib/ui}/index.d.ts +0 -0
- package/{ui → lib/ui}/index.js +2 -4
- package/{utils → lib/utils}/ClipboardService.d.ts +0 -0
- package/{utils → lib/utils}/ClipboardService.js +11 -13
- package/{utils → lib/utils}/args-typecheck.d.ts +0 -0
- package/{utils → lib/utils}/args-typecheck.js +1 -0
- package/{utils → lib/utils}/class-names.d.ts +0 -0
- package/lib/utils/class-names.js +12 -0
- package/{utils → lib/utils}/color.d.ts +0 -0
- package/{utils → lib/utils}/color.js +7 -6
- package/{utils → lib/utils}/css-variables.d.ts +0 -0
- package/lib/utils/css-variables.js +6 -0
- package/{utils → lib/utils}/getNavbarElement.d.ts +0 -0
- package/{utils → lib/utils}/getNavbarElement.js +3 -2
- package/{utils → lib/utils}/highlight.d.ts +0 -0
- package/{utils → lib/utils}/highlight.js +10 -11
- package/{utils → lib/utils}/index.d.ts +0 -0
- package/{utils → lib/utils}/index.js +1 -0
- package/{utils → lib/utils}/isUrl.d.ts +0 -0
- package/{utils → lib/utils}/isUrl.js +6 -5
- package/{utils → lib/utils}/jsonToHtml.d.ts +0 -0
- package/lib/utils/jsonToHtml.js +180 -0
- package/{utils → lib/utils}/media-css.d.ts +0 -0
- package/lib/utils/media-css.js +13 -0
- package/{utils → lib/utils}/replaceHashInColor.d.ts +0 -0
- package/{utils → lib/utils}/replaceHashInColor.js +1 -0
- package/{utils → lib/utils}/theme-helpers.d.ts +0 -0
- package/lib/utils/theme-helpers.js +75 -0
- package/package.json +111 -4
- package/{src/settings.yaml → settings.yaml} +1 -1
- package/src/Button/Button.tsx +2 -1
- package/src/Cards/Card.tsx +1 -2
- package/src/CopyButton/CopyButtonWrapper.tsx +1 -2
- package/src/Footer/CustomFooter.tsx +1 -2
- package/src/Footer/CustomFooterNavItem.tsx +1 -2
- package/src/Footer/Footer.tsx +1 -2
- package/src/Footer/FooterColumn.tsx +1 -2
- package/src/Footer/FooterColumns.tsx +1 -2
- package/src/JsonViewer/JsonViewer.tsx +2 -1
- package/src/LastUpdated/LastUpdated.tsx +41 -5
- package/src/Markdown/Heading.tsx +2 -1
- package/src/Markdown/MarkdownLayout.tsx +3 -6
- package/src/Markdown/MarkdownWrapper.tsx +2 -1
- package/src/Markdown/Sup.tsx +2 -1
- package/src/Markdown/Tabs/Tabs.tsx +2 -1
- package/src/Navbar/MobileNavbarDropdown.tsx +1 -2
- package/src/Navbar/MobileNavbarItem.tsx +3 -4
- package/src/Navbar/MobileNavbarMenu.tsx +1 -2
- package/src/Navbar/Navbar.tsx +1 -2
- package/src/Navbar/NavbarDropdown.tsx +1 -2
- package/src/Navbar/NavbarItem.tsx +3 -4
- package/src/Navbar/NavbarMenu.tsx +1 -2
- package/src/NavbarLogo/NavbarLogo.tsx +1 -2
- package/src/PageNavigation/NextPageLink.tsx +1 -2
- package/src/PageNavigation/PageNavigation.tsx +3 -11
- package/src/PageNavigation/PreviousPageLink.tsx +3 -4
- package/src/Panel/PanelComponent.tsx +2 -2
- package/src/Panel/PanelHeader.ts +2 -1
- package/src/Search/Autocomplete.tsx +2 -2
- package/src/Search/ClearIcon.tsx +2 -1
- package/src/Search/Parameters.tsx +1 -2
- package/src/Search/SearchIcon.tsx +2 -1
- package/src/Search/SearchItem.tsx +1 -2
- package/src/Sidebar/ApiCallItem.tsx +1 -2
- package/src/Sidebar/Drilldown.tsx +1 -2
- package/src/Sidebar/DrilldownMenu.tsx +1 -2
- package/src/Sidebar/MenuGroup.tsx +1 -2
- package/src/Sidebar/MenuItem.tsx +1 -2
- package/src/Sidebar/MenuLink.tsx +1 -2
- package/src/Sidebar/MenuLinkItem.tsx +1 -2
- package/src/Sidebar/Separator.tsx +1 -2
- package/src/TableOfContent/TableOfContent.tsx +3 -4
- package/src/Tooltip/Tooltip.tsx +1 -0
- package/src/globalStyle.ts +28 -28
- package/src/hooks/__tests__/mocks/MockIntersectionObserver.ts +48 -0
- package/src/hooks/useActiveSectionId.ts +1 -0
- package/src/hooks/useDefaultThemeSettings.ts +1 -2
- package/src/hooks/useFullHeight.ts +2 -1
- package/src/hooks/useMobileMenu.ts +2 -1
- package/src/hooks/useNavbarHeight.ts +1 -0
- package/src/hooks/useOutsideClick.ts +2 -1
- package/src/mocks/hooks/index.ts +2 -2
- package/src/mocks/types.ts +8 -1
- package/src/types/portal/src/shared/constants.d.ts +33 -33
- package/src/types/portal/src/shared/types/markdown.d.ts +3 -3
- package/src/types/portal/src/shared/types/nav.d.ts +116 -106
- package/src/ui/Box.tsx +3 -2
- package/src/ui/Burger.tsx +2 -1
- package/src/ui/Dropdown.tsx +1 -2
- package/src/ui/Flex.tsx +2 -1
- package/src/ui/Tiles/ThinTile.tsx +2 -1
- package/src/ui/Tiles/WideTile.tsx +1 -2
- package/src/ui/UniversalLink.tsx +2 -1
- package/src/utils/theme-helpers.ts +1 -0
- package/Button/Button.js +0 -87
- package/Cards/Card.js +0 -25
- package/Cards/CardsBlock.js +0 -15
- package/CodeBlock/CodeBlock.js +0 -16
- package/CopyButton/CopyButton.js +0 -100
- package/EditPageButton/EditPageButton.js +0 -24
- package/Footer/CustomFooter.js +0 -31
- package/Footer/CustomFooterNavItem.js +0 -25
- package/Footer/Footer.js +0 -29
- package/Footer/FooterColumn.js +0 -31
- package/Footer/FooterColumns.js +0 -34
- package/Footer/FooterCopyright.js +0 -19
- package/JsonViewer/JsonViewer.js +0 -147
- package/LastUpdated/LastUpdated.d.ts +0 -5
- package/LastUpdated/LastUpdated.js +0 -27
- package/Layout/PageLayout.js +0 -22
- package/Layout/RootLayout.js +0 -24
- package/Markdown/Admonition.js +0 -31
- package/Markdown/CodeSample/CodeSample.js +0 -93
- package/Markdown/ContainerWrapper.js +0 -21
- package/Markdown/Details.js +0 -22
- package/Markdown/MarkdownLayout.js +0 -31
- package/Markdown/MarkdownWrapper.js +0 -43
- package/Markdown/Mermaid.js +0 -19
- package/Markdown/PageWrapper.js +0 -15
- package/Markdown/Sup.js +0 -19
- package/Markdown/Tabs/Tab.js +0 -24
- package/Markdown/Tabs/Tabs.js +0 -72
- package/Navbar/MobileNavbarDropdown.js +0 -21
- package/Navbar/MobileNavbarItem.js +0 -102
- package/Navbar/MobileNavbarMenu.js +0 -32
- package/Navbar/MobileNavbarMenuButton.js +0 -19
- package/Navbar/Navbar.js +0 -64
- package/Navbar/NavbarDropdown.js +0 -21
- package/Navbar/NavbarItem.js +0 -53
- package/Navbar/NavbarMenu.js +0 -29
- package/NavbarLogo/NavbarLogo.js +0 -24
- package/OperationBadge/OperationBadge.js +0 -16
- package/PageNavigation/NextPageLink.js +0 -28
- package/PageNavigation/PageNavigation.d.ts +0 -7
- package/PageNavigation/PageNavigation.js +0 -28
- package/PageNavigation/PreviousPageLink.js +0 -28
- package/Panel/Panel.js +0 -23
- package/Panel/PanelBody.js +0 -43
- package/Panel/PanelHeader.js +0 -24
- package/Panel/PanelHeaderTitle.js +0 -15
- package/Profile/Profile.js +0 -59
- package/SamplesPanelControls/SamplesPanelControls.js +0 -27
- package/Search/Autocomplete.js +0 -122
- package/Search/ClearIcon.js +0 -32
- package/Search/Input.js +0 -15
- package/Search/Parameters.js +0 -42
- package/Search/Popover.js +0 -15
- package/Search/Search.js +0 -29
- package/Search/SearchIcon.js +0 -32
- package/Search/SearchItem.js +0 -64
- package/Search/SidebarSearch.js +0 -17
- package/Sidebar/ApiCallItem.js +0 -29
- package/Sidebar/ArrowBack.js +0 -21
- package/Sidebar/BackButton.js +0 -22
- package/Sidebar/Drilldown.js +0 -50
- package/Sidebar/DrilldownMenu.js +0 -52
- package/Sidebar/DrilldownMenuItem.js +0 -25
- package/Sidebar/ExternalIcon.js +0 -23
- package/Sidebar/Menu.js +0 -15
- package/Sidebar/MenuContainer.js +0 -15
- package/Sidebar/MenuGroup.js +0 -95
- package/Sidebar/MenuItemLabel.js +0 -19
- package/Sidebar/MenuLink.js +0 -16
- package/Sidebar/MenuLinkItem.js +0 -31
- package/Sidebar/MobileSidebarButton.js +0 -25
- package/Sidebar/Separator.js +0 -23
- package/Sidebar/SeparatorItem.js +0 -16
- package/Sidebar/SeparatorLine.js +0 -15
- package/Sidebar/Sidebar.js +0 -24
- package/Sidebar/SidebarLayout.js +0 -52
- package/SidebarLogo/SidebarLogo.js +0 -25
- package/TableOfContent/TableOfContent.js +0 -81
- package/TableOfContent/utils.js +0 -62
- package/Tooltip/Tooltip.js +0 -98
- package/Typography/CompactTypography.js +0 -18
- package/Typography/Emphasis.js +0 -15
- package/Typography/H1.js +0 -16
- package/Typography/H2.js +0 -16
- package/Typography/H3.js +0 -16
- package/Typography/SectionHeader.js +0 -15
- package/Typography/Typography.js +0 -45
- package/globalStyle.js +0 -38
- package/hooks/__tests__/mocks/MockIntersectionObserver.js +0 -39
- package/hooks/useActiveHeading.js +0 -100
- package/hooks/useActiveSectionId.js +0 -65
- package/hooks/useControl.js +0 -32
- package/hooks/useMobileMenu.js +0 -29
- package/hooks/useNavbarHeight.js +0 -36
- package/icons/ArrowIcon/ArrowIcon.js +0 -33
- package/icons/ShelfIcon/ShelfIcon.js +0 -52
- package/mocks/Link.js +0 -27
- package/mocks/types.d.ts +0 -7
- package/ui/Background.js +0 -16
- package/ui/Box.js +0 -16
- package/ui/Burger.js +0 -23
- package/ui/Dropdown.js +0 -89
- package/ui/Flex.js +0 -31
- package/ui/Jumbotron.js +0 -44
- package/ui/Tiles/ThinTile.js +0 -114
- package/ui/Tiles/TileHeader.js +0 -15
- package/ui/Tiles/TileText.js +0 -15
- package/ui/Tiles/WideTile.js +0 -109
- package/ui/UniversalLink.js +0 -97
- package/ui/darkColors.js +0 -10
- package/utils/class-names.js +0 -15
- package/utils/css-variables.js +0 -8
- package/utils/jsonToHtml.js +0 -324
- package/utils/media-css.js +0 -50
- package/utils/theme-helpers.js +0 -121
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLines = exports.jsonToHTML = void 0;
|
|
4
|
+
// Moved from reference-docs
|
|
5
|
+
let level = 0;
|
|
6
|
+
let line = 1;
|
|
7
|
+
const ellipsis = '<span class="ellipsis"></span>';
|
|
8
|
+
const colon = '<span class="colon">: </span>';
|
|
9
|
+
function jsonToHTML(json, maxExpandLevel, startLine = 1) {
|
|
10
|
+
level = 0;
|
|
11
|
+
line = startLine;
|
|
12
|
+
let output = '';
|
|
13
|
+
output += '<div data-cy="json-sample" class="redoc-json">';
|
|
14
|
+
output += '<code>';
|
|
15
|
+
output += getLines(json, maxExpandLevel);
|
|
16
|
+
output += '</code>';
|
|
17
|
+
output += '</div>';
|
|
18
|
+
return output;
|
|
19
|
+
}
|
|
20
|
+
exports.jsonToHTML = jsonToHTML;
|
|
21
|
+
function htmlEncode(t) {
|
|
22
|
+
return t !== undefined
|
|
23
|
+
? t
|
|
24
|
+
.toString()
|
|
25
|
+
.replace(/&/g, '&')
|
|
26
|
+
.replace(/"/g, '"')
|
|
27
|
+
.replace(/</g, '<')
|
|
28
|
+
.replace(/>/g, '>')
|
|
29
|
+
: '';
|
|
30
|
+
}
|
|
31
|
+
function stringifyStringLiteral(str) {
|
|
32
|
+
return JSON.stringify(str).slice(1, -1);
|
|
33
|
+
}
|
|
34
|
+
function decorateWithSpan(value, className) {
|
|
35
|
+
return '<span class="' + className + '">' + htmlEncode(value) + '</span>';
|
|
36
|
+
}
|
|
37
|
+
function punctuation(val) {
|
|
38
|
+
return '<span class="token punctuation">' + val + '</span>';
|
|
39
|
+
}
|
|
40
|
+
function collapser(maxExpandLevel) {
|
|
41
|
+
const collapsed = level > maxExpandLevel ? 'expand' : 'collapse';
|
|
42
|
+
return `<button class="collapser" aria-label="${collapsed}"></button>`;
|
|
43
|
+
}
|
|
44
|
+
function getLines(json, maxExpandLevel) {
|
|
45
|
+
const collapsibleLines = [];
|
|
46
|
+
const lines = valueToHTML(json, maxExpandLevel, 'root');
|
|
47
|
+
let nextLine = lines.next();
|
|
48
|
+
while (!nextLine.done) {
|
|
49
|
+
collapsibleLines.push(nextLine.value);
|
|
50
|
+
nextLine = lines.next();
|
|
51
|
+
}
|
|
52
|
+
collapsibleLines.push(nextLine.value);
|
|
53
|
+
return collapsibleLines.join('\n');
|
|
54
|
+
}
|
|
55
|
+
exports.getLines = getLines;
|
|
56
|
+
function* valueToHTML(value, maxExpandLevel, context) {
|
|
57
|
+
const valueType = typeof value;
|
|
58
|
+
if (value === undefined || value === null) {
|
|
59
|
+
return decorateWithSpan('null', 'token keyword');
|
|
60
|
+
}
|
|
61
|
+
else if (value && value.constructor === Array) {
|
|
62
|
+
const length = typeof value.length === 'number' ? value.length : 0;
|
|
63
|
+
if (!length) {
|
|
64
|
+
return punctuation('[ ]');
|
|
65
|
+
}
|
|
66
|
+
level++;
|
|
67
|
+
yield context === 'root'
|
|
68
|
+
? `<span data-line="${line++}">${punctuation('[')}</span>`
|
|
69
|
+
: punctuation('[');
|
|
70
|
+
for (const line of arrayToHTML(value, length, maxExpandLevel)) {
|
|
71
|
+
yield line;
|
|
72
|
+
}
|
|
73
|
+
level--;
|
|
74
|
+
return `<span data-line="${line++}">${punctuation(']')}</span>`;
|
|
75
|
+
}
|
|
76
|
+
else if (value && value.constructor === Date) {
|
|
77
|
+
return decorateWithSpan('"' + value.toISOString() + '"', 'token string');
|
|
78
|
+
}
|
|
79
|
+
else if (valueType === 'object') {
|
|
80
|
+
const keys = Object.keys(value);
|
|
81
|
+
if (!keys.length) {
|
|
82
|
+
return punctuation('{ }');
|
|
83
|
+
}
|
|
84
|
+
level++;
|
|
85
|
+
yield context === 'root'
|
|
86
|
+
? `<span data-line="${line++}">${punctuation('{')}</span>`
|
|
87
|
+
: punctuation('{');
|
|
88
|
+
for (const line of objectToHTML(value, keys, maxExpandLevel)) {
|
|
89
|
+
yield line;
|
|
90
|
+
}
|
|
91
|
+
level--;
|
|
92
|
+
return `<span data-line="${line++}">${punctuation('}')}</span>`;
|
|
93
|
+
}
|
|
94
|
+
else if (valueType === 'number') {
|
|
95
|
+
return decorateWithSpan(value, 'token number');
|
|
96
|
+
}
|
|
97
|
+
else if (valueType === 'string') {
|
|
98
|
+
if (/^(http|https):\/\/[^\s]+$/.test(value)) {
|
|
99
|
+
return (decorateWithSpan('"', 'token string') +
|
|
100
|
+
`<a href="${encodeURI(value)}">` +
|
|
101
|
+
htmlEncode(stringifyStringLiteral(value)) +
|
|
102
|
+
'</a>' +
|
|
103
|
+
decorateWithSpan('"', 'token string'));
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return decorateWithSpan('"' + stringifyStringLiteral(value) + '"', 'token string');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else if (valueType === 'boolean') {
|
|
110
|
+
return decorateWithSpan(value, 'token boolean');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getLineTemplate({ isFirstKey, isLastKey, nextLine, context, lineTemplate, maxExpandLevel, }) {
|
|
114
|
+
let lineValue = isFirstKey ? `${ellipsis}<span class="${context} collapsible">` : '';
|
|
115
|
+
// Create hoverable
|
|
116
|
+
lineValue += `<span data-line="${line++}" class="${level > maxExpandLevel ? 'hoverable collapsed' : 'hoverable'}">`;
|
|
117
|
+
// Add collapser button if item has nested lines
|
|
118
|
+
lineValue += (!nextLine.done && collapser(maxExpandLevel)) || '';
|
|
119
|
+
lineValue += lineTemplate;
|
|
120
|
+
lineValue += nextLine.value;
|
|
121
|
+
// Add punctuation in case we dont have more nested lines and it is not last item
|
|
122
|
+
lineValue += nextLine.done && !isLastKey ? punctuation(',') : '';
|
|
123
|
+
// Close hoverable if we dont have nested lines
|
|
124
|
+
lineValue += nextLine.done ? '</span>' : '';
|
|
125
|
+
// Close collapsible if value is single line and we are on last item
|
|
126
|
+
lineValue += nextLine.done && isLastKey ? '</span>' : '';
|
|
127
|
+
return lineValue;
|
|
128
|
+
}
|
|
129
|
+
function* arrayToHTML(array, arrayLength, maxExpandLevel) {
|
|
130
|
+
for (let i = 0; i < arrayLength; i++) {
|
|
131
|
+
const lines = valueToHTML(array[i], maxExpandLevel, 'array');
|
|
132
|
+
const isFirstKey = i === 0;
|
|
133
|
+
const isLastKey = i === arrayLength - 1;
|
|
134
|
+
let nextLine = lines.next();
|
|
135
|
+
yield getLineTemplate({
|
|
136
|
+
context: 'array',
|
|
137
|
+
isFirstKey,
|
|
138
|
+
isLastKey,
|
|
139
|
+
nextLine,
|
|
140
|
+
lineTemplate: '',
|
|
141
|
+
maxExpandLevel,
|
|
142
|
+
});
|
|
143
|
+
nextLine = lines.next();
|
|
144
|
+
while (!nextLine.done) {
|
|
145
|
+
yield nextLine.value;
|
|
146
|
+
nextLine = lines.next();
|
|
147
|
+
}
|
|
148
|
+
if (nextLine.value) {
|
|
149
|
+
// Close hoverable and collapsible (if last array item)
|
|
150
|
+
yield `${nextLine.value}${i < arrayLength - 1 ? punctuation(',') : '</span>'}</span>`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function* objectToHTML(object, keys, maxExpandLevel) {
|
|
155
|
+
for (let i = 0; i < keys.length; i++) {
|
|
156
|
+
const key = keys[i];
|
|
157
|
+
const lines = valueToHTML(object[key], maxExpandLevel, 'object');
|
|
158
|
+
const isFirstKey = i === 0;
|
|
159
|
+
const isLastKey = i === keys.length - 1;
|
|
160
|
+
let nextLine = lines.next();
|
|
161
|
+
yield getLineTemplate({
|
|
162
|
+
context: 'obj',
|
|
163
|
+
isFirstKey,
|
|
164
|
+
isLastKey,
|
|
165
|
+
nextLine,
|
|
166
|
+
lineTemplate: `<span class="property token string">"${htmlEncode(key)}"</span>${colon}`,
|
|
167
|
+
maxExpandLevel,
|
|
168
|
+
});
|
|
169
|
+
nextLine = lines.next();
|
|
170
|
+
while (!nextLine.done) {
|
|
171
|
+
yield nextLine.value;
|
|
172
|
+
nextLine = lines.next();
|
|
173
|
+
}
|
|
174
|
+
if (nextLine.value) {
|
|
175
|
+
// Close hoverable and collapsible (if last field)
|
|
176
|
+
yield `${nextLine.value}${isLastKey ? '</span>' : punctuation(',')}</span>`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=jsonToHtml.js.map
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateMediaQueries = exports.breakpoints = void 0;
|
|
4
|
+
exports.breakpoints = { small: '50rem', medium: '85rem', large: '105rem' };
|
|
5
|
+
function generateMediaQueries(breakpoints) {
|
|
6
|
+
const result = { print: '@media print' };
|
|
7
|
+
for (const [key, value] of Object.entries(breakpoints)) {
|
|
8
|
+
result[key] = `@media screen and (min-width: ${value})`;
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
exports.generateMediaQueries = generateMediaQueries;
|
|
13
|
+
//# sourceMappingURL=media-css.js.map
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateCodeBlockTokens = exports.typography = exports.getTypographyCssRulesByComponentName = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
var Token;
|
|
6
|
+
(function (Token) {
|
|
7
|
+
Token["Comment"] = "comment";
|
|
8
|
+
Token["Prolog"] = "prolog";
|
|
9
|
+
Token["Doctype"] = "doctype";
|
|
10
|
+
Token["Cdata"] = "cdata";
|
|
11
|
+
Token["Punctuation"] = "punctuation";
|
|
12
|
+
Token["Property"] = "property";
|
|
13
|
+
Token["Tag"] = "tag";
|
|
14
|
+
Token["Number"] = "number";
|
|
15
|
+
Token["Constant"] = "constant";
|
|
16
|
+
Token["Symbol"] = "symbol";
|
|
17
|
+
Token["Boolean"] = "boolean";
|
|
18
|
+
Token["Selector"] = "selector";
|
|
19
|
+
Token["String"] = "string";
|
|
20
|
+
Token["Char"] = "char";
|
|
21
|
+
Token["Builtin"] = "builtin";
|
|
22
|
+
Token["Inserted"] = "inserted";
|
|
23
|
+
Token["Operator"] = "operator";
|
|
24
|
+
Token["Entity"] = "entity";
|
|
25
|
+
Token["Url"] = "url";
|
|
26
|
+
Token["Variable"] = "variable";
|
|
27
|
+
Token["Atrule"] = "atrule";
|
|
28
|
+
Token["AttrValue"] = "attr-value";
|
|
29
|
+
Token["AttrName"] = "attr-name";
|
|
30
|
+
Token["Keyword"] = "keyword";
|
|
31
|
+
Token["Regex"] = "regex";
|
|
32
|
+
Token["Important"] = "important";
|
|
33
|
+
Token["Bold"] = "bold";
|
|
34
|
+
Token["Italic"] = "italic";
|
|
35
|
+
Token["Deleted"] = "deleted";
|
|
36
|
+
})(Token || (Token = {}));
|
|
37
|
+
const typographyProperties = Object.entries({
|
|
38
|
+
fontSize: 'font-size',
|
|
39
|
+
fontWeight: 'font-weight',
|
|
40
|
+
fontFamily: 'font-family',
|
|
41
|
+
lineHeight: 'line-height',
|
|
42
|
+
color: 'text-color',
|
|
43
|
+
textTransform: 'text-transform',
|
|
44
|
+
});
|
|
45
|
+
function getTypographyCssRulesByComponentName(componentName, fallbackName) {
|
|
46
|
+
const result = {};
|
|
47
|
+
for (const [styledPropertyName, cssPropertyName] of typographyProperties) {
|
|
48
|
+
const cssVariable = `--${componentName}-${cssPropertyName}`;
|
|
49
|
+
const fallbackVariable = fallbackName ? `,var(--${fallbackName}-${cssPropertyName})` : '';
|
|
50
|
+
result[styledPropertyName] = `var(${cssVariable}${fallbackVariable})`;
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
exports.getTypographyCssRulesByComponentName = getTypographyCssRulesByComponentName;
|
|
55
|
+
function typography(componentName, fallbackName) {
|
|
56
|
+
return (0, styled_components_1.css) `
|
|
57
|
+
${getTypographyCssRulesByComponentName(componentName, fallbackName)}
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
exports.typography = typography;
|
|
61
|
+
function generateCodeBlockTokens() {
|
|
62
|
+
let res = '';
|
|
63
|
+
for (const token of Object.values(Token)) {
|
|
64
|
+
const cssTokenColorVariableName = `--code-block-tokens-${token}-color`;
|
|
65
|
+
res += `.token.${token} { color: var(${cssTokenColorVariableName})}; }\n`;
|
|
66
|
+
}
|
|
67
|
+
return (0, styled_components_1.css) `
|
|
68
|
+
pre& {
|
|
69
|
+
color: var(--code-block-tokens-default-color);
|
|
70
|
+
}
|
|
71
|
+
${res}
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
exports.generateCodeBlockTokens = generateCodeBlockTokens;
|
|
75
|
+
//# sourceMappingURL=theme-helpers.js.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "Shared UI components",
|
|
5
5
|
"author": "team@redocly.com",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
-
"main": "index.js",
|
|
8
|
-
"
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./lib/index.js",
|
|
11
|
+
"./Sidebar/*": "./lib/Sidebar/*.js",
|
|
12
|
+
"./*": "./lib/*/index.js",
|
|
13
|
+
"./src/": "./src/"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "npm-run-all --parallel storybook generate-tokens:watch",
|
|
17
|
+
"storybook": "start-storybook -p 6006",
|
|
18
|
+
"build-storybook": "npm run generate-tokens && build-storybook",
|
|
19
|
+
"generate-tokens": "ts-node scripts/generate-css-tokens.ts",
|
|
20
|
+
"generate-tokens:watch": "ts-node-dev --respawn scripts/generate-css-tokens.ts",
|
|
21
|
+
"clean": "rm -rf lib",
|
|
22
|
+
"compile": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
23
|
+
"build": "npm run clean && npm run compile",
|
|
24
|
+
"build:on-rebuild": "tsc-alias -p tsconfig.build.json",
|
|
25
|
+
"build:watch": "npm run clean && tsc-watch --project tsconfig.build.json --onSuccess \"npm run build:on-rebuild\"",
|
|
26
|
+
"lint": "eslint . --ext .ts,.tsx --cache",
|
|
27
|
+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
28
|
+
"prettier-base": "prettier \"**/*.{json,js,jsx,ts,tsx,yml,yaml,html,md}\"",
|
|
29
|
+
"prettier": "npm run prettier-base -- --write",
|
|
30
|
+
"prettier:check": "npm run prettier-base -- --check",
|
|
31
|
+
"ts:check": "tsc --noEmit --skipLibCheck",
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"test:watch": "jest --watch",
|
|
34
|
+
"test:coverage": "jest --coverage",
|
|
35
|
+
"test:updateSnapshot": "jest --updateSnapshot",
|
|
36
|
+
"chromatic": "chromatic --exit-zero-on-changes"
|
|
37
|
+
},
|
|
9
38
|
"peerDependencies": {
|
|
10
39
|
"lodash.throttle": "^4.1.1",
|
|
11
40
|
"prismjs": "^1.28.0",
|
|
@@ -15,7 +44,85 @@
|
|
|
15
44
|
"styled-components": "^5.3.1",
|
|
16
45
|
"styled-system": "^5.1.5"
|
|
17
46
|
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@storybook/addon-actions": "^6.5.9",
|
|
49
|
+
"@storybook/addon-essentials": "^6.5.9",
|
|
50
|
+
"@storybook/addon-interactions": "^6.5.9",
|
|
51
|
+
"@storybook/addon-links": "^6.5.9",
|
|
52
|
+
"@storybook/addon-viewport": "^6.5.9",
|
|
53
|
+
"@storybook/addons": "^6.5.9",
|
|
54
|
+
"@storybook/builder-webpack5": "^6.5.9",
|
|
55
|
+
"@storybook/core-common": "^6.5.9",
|
|
56
|
+
"@storybook/manager-webpack5": "^6.5.9",
|
|
57
|
+
"@storybook/node-logger": "^6.5.9",
|
|
58
|
+
"@storybook/preset-create-react-app": "^4.1.0",
|
|
59
|
+
"@storybook/react": "^6.5.9",
|
|
60
|
+
"@storybook/testing-library": "^0.0.11",
|
|
61
|
+
"@storybook/theming": "^6.5.9",
|
|
62
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
63
|
+
"@testing-library/react": "^12.1.4",
|
|
64
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
65
|
+
"@testing-library/user-event": "^13.5.0",
|
|
66
|
+
"@types/jest": "^29.1.2",
|
|
67
|
+
"@types/jest-when": "^3.5.2",
|
|
68
|
+
"@types/lodash.throttle": "^4.1.7",
|
|
69
|
+
"@types/node": "^16.11.26",
|
|
70
|
+
"@types/prismjs": "^1.26.0",
|
|
71
|
+
"@types/react": "^17.0.43",
|
|
72
|
+
"@types/react-dom": "^17.0.14",
|
|
73
|
+
"@types/react-router-dom": "^5.3.1",
|
|
74
|
+
"@types/styled-components": "^5.1.15",
|
|
75
|
+
"@types/styled-system": "^5.1.13",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
77
|
+
"@typescript-eslint/parser": "^5.23.0",
|
|
78
|
+
"chromatic": "^6.5.4",
|
|
79
|
+
"esbuild": "^0.14.38",
|
|
80
|
+
"jest": "^29.1.2",
|
|
81
|
+
"jest-environment-jsdom": "^29.1.2",
|
|
82
|
+
"jest-styled-components": "^7.1.1",
|
|
83
|
+
"jest-when": "^3.5.1",
|
|
84
|
+
"lint-staged": "^12.4.1",
|
|
85
|
+
"lodash": "^4.17.21",
|
|
86
|
+
"lodash.throttle": "^4.1.1",
|
|
87
|
+
"npm-run-all": "^4.1.5",
|
|
88
|
+
"prettier": "2.6.2",
|
|
89
|
+
"react": "^17.0.2",
|
|
90
|
+
"react-dom": "^17.0.2",
|
|
91
|
+
"react-refresh": "^0.13.0",
|
|
92
|
+
"react-router-dom": "^5.3.0",
|
|
93
|
+
"react-scripts": "5.0.1",
|
|
94
|
+
"storybook-addon-pseudo-states": "^1.15.1",
|
|
95
|
+
"storybook-design-token": "^2.1.0",
|
|
96
|
+
"styled-components": "^5.3.5",
|
|
97
|
+
"styled-system": "^5.1.5",
|
|
98
|
+
"ts-jest": "^29.0.3",
|
|
99
|
+
"ts-node": "^10.7.0",
|
|
100
|
+
"ts-node-dev": "^1.1.8",
|
|
101
|
+
"tsc-alias": "^1.6.7",
|
|
102
|
+
"tsc-watch": "^5.0.3",
|
|
103
|
+
"tsconfig-paths-webpack-plugin": "^3.5.2",
|
|
104
|
+
"typescript": "^4.6.4",
|
|
105
|
+
"webpack": "^5.72.0"
|
|
106
|
+
},
|
|
18
107
|
"dependencies": {
|
|
19
108
|
"timeago.js": "^4.0.2"
|
|
109
|
+
},
|
|
110
|
+
"nx": {
|
|
111
|
+
"namedInputs": {
|
|
112
|
+
"prod": [
|
|
113
|
+
"!{projectRoot}/**/__tests__/**",
|
|
114
|
+
"!{projectRoot}/**/*.stories.{ts,tsx}"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"targets": {
|
|
118
|
+
"build": {
|
|
119
|
+
"outputs": [
|
|
120
|
+
"{projectRoot}/lib"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"test": {
|
|
124
|
+
"outputs": []
|
|
125
|
+
}
|
|
126
|
+
}
|
|
20
127
|
}
|
|
21
|
-
}
|
|
128
|
+
}
|
package/src/Button/Button.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { FlattenSimpleInterpolation, Keyframes } from 'styled-components';
|
|
3
2
|
import styled, { css, keyframes } from 'styled-components';
|
|
4
3
|
|
|
4
|
+
import type { FlattenSimpleInterpolation, Keyframes } from 'styled-components';
|
|
5
|
+
|
|
5
6
|
import { Link } from '@portal/Link';
|
|
6
7
|
|
|
7
8
|
export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge' | string;
|
package/src/Cards/Card.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { Link } from '@portal/Link';
|
|
7
5
|
import { H3 } from '@theme/Typography';
|
|
6
|
+
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
8
7
|
|
|
9
8
|
export interface CardProps {
|
|
10
9
|
title?: string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { TooltipProps } from '@theme/Tooltip';
|
|
4
|
-
|
|
5
3
|
import { SamplesControlButton } from '@theme/SamplesPanelControls';
|
|
6
4
|
import { Tooltip } from '@theme/Tooltip';
|
|
7
5
|
import { useControl } from '@theme/hooks';
|
|
8
6
|
import { ClipboardService } from '@theme/utils';
|
|
7
|
+
import type { TooltipProps } from '@theme/Tooltip';
|
|
9
8
|
|
|
10
9
|
export interface CopyButtonWrapperProps {
|
|
11
10
|
data: unknown;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { CustomFooterNavItem } from '@theme/Footer/CustomFooterNavItem';
|
|
7
5
|
import { FooterCopyright } from '@theme/Footer/FooterCopyright';
|
|
6
|
+
import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
|
|
8
7
|
|
|
9
8
|
interface FooterProps {
|
|
10
9
|
data: NavGroupRecord;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { ResolvedNavItem, ResolvedNavLinkItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { Link } from '@portal/Link';
|
|
5
|
+
import type { ResolvedNavItem, ResolvedNavLinkItem } from '@theme/types/portal';
|
|
7
6
|
|
|
8
7
|
interface CustomFooterNavItemProps {
|
|
9
8
|
navItem: ResolvedNavItem;
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { FooterColumns } from '@theme/Footer/FooterColumns';
|
|
7
5
|
import { FooterCopyright } from '@theme/Footer/FooterCopyright';
|
|
8
6
|
import { isEmptyArray } from '@theme/utils';
|
|
9
7
|
import { useDefaultThemeSettings } from '@theme/hooks/useDefaultThemeSettings';
|
|
8
|
+
import type { NavGroupRecord, ResolvedNavItem } from '@theme/types/portal';
|
|
10
9
|
|
|
11
10
|
interface FooterProps {
|
|
12
11
|
data: NavGroupRecord;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { Link } from '@portal/Link';
|
|
5
|
+
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
7
6
|
|
|
8
7
|
interface FooterColumnProps {
|
|
9
8
|
column: ResolvedNavItem;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
5
|
-
|
|
6
4
|
import { FooterColumn } from '@theme/Footer/FooterColumn';
|
|
5
|
+
import type { ResolvedNavItem } from '@theme/types/portal';
|
|
7
6
|
|
|
8
7
|
interface FooterColumnsProps {
|
|
9
8
|
columns: ResolvedNavItem[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
1
|
import React, { memo, useRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
|
|
4
|
+
import type { ReactElement } from 'react';
|
|
5
|
+
|
|
5
6
|
import { CopyButtonWrapper } from '@theme/CopyButton';
|
|
6
7
|
import { SampleControls, SamplesControlButton } from '@theme/SamplesPanelControls';
|
|
7
8
|
import { jsonToHTML } from '@theme/utils';
|
|
@@ -4,28 +4,64 @@ import { format } from 'timeago.js';
|
|
|
4
4
|
|
|
5
5
|
import { useDefaultThemeSettings } from '@theme/hooks/useDefaultThemeSettings';
|
|
6
6
|
|
|
7
|
+
const FORMATS = {
|
|
8
|
+
timeago: (date: Date, locale: string) => format(date, locale),
|
|
9
|
+
iso: (date: Date) => date.toISOString().split('T')[0],
|
|
10
|
+
short: (date: Date, locale: string) =>
|
|
11
|
+
date.toLocaleDateString(locale, { month: 'short', day: 'numeric', year: 'numeric' }),
|
|
12
|
+
long: (date: Date, locale: string) =>
|
|
13
|
+
date.toLocaleDateString(locale, { month: 'long', day: 'numeric', year: 'numeric' }),
|
|
14
|
+
};
|
|
15
|
+
|
|
7
16
|
export interface LastUpdatedProps {
|
|
8
|
-
lastModified:
|
|
17
|
+
lastModified: Date;
|
|
18
|
+
format?: keyof typeof FORMATS;
|
|
19
|
+
locale?: string;
|
|
9
20
|
}
|
|
10
21
|
|
|
11
|
-
export function LastUpdated(
|
|
22
|
+
export function LastUpdated(props: LastUpdatedProps): JSX.Element | null {
|
|
12
23
|
const { lastUpdatedBlock } = useDefaultThemeSettings();
|
|
13
24
|
|
|
14
25
|
if (lastUpdatedBlock?.hide) {
|
|
15
26
|
return null;
|
|
16
27
|
}
|
|
17
28
|
|
|
29
|
+
const lastModified = props.lastModified;
|
|
30
|
+
const format = props.format || lastUpdatedBlock?.format || 'timeago';
|
|
31
|
+
const locale = props.locale || lastUpdatedBlock?.locale || 'en-US';
|
|
32
|
+
const isoDate = lastModified.toISOString().split('T')[0];
|
|
33
|
+
|
|
34
|
+
const lastUpdatedString = FORMATS[format](lastModified, locale);
|
|
35
|
+
const separator = format === 'timeago' ? ' ' : ' on ';
|
|
36
|
+
|
|
18
37
|
return (
|
|
19
|
-
<Wrapper
|
|
20
|
-
|
|
38
|
+
<Wrapper
|
|
39
|
+
data-component-name="LastUpdated/LastUpdated"
|
|
40
|
+
rawOnPrint={format === 'timeago'}
|
|
41
|
+
data-print-datetime={isoDate}
|
|
42
|
+
>
|
|
43
|
+
Last updated{separator}
|
|
44
|
+
<time dateTime={isoDate}>{lastUpdatedString}</time>
|
|
21
45
|
</Wrapper>
|
|
22
46
|
);
|
|
23
47
|
}
|
|
24
48
|
|
|
25
|
-
const Wrapper = styled.div
|
|
49
|
+
const Wrapper = styled.div<{ rawOnPrint?: boolean }>`
|
|
26
50
|
color: var(--last-updated-text-color);
|
|
27
51
|
font-size: var(--last-updated-font-size);
|
|
28
52
|
font-family: var(--last-updated-font-family);
|
|
29
53
|
line-height: var(--last-updated-line-height);
|
|
30
54
|
padding-bottom: 30px;
|
|
55
|
+
|
|
56
|
+
${({ rawOnPrint }) =>
|
|
57
|
+
rawOnPrint &&
|
|
58
|
+
`@media print {
|
|
59
|
+
time {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
&::after {
|
|
63
|
+
content: attr(data-print-datetime);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`}
|
|
31
67
|
`;
|
package/src/Markdown/Heading.tsx
CHANGED
|
@@ -10,21 +10,18 @@ import { LastUpdated } from '@theme/LastUpdated/LastUpdated';
|
|
|
10
10
|
type MarkdownLayoutProps = {
|
|
11
11
|
tableOfContent: React.ReactNode;
|
|
12
12
|
markdownWrapper: React.ReactNode;
|
|
13
|
-
showPrevButton?: boolean;
|
|
14
|
-
showNextButton?: boolean;
|
|
15
13
|
editPage?: {
|
|
16
14
|
to: string;
|
|
17
15
|
text: string;
|
|
18
16
|
icon: string;
|
|
19
17
|
};
|
|
18
|
+
/** String in ISO format */
|
|
20
19
|
lastModified?: string | null;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export function MarkdownLayout({
|
|
24
23
|
tableOfContent,
|
|
25
24
|
markdownWrapper,
|
|
26
|
-
showPrevButton,
|
|
27
|
-
showNextButton,
|
|
28
25
|
editPage,
|
|
29
26
|
lastModified,
|
|
30
27
|
}: MarkdownLayoutProps): JSX.Element {
|
|
@@ -32,13 +29,13 @@ export function MarkdownLayout({
|
|
|
32
29
|
<PageWrapper data-component-name="Markdown/MarkdownLayout">
|
|
33
30
|
<ContainerWrapper withToc={true}>
|
|
34
31
|
<LayoutTop>
|
|
35
|
-
{lastModified && <LastUpdated lastModified={lastModified} />}
|
|
32
|
+
{lastModified && <LastUpdated lastModified={new Date(lastModified)} />}
|
|
36
33
|
{editPage && (
|
|
37
34
|
<EditPageButton text={editPage.text} to={editPage.to} icon={editPage.icon} />
|
|
38
35
|
)}
|
|
39
36
|
</LayoutTop>
|
|
40
37
|
{markdownWrapper}
|
|
41
|
-
<PageNavigation
|
|
38
|
+
<PageNavigation />
|
|
42
39
|
</ContainerWrapper>
|
|
43
40
|
{tableOfContent}
|
|
44
41
|
</PageWrapper>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
2
1
|
import styled, { css } from 'styled-components';
|
|
3
2
|
|
|
3
|
+
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
4
|
+
|
|
4
5
|
import { typography } from '@theme/utils';
|
|
5
6
|
|
|
6
7
|
export const baseTable = css`
|