@redocly/theme 0.55.0-rc.2 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Admonition/Admonition.js +4 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -1
- package/lib/components/Button/Button.d.ts +1 -0
- 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/Dropdown/variables.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/Image/Image.js +2 -2
- 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/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +7 -3
- 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 +22 -6
- package/lib/components/Select/SelectInput.d.ts +1 -0
- package/lib/components/Select/SelectInput.js +7 -3
- package/lib/components/Select/variables.js +2 -2
- 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/components/VersionPicker/VersionPicker.js +22 -3
- package/lib/components/VersionPicker/variables.js +1 -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/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/parse-style-string.d.ts +1 -0
- package/lib/core/utils/parse-style-string.js +23 -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 -1
- package/lib/index.js +19 -1
- 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.d.ts +1 -4
- package/lib/markdoc/components/Tabs/TabList.js +18 -38
- package/lib/markdoc/components/Tabs/Tabs.d.ts +3 -1
- package/lib/markdoc/components/Tabs/Tabs.js +5 -9
- package/package.json +4 -3
- package/src/components/Admonition/Admonition.tsx +4 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +7 -2
- package/src/components/Button/Button.tsx +1 -1
- 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/Dropdown/variables.ts +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/Image/Image.tsx +5 -9
- package/src/components/LoadMore/LoadMore.tsx +38 -0
- package/src/components/Markdown/Markdown.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +11 -2
- 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 +29 -4
- package/src/components/Select/SelectInput.tsx +20 -1
- package/src/components/Select/variables.ts +2 -2
- 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/components/VersionPicker/VersionPicker.tsx +32 -2
- package/src/components/VersionPicker/variables.ts +1 -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/index.ts +1 -0
- package/src/core/utils/load-and-navigate.ts +5 -4
- package/src/core/utils/parse-style-string.ts +21 -0
- 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 -1
- 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 +40 -70
- package/src/markdoc/components/Tabs/Tabs.tsx +11 -10
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +0 -1
- package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +0 -5
- package/lib/ext/process-scorecard.d.ts +0 -5
- package/lib/ext/process-scorecard.js +0 -11
- package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +0 -1
- package/src/ext/process-scorecard.ts +0 -13
|
@@ -13,6 +13,7 @@ export type TooltipProps = {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
width?: string;
|
|
15
15
|
dataTestId?: string;
|
|
16
|
+
disabled?: boolean;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
export function TooltipComponent({
|
|
@@ -24,6 +25,7 @@ export function TooltipComponent({
|
|
|
24
25
|
className = 'default',
|
|
25
26
|
width,
|
|
26
27
|
dataTestId,
|
|
28
|
+
disabled = false,
|
|
27
29
|
}: PropsWithChildren<TooltipProps>): JSX.Element {
|
|
28
30
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
29
31
|
const { isOpened, handleOpen, handleClose } = useControl(isOpen);
|
|
@@ -33,20 +35,21 @@ export function TooltipComponent({
|
|
|
33
35
|
const isControlled = isOpen !== undefined;
|
|
34
36
|
|
|
35
37
|
useEffect(() => {
|
|
36
|
-
if (isControlled) {
|
|
38
|
+
if (isControlled && !disabled) {
|
|
37
39
|
if (isOpen) {
|
|
38
40
|
handleOpen();
|
|
39
41
|
} else {
|
|
40
42
|
handleClose();
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
}, [isOpen, isControlled, handleOpen, handleClose]);
|
|
45
|
+
}, [isOpen, isControlled, handleOpen, handleClose, disabled]);
|
|
44
46
|
|
|
45
|
-
const controllers = !isControlled &&
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const controllers = !isControlled &&
|
|
48
|
+
!disabled && {
|
|
49
|
+
onMouseEnter: handleOpen,
|
|
50
|
+
onMouseLeave: handleClose,
|
|
51
|
+
onClick: handleClose,
|
|
52
|
+
};
|
|
50
53
|
|
|
51
54
|
return (
|
|
52
55
|
<TooltipWrapper
|
|
@@ -56,7 +59,7 @@ export function TooltipComponent({
|
|
|
56
59
|
data-component-name="Tooltip/Tooltip"
|
|
57
60
|
>
|
|
58
61
|
{children}
|
|
59
|
-
{isOpened && (
|
|
62
|
+
{isOpened && !disabled && (
|
|
60
63
|
<TooltipBody
|
|
61
64
|
data-testid={dataTestId || (typeof tip === 'string' ? tip : '')}
|
|
62
65
|
placement={placement}
|
|
@@ -83,10 +86,11 @@ const PLACEMENTS = {
|
|
|
83
86
|
withArrow &&
|
|
84
87
|
css`
|
|
85
88
|
&::after {
|
|
86
|
-
border-left:
|
|
87
|
-
border-right:
|
|
88
|
-
border-top-width:
|
|
89
|
+
border-left: 6px solid transparent;
|
|
90
|
+
border-right: 6px solid transparent;
|
|
91
|
+
border-top-width: 8px;
|
|
89
92
|
border-top-style: solid;
|
|
93
|
+
border-radius: 2px 2px 0 0;
|
|
90
94
|
bottom: 0;
|
|
91
95
|
left: 50%;
|
|
92
96
|
transform: translate(-50%, 99%);
|
|
@@ -103,10 +107,11 @@ const PLACEMENTS = {
|
|
|
103
107
|
withArrow &&
|
|
104
108
|
css`
|
|
105
109
|
&::after {
|
|
106
|
-
border-left:
|
|
107
|
-
border-right:
|
|
108
|
-
border-bottom-width:
|
|
110
|
+
border-left: 6px solid transparent;
|
|
111
|
+
border-right: 6px solid transparent;
|
|
112
|
+
border-bottom-width: 8px;
|
|
109
113
|
border-bottom-style: solid;
|
|
114
|
+
border-radius: 0 0 2px 2px;
|
|
110
115
|
top: 0;
|
|
111
116
|
left: 50%;
|
|
112
117
|
transform: translate(-50%, -99%);
|
|
@@ -123,10 +128,11 @@ const PLACEMENTS = {
|
|
|
123
128
|
withArrow &&
|
|
124
129
|
css`
|
|
125
130
|
&::after {
|
|
126
|
-
border-top:
|
|
127
|
-
border-bottom:
|
|
128
|
-
border-left-width:
|
|
131
|
+
border-top: 6px solid transparent;
|
|
132
|
+
border-bottom: 6px solid transparent;
|
|
133
|
+
border-left-width: 8px;
|
|
129
134
|
border-left-style: solid;
|
|
135
|
+
border-radius: 2px 0 0 2px;
|
|
130
136
|
top: 50%;
|
|
131
137
|
right: 0;
|
|
132
138
|
transform: translate(99%, -50%);
|
|
@@ -143,10 +149,11 @@ const PLACEMENTS = {
|
|
|
143
149
|
withArrow &&
|
|
144
150
|
css`
|
|
145
151
|
&::after {
|
|
146
|
-
border-top:
|
|
147
|
-
border-bottom:
|
|
148
|
-
border-right-width:
|
|
152
|
+
border-top: 6px solid transparent;
|
|
153
|
+
border-bottom: 6px solid transparent;
|
|
154
|
+
border-right-width: 8px;
|
|
149
155
|
border-right-style: solid;
|
|
156
|
+
border-radius: 0 2px 2px 0;
|
|
150
157
|
top: 50%;
|
|
151
158
|
left: 0;
|
|
152
159
|
transform: translate(-99%, -50%);
|
|
@@ -173,7 +180,7 @@ const TooltipBody = styled.span<
|
|
|
173
180
|
white-space: normal;
|
|
174
181
|
overflow-wrap: break-word;
|
|
175
182
|
|
|
176
|
-
border-radius: var(--border-radius);
|
|
183
|
+
border-radius: var(--border-radius-md);
|
|
177
184
|
transition: opacity 0.3s ease-out;
|
|
178
185
|
|
|
179
186
|
font-size: 13px;
|
|
@@ -187,11 +194,13 @@ const TooltipBody = styled.span<
|
|
|
187
194
|
display: inline-block;
|
|
188
195
|
width: 0;
|
|
189
196
|
height: 0;
|
|
190
|
-
border-color: var(--tooltip-bg-color);
|
|
197
|
+
border-color: var(--tooltip-arrow-color, var(--tooltip-bg-color));
|
|
191
198
|
}
|
|
192
199
|
|
|
193
200
|
background: var(--tooltip-bg-color);
|
|
194
201
|
color: var(--tooltip-text-color);
|
|
202
|
+
border: var(--tooltip-border-width, 0) var(--tooltip-border-style, solid)
|
|
203
|
+
var(--tooltip-border-color, transparent);
|
|
195
204
|
box-shadow: rgb(0 0 0 / 25%) 0 2px 4px;
|
|
196
205
|
|
|
197
206
|
width: ${({ width }) => width || '120px'};
|
|
@@ -8,6 +8,10 @@ export const tooltip = css`
|
|
|
8
8
|
|
|
9
9
|
--tooltip-text-color: var(--text-color-secondary);
|
|
10
10
|
--tooltip-bg-color: var(--bg-color-raised);
|
|
11
|
+
--tooltip-arrow-color: var(--tooltip-bg-color);
|
|
12
|
+
--tooltip-border-width: 0;
|
|
13
|
+
--tooltip-border-style: solid;
|
|
14
|
+
--tooltip-border-color: transparent;
|
|
11
15
|
--tooltip-padding-vertical: var(--spacing-xs);
|
|
12
16
|
--tooltip-padding-horizontal: var(--spacing-sm);
|
|
13
17
|
--tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
|
|
@@ -16,6 +20,19 @@ export const tooltip = css`
|
|
|
16
20
|
.tooltip-copy-button {
|
|
17
21
|
--tooltip-text-color: var(--text-color-secondary);
|
|
18
22
|
--tooltip-bg-color: var(--bg-color-raised);
|
|
23
|
+
--tooltip-arrow-color: var(--tooltip-bg-color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tooltip-catalog {
|
|
27
|
+
--tooltip-text-color: var(--text-color-primary);
|
|
28
|
+
--tooltip-bg-color: var(--layer-color);
|
|
29
|
+
--tooltip-arrow-color: var(--border-color-secondary);
|
|
30
|
+
--tooltip-border-width: 2px;
|
|
31
|
+
--tooltip-border-color: var(--border-color-secondary);
|
|
32
|
+
--tooltip-padding-vertical: var(--spacing-xs);
|
|
33
|
+
--tooltip-padding-horizontal: var(--spacing-sm);
|
|
34
|
+
--tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
|
|
35
|
+
--tooltip-max-width: 300px;
|
|
19
36
|
}
|
|
20
37
|
|
|
21
38
|
// @tokens End
|
|
@@ -35,8 +35,15 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
|
|
|
35
35
|
if (!options.length && !versionPicker?.showForUnversioned) return null;
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<VersionsPickerWrapper
|
|
39
|
-
|
|
38
|
+
<VersionsPickerWrapper
|
|
39
|
+
data-component-name="VersionPicker/VersionPicker"
|
|
40
|
+
role="region"
|
|
41
|
+
aria-label={translate('versionPicker.label', 'Version selector')}
|
|
42
|
+
>
|
|
43
|
+
<VersionPickerLabel
|
|
44
|
+
data-translation-key="versionPicker.label"
|
|
45
|
+
htmlFor="version-picker-select"
|
|
46
|
+
>
|
|
40
47
|
{translate('versionPicker.label', 'Version:')}
|
|
41
48
|
</VersionPickerLabel>
|
|
42
49
|
<VersionPickerSelect
|
|
@@ -45,7 +52,15 @@ export function VersionPicker(props: { versions?: Version[]; onChange: (v: Versi
|
|
|
45
52
|
options={options}
|
|
46
53
|
value={value}
|
|
47
54
|
onChange={handleOnChange}
|
|
55
|
+
dataAttributes={{
|
|
56
|
+
id: 'version-picker-select',
|
|
57
|
+
'aria-describedby': 'version-picker-description',
|
|
58
|
+
'aria-label': translate('versionPicker.label', 'Select version'),
|
|
59
|
+
}}
|
|
48
60
|
/>
|
|
61
|
+
<SrOnly id="version-picker-description">
|
|
62
|
+
This is version picker select, using it you can select a version of the API.
|
|
63
|
+
</SrOnly>
|
|
49
64
|
</VersionsPickerWrapper>
|
|
50
65
|
);
|
|
51
66
|
}
|
|
@@ -72,6 +87,10 @@ export const VersionPickerSelect = styled(Select)<SelectProps>`
|
|
|
72
87
|
border-radius: var(--version-picker-input-border-radius);
|
|
73
88
|
padding: var(--version-picker-input-padding-vertical)
|
|
74
89
|
var(--version-picker-input-padding-horizontal);
|
|
90
|
+
|
|
91
|
+
&:focus-within {
|
|
92
|
+
outline: 1px solid var(--version-picker-focus-outline-color);
|
|
93
|
+
}
|
|
75
94
|
}
|
|
76
95
|
`;
|
|
77
96
|
|
|
@@ -83,4 +102,15 @@ const VersionsPickerWrapper = styled.div`
|
|
|
83
102
|
justify-content: space-between;
|
|
84
103
|
padding: var(--version-picker-padding-vertical) var(--version-picker-padding-horizontal);
|
|
85
104
|
border-bottom: var(--version-picker-border-bottom);
|
|
105
|
+
|
|
106
|
+
&:focus-visible {
|
|
107
|
+
outline: 1px solid var(--version-picker-focus-outline-color);
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
const SrOnly = styled.span`
|
|
112
|
+
position: absolute;
|
|
113
|
+
width: 0;
|
|
114
|
+
height: 0;
|
|
115
|
+
overflow: hidden;
|
|
86
116
|
`;
|
|
@@ -35,5 +35,6 @@ export const versionPicker = css`
|
|
|
35
35
|
--version-picker-list-item-bg-color-active: var(--select-list-item-bg-color-active); // @presenter Color
|
|
36
36
|
--version-picker-list-item-bg-color-hover: var(--select-list-item-bg-color-hover); // @presenter Color
|
|
37
37
|
|
|
38
|
+
--version-picker-focus-outline-color: var(--button-border-color-focused);
|
|
38
39
|
// @tokens End
|
|
39
40
|
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CATALOG_TAG_MAX_LENGTH = 15;
|
|
@@ -2,3 +2,4 @@ export * from '@redocly/theme/core/constants/common';
|
|
|
2
2
|
export * from '@redocly/theme/core/constants/environments';
|
|
3
3
|
export * from '@redocly/theme/core/constants/code-walkthrough';
|
|
4
4
|
export * from '@redocly/theme/core/constants/search';
|
|
5
|
+
export * from '@redocly/theme/core/constants/catalog';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UseCatalogEntitiesProps } from '@redocly/theme';
|
|
2
|
+
|
|
3
|
+
export function useCatalogEntities({ entitiesTypes, excludedEntities }: UseCatalogEntitiesProps) {
|
|
4
|
+
const initialTypesWithoutAll = entitiesTypes.filter((type) => type !== 'all');
|
|
5
|
+
const initialTypesFilter = entitiesTypes.length ? `type:${initialTypesWithoutAll.join(',')}` : '';
|
|
6
|
+
const initialExcludedEntitiesFilter = excludedEntities?.length
|
|
7
|
+
? `-key:${excludedEntities.map((entity) => entity.key).join(',')}`
|
|
8
|
+
: '';
|
|
9
|
+
const initialFilter = initialTypesFilter
|
|
10
|
+
? `${initialTypesFilter} AND ${initialExcludedEntitiesFilter}`
|
|
11
|
+
: initialExcludedEntitiesFilter;
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
initialFilter,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
CatalogColumn,
|
|
4
|
+
} from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
|
|
5
|
+
|
|
6
|
+
import { SortOption } from '../../types';
|
|
7
|
+
|
|
8
|
+
type CatalogTableHeaderCellActionsProps<T extends BaseEntity> = {
|
|
9
|
+
column: CatalogColumn<T>;
|
|
10
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
11
|
+
setSortOption: (sortOption: SortOption | null) => void;
|
|
12
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function useCatalogTableHeaderCellActions<T extends BaseEntity>({
|
|
16
|
+
column,
|
|
17
|
+
handleSortClick,
|
|
18
|
+
setSortOption,
|
|
19
|
+
isColumnSorted,
|
|
20
|
+
}: CatalogTableHeaderCellActionsProps<T>) {
|
|
21
|
+
const sortKey = column.sortKey;
|
|
22
|
+
const isUpActive = sortKey ? isColumnSorted(sortKey, 'desc') : false;
|
|
23
|
+
const isDownActive = sortKey ? isColumnSorted(sortKey, 'asc') : false;
|
|
24
|
+
|
|
25
|
+
const handleCellClick = (): void => {
|
|
26
|
+
if (!column.sortable || !sortKey) return;
|
|
27
|
+
|
|
28
|
+
if (isDownActive) {
|
|
29
|
+
handleSortClick(sortKey, 'desc');
|
|
30
|
+
} else if (isUpActive) {
|
|
31
|
+
setSortOption(null);
|
|
32
|
+
} else {
|
|
33
|
+
handleSortClick(sortKey, 'asc');
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return { handleCellClick, sortKey, isUpActive, isDownActive };
|
|
38
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
2
|
+
|
|
3
|
+
import { getPathPrefix } from '../../utils';
|
|
4
|
+
|
|
5
|
+
type CatalogTableViewRowProps = {
|
|
6
|
+
entityKey: string;
|
|
7
|
+
entityType: string;
|
|
8
|
+
catalogConfig: CatalogEntityConfig;
|
|
9
|
+
entitiesCatalogConfig?: EntitiesCatalogConfig;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function useCatalogTableViewRow({
|
|
13
|
+
entityKey,
|
|
14
|
+
entityType,
|
|
15
|
+
catalogConfig,
|
|
16
|
+
entitiesCatalogConfig,
|
|
17
|
+
}: CatalogTableViewRowProps) {
|
|
18
|
+
const getCatalogSpecificConfigByEntityTypeIncluded = () => {
|
|
19
|
+
if (!entitiesCatalogConfig) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return Object.values(entitiesCatalogConfig.catalogs ?? {}).find((catalog) => {
|
|
24
|
+
return catalog.includes?.some((include) => include.type === entityType);
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const getEntityDetailsLink = () => {
|
|
29
|
+
const pathPrefix = getPathPrefix();
|
|
30
|
+
const catalogSpecificConfig = getCatalogSpecificConfigByEntityTypeIncluded();
|
|
31
|
+
|
|
32
|
+
if (!catalogSpecificConfig || !entitiesCatalogConfig) {
|
|
33
|
+
return `${pathPrefix}/catalogs/${catalogConfig.slug}/entities/${entityKey}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return `${pathPrefix}/catalogs/${catalogSpecificConfig.slug}/entities/${entityKey}`;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return { getEntityDetailsLink };
|
|
40
|
+
}
|
package/src/core/hooks/index.ts
CHANGED
|
@@ -36,5 +36,7 @@ export * from '@redocly/theme/core/hooks/code-walkthrough/use-renderable-files';
|
|
|
36
36
|
export * from '@redocly/theme/core/hooks/use-element-size';
|
|
37
37
|
export * from '@redocly/theme/core/hooks/use-time-ago';
|
|
38
38
|
export * from '@redocly/theme/core/hooks/use-input-key-commands';
|
|
39
|
+
export * from '@redocly/theme/core/hooks/catalog/useCatalogEntities';
|
|
39
40
|
export * from '@redocly/theme/core/hooks/use-active-page-version';
|
|
40
41
|
export * from '@redocly/theme/core/hooks/use-page-versions';
|
|
42
|
+
export * from '@redocly/theme/core/hooks/use-user-teams';
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { tagDarkMode } from '@redocly/theme/components/Tag/variables.dark';
|
|
|
10
10
|
import { statusCodeDarkMode } from '@redocly/theme/components/StatusCode/variables.dark';
|
|
11
11
|
import { switcherDarkMode } from '@redocly/theme/components/Switch/variables.dark';
|
|
12
12
|
import { cardsDarkMode } from '@redocly/theme/markdoc/components/Cards/variables.dark';
|
|
13
|
+
import { catalogDarkMode } from '@redocly/theme/components/Catalog/variables.dark';
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
const replayDarkMode = css`
|
|
@@ -316,6 +317,7 @@ export const darkMode = css`
|
|
|
316
317
|
${replayDarkMode}
|
|
317
318
|
${switcherDarkMode}
|
|
318
319
|
${cardsDarkMode}
|
|
320
|
+
${catalogDarkMode}
|
|
319
321
|
|
|
320
322
|
/**
|
|
321
323
|
* @tokens Dark Theme Scrollbar Config
|
|
@@ -8,6 +8,7 @@ import { sidebar } from '@redocly/theme/components/Sidebar/variables';
|
|
|
8
8
|
import { breadcrumbs } from '@redocly/theme/components/Breadcrumbs/variables';
|
|
9
9
|
import { tag } from '@redocly/theme/components/Tag/variables';
|
|
10
10
|
import { toc } from '@redocly/theme/components/TableOfContent/variables';
|
|
11
|
+
import { catalog } from '@redocly/theme/components/Catalog/variables';
|
|
11
12
|
import { filter } from '@redocly/theme/components/Filter/variables';
|
|
12
13
|
import { catalogClassic } from '@redocly/theme/components/CatalogClassic/variables';
|
|
13
14
|
import { apiReferencePanels, responsePanelColors } from '@redocly/theme/components/Panel/variables';
|
|
@@ -37,6 +38,7 @@ import { datePicker } from '@redocly/theme/components/DatePicker/variables'
|
|
|
37
38
|
import { switcher } from '@redocly/theme/components/Switch/variables';
|
|
38
39
|
import { cards } from '@redocly/theme/markdoc/components/Cards/variables';
|
|
39
40
|
import { codeWalkthrough } from '@redocly/theme/markdoc/components/CodeWalkthrough/variables';
|
|
41
|
+
import { skipContent } from '@redocly/theme/components/SkipContent/variables';
|
|
40
42
|
|
|
41
43
|
const themeColors = css`
|
|
42
44
|
/* === Palette === */
|
|
@@ -367,6 +369,7 @@ const typography = css`
|
|
|
367
369
|
--font-size-base: 14px; // Base font size of the entire system.
|
|
368
370
|
--font-size-sm: 12px;
|
|
369
371
|
--font-size-lg: 16px;
|
|
372
|
+
--font-size-md: 18px;
|
|
370
373
|
--font-size-xl: 20px;
|
|
371
374
|
|
|
372
375
|
/**
|
|
@@ -1211,6 +1214,7 @@ export const styles = css`
|
|
|
1211
1214
|
${breadcrumbs}
|
|
1212
1215
|
${button}
|
|
1213
1216
|
${cards}
|
|
1217
|
+
${catalog}
|
|
1214
1218
|
${catalogClassic}
|
|
1215
1219
|
${code}
|
|
1216
1220
|
${codeWalkthrough}
|
|
@@ -1262,6 +1266,7 @@ export const styles = css`
|
|
|
1262
1266
|
${scorecard}
|
|
1263
1267
|
${datePicker}
|
|
1264
1268
|
${replay}
|
|
1269
|
+
${skipContent}
|
|
1265
1270
|
|
|
1266
1271
|
background-color: var(--bg-color);
|
|
1267
1272
|
color: var(--text-color-primary);
|
|
@@ -1,5 +1,41 @@
|
|
|
1
|
+
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
|
|
3
|
+
|
|
1
4
|
import type { CatalogFilterConfig } from '@redocly/theme/config';
|
|
2
5
|
|
|
6
|
+
export type SortOption = 'title' | '-title' | 'type' | '-type';
|
|
7
|
+
|
|
8
|
+
export type UseCatalogResponse = {
|
|
9
|
+
filters: ResolvedFilter[];
|
|
10
|
+
filterQuery: string;
|
|
11
|
+
searchQuery: string;
|
|
12
|
+
setSearchQuery: (query: string) => void;
|
|
13
|
+
sortOption: SortOption | null;
|
|
14
|
+
setSortOption: (option: SortOption | null) => void;
|
|
15
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
16
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
17
|
+
viewMode: CatalogViewMode;
|
|
18
|
+
setViewMode: (mode: CatalogViewMode) => void;
|
|
19
|
+
entitiesCounter: number;
|
|
20
|
+
setEntitiesCounter: (counter: number) => void;
|
|
21
|
+
onChangeViewClick: () => void;
|
|
22
|
+
onChangeCollapseSidebarClick: () => void;
|
|
23
|
+
layout: LayoutVariant;
|
|
24
|
+
collapsedSidebar: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type UseCatalogSortResponse = {
|
|
28
|
+
sortOption: SortOption | null;
|
|
29
|
+
setSortOption: (option: SortOption | null) => void;
|
|
30
|
+
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
31
|
+
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type UseCatalogSearchResponse = {
|
|
35
|
+
searchQuery: string;
|
|
36
|
+
setSearchQuery: (query: string) => void;
|
|
37
|
+
};
|
|
38
|
+
|
|
3
39
|
export type FilteredCatalog = {
|
|
4
40
|
groups: { title: string; items: CatalogItem[] }[];
|
|
5
41
|
filters: ResolvedFilter[];
|
|
@@ -12,10 +48,6 @@ export type ResolvedFilter = Omit<CatalogFilterConfig, 'options'> & {
|
|
|
12
48
|
value: string;
|
|
13
49
|
count: number;
|
|
14
50
|
}[];
|
|
15
|
-
filteredOptions: {
|
|
16
|
-
value: string;
|
|
17
|
-
count: number;
|
|
18
|
-
}[];
|
|
19
51
|
toggleOption: (option: string) => void;
|
|
20
52
|
selectOption: (option: string) => void;
|
|
21
53
|
parentUsed: boolean;
|
|
@@ -34,9 +66,115 @@ export type CatalogItem = {
|
|
|
34
66
|
scorecardLevelIdx?: number;
|
|
35
67
|
scorecardLevels?: Record<string, { uniqueErrors: number; uniqueWarnings: number }>;
|
|
36
68
|
scoreCardSlug?: string;
|
|
37
|
-
tags?:
|
|
69
|
+
tags?: string[];
|
|
38
70
|
versions?: CatalogItem[];
|
|
39
71
|
version?: string;
|
|
40
72
|
versionFolderId?: string;
|
|
41
73
|
[k: string]: unknown;
|
|
42
74
|
};
|
|
75
|
+
|
|
76
|
+
export type DefaultCatalogSlug =
|
|
77
|
+
| 'services'
|
|
78
|
+
| 'users'
|
|
79
|
+
| 'teams'
|
|
80
|
+
| 'domains'
|
|
81
|
+
| 'api-descriptions'
|
|
82
|
+
| 'all';
|
|
83
|
+
|
|
84
|
+
export type CatalogApiResults<T, L> = {
|
|
85
|
+
query: UseInfiniteQueryResult<InfiniteData<L, unknown>, Error>;
|
|
86
|
+
items: T[];
|
|
87
|
+
total: number;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type CatalogApiParams = {
|
|
91
|
+
limit?: number;
|
|
92
|
+
filter?: string;
|
|
93
|
+
sort?: string;
|
|
94
|
+
search?: string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export type UseCatalogEntitiesProps = {
|
|
98
|
+
entitiesTypes: string[];
|
|
99
|
+
excludedEntities?: CatalogEntityConfig['excludes'];
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type UseCatalogEntitiesResponse = {
|
|
103
|
+
setEntitiesCounter: (counter: number) => void;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type EntityType = 'service' | 'domain' | 'team' | 'user' | 'api-description';
|
|
107
|
+
|
|
108
|
+
export type CatalogViewMode = 'cards' | 'table';
|
|
109
|
+
|
|
110
|
+
export type CatalogSwitcherItem = {
|
|
111
|
+
labelTranslationKey: string;
|
|
112
|
+
slug: string;
|
|
113
|
+
selected: boolean;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// TODO: remove this types after we make api-sdk package public and will be able import them from there
|
|
117
|
+
export type BffCatalogRelatedEntity = {
|
|
118
|
+
readonly id: string;
|
|
119
|
+
type: string;
|
|
120
|
+
key: string;
|
|
121
|
+
title: string;
|
|
122
|
+
summary?: string | null;
|
|
123
|
+
readonly source: 'api' | 'file';
|
|
124
|
+
sourceFile?: string | null;
|
|
125
|
+
metadata?: Record<string, any>;
|
|
126
|
+
readonly createdAt: string | null;
|
|
127
|
+
readonly updatedAt: string | null;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export type BffCatalogEntity = {
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly organizationId: string;
|
|
133
|
+
readonly projectId: string;
|
|
134
|
+
key: string;
|
|
135
|
+
type: string;
|
|
136
|
+
title: string;
|
|
137
|
+
readonly source: 'api' | 'file';
|
|
138
|
+
domains?: Array<BffCatalogRelatedEntity>;
|
|
139
|
+
owners?: Array<BffCatalogRelatedEntity>;
|
|
140
|
+
summary?: string;
|
|
141
|
+
tags?: Array<string>;
|
|
142
|
+
metadata?: Record<string, any>;
|
|
143
|
+
git?: Array<string>;
|
|
144
|
+
contact?: {
|
|
145
|
+
slack?: {
|
|
146
|
+
channels?: Array<{
|
|
147
|
+
name: string;
|
|
148
|
+
}>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
links?: Array<{
|
|
152
|
+
label: string;
|
|
153
|
+
url: string;
|
|
154
|
+
}>;
|
|
155
|
+
sourceFile?: string;
|
|
156
|
+
readonly object: 'catalogEntityView';
|
|
157
|
+
readonly createdAt: string;
|
|
158
|
+
readonly updatedAt: string;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type BffCatalogEntityList = {
|
|
162
|
+
object: 'list';
|
|
163
|
+
page: Page;
|
|
164
|
+
items: Array<BffCatalogEntity>;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export type BffCatalogRelatedEntityList = {
|
|
168
|
+
object: 'list';
|
|
169
|
+
page: Page;
|
|
170
|
+
items: Array<BffCatalogRelatedEntity>;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export type Page = {
|
|
174
|
+
endCursor: string | null;
|
|
175
|
+
startCursor: string | null;
|
|
176
|
+
hasNextPage: boolean;
|
|
177
|
+
hasPrevPage: boolean;
|
|
178
|
+
limit: number;
|
|
179
|
+
total: number;
|
|
180
|
+
};
|
package/src/core/types/filter.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { RedoclyConfig } from '@redocly/config';
|
|
|
4
4
|
export type FilterProps = {
|
|
5
5
|
filter: ResolvedFilter & { selectedOptions: any };
|
|
6
6
|
filterValuesCasing?: NonNullable<RedoclyConfig['catalog']>[string]['filterValuesCasing'];
|
|
7
|
+
showCounter?: boolean;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export type FilterTypes = NonNullable<FilterProps['filter']['type']>;
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CatalogEntityConfig,
|
|
3
|
+
PageProps,
|
|
4
|
+
ResolvedNavItemWithLink,
|
|
5
|
+
Version,
|
|
6
|
+
} from '@redocly/config';
|
|
4
7
|
import type { ShikiTransformer } from '@shikijs/types';
|
|
5
8
|
import type { Callback, TFunction as TFunc } from 'i18next';
|
|
6
9
|
import type { To, Location, NavigateFunction } from 'react-router-dom';
|
|
7
10
|
import type { CatalogConfig, ProductUiConfig } from '@redocly/theme/config';
|
|
8
11
|
import type {
|
|
9
12
|
UserMenuData,
|
|
10
|
-
|
|
13
|
+
UseCatalogResponse,
|
|
11
14
|
ItemState,
|
|
12
15
|
SearchItemData,
|
|
13
16
|
SubmitFeedbackParams,
|
|
@@ -18,8 +21,21 @@ import type {
|
|
|
18
21
|
SearchFilterItem,
|
|
19
22
|
SearchFacetQuery,
|
|
20
23
|
AiSearchConversationItem,
|
|
24
|
+
CatalogApiResults,
|
|
25
|
+
CatalogApiParams,
|
|
26
|
+
FilteredCatalog,
|
|
27
|
+
UseCatalogSortResponse,
|
|
28
|
+
UseCatalogSearchResponse,
|
|
29
|
+
EventType,
|
|
30
|
+
SendEventParams,
|
|
21
31
|
} from '@redocly/theme/core/types';
|
|
22
32
|
|
|
33
|
+
import {
|
|
34
|
+
BffCatalogEntity,
|
|
35
|
+
BffCatalogEntityList,
|
|
36
|
+
BffCatalogRelatedEntity,
|
|
37
|
+
BffCatalogRelatedEntityList,
|
|
38
|
+
} from '@redocly/theme/core/types';
|
|
23
39
|
import { AiSearchError } from '@redocly/theme/core/constants';
|
|
24
40
|
|
|
25
41
|
export type ThemeHooks = {
|
|
@@ -118,9 +134,20 @@ export type ThemeHooks = {
|
|
|
118
134
|
nextPage?: ResolvedNavItemWithLink;
|
|
119
135
|
}
|
|
120
136
|
| undefined;
|
|
137
|
+
useCatalog: (config?: CatalogEntityConfig, entitiesCounterInitial?: number) => UseCatalogResponse;
|
|
138
|
+
useCatalogSort: () => UseCatalogSortResponse;
|
|
139
|
+
useCatalogSearch: () => UseCatalogSearchResponse;
|
|
140
|
+
useFetchCatalogEntities: (
|
|
141
|
+
params: CatalogApiParams,
|
|
142
|
+
initialData?: BffCatalogEntityList,
|
|
143
|
+
) => CatalogApiResults<BffCatalogEntity, BffCatalogEntityList>;
|
|
144
|
+
useFetchCatalogEntitiesRelations: (
|
|
145
|
+
params: CatalogApiParams & { entityKey: string },
|
|
146
|
+
initialData?: BffCatalogRelatedEntityList,
|
|
147
|
+
) => CatalogApiResults<BffCatalogRelatedEntity, BffCatalogRelatedEntityList>;
|
|
121
148
|
useCatalogClassic: (config: CatalogConfig) => FilteredCatalog;
|
|
122
149
|
useTelemetry: () => {
|
|
123
|
-
send(
|
|
150
|
+
send<TEventType extends EventType>(event: SendEventParams<TEventType>): void;
|
|
124
151
|
};
|
|
125
152
|
useUserTeams: () => string[];
|
|
126
153
|
usePageProps: <T extends Record<string, unknown>>() => PageProps & T;
|