@redocly/theme 0.55.0-next.7 → 0.55.0-next.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/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -1
- package/lib/components/Catalog/Catalog.d.ts +11 -0
- package/lib/components/Catalog/Catalog.js +138 -0
- package/lib/components/Catalog/CatalogActionsRow.d.ts +15 -0
- package/lib/components/Catalog/CatalogActionsRow.js +34 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +8 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +179 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +8 -0
- package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +20 -0
- package/lib/components/Catalog/CatalogEntities.d.ts +18 -0
- package/lib/components/Catalog/CatalogEntities.js +63 -0
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +2 -0
- package/lib/components/Catalog/CatalogEntitiesEmptyState.js +38 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +12 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +133 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +49 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +48 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +111 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +25 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +69 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +48 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +20 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +20 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +23 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +24 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.js +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +21 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +37 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +10 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +25 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +27 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +22 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +60 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +5 -0
- package/lib/components/Catalog/CatalogEntityIcon.js +38 -0
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +5 -0
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +42 -0
- package/lib/components/Catalog/CatalogHighlight.d.ts +4 -0
- package/lib/components/Catalog/CatalogHighlight.js +48 -0
- package/lib/components/Catalog/CatalogPageDescription.d.ts +9 -0
- package/lib/components/Catalog/CatalogPageDescription.js +52 -0
- package/lib/components/Catalog/CatalogSelector.d.ts +12 -0
- package/lib/components/Catalog/CatalogSelector.js +48 -0
- package/lib/components/Catalog/CatalogSortButton.d.ts +10 -0
- package/lib/components/Catalog/CatalogSortButton.js +71 -0
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.d.ts +5 -0
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +19 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +63 -0
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.d.ts +5 -0
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +19 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +11 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +101 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +31 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +106 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +27 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +127 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.d.ts +6 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +20 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.d.ts +7 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +66 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +9 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +46 -0
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +7 -0
- package/lib/components/Catalog/CatalogViewModeToggle.js +67 -0
- package/lib/components/Catalog/variables.d.ts +1 -0
- package/lib/components/Catalog/variables.dark.d.ts +1 -0
- package/lib/components/Catalog/variables.dark.js +8 -0
- package/lib/components/Catalog/variables.js +354 -0
- package/lib/components/CatalogClassic/CatalogClassicHighlight.js +1 -1
- package/lib/components/Filter/Filter.d.ts +1 -1
- package/lib/components/Filter/Filter.js +2 -2
- package/lib/components/Filter/FilterCheckboxes.d.ts +1 -1
- package/lib/components/Filter/FilterCheckboxes.js +4 -4
- package/lib/components/Filter/FilterContent.d.ts +3 -1
- package/lib/components/Filter/FilterContent.js +34 -4
- package/lib/components/Filter/FilterInput.js +35 -3
- package/lib/components/Filter/FilterSelect.d.ts +1 -1
- package/lib/components/Filter/FilterSelect.js +4 -4
- package/lib/components/LoadMore/LoadMore.d.ts +8 -0
- package/lib/components/LoadMore/LoadMore.js +18 -0
- package/lib/components/Markdown/Markdown.js +1 -1
- package/lib/components/PageNavigation/NavigationButton.d.ts +13 -0
- package/lib/components/PageNavigation/NavigationButton.js +32 -0
- package/lib/components/PageNavigation/NextButton.js +10 -29
- package/lib/components/PageNavigation/PageNavigation.js +1 -1
- package/lib/components/PageNavigation/PreviousButton.js +11 -27
- package/lib/components/Search/SearchAiConversationInput.js +2 -1
- package/lib/components/Select/Select.js +3 -3
- package/lib/components/Sidebar/Sidebar.d.ts +3 -0
- package/lib/components/Sidebar/Sidebar.js +3 -2
- package/lib/components/SkipContent/SkipContent.d.ts +2 -0
- package/lib/components/SkipContent/SkipContent.js +68 -0
- package/lib/components/SkipContent/variables.d.ts +1 -0
- package/lib/components/SkipContent/variables.js +23 -0
- package/lib/components/Tag/Tag.d.ts +3 -1
- package/lib/components/Tag/Tag.js +54 -2
- package/lib/components/Tag/variables.js +21 -0
- package/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/components/Tooltip/Tooltip.js +26 -19
- package/lib/components/Tooltip/variables.js +17 -0
- package/lib/core/constants/catalog.d.ts +1 -0
- package/lib/core/constants/catalog.js +5 -0
- package/lib/core/constants/common.d.ts +1 -0
- package/lib/core/constants/common.js +2 -1
- package/lib/core/constants/index.d.ts +1 -0
- package/lib/core/constants/index.js +1 -0
- package/lib/core/constants/search.d.ts +1 -0
- package/lib/core/constants/search.js +2 -1
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +1 -0
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +1 -0
- package/lib/core/hooks/catalog/useCatalogEntities.d.ts +4 -0
- package/lib/core/hooks/catalog/useCatalogEntities.js +17 -0
- package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.d.ts +15 -0
- package/lib/core/hooks/catalog/useCatalogTableHeaderCellActions.js +23 -0
- package/lib/core/hooks/catalog/useCatalogTableViewRow.d.ts +11 -0
- package/lib/core/hooks/catalog/useCatalogTableViewRow.js +26 -0
- package/lib/core/hooks/index.d.ts +2 -0
- package/lib/core/hooks/index.js +2 -0
- package/lib/core/hooks/use-user-teams.d.ts +1 -0
- package/lib/core/hooks/use-user-teams.js +10 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +65 -60
- package/lib/core/types/catalog.d.ts +118 -5
- package/lib/core/types/filter.d.ts +1 -0
- package/lib/core/types/hooks.d.ts +11 -4
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/index.js +1 -0
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/telemetry.d.ts +32 -0
- package/lib/core/types/telemetry.js +3 -0
- package/lib/icons/AscSortIcon/AscSortIcon.d.ts +9 -0
- package/lib/icons/AscSortIcon/AscSortIcon.js +25 -0
- package/lib/icons/CardsIcon/CardsIcon.d.ts +9 -0
- package/lib/icons/CardsIcon/CardsIcon.js +25 -0
- package/lib/icons/CaretDownIcon/CaretDownIcon.d.ts +9 -0
- package/lib/icons/CaretDownIcon/CaretDownIcon.js +22 -0
- package/lib/icons/CaretUpIcon/CaretUpIcon.d.ts +9 -0
- package/lib/icons/CaretUpIcon/CaretUpIcon.js +22 -0
- package/lib/icons/DescSortIcon/DescSortIcon.d.ts +9 -0
- package/lib/icons/DescSortIcon/DescSortIcon.js +25 -0
- package/lib/icons/EntityTypeIcon/EntityTypeIcon.d.ts +9 -0
- package/lib/icons/EntityTypeIcon/EntityTypeIcon.js +26 -0
- package/lib/icons/GithubIcon/GithubIcon.d.ts +9 -0
- package/lib/icons/GithubIcon/GithubIcon.js +22 -0
- package/lib/icons/GraphIcon/GraphIcon.d.ts +9 -0
- package/lib/icons/GraphIcon/GraphIcon.js +22 -0
- package/lib/icons/PeopleIcon/PeopleIcon.d.ts +9 -0
- package/lib/icons/PeopleIcon/PeopleIcon.js +27 -0
- package/lib/icons/SlackIcon/SlackIcon.d.ts +9 -0
- package/lib/icons/SlackIcon/SlackIcon.js +29 -0
- package/lib/icons/SortIcon/SortIcon.d.ts +9 -0
- package/lib/icons/SortIcon/SortIcon.js +25 -0
- package/lib/icons/TableIcon/TableIcon.d.ts +9 -0
- package/lib/icons/TableIcon/TableIcon.js +22 -0
- package/lib/icons/TagsIcon/TagsIcon.d.ts +9 -0
- package/lib/icons/TagsIcon/TagsIcon.js +24 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +19 -0
- package/lib/layouts/PageLayout.js +2 -1
- package/lib/layouts/RootLayout.js +2 -0
- package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tab.js +10 -2
- package/lib/markdoc/components/Tabs/TabList.js +2 -2
- package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -1
- package/lib/markdoc/components/Tabs/Tabs.js +2 -2
- package/package.json +2 -1
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +7 -2
- package/src/components/Catalog/Catalog.tsx +235 -0
- package/src/components/Catalog/CatalogActionsRow.tsx +58 -0
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +227 -0
- package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +29 -0
- package/src/components/Catalog/CatalogEntities.tsx +107 -0
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +207 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +60 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +67 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +93 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +35 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +83 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +62 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +36 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +38 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +33 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +41 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +42 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +39 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/UserEmailProperty.tsx +31 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +97 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +80 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +92 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +127 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +41 -0
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +48 -0
- package/src/components/Catalog/CatalogHighlight.tsx +56 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +72 -0
- package/src/components/Catalog/CatalogSelector.tsx +67 -0
- package/src/components/Catalog/CatalogSortButton.tsx +78 -0
- package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +26 -0
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +77 -0
- package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +26 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +120 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +176 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +180 -0
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +28 -0
- package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +77 -0
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +83 -0
- package/src/components/Catalog/CatalogViewModeToggle.tsx +65 -0
- package/src/components/Catalog/variables.dark.ts +5 -0
- package/src/components/Catalog/variables.ts +351 -0
- package/src/components/CatalogClassic/CatalogClassicHighlight.tsx +1 -1
- package/src/components/Filter/Filter.tsx +10 -2
- package/src/components/Filter/FilterCheckboxes.tsx +8 -4
- package/src/components/Filter/FilterContent.tsx +21 -5
- package/src/components/Filter/FilterInput.tsx +16 -4
- package/src/components/Filter/FilterSelect.tsx +8 -4
- package/src/components/LoadMore/LoadMore.tsx +38 -0
- package/src/components/Markdown/Markdown.tsx +1 -1
- package/src/components/PageNavigation/NavigationButton.tsx +68 -0
- package/src/components/PageNavigation/NextButton.tsx +20 -43
- package/src/components/PageNavigation/PageNavigation.tsx +1 -1
- package/src/components/PageNavigation/PreviousButton.tsx +20 -43
- package/src/components/Search/SearchAiConversationInput.tsx +3 -0
- package/src/components/Select/Select.tsx +5 -3
- package/src/components/Sidebar/Sidebar.tsx +1 -1
- package/src/components/SkipContent/SkipContent.tsx +47 -0
- package/src/components/SkipContent/variables.ts +20 -0
- package/src/components/Tag/Tag.tsx +67 -1
- package/src/components/Tag/variables.ts +21 -0
- package/src/components/Tooltip/Tooltip.tsx +31 -22
- package/src/components/Tooltip/variables.ts +17 -0
- package/src/core/constants/catalog.ts +1 -0
- package/src/core/constants/common.ts +1 -0
- package/src/core/constants/index.ts +1 -0
- package/src/core/constants/search.ts +2 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/catalog/useCatalogEntities.ts +16 -0
- package/src/core/hooks/catalog/useCatalogTableHeaderCellActions.ts +38 -0
- package/src/core/hooks/catalog/useCatalogTableViewRow.ts +40 -0
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/use-user-teams.ts +8 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +5 -0
- package/src/core/types/catalog.ts +143 -5
- package/src/core/types/filter.ts +1 -0
- package/src/core/types/hooks.ts +32 -5
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +22 -1
- package/src/core/types/telemetry.ts +36 -0
- package/src/core/utils/load-and-navigate.ts +5 -4
- package/src/icons/AscSortIcon/AscSortIcon.tsx +29 -0
- package/src/icons/CardsIcon/CardsIcon.tsx +38 -0
- package/src/icons/CaretDownIcon/CaretDownIcon.tsx +26 -0
- package/src/icons/CaretUpIcon/CaretUpIcon.tsx +26 -0
- package/src/icons/DescSortIcon/DescSortIcon.tsx +29 -0
- package/src/icons/EntityTypeIcon/EntityTypeIcon.tsx +49 -0
- package/src/icons/GithubIcon/GithubIcon.tsx +35 -0
- package/src/icons/GraphIcon/GraphIcon.tsx +26 -0
- package/src/icons/PeopleIcon/PeopleIcon.tsx +46 -0
- package/src/icons/SlackIcon/SlackIcon.tsx +61 -0
- package/src/icons/SortIcon/SortIcon.tsx +29 -0
- package/src/icons/TableIcon/TableIcon.tsx +26 -0
- package/src/icons/TagsIcon/TagsIcon.tsx +41 -0
- package/src/index.ts +20 -0
- package/src/layouts/PageLayout.tsx +4 -1
- package/src/layouts/RootLayout.tsx +2 -0
- package/src/markdoc/components/Tabs/Tab.tsx +12 -1
- package/src/markdoc/components/Tabs/TabList.tsx +2 -1
- package/src/markdoc/components/Tabs/Tabs.tsx +8 -3
|
@@ -7,10 +7,11 @@ exports.PageLayout = PageLayout;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const utils_1 = require("../core/utils");
|
|
10
|
+
const constants_1 = require("../core/constants");
|
|
10
11
|
function PageLayout({ sidebar, children, }) {
|
|
11
12
|
return (react_1.default.createElement(Container, { "data-component-name": "Layout/PageLayout" },
|
|
12
13
|
sidebar,
|
|
13
|
-
react_1.default.createElement(ContentContainer,
|
|
14
|
+
react_1.default.createElement(ContentContainer, { id: constants_1.CONTENT_ID, tabIndex: 0 }, children)));
|
|
14
15
|
}
|
|
15
16
|
const Container = styled_components_1.default.div `
|
|
16
17
|
display: flex;
|
|
@@ -7,8 +7,10 @@ exports.RootLayout = RootLayout;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Navbar_1 = require("../components/Navbar/Navbar");
|
|
9
9
|
const Footer_1 = require("../components/Footer/Footer");
|
|
10
|
+
const SkipContent_1 = require("../components/SkipContent/SkipContent");
|
|
10
11
|
function RootLayout({ children }) {
|
|
11
12
|
return (react_1.default.createElement("div", { "data-component-name": "layouts/RootLayout" },
|
|
13
|
+
react_1.default.createElement(SkipContent_1.SkipContent, null),
|
|
12
14
|
react_1.default.createElement(Navbar_1.Navbar, null),
|
|
13
15
|
children,
|
|
14
16
|
react_1.default.createElement(Footer_1.Footer, null)));
|
|
@@ -9,6 +9,7 @@ export type TabProps = {
|
|
|
9
9
|
setRef: (element: HTMLButtonElement | null) => void;
|
|
10
10
|
onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
11
|
onClick: () => void;
|
|
12
|
+
icon?: React.ReactNode;
|
|
12
13
|
};
|
|
13
|
-
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, }: TabProps): JSX.Element;
|
|
14
|
+
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }: TabProps): JSX.Element;
|
|
14
15
|
export declare const Tab: import("styled-components").StyledComponent<typeof TabComponent, any, {}, never>;
|
|
@@ -8,9 +8,17 @@ exports.TabComponent = TabComponent;
|
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
10
|
const TabList_1 = require("../../../markdoc/components/Tabs/TabList");
|
|
11
|
-
function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, }) {
|
|
11
|
+
function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }) {
|
|
12
12
|
return (react_1.default.createElement(TabList_1.TabItem, { "data-component-name": "Markdoc/Tabs/Tab", size: size, tabIndex: 0 },
|
|
13
|
-
react_1.default.createElement(TabList_1.TabButtonLink, { id: `tab-${tabId}`, role: "tab", "aria-selected": "false", "aria-controls": `panel-${tabId}`, tabIndex: -1, size: size, disabled: disabled, ref: setRef, onKeyDown: onKeyDown, onClick: onClick },
|
|
13
|
+
react_1.default.createElement(TabList_1.TabButtonLink, { id: `tab-${tabId}`, role: "tab", "aria-selected": "false", "aria-controls": `panel-${tabId}`, tabIndex: -1, size: size, disabled: disabled, ref: setRef, onKeyDown: onKeyDown, onClick: onClick },
|
|
14
|
+
react_1.default.createElement(LabelWrapper, null,
|
|
15
|
+
icon,
|
|
16
|
+
label))));
|
|
14
17
|
}
|
|
18
|
+
const LabelWrapper = styled_components_1.default.div `
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 4px;
|
|
22
|
+
`;
|
|
15
23
|
exports.Tab = (0, styled_components_1.default)(TabComponent) ``;
|
|
16
24
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -42,9 +42,9 @@ function TabList({ childrenArray, size, overflowTabs, visibleTabs, setTabRef, on
|
|
|
42
42
|
childrenArray.map((child, index) => {
|
|
43
43
|
if (!visibleTabs.includes(index))
|
|
44
44
|
return null;
|
|
45
|
-
const { label } = child.props;
|
|
45
|
+
const { label, icon } = child.props;
|
|
46
46
|
const tabId = getTabId(label, index);
|
|
47
|
-
return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, size: size, disabled: child.props.disable, setRef: (el) => {
|
|
47
|
+
return (react_1.default.createElement(Tab_1.Tab, { key: `key-${tabId}`, tabId: tabId, label: label, icon: icon, size: size, disabled: child.props.disable, setRef: (el) => {
|
|
48
48
|
setTabRef(el, index);
|
|
49
49
|
if (el) {
|
|
50
50
|
el.setAttribute('data-label', label);
|
|
@@ -9,12 +9,14 @@ export type TabItemProps = {
|
|
|
9
9
|
disable?: boolean;
|
|
10
10
|
onClick?: () => void;
|
|
11
11
|
children: React.ReactNode;
|
|
12
|
+
icon?: React.ReactNode;
|
|
12
13
|
};
|
|
13
14
|
type TabsProps = {
|
|
14
15
|
children: React.ReactElement<TabItemProps>[];
|
|
15
16
|
className?: string;
|
|
16
17
|
size: TabsSize;
|
|
18
|
+
forceReady?: boolean;
|
|
17
19
|
};
|
|
18
|
-
export declare function Tabs({ children, className, size }: TabsProps): JSX.Element;
|
|
20
|
+
export declare function Tabs({ children, className, size, forceReady }: TabsProps): JSX.Element;
|
|
19
21
|
export declare const TabContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
22
|
export {};
|
|
@@ -34,7 +34,7 @@ var TabsSize;
|
|
|
34
34
|
TabsSize["SMALL"] = "small";
|
|
35
35
|
TabsSize["MEDIUM"] = "medium";
|
|
36
36
|
})(TabsSize || (exports.TabsSize = TabsSize = {}));
|
|
37
|
-
function Tabs({ children, className, size }) {
|
|
37
|
+
function Tabs({ children, className, size, forceReady = false }) {
|
|
38
38
|
var _a, _b;
|
|
39
39
|
const [childrenArray, setChildrenArray] = (0, react_1.useState)(react_1.default.Children.toArray(children));
|
|
40
40
|
(0, react_1.useEffect)(() => {
|
|
@@ -111,7 +111,7 @@ function Tabs({ children, className, size }) {
|
|
|
111
111
|
setIsAnimating(false);
|
|
112
112
|
}
|
|
113
113
|
}, [activeTab, prevTab, childrenArray, visibleTabs, overflowTabs]);
|
|
114
|
-
return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, isReady: ready },
|
|
114
|
+
return (react_1.default.createElement(TabsContainer, { "data-component-name": "Markdoc/Tabs/Tabs", className: className, isReady: ready || forceReady },
|
|
115
115
|
react_1.default.createElement(TabList_1.TabList, { size: size, childrenArray: childrenArray, overflowTabs: overflowTabs, setTabRef: setTabRef, onTabClick: onTabClick, handleKeyboard: handleKeyboard, getTabId: getTabId, activeTab: activeTab, isAnimating: isAnimating, highlightStyle: highlightStyle, visibleTabs: visibleTabs, allTabsHidden: allTabsHidden, tabsContainerRef: tabsContainerRef }),
|
|
116
116
|
childrenArray.map((child, index) => {
|
|
117
117
|
const { label } = child.props;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.55.0-next.
|
|
3
|
+
"version": "0.55.0-next.9",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"webpack": "5.94.0"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
+
"@tanstack/react-query": "5.62.3",
|
|
79
80
|
"@tanstack/react-virtual": "3.13.0",
|
|
80
81
|
"copy-to-clipboard": "3.3.3",
|
|
81
82
|
"file-saver": "2.0.5",
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { BreadcrumbItem } from '@redocly/config';
|
|
3
4
|
|
|
4
5
|
import type { JSX } from 'react';
|
|
5
6
|
|
|
6
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
8
|
import { Breadcrumb } from '@redocly/theme/components/Breadcrumbs/Breadcrumb';
|
|
8
9
|
|
|
9
|
-
export function Breadcrumbs(props: {
|
|
10
|
+
export function Breadcrumbs(props: {
|
|
11
|
+
className?: string;
|
|
12
|
+
additionalBreadcrumbs?: BreadcrumbItem[];
|
|
13
|
+
}): JSX.Element | null {
|
|
10
14
|
const { useBreadcrumbs, useTelemetry } = useThemeHooks();
|
|
15
|
+
const fileBreadcrumbs = useBreadcrumbs();
|
|
16
|
+
const breadcrumbs = [...fileBreadcrumbs, ...(props.additionalBreadcrumbs || [])];
|
|
11
17
|
const telemetry = useTelemetry();
|
|
12
|
-
const breadcrumbs = useBreadcrumbs();
|
|
13
18
|
|
|
14
19
|
if (breadcrumbs.length === 0) {
|
|
15
20
|
return null;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { CatalogEntityConfig } from '@redocly/config';
|
|
4
|
+
|
|
5
|
+
import { BffCatalogEntityList } from '@redocly/theme/core/types';
|
|
6
|
+
import { breakpoints } from '@redocly/theme/core/utils';
|
|
7
|
+
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
|
+
import { H3 } from '@redocly/theme/components/Typography/H3';
|
|
9
|
+
import { FilterContent } from '@redocly/theme/components/Filter/FilterContent';
|
|
10
|
+
import { Sidebar, SidebarHeader } from '@redocly/theme/components/Sidebar/Sidebar';
|
|
11
|
+
import { CatalogSwitcherItem } from '@redocly/theme/core';
|
|
12
|
+
import { CatalogSelector } from '@redocly/theme/components/Catalog/CatalogSelector';
|
|
13
|
+
import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
|
|
14
|
+
import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
|
|
15
|
+
import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
|
|
16
|
+
import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
|
|
17
|
+
import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
|
|
18
|
+
import { CatalogEntities } from '@redocly/theme/components/Catalog/CatalogEntities';
|
|
19
|
+
|
|
20
|
+
export type CatalogProps = {
|
|
21
|
+
catalogConfig: CatalogEntityConfig;
|
|
22
|
+
entitiesTypes: string[];
|
|
23
|
+
initialEntitiesList?: BffCatalogEntityList;
|
|
24
|
+
catalogSwitcherItems: CatalogSwitcherItem[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function Catalog(props: CatalogProps): JSX.Element {
|
|
28
|
+
const { catalogConfig, entitiesTypes, initialEntitiesList, catalogSwitcherItems } = props;
|
|
29
|
+
|
|
30
|
+
const { useTranslate, useCatalog } = useThemeHooks();
|
|
31
|
+
|
|
32
|
+
const { translate } = useTranslate();
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
filters,
|
|
36
|
+
searchQuery,
|
|
37
|
+
setSearchQuery,
|
|
38
|
+
filterQuery,
|
|
39
|
+
sortOption,
|
|
40
|
+
setSortOption,
|
|
41
|
+
handleSortClick,
|
|
42
|
+
isColumnSorted,
|
|
43
|
+
viewMode,
|
|
44
|
+
setViewMode,
|
|
45
|
+
entitiesCounter,
|
|
46
|
+
setEntitiesCounter,
|
|
47
|
+
onChangeViewClick,
|
|
48
|
+
onChangeCollapseSidebarClick,
|
|
49
|
+
layout,
|
|
50
|
+
collapsedSidebar,
|
|
51
|
+
} = useCatalog(catalogConfig, initialEntitiesList?.page.total || 0);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<CatalogPageWrapper data-component-name="Catalog/Catalog">
|
|
56
|
+
<FiltersSidebar
|
|
57
|
+
collapsed={collapsedSidebar}
|
|
58
|
+
header={
|
|
59
|
+
collapsedSidebar ? null : (
|
|
60
|
+
<CatalogSelector
|
|
61
|
+
catalogSwitcherItems={catalogSwitcherItems}
|
|
62
|
+
setSearchQuery={setSearchQuery}
|
|
63
|
+
setSortOption={setSortOption}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
menu={
|
|
68
|
+
<FilterContent
|
|
69
|
+
setFilterTerm={setSearchQuery}
|
|
70
|
+
filters={filters}
|
|
71
|
+
filterTerm={searchQuery}
|
|
72
|
+
hideSearch={true}
|
|
73
|
+
showCounter={false}
|
|
74
|
+
filterValuesCasing="sentence"
|
|
75
|
+
/>
|
|
76
|
+
}
|
|
77
|
+
footer={
|
|
78
|
+
<SidebarActions
|
|
79
|
+
layout={layout}
|
|
80
|
+
collapsedSidebar={collapsedSidebar}
|
|
81
|
+
isApiDocs={false}
|
|
82
|
+
onChangeViewClick={onChangeViewClick}
|
|
83
|
+
onChangeCollapseSidebarClick={onChangeCollapseSidebarClick}
|
|
84
|
+
/>
|
|
85
|
+
}
|
|
86
|
+
/>
|
|
87
|
+
<CatalogPageContent>
|
|
88
|
+
<CatalogPageDescription>
|
|
89
|
+
<CatalogTitleWrapper>
|
|
90
|
+
<CatalogTitle data-translation-key={catalogConfig?.titleTranslationKey}>
|
|
91
|
+
{translate(catalogConfig?.titleTranslationKey)}{' '}
|
|
92
|
+
</CatalogTitle>
|
|
93
|
+
<CounterTag borderless>{entitiesCounter}</CounterTag>
|
|
94
|
+
</CatalogTitleWrapper>
|
|
95
|
+
<CatalogDescription data-translation-key={catalogConfig?.descriptionTranslationKey}>
|
|
96
|
+
{translate(catalogConfig?.descriptionTranslationKey)}
|
|
97
|
+
</CatalogDescription>
|
|
98
|
+
</CatalogPageDescription>
|
|
99
|
+
|
|
100
|
+
<CatalogActionsRow>
|
|
101
|
+
<CatalogSearchInputWrapper>
|
|
102
|
+
<FilterInput
|
|
103
|
+
value={searchQuery}
|
|
104
|
+
onChange={(updatedTerm) => setSearchQuery(updatedTerm)}
|
|
105
|
+
/>
|
|
106
|
+
</CatalogSearchInputWrapper>
|
|
107
|
+
|
|
108
|
+
<CatalogControlsWrapper>
|
|
109
|
+
<CatalogSortButton onSortChange={setSortOption} currentSort={sortOption} />
|
|
110
|
+
<CatalogViewModeToggle viewMode={viewMode} onViewModeChange={setViewMode} />
|
|
111
|
+
</CatalogControlsWrapper>
|
|
112
|
+
</CatalogActionsRow>
|
|
113
|
+
|
|
114
|
+
<CatalogEntities
|
|
115
|
+
catalogConfig={catalogConfig}
|
|
116
|
+
excludedEntities={catalogConfig?.excludes}
|
|
117
|
+
filterQuery={filterQuery}
|
|
118
|
+
entitiesTypes={entitiesTypes}
|
|
119
|
+
sortOption={sortOption}
|
|
120
|
+
searchQuery={searchQuery}
|
|
121
|
+
viewMode={viewMode}
|
|
122
|
+
setEntitiesCounter={setEntitiesCounter}
|
|
123
|
+
initialEntitiesList={initialEntitiesList}
|
|
124
|
+
setSortOption={setSortOption}
|
|
125
|
+
handleSortClick={handleSortClick}
|
|
126
|
+
isColumnSorted={isColumnSorted}
|
|
127
|
+
/>
|
|
128
|
+
</CatalogPageContent>
|
|
129
|
+
</CatalogPageWrapper>
|
|
130
|
+
</>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const CatalogActionsRow = styled.div`
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
`;
|
|
138
|
+
|
|
139
|
+
const CatalogControlsWrapper = styled.div`
|
|
140
|
+
display: var(--catalog-controls-wrapper-display);
|
|
141
|
+
align-items: var(--catalog-controls-wrapper-align-items);
|
|
142
|
+
margin-left: var(--catalog-controls-wrapper-margin-left);
|
|
143
|
+
gap: var(--catalog-controls-wrapper-gap);
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
const CatalogPageContent = styled.main`
|
|
147
|
+
flex: 1;
|
|
148
|
+
width: var(--catalog-page-content-width-mobile);
|
|
149
|
+
margin: var(--catalog-page-content-margin-mobile);
|
|
150
|
+
|
|
151
|
+
@media screen and (min-width: ${breakpoints.medium}) {
|
|
152
|
+
width: var(--catalog-page-content-width-desktop);
|
|
153
|
+
padding: var(--catalog-page-padding);
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
|
|
157
|
+
const CatalogTitleWrapper = styled.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
color: var(--catalog-title-text-color);
|
|
161
|
+
font-weight: var(--catalog-title-font-weight) !important;
|
|
162
|
+
font-size: var(--catalog-title-font-size);
|
|
163
|
+
`;
|
|
164
|
+
|
|
165
|
+
const CatalogTitle = styled(H3)`
|
|
166
|
+
color: var(--catalog-title-text-color);
|
|
167
|
+
font-weight: var(--catalog-title-font-weight) !important;
|
|
168
|
+
font-size: var(--catalog-title-font-size);
|
|
169
|
+
margin: var(--catalog-title-margin);
|
|
170
|
+
margin-right: var(--catalog-title-spacing-right);
|
|
171
|
+
`;
|
|
172
|
+
|
|
173
|
+
const CatalogDescription = styled.p`
|
|
174
|
+
color: var(--catalog-description-text-color);
|
|
175
|
+
font-weight: var(--catalog-description-font-weight);
|
|
176
|
+
font-size: var(--catalog-description-font-size);
|
|
177
|
+
margin: var(--catalog-description-margin);
|
|
178
|
+
line-height: var(--catalog-description-line-height);
|
|
179
|
+
`;
|
|
180
|
+
|
|
181
|
+
const CatalogPageWrapper = styled.div`
|
|
182
|
+
--sidebar-width: var(--catalog-sidebar-width);
|
|
183
|
+
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
186
|
+
|
|
187
|
+
font-weight: var(--catalog-page-wrapper-font-weight);
|
|
188
|
+
color: var(--catalog-page-wrapper-text-color);
|
|
189
|
+
font-size: var(--catalog-page-wrapper-font-size);
|
|
190
|
+
font-family: var(--catalog-page-wrapper-font-family);
|
|
191
|
+
line-height: var(--catalog-page-wrapper-line-height);
|
|
192
|
+
|
|
193
|
+
hr {
|
|
194
|
+
border: 0;
|
|
195
|
+
width: var(--catalog-hr-width);
|
|
196
|
+
margin: var(--catalog-hr-margin);
|
|
197
|
+
border-top: var(--catalog-hr-border-width) solid var(--catalog-hr-border-color);
|
|
198
|
+
}
|
|
199
|
+
a:not([role='button']) {
|
|
200
|
+
text-decoration: var(--catalog-link-text-decoration);
|
|
201
|
+
color: var(--catalog-link-color);
|
|
202
|
+
font-weight: var(--catalog-link-font-weight);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@media screen and (min-width: ${breakpoints.medium}) {
|
|
206
|
+
flex-direction: row;
|
|
207
|
+
padding: 0;
|
|
208
|
+
}
|
|
209
|
+
`;
|
|
210
|
+
|
|
211
|
+
const CatalogPageDescription = styled.div`
|
|
212
|
+
margin: var(--catalog-heading-margin);
|
|
213
|
+
display: var(--catalog-page-description-display-mobile);
|
|
214
|
+
|
|
215
|
+
@media screen and (min-width: ${breakpoints.medium}) {
|
|
216
|
+
display: var(--catalog-page-description-display-desktop);
|
|
217
|
+
}
|
|
218
|
+
`;
|
|
219
|
+
|
|
220
|
+
const FiltersSidebar = styled(Sidebar)`
|
|
221
|
+
display: var(--catalog-sidebar-display-mobile);
|
|
222
|
+
|
|
223
|
+
@media screen and (min-width: ${breakpoints.medium}) {
|
|
224
|
+
display: var(--catalog-sidebar-display-desktop);
|
|
225
|
+
}
|
|
226
|
+
--menu-container-padding-top: var(--catalog-sidebar-menu-container-padding-top);
|
|
227
|
+
|
|
228
|
+
${SidebarHeader} {
|
|
229
|
+
border: none;
|
|
230
|
+
}
|
|
231
|
+
`;
|
|
232
|
+
|
|
233
|
+
const CatalogSearchInputWrapper = styled.div`
|
|
234
|
+
width: var(--catalog-search-input-wrapper-width);
|
|
235
|
+
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { SortOption, CatalogViewMode } from '@redocly/theme/core/types';
|
|
5
|
+
import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
|
|
6
|
+
import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
|
|
7
|
+
import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
|
|
8
|
+
|
|
9
|
+
export type CatalogActionsRowProps = {
|
|
10
|
+
searchQuery: string;
|
|
11
|
+
setSearchQuery: (updatedTerm: string) => void;
|
|
12
|
+
sortOption: SortOption | null;
|
|
13
|
+
setSortOption: (option: SortOption | null) => void;
|
|
14
|
+
viewMode?: CatalogViewMode;
|
|
15
|
+
onViewModeChange?: (mode: CatalogViewMode) => void;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function CatalogActionsRow({
|
|
20
|
+
searchQuery,
|
|
21
|
+
setSearchQuery,
|
|
22
|
+
sortOption,
|
|
23
|
+
setSortOption,
|
|
24
|
+
viewMode,
|
|
25
|
+
onViewModeChange,
|
|
26
|
+
style,
|
|
27
|
+
}: CatalogActionsRowProps): JSX.Element {
|
|
28
|
+
return (
|
|
29
|
+
<CatalogActionsRowWrapper style={style}>
|
|
30
|
+
<CatalogSearchInputWrapper>
|
|
31
|
+
<FilterInput value={searchQuery} onChange={(updatedTerm) => setSearchQuery(updatedTerm)} />
|
|
32
|
+
</CatalogSearchInputWrapper>
|
|
33
|
+
|
|
34
|
+
<CatalogControlsWrapper>
|
|
35
|
+
<CatalogSortButton onSortChange={setSortOption} currentSort={sortOption} />
|
|
36
|
+
{viewMode && onViewModeChange && (
|
|
37
|
+
<CatalogViewModeToggle viewMode={viewMode} onViewModeChange={onViewModeChange} />
|
|
38
|
+
)}
|
|
39
|
+
</CatalogControlsWrapper>
|
|
40
|
+
</CatalogActionsRowWrapper>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const CatalogActionsRowWrapper = styled.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export const CatalogControlsWrapper = styled.div`
|
|
50
|
+
display: var(--catalog-controls-wrapper-display);
|
|
51
|
+
align-items: var(--catalog-controls-wrapper-align-items);
|
|
52
|
+
margin-left: var(--catalog-controls-wrapper-margin-left);
|
|
53
|
+
gap: var(--catalog-controls-wrapper-gap);
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const CatalogSearchInputWrapper = styled.div`
|
|
57
|
+
width: var(--catalog-search-input-wrapper-width);
|
|
58
|
+
`;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { CatalogEntityConfig } from '@redocly/config';
|
|
4
|
+
|
|
5
|
+
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
|
+
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
|
+
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
8
|
+
import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
|
|
9
|
+
import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
|
|
10
|
+
import { ArrowUpRightIcon } from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
|
|
11
|
+
import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
|
|
12
|
+
import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
|
|
13
|
+
import { getPathPrefix } from '@redocly/theme/core';
|
|
14
|
+
|
|
15
|
+
export type CatalogCardProps = {
|
|
16
|
+
entity: BffCatalogEntity;
|
|
17
|
+
catalogConfig: CatalogEntityConfig;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.Element {
|
|
21
|
+
const { useTelemetry } = useThemeHooks();
|
|
22
|
+
const telemetry = useTelemetry();
|
|
23
|
+
const pathPrefix = getPathPrefix();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<CatalogCardWrapper
|
|
27
|
+
data-component-name="Catalog/CatalogCardView/CatalogCard"
|
|
28
|
+
onClick={() => {
|
|
29
|
+
window.location.assign(
|
|
30
|
+
`${pathPrefix}/catalogs/${catalogConfig.slug}/entities/${entity.key}`,
|
|
31
|
+
);
|
|
32
|
+
telemetry.send({ type: 'catalog_item.clicked' });
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<CardContent>
|
|
36
|
+
<CardHeader>
|
|
37
|
+
<HeaderIconWrapper>
|
|
38
|
+
<CatalogEntityIcon entityType={entity.type} />
|
|
39
|
+
</HeaderIconWrapper>
|
|
40
|
+
<CardTitle>
|
|
41
|
+
<CatalogHighlight>{entity.title}</CatalogHighlight>
|
|
42
|
+
</CardTitle>
|
|
43
|
+
</CardHeader>
|
|
44
|
+
|
|
45
|
+
<CardDescription>
|
|
46
|
+
<CatalogHighlight>{entity.summary ?? ''}</CatalogHighlight>
|
|
47
|
+
</CardDescription>
|
|
48
|
+
|
|
49
|
+
<CardMetadataSection>
|
|
50
|
+
<MetadataColumn>
|
|
51
|
+
<MetadataLabel>Domains:</MetadataLabel>
|
|
52
|
+
<CatalogTagsWithTooltip
|
|
53
|
+
items={entity.domains?.map((domain) => domain.title) || []}
|
|
54
|
+
tagProps={{
|
|
55
|
+
style: {
|
|
56
|
+
fontSize: 'var(--catalog-card-font-size)',
|
|
57
|
+
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
58
|
+
},
|
|
59
|
+
icon: <GraphIcon color="var(--color-green-8)" />,
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
</MetadataColumn>
|
|
63
|
+
|
|
64
|
+
<MetadataColumn>
|
|
65
|
+
<MetadataLabel>Owners:</MetadataLabel>
|
|
66
|
+
<CatalogTagsWithTooltip
|
|
67
|
+
items={entity.owners?.map((owner) => owner.key) || []}
|
|
68
|
+
tagProps={{
|
|
69
|
+
style: {
|
|
70
|
+
fontSize: 'var(--catalog-card-font-size)',
|
|
71
|
+
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
72
|
+
borderRadius: 'var(--border-radius-xl)',
|
|
73
|
+
},
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
</MetadataColumn>
|
|
77
|
+
</CardMetadataSection>
|
|
78
|
+
</CardContent>
|
|
79
|
+
|
|
80
|
+
<Divider />
|
|
81
|
+
|
|
82
|
+
<CardFooter>
|
|
83
|
+
<CatalogTagsWithTooltip
|
|
84
|
+
items={entity.tags || []}
|
|
85
|
+
tagProps={{
|
|
86
|
+
style: {
|
|
87
|
+
fontSize: 'var(--catalog-card-font-size)',
|
|
88
|
+
borderRadius: 'var(--border-radius)',
|
|
89
|
+
},
|
|
90
|
+
borderless: true,
|
|
91
|
+
color: 'grey',
|
|
92
|
+
}}
|
|
93
|
+
itemsToShow={3}
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<ArrowCircle>
|
|
97
|
+
<ArrowRightIcon size="16px" />
|
|
98
|
+
<ArrowUpRightIcon size="16px" />
|
|
99
|
+
</ArrowCircle>
|
|
100
|
+
</CardFooter>
|
|
101
|
+
</CatalogCardWrapper>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const HeaderIconWrapper = styled.div`
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: var(--catalog-card-icon-width);
|
|
110
|
+
height: var(--catalog-card-icon-height);
|
|
111
|
+
border-radius: var(--catalog-card-icon-border-radius);
|
|
112
|
+
background-color: var(--catalog-card-icon-bg-color);
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
border: var(--catalog-card-icon-border-width) solid var(--catalog-card-icon-border-color);
|
|
115
|
+
margin-right: var(--catalog-card-icon-margin-right);
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
const CardHeader = styled.div`
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
`;
|
|
122
|
+
|
|
123
|
+
const MetadataLabel = styled.div`
|
|
124
|
+
font-size: var(--catalog-metadata-label-font-size);
|
|
125
|
+
font-weight: var(--catalog-metadata-label-font-weight);
|
|
126
|
+
color: var(--catalog-metadata-label-color);
|
|
127
|
+
margin-bottom: var(--catalog-metadata-label-margin-bottom);
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
const CardMetadataSection = styled.div`
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
margin-top: var(--catalog-metadata-section-margin-top);
|
|
134
|
+
gap: var(--catalog-metadata-section-gap);
|
|
135
|
+
width: 100%;
|
|
136
|
+
`;
|
|
137
|
+
|
|
138
|
+
const MetadataColumn = styled.div`
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
flex: 1;
|
|
142
|
+
width: calc(50% - var(--catalog-metadata-column-half-gap)); /* 50% minus half the gap */
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
const ArrowCircle = styled.div`
|
|
146
|
+
width: var(--catalog-arrow-circle-size);
|
|
147
|
+
height: var(--catalog-arrow-circle-size);
|
|
148
|
+
border-radius: var(--catalog-arrow-circle-radius);
|
|
149
|
+
background-color: var(--catalog-arrow-circle-bg-color);
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
position: relative;
|
|
154
|
+
|
|
155
|
+
${ArrowRightIcon}, ${ArrowUpRightIcon} {
|
|
156
|
+
position: absolute;
|
|
157
|
+
transition: opacity 0.2s ease-in-out;
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
const CardContent = styled.div`
|
|
162
|
+
padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
|
|
163
|
+
`;
|
|
164
|
+
|
|
165
|
+
const CardFooter = styled.div`
|
|
166
|
+
display: flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
justify-content: space-between;
|
|
169
|
+
padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
const Divider = styled.div`
|
|
173
|
+
width: 100%;
|
|
174
|
+
height: 1px;
|
|
175
|
+
background-color: var(--catalog-card-divider-color);
|
|
176
|
+
`;
|
|
177
|
+
|
|
178
|
+
const CatalogCardWrapper = styled.div`
|
|
179
|
+
min-height: var(--catalog-card-min-height);
|
|
180
|
+
height: 100%;
|
|
181
|
+
color: var(--catalog-card-text-color);
|
|
182
|
+
font-size: var(--catalog-card-font-size);
|
|
183
|
+
font-weight: var(--catalog-card-font-weight);
|
|
184
|
+
background-color: var(--catalog-card-bg-color);
|
|
185
|
+
border: var(--catalog-card-border-width) var(--catalog-card-border-style)
|
|
186
|
+
var(--catalog-card-border-color);
|
|
187
|
+
transition: all 0.2s ease-in-out;
|
|
188
|
+
border-radius: var(--catalog-card-border-radius);
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
${ArrowRightIcon} {
|
|
193
|
+
opacity: 1;
|
|
194
|
+
}
|
|
195
|
+
${ArrowUpRightIcon} {
|
|
196
|
+
opacity: 0;
|
|
197
|
+
}
|
|
198
|
+
&:hover {
|
|
199
|
+
${ArrowRightIcon} {
|
|
200
|
+
opacity: 0;
|
|
201
|
+
}
|
|
202
|
+
${ArrowUpRightIcon} {
|
|
203
|
+
opacity: 1;
|
|
204
|
+
}
|
|
205
|
+
border-color: var(--catalog-card-border-color-hover);
|
|
206
|
+
}
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
const CardTitle = styled.div`
|
|
210
|
+
color: var(--catalog-card-title-color);
|
|
211
|
+
font-size: var(--catalog-card-title-font-size);
|
|
212
|
+
font-weight: var(--catalog-card-title-font-weight);
|
|
213
|
+
line-height: var(--catalog-card-title-line-height);
|
|
214
|
+
margin: 0;
|
|
215
|
+
`;
|
|
216
|
+
|
|
217
|
+
const CardDescription = styled.div`
|
|
218
|
+
margin-top: var(--catalog-card-description-margin-top);
|
|
219
|
+
color: var(--catalog-card-description-color);
|
|
220
|
+
font-size: var(--catalog-card-description-font-size);
|
|
221
|
+
font-weight: var(--catalog-card-description-font-weight);
|
|
222
|
+
line-height: var(--catalog-card-description-line-height);
|
|
223
|
+
white-space: nowrap;
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
text-overflow: ellipsis;
|
|
226
|
+
width: 100%;
|
|
227
|
+
`;
|