@redocly/theme 0.56.0-rc.2 → 0.56.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/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +3 -1
- package/lib/components/Button/ButtonGroup.d.ts +12 -0
- package/lib/components/Button/ButtonGroup.js +38 -0
- package/lib/components/Button/variables.js +32 -5
- package/lib/components/Catalog/Catalog.d.ts +1 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +11 -6
- package/lib/components/Catalog/CatalogEntitiesEmptyState.d.ts +5 -1
- package/lib/components/Catalog/CatalogEntitiesEmptyState.js +25 -4
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -13
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.d.ts +4 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityInfoBar.js +15 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityLinks.js +6 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +18 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +47 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.js +8 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +12 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +4 -10
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +2 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +5 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityIcon.js +22 -29
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntityTypeTag.js +40 -0
- package/lib/components/Catalog/CatalogPageDescription.js +3 -3
- package/lib/components/Catalog/CatalogSelector.d.ts +1 -1
- package/lib/components/Catalog/CatalogSelector.js +4 -3
- package/lib/components/Catalog/CatalogSortButton.js +6 -6
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +3 -15
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +1 -5
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +3 -3
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +5 -32
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +12 -37
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +1 -0
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +8 -4
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +4 -4
- package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
- package/lib/components/Catalog/variables.js +42 -8
- package/lib/components/CodeBlock/CodeBlock.d.ts +16 -6
- package/lib/components/CodeBlock/CodeBlock.js +3 -2
- package/lib/components/CodeBlock/CodeBlockControls.d.ts +4 -3
- package/lib/components/CodeBlock/CodeBlockControls.js +35 -8
- package/lib/components/CodeBlock/CodeBlockDropdown.d.ts +3 -0
- package/lib/components/CodeBlock/CodeBlockDropdown.js +35 -0
- package/lib/components/CodeBlock/CodeBlockTabs.d.ts +2 -2
- package/lib/components/CodeBlock/CodeBlockTabs.js +18 -9
- package/lib/components/CodeBlock/variables.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -0
- package/lib/components/Dropdown/DropdownMenu.js +4 -0
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Feedback/Feedback.js +1 -1
- package/lib/components/Filter/FilterCheckboxes.js +5 -2
- package/lib/components/Footer/FooterItem.js +4 -7
- package/lib/components/Footer/variables.js +2 -2
- package/lib/components/Image/Image.js +2 -0
- package/lib/components/Markdown/Markdown.js +9 -9
- package/lib/components/Markdown/styles/headingAnchor.js +0 -1
- package/lib/components/Menu/MenuItem.js +5 -5
- package/lib/components/Menu/variables.js +3 -1
- package/lib/components/Navbar/NavbarItem.js +8 -39
- package/lib/components/Navbar/variables.js +2 -2
- package/lib/components/PageActions/PageActions.d.ts +6 -0
- package/lib/components/PageActions/PageActions.js +104 -0
- package/lib/components/PageActions/PageActionsMenuItem.d.ts +7 -0
- package/lib/components/PageActions/PageActionsMenuItem.js +58 -0
- package/lib/components/PageActions/variables.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.d.ts +1 -0
- package/lib/components/PageActions/variables.dark.js +9 -0
- package/lib/components/PageActions/variables.js +37 -0
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Select/variables.js +2 -2
- package/lib/components/TableOfContent/TableOfContent.js +15 -12
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +3 -3
- package/lib/components/Tag/variables.js +14 -0
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/common.d.ts +4 -0
- package/lib/core/constants/common.js +5 -1
- package/lib/core/contexts/CodeSnippetContext.d.ts +7 -0
- package/lib/core/contexts/CodeSnippetContext.js +23 -0
- package/lib/core/contexts/index.d.ts +1 -0
- package/lib/core/contexts/index.js +1 -0
- 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/code-walkthrough/use-renderable-files.d.ts +1 -2
- package/lib/core/hooks/code-walkthrough/use-renderable-files.js +2 -2
- package/lib/core/hooks/index.d.ts +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/hooks/use-active-heading.d.ts +7 -2
- package/lib/core/hooks/use-active-heading.js +160 -23
- package/lib/core/hooks/use-active-section-id.d.ts +1 -1
- package/lib/core/hooks/use-active-section-id.js +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +2 -2
- package/lib/core/hooks/use-codeblock-tabs-controls.js +6 -6
- package/lib/core/hooks/use-local-state.d.ts +1 -0
- package/lib/core/hooks/use-local-state.js +32 -0
- package/lib/core/hooks/use-page-actions.d.ts +2 -0
- package/lib/core/hooks/use-page-actions.js +101 -0
- package/lib/core/hooks/use-theme-hooks.js +2 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +2 -0
- package/lib/core/types/catalog.d.ts +5 -1
- package/lib/core/types/hooks.d.ts +2 -1
- 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/page-actions.d.ts +15 -0
- package/lib/core/types/page-actions.js +3 -0
- package/lib/core/types/sidebar.d.ts +1 -0
- package/lib/core/types/telemetry.d.ts +5 -20
- package/lib/core/utils/download-code-walkthrough.js +27 -7
- package/lib/core/utils/enhanced-smoothstep.d.ts +5 -0
- package/lib/core/utils/enhanced-smoothstep.js +15 -0
- package/lib/core/utils/get-file-icon.d.ts +3 -2
- package/lib/core/utils/get-file-icon.js +109 -29
- package/lib/core/utils/icon-resolver.d.ts +28 -0
- package/lib/core/utils/icon-resolver.js +52 -0
- package/lib/core/utils/index.d.ts +4 -1
- package/lib/core/utils/index.js +4 -1
- package/lib/core/utils/lang-to-name.d.ts +1 -0
- package/lib/core/utils/lang-to-name.js +37 -0
- package/lib/core/utils/{text-transform.js → string.js} +1 -1
- package/lib/ext/configure.d.ts +1 -1
- package/lib/icons/CDNIcon/CDNIcon.d.ts +14 -0
- package/lib/icons/CDNIcon/CDNIcon.js +48 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.d.ts +9 -0
- package/lib/icons/ChatGptIcon/ChatGptIcon.js +22 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.d.ts +9 -0
- package/lib/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.js +23 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.d.ts +9 -0
- package/lib/icons/ClaudeIcon/ClaudeIcon.js +22 -0
- package/lib/icons/GenericIcon/GenericIcon.d.ts +11 -0
- package/lib/icons/GenericIcon/GenericIcon.js +61 -0
- package/lib/icons/GraphqlIcon/GraphqlIcon.d.ts +9 -0
- package/lib/icons/GraphqlIcon/GraphqlIcon.js +36 -0
- package/lib/icons/GraphqlIcon/index.d.ts +1 -0
- package/lib/icons/GraphqlIcon/index.js +6 -0
- package/lib/icons/HexagonIcon/HexagonIcon.d.ts +9 -0
- package/lib/icons/HexagonIcon/HexagonIcon.js +22 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.d.ts +9 -0
- package/lib/icons/MarkdownFullIcon/MarkdownFullIcon.js +23 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
- package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
- package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
- package/lib/icons/NoneIcon/NoneIcon.d.ts +9 -0
- package/lib/icons/NoneIcon/NoneIcon.js +17 -0
- package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
- package/lib/icons/NotesIcon/NotesIcon.js +26 -0
- package/lib/icons/types.d.ts +6 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +7 -1
- package/lib/layouts/CodeWalkthroughLayout.js +2 -2
- package/lib/layouts/DocumentationLayout.js +14 -10
- package/lib/markdoc/components/Cards/CardIcon.js +7 -19
- package/lib/markdoc/components/CodeGroup/CodeGroup.d.ts +4 -0
- package/lib/markdoc/components/CodeGroup/CodeGroup.js +72 -0
- package/lib/markdoc/components/CodeWalkthrough/CodePanelHeader.js +7 -4
- package/lib/markdoc/components/Heading/Heading.d.ts +2 -1
- package/lib/markdoc/components/Heading/Heading.js +21 -3
- package/lib/markdoc/components/Icon/Icon.d.ts +3 -0
- package/lib/markdoc/components/Icon/Icon.js +29 -0
- package/lib/markdoc/components/Tabs/Tab.d.ts +2 -1
- package/lib/markdoc/components/Tabs/Tab.js +5 -2
- package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -1
- package/lib/markdoc/components/Tabs/variables.js +2 -0
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/card.js +1 -1
- package/lib/markdoc/tags/code-group.d.ts +2 -0
- package/lib/markdoc/tags/code-group.js +23 -0
- package/lib/markdoc/tags/code-snippet.js +1 -1
- package/lib/markdoc/tags/icon.d.ts +2 -0
- package/lib/markdoc/tags/icon.js +16 -0
- package/lib/markdoc/tags/tab.js +1 -0
- package/package.json +4 -4
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Button/Button.tsx +4 -2
- package/src/components/Button/ButtonGroup.tsx +53 -0
- package/src/components/Button/variables.ts +32 -5
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +12 -6
- package/src/components/Catalog/CatalogEntitiesEmptyState.tsx +38 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +25 -17
- package/src/components/Catalog/CatalogEntity/CatalogEntityInfoBar.tsx +25 -9
- package/src/components/Catalog/CatalogEntity/CatalogEntityLinks.tsx +12 -15
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +39 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +61 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ApiDescriptionProperty.tsx +12 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +15 -4
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +5 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +11 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +37 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/GitProperty.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +7 -23
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +5 -6
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +21 -13
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +9 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +33 -33
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +49 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +5 -4
- package/src/components/Catalog/CatalogSelector.tsx +3 -1
- package/src/components/Catalog/CatalogSortButton.tsx +19 -20
- package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +3 -17
- package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +5 -8
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +6 -36
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +18 -46
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +1 -0
- package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +9 -4
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
- package/src/components/Catalog/CatalogViewModeToggle.tsx +1 -1
- package/src/components/Catalog/variables.ts +42 -8
- package/src/components/CodeBlock/CodeBlock.tsx +15 -5
- package/src/components/CodeBlock/CodeBlockControls.tsx +67 -26
- package/src/components/CodeBlock/CodeBlockDropdown.tsx +53 -0
- package/src/components/CodeBlock/CodeBlockTabs.tsx +29 -20
- package/src/components/CodeBlock/variables.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +1 -0
- package/src/components/Dropdown/DropdownMenu.tsx +4 -0
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Feedback/Feedback.tsx +1 -1
- package/src/components/Filter/FilterCheckboxes.tsx +9 -2
- package/src/components/Footer/FooterItem.tsx +5 -12
- package/src/components/Footer/variables.ts +2 -2
- package/src/components/Image/Image.tsx +2 -0
- package/src/components/Markdown/Markdown.tsx +3 -3
- package/src/components/Markdown/styles/headingAnchor.ts +0 -1
- package/src/components/Menu/MenuItem.tsx +5 -5
- package/src/components/Menu/variables.ts +3 -1
- package/src/components/Navbar/NavbarItem.tsx +8 -17
- package/src/components/Navbar/variables.ts +2 -2
- package/src/components/PageActions/PageActions.tsx +110 -0
- package/src/components/PageActions/PageActionsMenuItem.tsx +73 -0
- package/src/components/PageActions/variables.dark.ts +6 -0
- package/src/components/PageActions/variables.ts +34 -0
- package/src/components/Search/SearchDialog.tsx +2 -2
- package/src/components/Select/variables.ts +2 -2
- package/src/components/TableOfContent/TableOfContent.tsx +33 -36
- package/src/components/Tag/Tag.tsx +11 -2
- package/src/components/Tag/variables.ts +14 -0
- package/src/core/constants/catalog.ts +1 -1
- package/src/core/constants/common.ts +4 -0
- package/src/core/contexts/CodeSnippetContext.tsx +31 -0
- package/src/core/contexts/index.ts +1 -0
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +1 -0
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +3 -4
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/use-active-heading.ts +199 -28
- package/src/core/hooks/use-active-section-id.ts +2 -1
- package/src/core/hooks/use-codeblock-tabs-controls.ts +8 -8
- package/src/core/hooks/use-local-state.ts +30 -0
- package/src/core/hooks/use-page-actions.ts +115 -0
- package/src/core/hooks/use-theme-hooks.ts +2 -0
- package/src/core/styles/dark.ts +2 -1
- package/src/core/styles/global.ts +2 -0
- package/src/core/types/catalog.ts +5 -1
- package/src/core/types/hooks.ts +2 -0
- package/src/core/types/index.ts +1 -0
- package/src/core/types/l10n.ts +21 -0
- package/src/core/types/page-actions.ts +18 -0
- package/src/core/types/sidebar.ts +1 -0
- package/src/core/types/telemetry.ts +5 -13
- package/src/core/utils/download-code-walkthrough.ts +5 -4
- package/src/core/utils/enhanced-smoothstep.ts +14 -0
- package/src/core/utils/get-file-icon.tsx +94 -0
- package/src/core/utils/icon-resolver.ts +57 -0
- package/src/core/utils/index.ts +4 -1
- package/src/core/utils/lang-to-name.ts +35 -0
- package/src/ext/configure.ts +1 -1
- package/src/icons/CDNIcon/CDNIcon.tsx +47 -0
- package/src/icons/ChatGptIcon/ChatGptIcon.tsx +23 -0
- package/src/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon.tsx +24 -0
- package/src/icons/ClaudeIcon/ClaudeIcon.tsx +23 -0
- package/src/icons/GenericIcon/GenericIcon.tsx +69 -0
- package/src/icons/GraphqlIcon/GraphqlIcon.tsx +81 -0
- package/src/icons/GraphqlIcon/index.ts +1 -0
- package/src/icons/HexagonIcon/HexagonIcon.tsx +23 -0
- package/src/icons/MarkdownFullIcon/MarkdownFullIcon.tsx +24 -0
- package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
- package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
- package/src/icons/NoneIcon/NoneIcon.tsx +17 -0
- package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
- package/src/icons/types.ts +7 -0
- package/src/index.ts +7 -1
- package/src/layouts/CodeWalkthroughLayout.tsx +1 -1
- package/src/layouts/DocumentationLayout.tsx +23 -13
- package/src/markdoc/components/Cards/CardIcon.tsx +6 -21
- package/src/markdoc/components/CodeGroup/CodeGroup.tsx +78 -0
- package/src/markdoc/components/CodeWalkthrough/CodePanelHeader.tsx +7 -4
- package/src/markdoc/components/Heading/Heading.tsx +22 -3
- package/src/markdoc/components/Icon/Icon.tsx +16 -0
- package/src/markdoc/components/Tabs/Tab.tsx +6 -1
- package/src/markdoc/components/Tabs/Tabs.tsx +1 -1
- package/src/markdoc/components/Tabs/variables.ts +2 -0
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/card.ts +1 -1
- package/src/markdoc/tags/code-group.ts +21 -0
- package/src/markdoc/tags/code-snippet.ts +1 -1
- package/src/markdoc/tags/icon.ts +14 -0
- package/src/markdoc/tags/tab.ts +1 -0
- 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/core/utils/get-file-icon.ts +0 -42
- package/src/ext/process-scorecard.ts +0 -13
- /package/lib/core/utils/{text-transform.d.ts → string.d.ts} +0 -0
- /package/src/core/utils/{text-transform.ts → string.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Icon = Icon;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const CDNIcon_1 = require("../../../icons/CDNIcon/CDNIcon");
|
|
20
|
+
const utils_1 = require("../../../core/utils");
|
|
21
|
+
function Icon(props) {
|
|
22
|
+
const { name } = props, rest = __rest(props, ["name"]);
|
|
23
|
+
const resolvedIcon = (0, utils_1.resolveIcon)(name);
|
|
24
|
+
if (resolvedIcon.type === 'font-awesome') {
|
|
25
|
+
return react_1.default.createElement(CDNIcon_1.CDNIcon, Object.assign({ name: resolvedIcon.name, type: resolvedIcon.style }, rest));
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Icon.js.map
|
|
@@ -10,6 +10,7 @@ export type TabProps = {
|
|
|
10
10
|
onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
11
11
|
onClick: () => void;
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
|
+
iconRawContent?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, }: TabProps): JSX.Element;
|
|
15
|
+
export declare function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }: TabProps): JSX.Element;
|
|
15
16
|
export declare const Tab: import("styled-components").StyledComponent<typeof TabComponent, any, {}, never>;
|
|
@@ -8,17 +8,20 @@ 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
|
-
|
|
11
|
+
const GenericIcon_1 = require("../../../icons/GenericIcon/GenericIcon");
|
|
12
|
+
function TabComponent({ tabId, label, size, disabled, setRef, onKeyDown, onClick, icon, iconRawContent, }) {
|
|
12
13
|
return (react_1.default.createElement(TabList_1.TabItem, { "data-component-name": "Markdoc/Tabs/Tab", size: size, tabIndex: 0 },
|
|
13
14
|
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
15
|
react_1.default.createElement(LabelWrapper, null,
|
|
15
|
-
icon,
|
|
16
|
+
react_1.default.createElement(GenericIcon_1.GenericIcon, { icon: icon, rawContent: iconRawContent }),
|
|
16
17
|
label))));
|
|
17
18
|
}
|
|
18
19
|
const LabelWrapper = styled_components_1.default.div `
|
|
19
20
|
display: flex;
|
|
20
21
|
align-items: center;
|
|
21
22
|
gap: 4px;
|
|
23
|
+
--icon-width: var(--md-tabs-icon-size);
|
|
24
|
+
--icon-height: var(--md-tabs-icon-size);
|
|
22
25
|
`;
|
|
23
26
|
exports.Tab = (0, styled_components_1.default)(TabComponent) ``;
|
|
24
27
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -98,6 +98,8 @@ exports.markdownTabs = (0, styled_components_1.css) `
|
|
|
98
98
|
|
|
99
99
|
--md-tabs-tab-focused-padding: var(--spacing-unit); // @presenter Spacing
|
|
100
100
|
|
|
101
|
+
--md-tabs-icon-size: 16px; // @presenter Spacing
|
|
102
|
+
|
|
101
103
|
// @tokens End
|
|
102
104
|
`;
|
|
103
105
|
//# sourceMappingURL=variables.js.map
|
|
@@ -18,3 +18,5 @@ export * from '../../markdoc/components/CodeWalkthrough/CodeStep';
|
|
|
18
18
|
export * from '../../markdoc/components/CodeWalkthrough/Input';
|
|
19
19
|
export * from '../../markdoc/components/CodeWalkthrough/CodeToggle';
|
|
20
20
|
export * from '../../markdoc/components/CodeWalkthrough/CodeContainer';
|
|
21
|
+
export * from '../../markdoc/components/CodeGroup/CodeGroup';
|
|
22
|
+
export * from '../../markdoc/components/Icon/Icon';
|
|
@@ -34,4 +34,6 @@ __exportStar(require("../../markdoc/components/CodeWalkthrough/CodeStep"), expor
|
|
|
34
34
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/Input"), exports);
|
|
35
35
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/CodeToggle"), exports);
|
|
36
36
|
__exportStar(require("../../markdoc/components/CodeWalkthrough/CodeContainer"), exports);
|
|
37
|
+
__exportStar(require("../../markdoc/components/CodeGroup/CodeGroup"), exports);
|
|
38
|
+
__exportStar(require("../../markdoc/components/Icon/Icon"), exports);
|
|
37
39
|
//# sourceMappingURL=default.js.map
|
package/lib/markdoc/default.js
CHANGED
|
@@ -52,6 +52,8 @@ const code_walkthrough_1 = require("../markdoc/tags/code-walkthrough");
|
|
|
52
52
|
const code_step_1 = require("../markdoc/tags/code-step");
|
|
53
53
|
const input_1 = require("../markdoc/tags/input");
|
|
54
54
|
const code_toggle_1 = require("../markdoc/tags/code-toggle");
|
|
55
|
+
const code_group_1 = require("../markdoc/tags/code-group");
|
|
56
|
+
const icon_1 = require("../markdoc/tags/icon");
|
|
55
57
|
exports.tags = {
|
|
56
58
|
[admonition_1.admonition.tagName]: admonition_1.admonition.schema,
|
|
57
59
|
[debug_1.debug.tagName]: debug_1.debug.schema,
|
|
@@ -69,5 +71,7 @@ exports.tags = {
|
|
|
69
71
|
[code_step_1.codeStep.tagName]: code_step_1.codeStep.schema,
|
|
70
72
|
[code_toggle_1.toggle.tagName]: code_toggle_1.toggle.schema,
|
|
71
73
|
[input_1.input.tagName]: input_1.input.schema,
|
|
74
|
+
[code_group_1.codeGroup.tagName]: code_group_1.codeGroup.schema,
|
|
75
|
+
[icon_1.icon.tagName]: icon_1.icon.schema,
|
|
72
76
|
};
|
|
73
77
|
//# sourceMappingURL=default.js.map
|
package/lib/markdoc/tags/card.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.codeGroup = void 0;
|
|
7
|
+
const markdoc_1 = __importDefault(require("@markdoc/markdoc"));
|
|
8
|
+
exports.codeGroup = {
|
|
9
|
+
schema: {
|
|
10
|
+
render: 'CodeGroup',
|
|
11
|
+
children: ['fence', 'tag'],
|
|
12
|
+
attributes: {
|
|
13
|
+
mode: { type: String, default: 'tabs', matches: ['tabs', 'dropdown'] },
|
|
14
|
+
},
|
|
15
|
+
transform(node, config) {
|
|
16
|
+
const attributes = node.transformAttributes(config);
|
|
17
|
+
const children = node.transformChildren(config);
|
|
18
|
+
return new markdoc_1.default.Tag('CodeGroup', attributes, children);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
tagName: 'code-group',
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=code-group.js.map
|
|
@@ -9,7 +9,7 @@ const code_snippet_file_1 = require("../../markdoc/attributes/code-snippet-file"
|
|
|
9
9
|
exports.codeSnippet = {
|
|
10
10
|
schema: {
|
|
11
11
|
attributes: {
|
|
12
|
-
file: { type: code_snippet_file_1.CodeSnippetFile,
|
|
12
|
+
file: { type: code_snippet_file_1.CodeSnippetFile, required: true },
|
|
13
13
|
language: { type: String, render: true },
|
|
14
14
|
title: { type: String, render: true },
|
|
15
15
|
to: { type: [String, Number], render: false },
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.icon = void 0;
|
|
4
|
+
exports.icon = {
|
|
5
|
+
schema: {
|
|
6
|
+
render: 'Icon',
|
|
7
|
+
attributes: {
|
|
8
|
+
name: { type: String, required: true },
|
|
9
|
+
size: { type: String, default: '1em' },
|
|
10
|
+
color: { type: String, default: 'currentColor' },
|
|
11
|
+
},
|
|
12
|
+
selfClosing: true,
|
|
13
|
+
},
|
|
14
|
+
tagName: 'icon',
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=icon.js.map
|
package/lib/markdoc/tags/tab.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.56.0
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"./markdoc/*": "./lib/markdoc/*.js"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@markdoc/markdoc": "0.5.
|
|
29
|
+
"@markdoc/markdoc": "0.5.2",
|
|
30
30
|
"lodash.debounce": "^4.0.8",
|
|
31
31
|
"lodash.throttle": "^4.1.1",
|
|
32
32
|
"react": "^19.1.0",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
"nprogress": "0.2.0",
|
|
90
90
|
"react-calendar": "5.1.0",
|
|
91
91
|
"react-date-picker": "11.0.0",
|
|
92
|
-
"@redocly/config": "0.
|
|
93
|
-
"@redocly/realm-asyncapi-sdk": "0.2.0
|
|
92
|
+
"@redocly/config": "0.28.0",
|
|
93
|
+
"@redocly/realm-asyncapi-sdk": "0.2.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -27,13 +27,13 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
27
27
|
size?: ButtonSize;
|
|
28
28
|
extraClass?: string;
|
|
29
29
|
to?: string;
|
|
30
|
+
external?: boolean;
|
|
30
31
|
icon?: JSX.Element;
|
|
31
32
|
iconPosition?: 'left' | 'right';
|
|
32
33
|
title?: string;
|
|
33
34
|
tabIndex?: number;
|
|
34
35
|
onClick?: (e?: any) => void;
|
|
35
36
|
ref?: React.Ref<HTMLButtonElement>;
|
|
36
|
-
type?: 'button' | 'submit' | 'reset';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const getBlink = (): Keyframes => keyframes`
|
|
@@ -67,6 +67,7 @@ export function generateClassName({
|
|
|
67
67
|
extraClass = '',
|
|
68
68
|
}: ButtonProps) {
|
|
69
69
|
const classNames = [
|
|
70
|
+
'button',
|
|
70
71
|
extraClass,
|
|
71
72
|
`button-tone-${tone}`,
|
|
72
73
|
`button-variant-${variant}`,
|
|
@@ -96,6 +97,7 @@ const StyledButton = styled.button.attrs((props: ButtonProps) => ({
|
|
|
96
97
|
background-color: var(--button-bg-color);
|
|
97
98
|
border: var(--button-border-width) var(--button-border-style) var(--button-border-color);
|
|
98
99
|
box-shadow: var(--button-box-shadow);
|
|
100
|
+
backdrop-filter: var(--button-backdrop-filter, none);
|
|
99
101
|
|
|
100
102
|
font-weight: var(--button-font-weight);
|
|
101
103
|
font-size: var(--button-font-size);
|
|
@@ -189,7 +191,7 @@ const ButtonComponent: React.FC<ButtonProps> = (props) => {
|
|
|
189
191
|
|
|
190
192
|
if (props.to) {
|
|
191
193
|
return (
|
|
192
|
-
<StyledButtonLink to={props.to} onClick={props.onClick}>
|
|
194
|
+
<StyledButtonLink to={props.to} external={props.external} onClick={props.onClick}>
|
|
193
195
|
{button}
|
|
194
196
|
</StyledButtonLink>
|
|
195
197
|
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { JSX } from 'react';
|
|
5
|
+
import type { ButtonSize } from '@redocly/theme/components/Button/Button';
|
|
6
|
+
|
|
7
|
+
type ButtonGroupVariant = 'outlined';
|
|
8
|
+
|
|
9
|
+
type ButtonGroupProps = {
|
|
10
|
+
variant?: ButtonGroupVariant;
|
|
11
|
+
size?: ButtonSize;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function ButtonGroup(props: ButtonGroupProps): JSX.Element {
|
|
17
|
+
const { variant = 'outlined', className = '', children, size = 'medium' } = props;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<ButtonGroupWrapper
|
|
21
|
+
data-component-name="Button/ButtonGroup"
|
|
22
|
+
className={`button-group-${variant} button-group-size-${size} ${className}`}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</ButtonGroupWrapper>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const ButtonGroupWrapper = styled.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
line-height: var(--button-line-height);
|
|
32
|
+
|
|
33
|
+
.button {
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& > .button:first-child,
|
|
38
|
+
*:first-child > .button {
|
|
39
|
+
border-top-left-radius: var(--button-border-radius);
|
|
40
|
+
border-bottom-left-radius: var(--button-border-radius);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
& > .button:last-child,
|
|
44
|
+
*:last-child > .button {
|
|
45
|
+
border-top-right-radius: var(--button-border-radius);
|
|
46
|
+
border-bottom-right-radius: var(--button-border-radius);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& > .button:not(:first-child),
|
|
50
|
+
*:not(:first-child) > .button {
|
|
51
|
+
border-left: none;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
@@ -91,9 +91,12 @@ export const button = css`
|
|
|
91
91
|
* @tokens Button size
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
|
-
.button-size-small
|
|
94
|
+
.button-size-small,
|
|
95
|
+
.button-group-size-small .button {
|
|
96
|
+
--button-font-size: var(--font-size-base);
|
|
95
97
|
--button-border-radius: var(--border-radius);
|
|
96
98
|
--button-padding: 1px var(--spacing-sm);
|
|
99
|
+
--button-line-height: var(--line-height-base);
|
|
97
100
|
|
|
98
101
|
--button-icon-size: 14px;
|
|
99
102
|
--button-icon-padding: 5px; /* Padding for small buttons with only icon */
|
|
@@ -101,11 +104,25 @@ export const button = css`
|
|
|
101
104
|
--button-icon-right-padding: 1px 10px 1px var(--spacing-sm); /* Padding for small buttons with icon on the right */
|
|
102
105
|
}
|
|
103
106
|
|
|
104
|
-
.button-size-
|
|
107
|
+
.button-size-medium,
|
|
108
|
+
.button-group-size-medium .button {
|
|
109
|
+
--button-font-size: var(--font-size-base);
|
|
110
|
+
--button-border-radius: var(--border-radius-md);
|
|
111
|
+
--button-padding: 5px var(--spacing-sm);
|
|
112
|
+
--button-line-height: var(--line-height-base);
|
|
113
|
+
|
|
114
|
+
--button-icon-size: 16px;
|
|
115
|
+
--button-icon-padding: var(--spacing-xs); /* Padding for buttons with only icon */
|
|
116
|
+
--button-icon-left-padding: 5px var(--spacing-base) 5px 14px; /* Padding for buttons with icon on the left */
|
|
117
|
+
--button-icon-right-padding: 5px 14px 5px var(--spacing-base); /* Padding for buttons with icon on the right */
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.button-size-large,
|
|
121
|
+
.button-group-size-large .button {
|
|
105
122
|
--button-font-size: var(--font-size-lg); // @presenter FontSize
|
|
106
|
-
--button-
|
|
107
|
-
--border-radius: var(--border-radius-lg);
|
|
123
|
+
--button-border-radius: var(--border-radius-md);
|
|
108
124
|
--button-padding: var(--spacing-xs) var(--spacing-md);
|
|
125
|
+
--button-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
109
126
|
|
|
110
127
|
--button-icon-size: 18px;
|
|
111
128
|
--button-icon-padding: 11px; /* Padding for large buttons with only icon */
|
|
@@ -153,7 +170,8 @@ export const button = css`
|
|
|
153
170
|
--button-border-color-danger-pressed: transparent;
|
|
154
171
|
}
|
|
155
172
|
|
|
156
|
-
.button-variant-outlined
|
|
173
|
+
.button-variant-outlined,
|
|
174
|
+
.button-group-outlined .button {
|
|
157
175
|
--button-color: var(--button-content-color-custom); // @presenter Color
|
|
158
176
|
--button-color-hover: var(--button-content-color-custom-hover); // @presenter Color
|
|
159
177
|
--button-color-active: var(--button-content-color-custom-hover); // @presenter Color
|
|
@@ -163,6 +181,15 @@ export const button = css`
|
|
|
163
181
|
--button-bg-color-disabled: transparent; // @presenter Color
|
|
164
182
|
--button-border-width: 1px;
|
|
165
183
|
--button-border-width-disabled: 1px;
|
|
184
|
+
--button-bg-color: transparent; // @presenter Color
|
|
185
|
+
--button-border-color-disabled: var(--color-warm-grey-2); // @presenter Color
|
|
186
|
+
--button-border-color-danger: var(--color-raspberry-6); // @presenter Color
|
|
187
|
+
--button-border-color-danger-hover: var(--color-raspberry-7); // @presenter Color
|
|
188
|
+
--button-border-color-danger-pressed: var(--color-raspberry-8); // @presenter Color
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.button-group-outlined .button {
|
|
192
|
+
--button-bg-color-hover: var(--color-hover-base); // @presenter Color
|
|
166
193
|
}
|
|
167
194
|
|
|
168
195
|
.button-variant-text {
|
|
@@ -8,7 +8,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
|
8
8
|
import { H3 } from '@redocly/theme/components/Typography/H3';
|
|
9
9
|
import { FilterContent } from '@redocly/theme/components/Filter/FilterContent';
|
|
10
10
|
import { Sidebar, SidebarHeader } from '@redocly/theme/components/Sidebar/Sidebar';
|
|
11
|
-
import { CatalogSwitcherItem } from '@redocly/theme/core';
|
|
11
|
+
import { CatalogSwitcherItem } from '@redocly/theme/core/types/catalog';
|
|
12
12
|
import { CatalogSelector } from '@redocly/theme/components/Catalog/CatalogSelector';
|
|
13
13
|
import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
|
|
14
14
|
import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
|
|
@@ -10,7 +10,8 @@ import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIc
|
|
|
10
10
|
import { ArrowUpRightIcon } from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
|
|
11
11
|
import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
|
|
12
12
|
import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
|
|
13
|
-
import { getPathPrefix } from '@redocly/theme/core';
|
|
13
|
+
import { getPathPrefix } from '@redocly/theme/core/utils';
|
|
14
|
+
import { TooltipComponent } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
14
15
|
|
|
15
16
|
export type CatalogCardProps = {
|
|
16
17
|
entity: BffCatalogEntity;
|
|
@@ -34,9 +35,11 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
|
|
|
34
35
|
>
|
|
35
36
|
<CardContent>
|
|
36
37
|
<CardHeader>
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
38
|
+
<TooltipComponent tip={entity.type} placement="bottom" className="catalog">
|
|
39
|
+
<HeaderIconWrapper>
|
|
40
|
+
<CatalogEntityIcon entityType={entity.type} defaultColor={true} />
|
|
41
|
+
</HeaderIconWrapper>
|
|
42
|
+
</TooltipComponent>
|
|
40
43
|
<CardTitle>
|
|
41
44
|
<CatalogHighlight>{entity.title}</CatalogHighlight>
|
|
42
45
|
</CardTitle>
|
|
@@ -57,6 +60,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
|
|
|
57
60
|
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
58
61
|
},
|
|
59
62
|
icon: <GraphIcon color="var(--color-green-8)" />,
|
|
63
|
+
textTransform: 'none',
|
|
60
64
|
}}
|
|
61
65
|
/>
|
|
62
66
|
</MetadataColumn>
|
|
@@ -71,6 +75,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
|
|
|
71
75
|
backgroundColor: 'var(--catalog-card-icon-bg-color)',
|
|
72
76
|
borderRadius: 'var(--border-radius-xl)',
|
|
73
77
|
},
|
|
78
|
+
textTransform: 'none',
|
|
74
79
|
}}
|
|
75
80
|
/>
|
|
76
81
|
</MetadataColumn>
|
|
@@ -89,6 +94,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
|
|
|
89
94
|
},
|
|
90
95
|
borderless: true,
|
|
91
96
|
color: 'grey',
|
|
97
|
+
textTransform: 'none',
|
|
92
98
|
}}
|
|
93
99
|
itemsToShow={3}
|
|
94
100
|
/>
|
|
@@ -163,6 +169,7 @@ const CardContent = styled.div`
|
|
|
163
169
|
`;
|
|
164
170
|
|
|
165
171
|
const CardFooter = styled.div`
|
|
172
|
+
height: var(--catalog-card-footer-height);
|
|
166
173
|
display: flex;
|
|
167
174
|
align-items: center;
|
|
168
175
|
justify-content: space-between;
|
|
@@ -176,8 +183,7 @@ const Divider = styled.div`
|
|
|
176
183
|
`;
|
|
177
184
|
|
|
178
185
|
const CatalogCardWrapper = styled.div`
|
|
179
|
-
|
|
180
|
-
height: 100%;
|
|
186
|
+
height: var(--catalog-card-height);
|
|
181
187
|
color: var(--catalog-card-text-color);
|
|
182
188
|
font-size: var(--catalog-card-font-size);
|
|
183
189
|
font-weight: var(--catalog-card-font-weight);
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import { HexagonIcon } from '@redocly/theme/icons/HexagonIcon/HexagonIcon';
|
|
5
|
+
|
|
6
|
+
interface CatalogEntitiesEmptyStateProps {
|
|
7
|
+
listType?: 'default' | 'team';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function CatalogEntitiesEmptyState({
|
|
11
|
+
listType = 'default',
|
|
12
|
+
}: CatalogEntitiesEmptyStateProps): JSX.Element {
|
|
13
|
+
if (listType === 'team') {
|
|
14
|
+
return (
|
|
15
|
+
<EmptyStateWrapper data-component-name="Catalog/CatalogEntitiesEmptyState">
|
|
16
|
+
<EmptyStateIconWrapper>
|
|
17
|
+
<HexagonIcon size="21px" color="var(--color-warm-grey-7)" />
|
|
18
|
+
</EmptyStateIconWrapper>
|
|
19
|
+
<EmptyStateHeader>No team members yet</EmptyStateHeader>
|
|
20
|
+
<EmptyStateText>Your team members will appear here</EmptyStateText>
|
|
21
|
+
<EmptyStateText>once they've been added to the team.</EmptyStateText>
|
|
22
|
+
</EmptyStateWrapper>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
5
25
|
return (
|
|
6
26
|
<EmptyStateWrapper data-component-name="Catalog/CatalogEntitiesEmptyState">
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
27
|
+
<EmptyStateIconWrapper>
|
|
28
|
+
<HexagonIcon size="21px" color="var(--color-warm-grey-7)" />
|
|
29
|
+
</EmptyStateIconWrapper>
|
|
30
|
+
<EmptyStateHeader>No entities found</EmptyStateHeader>
|
|
31
|
+
<EmptyStateText>Try adjusting your search criteria or</EmptyStateText>
|
|
32
|
+
<EmptyStateText>check back later for new additions.</EmptyStateText>
|
|
10
33
|
</EmptyStateWrapper>
|
|
11
34
|
);
|
|
12
35
|
}
|
|
@@ -21,6 +44,17 @@ const EmptyStateWrapper = styled.div`
|
|
|
21
44
|
min-height: var(--catalog-empty-state-min-height);
|
|
22
45
|
`;
|
|
23
46
|
|
|
47
|
+
const EmptyStateIconWrapper = styled.div`
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
background-color: var(--color-warm-grey-2);
|
|
52
|
+
width: 40px;
|
|
53
|
+
height: 40px;
|
|
54
|
+
border-radius: 50%;
|
|
55
|
+
margin-bottom: var(--spacing-xxs);
|
|
56
|
+
`;
|
|
57
|
+
|
|
24
58
|
const EmptyStateHeader = styled.p`
|
|
25
59
|
color: var(--catalog-empty-state-header-text-color);
|
|
26
60
|
font-size: var(--catalog-empty-state-header-font-size);
|
|
@@ -16,16 +16,15 @@ import { Menu } from '@redocly/theme/components/Menu/Menu';
|
|
|
16
16
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
17
17
|
import { CatalogEntityRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations';
|
|
18
18
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
19
|
-
|
|
20
|
-
import {
|
|
19
|
+
import { SidebarActions } from '@redocly/theme/components/SidebarActions/SidebarActions';
|
|
20
|
+
import { CatalogEntitySchema } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntitySchema';
|
|
21
|
+
import { CatalogEntityMethodAndPath } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath';
|
|
21
22
|
|
|
22
23
|
export type CatalogEntityProps = {
|
|
23
24
|
entity: BffCatalogEntity;
|
|
24
25
|
entitiesCatalogConfig: EntitiesCatalogConfig;
|
|
25
26
|
catalogConfig: CatalogEntityConfig;
|
|
26
27
|
initialRelations: BffCatalogRelatedEntityList;
|
|
27
|
-
mainCatalogLabelTranslationKey?: string;
|
|
28
|
-
mainCatalogSlug?: string;
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
export function CatalogEntity({
|
|
@@ -33,16 +32,31 @@ export function CatalogEntity({
|
|
|
33
32
|
entitiesCatalogConfig,
|
|
34
33
|
catalogConfig,
|
|
35
34
|
initialRelations,
|
|
36
|
-
mainCatalogLabelTranslationKey,
|
|
37
|
-
mainCatalogSlug,
|
|
38
35
|
}: CatalogEntityProps) {
|
|
39
36
|
const { useTranslate, useCatalog } = useThemeHooks();
|
|
40
37
|
const { translate } = useTranslate();
|
|
41
38
|
const linkToMainCatalog = `catalogs/${catalogConfig.slug}`;
|
|
42
39
|
const linkToMainCatalogLabel = translate(catalogConfig.titleTranslationKey);
|
|
43
40
|
|
|
44
|
-
const {
|
|
45
|
-
|
|
41
|
+
const {
|
|
42
|
+
layout,
|
|
43
|
+
collapsedSidebar,
|
|
44
|
+
onChangeViewClick,
|
|
45
|
+
onChangeCollapseSidebarClick,
|
|
46
|
+
searchQuery,
|
|
47
|
+
setSearchQuery,
|
|
48
|
+
} = useCatalog();
|
|
49
|
+
|
|
50
|
+
const renderEntityContent = (): React.ReactElement => {
|
|
51
|
+
switch (entity.type) {
|
|
52
|
+
case 'data-schema':
|
|
53
|
+
return <CatalogEntitySchema entity={entity} />;
|
|
54
|
+
case 'api-operation':
|
|
55
|
+
return <CatalogEntityMethodAndPath entity={entity} />;
|
|
56
|
+
default:
|
|
57
|
+
return <CatalogEntityMetadata entity={entity} />;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
46
60
|
|
|
47
61
|
return (
|
|
48
62
|
<CatalogPageWrapper data-component-name="Catalog/CatalogEntity/CatalogEntity">
|
|
@@ -92,14 +106,6 @@ export function CatalogEntity({
|
|
|
92
106
|
<CatalogPageContent>
|
|
93
107
|
<Breadcrumbs
|
|
94
108
|
additionalBreadcrumbs={[
|
|
95
|
-
...(mainCatalogLabelTranslationKey
|
|
96
|
-
? [
|
|
97
|
-
{
|
|
98
|
-
label: translate(mainCatalogLabelTranslationKey),
|
|
99
|
-
link: `catalogs/${mainCatalogSlug}`,
|
|
100
|
-
},
|
|
101
|
-
]
|
|
102
|
-
: []),
|
|
103
109
|
{ label: linkToMainCatalogLabel, link: linkToMainCatalog },
|
|
104
110
|
{ label: entity.title },
|
|
105
111
|
]}
|
|
@@ -112,7 +118,7 @@ export function CatalogEntity({
|
|
|
112
118
|
/>
|
|
113
119
|
<CatalogEntityProperties entity={entity} />
|
|
114
120
|
<CatalogTwoColumnsSection>
|
|
115
|
-
|
|
121
|
+
{renderEntityContent()}
|
|
116
122
|
<CatalogEntityLinks entity={entity} />
|
|
117
123
|
</CatalogTwoColumnsSection>
|
|
118
124
|
<CatalogEntityRelations
|
|
@@ -120,6 +126,8 @@ export function CatalogEntity({
|
|
|
120
126
|
entitiesCatalogConfig={entitiesCatalogConfig}
|
|
121
127
|
catalogConfig={catalogConfig}
|
|
122
128
|
initialRelations={initialRelations}
|
|
129
|
+
searchQuery={searchQuery}
|
|
130
|
+
setSearchQuery={setSearchQuery}
|
|
123
131
|
/>
|
|
124
132
|
</CatalogEntityPageWrapper>
|
|
125
133
|
</CatalogPageContent>
|