@redocly/theme 0.64.0-next.1 → 0.64.0-next.3
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.d.ts +1 -1
- package/lib/components/Admonition/Admonition.js +2 -0
- package/lib/components/Admonition/variables.dark.js +3 -0
- package/lib/components/Admonition/variables.js +13 -0
- package/lib/components/Banner/Banner.js +3 -3
- package/lib/components/Button/variables.dark.js +2 -2
- package/lib/components/Button/variables.js +3 -3
- package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
- package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
- package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntities.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
- package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +3 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
- package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
- package/lib/components/Catalog/CatalogPageDescription.js +1 -1
- package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
- package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
- package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
- package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
- package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
- package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
- package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
- package/lib/components/Catalog/CatalogTags.d.ts +11 -0
- package/lib/components/Catalog/CatalogTags.js +62 -0
- package/lib/components/Catalog/variables.js +22 -14
- package/lib/components/Filter/variables.js +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Menu/MenuItem.js +1 -0
- package/lib/components/Menu/variables.dark.js +2 -0
- package/lib/components/Menu/variables.js +4 -3
- package/lib/components/Search/SearchDialog.js +118 -116
- package/lib/components/SvgViewer/variables.dark.js +1 -1
- package/lib/components/Switch/variables.dark.js +2 -2
- package/lib/components/Switch/variables.js +1 -1
- package/lib/components/TableOfContent/TableOfContent.js +1 -0
- package/lib/components/TableOfContent/variables.js +3 -2
- package/lib/components/Toast/Toast.d.ts +14 -0
- package/lib/components/Toast/Toast.js +239 -0
- package/lib/components/Toast/variables.d.ts +1 -0
- package/lib/components/Toast/variables.js +64 -0
- package/lib/components/Tooltip/JsTooltip.js +1 -1
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/catalog.js +1 -1
- package/lib/core/constants/toast.d.ts +1 -0
- package/lib/core/constants/toast.js +5 -0
- package/lib/core/contexts/Toast/ToastContext.d.ts +2 -0
- package/lib/core/contexts/Toast/ToastContext.js +6 -0
- package/lib/core/contexts/Toast/ToastProvider.d.ts +3 -0
- package/lib/core/contexts/Toast/ToastProvider.js +156 -0
- package/lib/core/contexts/index.d.ts +2 -0
- package/lib/core/contexts/index.js +2 -0
- package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
- package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
- package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
- package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
- package/lib/core/hooks/index.d.ts +3 -0
- package/lib/core/hooks/index.js +3 -0
- package/lib/core/hooks/use-toast-logic.d.ts +18 -0
- package/lib/core/hooks/use-toast-logic.js +141 -0
- package/lib/core/hooks/use-toast.d.ts +11 -0
- package/lib/core/hooks/use-toast.js +17 -0
- package/lib/core/styles/dark.d.ts +3 -1
- package/lib/core/styles/dark.js +37 -33
- package/lib/core/styles/global.d.ts +6 -2
- package/lib/core/styles/global.js +56 -46
- package/lib/core/styles/palette.d.ts +6 -0
- package/lib/core/styles/palette.dark.d.ts +3 -0
- package/lib/core/styles/palette.dark.js +201 -0
- package/lib/core/styles/palette.js +175 -0
- package/lib/core/types/catalog.d.ts +23 -7
- package/lib/core/types/hooks.d.ts +6 -4
- package/lib/core/types/index.d.ts +1 -0
- package/lib/core/types/search.d.ts +1 -0
- package/lib/core/types/toast.d.ts +23 -0
- package/lib/core/types/toast.js +3 -0
- package/lib/core/utils/get-auto-dismiss-duration.d.ts +2 -0
- package/lib/core/utils/get-auto-dismiss-duration.js +15 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/icons/CheckboxIcon/CheckboxIcon.js +6 -4
- package/lib/icons/CheckboxIcon/variables.dark.js +2 -1
- package/lib/icons/CheckboxIcon/variables.js +3 -3
- package/lib/icons/IdeaIcon/IdeaIcon.d.ts +9 -0
- package/lib/icons/IdeaIcon/IdeaIcon.js +24 -0
- package/lib/icons/NewChatIcon/NewChatIcon.d.ts +11 -0
- package/lib/icons/NewChatIcon/NewChatIcon.js +25 -0
- package/lib/index.d.ts +5 -1
- package/lib/index.js +5 -1
- package/lib/markdoc/components/Heading/Heading.js +2 -2
- package/lib/markdoc/components/Mermaid/Mermaid.js +0 -2
- package/lib/markdoc/components/Tabs/variables.js +3 -3
- package/lib/markdoc/components/default.d.ts +0 -1
- package/lib/markdoc/components/default.js +0 -1
- package/lib/markdoc/tags/admonition.js +1 -1
- package/package.json +2 -2
- package/src/components/Admonition/Admonition.tsx +3 -1
- package/src/components/Admonition/variables.dark.ts +3 -0
- package/src/components/Admonition/variables.ts +13 -0
- package/src/components/Banner/Banner.tsx +7 -7
- package/src/components/Button/variables.dark.ts +2 -2
- package/src/components/Button/variables.ts +3 -3
- package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
- package/src/components/Catalog/CatalogEntities.tsx +3 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
- package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +3 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
- package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
- package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
- package/src/components/Catalog/CatalogSortButton.tsx +5 -6
- package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
- package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
- package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
- package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
- package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
- package/src/components/Catalog/CatalogTags.tsx +115 -0
- package/src/components/Catalog/variables.ts +22 -14
- package/src/components/Filter/variables.ts +1 -1
- package/src/components/Link/Link.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +5 -1
- package/src/components/Menu/variables.dark.ts +2 -0
- package/src/components/Menu/variables.ts +4 -3
- package/src/components/Search/SearchDialog.tsx +299 -293
- package/src/components/SvgViewer/variables.dark.ts +1 -1
- package/src/components/Switch/variables.dark.ts +2 -2
- package/src/components/Switch/variables.ts +1 -1
- package/src/components/TableOfContent/TableOfContent.tsx +1 -0
- package/src/components/TableOfContent/variables.ts +3 -2
- package/src/components/Toast/Toast.tsx +289 -0
- package/src/components/Toast/variables.ts +61 -0
- package/src/components/Tooltip/JsTooltip.tsx +1 -1
- package/src/core/constants/catalog.ts +1 -1
- package/src/core/constants/toast.ts +1 -0
- package/src/core/contexts/Toast/ToastContext.tsx +5 -0
- package/src/core/contexts/Toast/ToastProvider.tsx +206 -0
- package/src/core/contexts/index.ts +2 -0
- package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
- package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
- package/src/core/hooks/index.ts +3 -0
- package/src/core/hooks/use-toast-logic.ts +203 -0
- package/src/core/hooks/use-toast.ts +47 -0
- package/src/core/styles/dark.ts +9 -4
- package/src/core/styles/global.ts +30 -20
- package/src/core/styles/palette.dark.ts +199 -0
- package/src/core/styles/palette.ts +173 -0
- package/src/core/types/catalog.ts +24 -8
- package/src/core/types/hooks.ts +5 -10
- package/src/core/types/index.ts +1 -0
- package/src/core/types/search.ts +1 -0
- package/src/core/types/toast.ts +28 -0
- package/src/core/utils/get-auto-dismiss-duration.ts +20 -0
- package/src/core/utils/index.ts +1 -0
- package/src/icons/CheckboxIcon/CheckboxIcon.tsx +26 -17
- package/src/icons/CheckboxIcon/variables.dark.ts +2 -1
- package/src/icons/CheckboxIcon/variables.ts +3 -3
- package/src/icons/IdeaIcon/IdeaIcon.tsx +32 -0
- package/src/icons/NewChatIcon/NewChatIcon.tsx +39 -0
- package/src/index.ts +5 -1
- package/src/markdoc/components/Heading/Heading.tsx +2 -1
- package/src/markdoc/components/Mermaid/Mermaid.tsx +0 -2
- package/src/markdoc/components/Tabs/variables.ts +3 -3
- package/src/markdoc/components/default.ts +0 -1
- package/src/markdoc/tags/admonition.ts +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +0 -7
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +0 -95
- package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +0 -1
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +0 -1
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +0 -8
- package/lib/markdoc/components/ExcalidrawDiagram/variables.js +0 -15
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
- package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +0 -85
- package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +0 -5
- package/src/markdoc/components/ExcalidrawDiagram/variables.ts +0 -12
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js
CHANGED
|
@@ -13,6 +13,7 @@ const Tag_1 = require("../../../../components/Tag/Tag");
|
|
|
13
13
|
const CatalogEntityRelationsTable_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable");
|
|
14
14
|
const CatalogUserEntityCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogUserEntityCell");
|
|
15
15
|
const CatalogEntityDefaultRelations_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations");
|
|
16
|
+
const CatalogLastUpdateCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogLastUpdateCell");
|
|
16
17
|
const teamColumns = [
|
|
17
18
|
{
|
|
18
19
|
key: 'entity',
|
|
@@ -21,12 +22,12 @@ const teamColumns = [
|
|
|
21
22
|
var _a;
|
|
22
23
|
return (react_1.default.createElement(CatalogUserEntityCell_1.CatalogUserEntityCell, { name: entity.title, email: (_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.email }));
|
|
23
24
|
},
|
|
24
|
-
width: '
|
|
25
|
+
width: '3fr',
|
|
25
26
|
sortable: true,
|
|
26
27
|
sortKey: 'title',
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
|
-
key: 'metadata',
|
|
30
|
+
key: 'metadata.role',
|
|
30
31
|
title: 'Role',
|
|
31
32
|
render: (entity) => { var _a, _b; return (((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.role) ? react_1.default.createElement(Tag_1.Tag, null, (_b = entity.metadata) === null || _b === void 0 ? void 0 : _b.role) : null); },
|
|
32
33
|
width: '2fr',
|
|
@@ -35,7 +36,16 @@ const teamColumns = [
|
|
|
35
36
|
key: 'description',
|
|
36
37
|
title: 'Description',
|
|
37
38
|
render: (entity) => react_1.default.createElement(EntityDescription, null, entity.summary),
|
|
38
|
-
width: '
|
|
39
|
+
width: '2fr',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: 'lastUpdate',
|
|
43
|
+
title: 'Last update',
|
|
44
|
+
render: (entity) => react_1.default.createElement(CatalogLastUpdateCell_1.CatalogLastUpdateCell, { lastModified: entity.updatedAt }),
|
|
45
|
+
width: '1fr',
|
|
46
|
+
minWidth: '112px',
|
|
47
|
+
sortable: true,
|
|
48
|
+
sortKey: 'updated_at',
|
|
39
49
|
},
|
|
40
50
|
];
|
|
41
51
|
function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
@@ -55,7 +55,7 @@ function CatalogEntitySchema({ entity, relatedEntity, catalogConfig, RedocSchema
|
|
|
55
55
|
const { getEntityDetailsLink } = (0, hooks_1.useCatalogEntityDetails)({
|
|
56
56
|
catalogConfig,
|
|
57
57
|
});
|
|
58
|
-
return (react_1.default.createElement(MetadataWrapper, { "data-component-name": "Catalog/CatalogEntity/
|
|
58
|
+
return (react_1.default.createElement(MetadataWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntitySchema" },
|
|
59
59
|
react_1.default.createElement(HeaderWrapper, null,
|
|
60
60
|
react_1.default.createElement(Heading, null, translate('catalog.entity.schema.title')),
|
|
61
61
|
!isGraphql && (react_1.default.createElement(CopyButton_1.CopyButton, { data: rawSchema, buttonText: "Copy Schema", type: "compound", variant: "secondary", iconPosition: "right", size: "medium", onCopyClick: () => telemetry.sendCatalogEntitiesCopyDataSchemaClickedMessage([
|
|
@@ -76,8 +76,7 @@ const MetadataWrapper = styled_components_1.default.div `
|
|
|
76
76
|
flex-direction: column;
|
|
77
77
|
border-radius: var(--border-radius);
|
|
78
78
|
background-color: var(--catalog-metadata-bg-color);
|
|
79
|
-
margin-
|
|
80
|
-
margin-bottom: var(--spacing-xs);
|
|
79
|
+
margin-bottom: var(--spacing-lg);
|
|
81
80
|
`;
|
|
82
81
|
const SchemaContentWrapper = styled_components_1.default.div `
|
|
83
82
|
flex: 1;
|
|
@@ -94,6 +93,8 @@ const HeaderWrapper = styled_components_1.default.div `
|
|
|
94
93
|
`;
|
|
95
94
|
const Heading = styled_components_1.default.h2 `
|
|
96
95
|
font-size: var(--catalog-metadata-heading-size);
|
|
96
|
+
line-height: var(--line-height-lg);
|
|
97
|
+
margin: 0;
|
|
97
98
|
`;
|
|
98
99
|
const SplitViewWrapper = styled_components_1.default.div `
|
|
99
100
|
display: flex;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type CatalogEntityTypeIconProps = {
|
|
3
3
|
entityType: string;
|
|
4
|
-
|
|
4
|
+
defaultColors?: boolean;
|
|
5
|
+
size?: 'large' | 'medium';
|
|
5
6
|
};
|
|
6
|
-
export declare function CatalogEntityTypeIcon({ entityType,
|
|
7
|
+
export declare function CatalogEntityTypeIcon({ entityType, defaultColors, size, }: CatalogEntityTypeIconProps): React.JSX.Element;
|
|
@@ -8,19 +8,19 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const CatalogEntityIcon_1 = require("../../components/Catalog/CatalogEntityIcon");
|
|
10
10
|
const core_1 = require("../../core");
|
|
11
|
-
function CatalogEntityTypeIcon({ entityType,
|
|
12
|
-
return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon", entityType: entityType,
|
|
13
|
-
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entityType, defaultColor:
|
|
11
|
+
function CatalogEntityTypeIcon({ entityType, defaultColors = false, size = 'medium', }) {
|
|
12
|
+
return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon", entityType: entityType, defaultColors: defaultColors, size: size },
|
|
13
|
+
react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entityType, defaultColor: false })));
|
|
14
14
|
}
|
|
15
15
|
const IconContainer = styled_components_1.default.div `
|
|
16
16
|
display: flex;
|
|
17
17
|
align-items: center;
|
|
18
18
|
justify-content: center;
|
|
19
|
-
width: var(--catalog-table-icon-width);
|
|
20
|
-
height: var(--catalog-table-icon-height);
|
|
19
|
+
width: ${({ size }) => (size === 'large' ? 'var(--catalog-table-icon-width-large)' : 'var(--catalog-table-icon-width-medium)')};
|
|
20
|
+
height: ${({ size }) => (size === 'large' ? 'var(--catalog-table-icon-height-large)' : 'var(--catalog-table-icon-height-medium)')};
|
|
21
21
|
border-radius: var(--catalog-table-icon-border-radius);
|
|
22
|
-
background-color: ${({
|
|
23
|
-
if (
|
|
22
|
+
background-color: ${({ defaultColors, entityType }) => {
|
|
23
|
+
if (defaultColors) {
|
|
24
24
|
return 'var(--catalog-entity-bg-color)';
|
|
25
25
|
}
|
|
26
26
|
if (core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
@@ -30,8 +30,8 @@ const IconContainer = styled_components_1.default.div `
|
|
|
30
30
|
}};
|
|
31
31
|
flex-shrink: 0;
|
|
32
32
|
border: 1px solid
|
|
33
|
-
${({
|
|
34
|
-
if (
|
|
33
|
+
${({ defaultColors, entityType }) => {
|
|
34
|
+
if (defaultColors) {
|
|
35
35
|
return 'var(--catalog-entity-border-color)';
|
|
36
36
|
}
|
|
37
37
|
if (core_1.PREDEFINED_ENTITY_TYPES.includes(entityType)) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { SortOption } from '../../../core';
|
|
3
2
|
import { CatalogViewMode } from '../../../core';
|
|
4
3
|
type CatalogMobileTopBarProps = {
|
|
5
4
|
setMobileFiltersPanelOpen: (open: boolean) => void;
|
|
6
5
|
activeFiltersCount: number;
|
|
7
|
-
setSortOption: (sortOption:
|
|
8
|
-
sortOption:
|
|
6
|
+
setSortOption: (sortOption: string | null) => void;
|
|
7
|
+
sortOption: string | null;
|
|
9
8
|
viewMode: CatalogViewMode;
|
|
10
9
|
setViewMode: (viewMode: CatalogViewMode) => void;
|
|
11
10
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { SortOption } from '../../../core';
|
|
3
2
|
import { CatalogViewMode } from '../../../core';
|
|
4
3
|
type CatalogMobileTopBarControlsProps = {
|
|
5
|
-
setSortOption: (sortOption:
|
|
6
|
-
sortOption:
|
|
4
|
+
setSortOption: (sortOption: string | null) => void;
|
|
5
|
+
sortOption: string | null;
|
|
7
6
|
viewMode: CatalogViewMode;
|
|
8
7
|
setViewMode: (viewMode: CatalogViewMode) => void;
|
|
9
8
|
};
|
|
@@ -36,7 +36,7 @@ const CatalogDescription = styled_components_1.default.p `
|
|
|
36
36
|
color: var(--catalog-description-text-color);
|
|
37
37
|
font-weight: var(--catalog-description-font-weight);
|
|
38
38
|
font-size: var(--catalog-description-font-size);
|
|
39
|
-
margin:
|
|
39
|
+
margin: 0;
|
|
40
40
|
line-height: var(--catalog-description-line-height);
|
|
41
41
|
display: -webkit-box;
|
|
42
42
|
-webkit-line-clamp: 3;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SortOption } from '../../core/types';
|
|
3
2
|
export type CatalogSortButtonProps = {
|
|
4
|
-
onSortChange: (sortOption:
|
|
5
|
-
currentSort?:
|
|
3
|
+
onSortChange: (sortOption: string | null) => void;
|
|
4
|
+
currentSort?: string | null;
|
|
6
5
|
};
|
|
7
6
|
export declare function CatalogSortButton({ onSortChange, currentSort, }: {
|
|
8
|
-
onSortChange: (sortOption:
|
|
9
|
-
currentSort?:
|
|
7
|
+
onSortChange: (sortOption: string | null) => void;
|
|
8
|
+
currentSort?: string | null;
|
|
10
9
|
}): React.JSX.Element;
|
|
@@ -5,14 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CatalogDomainsCell = CatalogDomainsCell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
|
|
9
|
+
const GraphIcon_1 = require("../../../icons/GraphIcon/GraphIcon");
|
|
9
10
|
function CatalogDomainsCell({ domains }) {
|
|
10
11
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogDomainsCell" },
|
|
11
|
-
react_1.default.createElement(
|
|
12
|
+
react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-domains-cell", items: domains, showPlaceholder: false, tagProps: {
|
|
13
|
+
variant: 'outline',
|
|
14
|
+
icon: react_1.default.createElement(GraphIcon_1.GraphIcon, null),
|
|
12
15
|
style: {
|
|
13
16
|
fontSize: 'var(--font-size-base)',
|
|
14
17
|
backgroundColor: 'transparent',
|
|
15
18
|
borderRadius: 'var(--border-radius-xl)',
|
|
19
|
+
margin: 0,
|
|
16
20
|
},
|
|
17
21
|
textTransform: 'none',
|
|
18
22
|
} })));
|
|
@@ -10,7 +10,7 @@ const CatalogHighlight_1 = require("../../../components/Catalog/CatalogHighlight
|
|
|
10
10
|
const CatalogEntityTypeIcon_1 = require("../../../components/Catalog/CatalogEntityTypeIcon");
|
|
11
11
|
function CatalogEntityCell({ entity }) {
|
|
12
12
|
return (react_1.default.createElement(EntityTitleCellWrapper, { "data-component-name": "Catalog/CatalogTableView/CatalogEntityCell" },
|
|
13
|
-
react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type }),
|
|
13
|
+
react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type, size: "large", defaultColors: true }),
|
|
14
14
|
react_1.default.createElement(EntityTitleContent, null,
|
|
15
15
|
react_1.default.createElement(EntityTitle, { "data-component-name": "Catalog/CatalogTableView/CatalogEntityTitle" },
|
|
16
16
|
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title)),
|
|
@@ -28,7 +28,7 @@ const EntityTitleContent = styled_components_1.default.div `
|
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
max-width: calc(
|
|
30
30
|
100% - var(--catalog-table-entity-title-content-offset)
|
|
31
|
-
); /* Account for icon width (
|
|
31
|
+
); /* Account for icon width (32px) + gap (8px) */
|
|
32
32
|
overflow: hidden;
|
|
33
33
|
`;
|
|
34
34
|
const EntityTitle = styled_components_1.default.div `
|
|
@@ -0,0 +1,45 @@
|
|
|
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.CatalogLastUpdateCell = CatalogLastUpdateCell;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
|
|
10
|
+
function formatLastModified(isoString) {
|
|
11
|
+
const date = new Date(isoString);
|
|
12
|
+
if (Number.isNaN(date.getTime())) {
|
|
13
|
+
return isoString;
|
|
14
|
+
}
|
|
15
|
+
return date.toLocaleDateString('en-US', {
|
|
16
|
+
year: 'numeric',
|
|
17
|
+
month: 'short',
|
|
18
|
+
day: 'numeric',
|
|
19
|
+
timeZone: 'UTC',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function formatLastModifiedTooltip(isoString) {
|
|
23
|
+
const date = new Date(isoString);
|
|
24
|
+
if (Number.isNaN(date.getTime())) {
|
|
25
|
+
return isoString;
|
|
26
|
+
}
|
|
27
|
+
return date.toLocaleString('en-US', {
|
|
28
|
+
year: 'numeric',
|
|
29
|
+
month: 'short',
|
|
30
|
+
day: 'numeric',
|
|
31
|
+
hour: '2-digit',
|
|
32
|
+
minute: '2-digit',
|
|
33
|
+
second: '2-digit',
|
|
34
|
+
hour12: false,
|
|
35
|
+
timeZone: 'UTC',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CatalogLastUpdateCell({ lastModified, }) {
|
|
39
|
+
return (react_1.default.createElement(CatalogLastUpdateCellWrapper, { "data-component-name": "Catalog/CatalogTableView/CatalogLastUpdateCell" },
|
|
40
|
+
react_1.default.createElement(Tooltip_1.Tooltip, { tip: formatLastModifiedTooltip(lastModified), placement: "bottom" }, formatLastModified(lastModified))));
|
|
41
|
+
}
|
|
42
|
+
const CatalogLastUpdateCellWrapper = styled_components_1.default.div `
|
|
43
|
+
color: var(--text-color-helper);
|
|
44
|
+
`;
|
|
45
|
+
//# sourceMappingURL=CatalogLastUpdateCell.js.map
|
|
@@ -5,16 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CatalogOwnersCell = CatalogOwnersCell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
|
|
9
9
|
function CatalogOwnersCell({ owners }) {
|
|
10
10
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogOwnersCell" },
|
|
11
|
-
react_1.default.createElement(
|
|
11
|
+
react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-owners-cell", items: owners, showPlaceholder: false, tagProps: {
|
|
12
|
+
variant: 'outline',
|
|
12
13
|
style: {
|
|
13
14
|
fontSize: 'var(--font-size-base)',
|
|
14
15
|
backgroundColor: 'transparent',
|
|
15
16
|
borderRadius: 'var(--border-radius-xl)',
|
|
17
|
+
margin: 0,
|
|
16
18
|
},
|
|
17
19
|
textTransform: 'none',
|
|
18
|
-
} })));
|
|
20
|
+
}, showAvatars: true })));
|
|
19
21
|
}
|
|
20
22
|
//# sourceMappingURL=CatalogOwnersCell.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SortOption } from '../../../core/types';
|
|
3
2
|
import { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
|
|
4
3
|
export type CatalogTableHeaderCellProps<T extends BaseEntity> = {
|
|
5
4
|
column: CatalogColumn<T>;
|
|
6
|
-
currentSortOption?:
|
|
5
|
+
currentSortOption?: string | null;
|
|
7
6
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
8
7
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
9
8
|
};
|
|
10
|
-
export declare const CatalogTableHeaderCell: <T extends BaseEntity>({ column, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellProps<T>) => React.JSX.Element;
|
|
9
|
+
export declare const CatalogTableHeaderCell: <T extends BaseEntity>({ column, currentSortOption, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellProps<T>) => React.JSX.Element;
|
|
@@ -42,9 +42,10 @@ const styled_components_1 = __importStar(require("styled-components"));
|
|
|
42
42
|
const CaretDownIcon_1 = require("../../../icons/CaretDownIcon/CaretDownIcon");
|
|
43
43
|
const CaretUpIcon_1 = require("../../../icons/CaretUpIcon/CaretUpIcon");
|
|
44
44
|
const hooks_1 = require("../../../core/hooks");
|
|
45
|
-
const CatalogTableHeaderCell = ({ column, handleSortClick, isColumnSorted, }) => {
|
|
45
|
+
const CatalogTableHeaderCell = ({ column, currentSortOption, handleSortClick, isColumnSorted, }) => {
|
|
46
46
|
const { handleCellClick, sortKey, isUpActive, isDownActive } = (0, hooks_1.useCatalogTableHeaderCellActions)({
|
|
47
47
|
column,
|
|
48
|
+
currentSortOption,
|
|
48
49
|
handleSortClick,
|
|
49
50
|
isColumnSorted,
|
|
50
51
|
});
|
|
@@ -81,7 +82,7 @@ const SortIndicator = styled_components_1.default.div `
|
|
|
81
82
|
flex-direction: column;
|
|
82
83
|
align-items: center;
|
|
83
84
|
justify-content: center;
|
|
84
|
-
margin-left:
|
|
85
|
+
margin-left: 4px;
|
|
85
86
|
gap: 2px;
|
|
86
87
|
color: var(--catalog-table-header-sort-indicator-color);
|
|
87
88
|
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
|
-
import type { SortOption } from '../../../core/types';
|
|
4
3
|
export type BaseEntity = {
|
|
5
4
|
id: string;
|
|
6
5
|
key: string;
|
|
@@ -13,7 +12,7 @@ export type CatalogTableViewProps<T extends BaseEntity> = {
|
|
|
13
12
|
entitiesCatalogConfig?: EntitiesCatalogConfig;
|
|
14
13
|
catalogConfig: CatalogEntityConfig;
|
|
15
14
|
columns?: CatalogColumn<T>[];
|
|
16
|
-
currentSortOption?:
|
|
15
|
+
currentSortOption?: string | null;
|
|
17
16
|
onRowClick?: (entity: T) => void;
|
|
18
17
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
19
18
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
@@ -14,13 +14,14 @@ const CatalogTagsCell_1 = require("../../../components/Catalog/CatalogTableView/
|
|
|
14
14
|
const CatalogTableViewRow_1 = require("../../../components/Catalog/CatalogTableView/CatalogTableViewRow");
|
|
15
15
|
const CatalogEntityTypeTag_1 = require("../../../components/Catalog/CatalogEntityTypeTag");
|
|
16
16
|
const core_1 = require("../../../core");
|
|
17
|
+
const CatalogLastUpdateCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogLastUpdateCell");
|
|
17
18
|
const baseColumns = [
|
|
18
19
|
{
|
|
19
20
|
key: 'entity',
|
|
20
21
|
title: 'Entity',
|
|
21
22
|
render: (entity) => react_1.default.createElement(CatalogEntityCell_1.CatalogEntityCell, { entity: entity }),
|
|
22
23
|
width: '3fr',
|
|
23
|
-
minWidth: '
|
|
24
|
+
minWidth: '164px',
|
|
24
25
|
sortable: true,
|
|
25
26
|
sortKey: 'title',
|
|
26
27
|
},
|
|
@@ -29,7 +30,7 @@ const baseColumns = [
|
|
|
29
30
|
title: 'Type',
|
|
30
31
|
render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
|
|
31
32
|
width: '2fr',
|
|
32
|
-
minWidth: '
|
|
33
|
+
minWidth: '162px',
|
|
33
34
|
sortable: true,
|
|
34
35
|
sortKey: 'type',
|
|
35
36
|
},
|
|
@@ -41,7 +42,7 @@ const baseColumns = [
|
|
|
41
42
|
return (react_1.default.createElement(CatalogDomainsCell_1.CatalogDomainsCell, { domains: ((_a = entity.domains) === null || _a === void 0 ? void 0 : _a.map((domain) => domain.title)) || [] }));
|
|
42
43
|
},
|
|
43
44
|
width: '2fr',
|
|
44
|
-
minWidth: '
|
|
45
|
+
minWidth: '162px',
|
|
45
46
|
},
|
|
46
47
|
{
|
|
47
48
|
key: 'owners',
|
|
@@ -51,14 +52,23 @@ const baseColumns = [
|
|
|
51
52
|
return (react_1.default.createElement(CatalogOwnersCell_1.CatalogOwnersCell, { owners: ((_a = entity.owners) === null || _a === void 0 ? void 0 : _a.map((owner) => owner.title)) || [] }));
|
|
52
53
|
},
|
|
53
54
|
width: '2fr',
|
|
54
|
-
minWidth: '
|
|
55
|
+
minWidth: '162px',
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
58
|
key: 'tags',
|
|
58
59
|
title: 'Tags',
|
|
59
60
|
render: (entity) => react_1.default.createElement(CatalogTagsCell_1.CatalogTagsCell, { entity: entity }),
|
|
60
61
|
width: '2fr',
|
|
61
|
-
minWidth: '
|
|
62
|
+
minWidth: '160px',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: 'lastUpdate',
|
|
66
|
+
title: 'Last update',
|
|
67
|
+
render: (entity) => react_1.default.createElement(CatalogLastUpdateCell_1.CatalogLastUpdateCell, { lastModified: entity.updatedAt }),
|
|
68
|
+
width: '1fr',
|
|
69
|
+
minWidth: '112px',
|
|
70
|
+
sortable: true,
|
|
71
|
+
sortKey: 'updated_at',
|
|
62
72
|
},
|
|
63
73
|
];
|
|
64
74
|
const CatalogTableView = ({ entities, entitiesCatalogConfig, catalogConfig, columns = baseColumns, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, contentMinWidth, }) => {
|
|
@@ -5,13 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CatalogTagsCell = CatalogTagsCell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const
|
|
8
|
+
const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
|
|
9
9
|
function CatalogTagsCell({ entity }) {
|
|
10
10
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogTagsCell" },
|
|
11
|
-
react_1.default.createElement(
|
|
11
|
+
react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-tags-cell", items: entity.tags || [], showPlaceholder: false, tagProps: {
|
|
12
12
|
style: {
|
|
13
13
|
fontSize: 'var(--font-size-base)',
|
|
14
14
|
borderRadius: 'var(--border-radius)',
|
|
15
|
+
margin: 0,
|
|
15
16
|
},
|
|
16
17
|
borderless: true,
|
|
17
18
|
color: 'grey',
|
|
@@ -38,8 +38,8 @@ const EntityTitle = styled_components_1.default.div `
|
|
|
38
38
|
text-overflow: ellipsis;
|
|
39
39
|
`;
|
|
40
40
|
exports.Email = styled_components_1.default.div `
|
|
41
|
-
font-size: var(--catalog-
|
|
42
|
-
line-height: var(--catalog-
|
|
41
|
+
font-size: var(--catalog-user-entity-cell-email-font-size);
|
|
42
|
+
line-height: var(--catalog-user-entity-cell-email-line-height);
|
|
43
43
|
color: var(--color-blue-6);
|
|
44
44
|
white-space: nowrap;
|
|
45
45
|
overflow: hidden;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { TagProps } from '../../components/Tag/Tag';
|
|
3
|
+
export type CatalogTagsProps = {
|
|
4
|
+
items: string[];
|
|
5
|
+
itemsToShow?: number;
|
|
6
|
+
showPlaceholder?: boolean;
|
|
7
|
+
tagProps?: TagProps;
|
|
8
|
+
showAvatars?: boolean;
|
|
9
|
+
maxItemLength?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function CatalogTags({ items, itemsToShow, showPlaceholder, showAvatars, tagProps, maxItemLength, }: CatalogTagsProps): JSX.Element | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
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.CatalogTags = CatalogTags;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const constants_1 = require("../../core/constants");
|
|
10
|
+
const Tag_1 = require("../../components/Tag/Tag");
|
|
11
|
+
const Tooltip_1 = require("../../components/Tooltip/Tooltip");
|
|
12
|
+
const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
|
|
13
|
+
const hooks_1 = require("../../core/hooks");
|
|
14
|
+
const CatalogAvatar_1 = require("../../components/Catalog/CatalogAvatar");
|
|
15
|
+
function CatalogTags({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, maxItemLength = constants_1.CATALOG_TAG_MAX_LENGTH, }) {
|
|
16
|
+
var _a;
|
|
17
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
18
|
+
const { translate } = useTranslate();
|
|
19
|
+
if (!items || items.length === 0) {
|
|
20
|
+
if (showPlaceholder) {
|
|
21
|
+
return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTags" }, translate('catalog.notConnected', 'Not connected')));
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const maxLength = showAvatars || (tagProps === null || tagProps === void 0 ? void 0 : tagProps.icon) ? maxItemLength - 3 : maxItemLength;
|
|
26
|
+
const isFirstItemTruncated = ((_a = items[0]) === null || _a === void 0 ? void 0 : _a.length) > maxLength;
|
|
27
|
+
const anyItemHidden = items.length > itemsToShow;
|
|
28
|
+
const shouldUseVariantWithTooltip = anyItemHidden || isFirstItemTruncated;
|
|
29
|
+
if (shouldUseVariantWithTooltip) {
|
|
30
|
+
const displayedItems = items.slice(0, itemsToShow);
|
|
31
|
+
const remainingCount = items.length - itemsToShow;
|
|
32
|
+
return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog" },
|
|
33
|
+
react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" },
|
|
34
|
+
displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
|
|
35
|
+
icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
|
|
36
|
+
style: Object.assign(Object.assign({}, tagProps === null || tagProps === void 0 ? void 0 : tagProps.style), { paddingLeft: 'var(--catalog-tags-tag-left-padding)' }),
|
|
37
|
+
}), { textTransform: "none", maxLength: maxLength }),
|
|
38
|
+
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
|
|
39
|
+
remainingCount > 0 && react_1.default.createElement(MoreTagsButton, null,
|
|
40
|
+
"+ ",
|
|
41
|
+
remainingCount))));
|
|
42
|
+
}
|
|
43
|
+
return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
|
|
44
|
+
icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
|
|
45
|
+
style: Object.assign(Object.assign({}, tagProps === null || tagProps === void 0 ? void 0 : tagProps.style), { paddingLeft: 'var(--catalog-tags-tag-left-padding)' }),
|
|
46
|
+
}), { maxLength: maxLength }),
|
|
47
|
+
react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
|
|
48
|
+
}
|
|
49
|
+
const CatalogTagsWrapper = styled_components_1.default.div `
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
`;
|
|
53
|
+
const MoreTagsButton = styled_components_1.default.span `
|
|
54
|
+
font-size: var(--catalog-tags-more-button-font-size);
|
|
55
|
+
margin-left: var(--catalog-tags-more-button-margin-left);
|
|
56
|
+
`;
|
|
57
|
+
const CatalogTagsNotConnectedWrapper = styled_components_1.default.span `
|
|
58
|
+
font-size: var(--catalog-tags-not-connected-font-size);
|
|
59
|
+
line-height: var(--catalog-tags-not-connected-line-height);
|
|
60
|
+
color: var(--catalog-tags-not-connected-color);
|
|
61
|
+
`;
|
|
62
|
+
//# sourceMappingURL=CatalogTags.js.map
|
|
@@ -49,7 +49,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
49
49
|
--catalog-description-text-color: var(--text-color-secondary);
|
|
50
50
|
--catalog-description-font-weight: var(--font-weight-regular);
|
|
51
51
|
--catalog-description-font-size: var(--font-size-lg);
|
|
52
|
-
--catalog-description-margin: 0 0 var(--spacing-
|
|
52
|
+
--catalog-description-margin: 0 0 var(--spacing-base) 0;
|
|
53
53
|
--catalog-description-line-height: var(--line-height-lg);
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -154,6 +154,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
154
154
|
--catalog-tags-not-connected-font-size: var(--font-size-base);
|
|
155
155
|
--catalog-tags-not-connected-line-height: var(--line-height-base);
|
|
156
156
|
--catalog-tags-not-connected-color: var(--text-color-disabled);
|
|
157
|
+
--catalog-tags-tag-left-padding: 2px;
|
|
157
158
|
|
|
158
159
|
/**
|
|
159
160
|
* @tokens Catalog empty state
|
|
@@ -208,7 +209,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
208
209
|
* @tokens Catalog card
|
|
209
210
|
*/
|
|
210
211
|
--catalog-card-height: 241px;
|
|
211
|
-
--catalog-card-padding-vertical: var(--spacing-
|
|
212
|
+
--catalog-card-padding-vertical: var(--spacing-md);
|
|
212
213
|
--catalog-card-padding-horizontal: var(--spacing-md);
|
|
213
214
|
--catalog-card-gap: var(--spacing-sm);
|
|
214
215
|
--catalog-card-text-color: var(--text-color-secondary);
|
|
@@ -283,7 +284,7 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
283
284
|
/**
|
|
284
285
|
* @tokens Catalog card footer
|
|
285
286
|
*/
|
|
286
|
-
--catalog-card-footer-height:
|
|
287
|
+
--catalog-card-footer-height: 68px;
|
|
287
288
|
|
|
288
289
|
/**
|
|
289
290
|
* @tokens Catalog card description
|
|
@@ -315,11 +316,6 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
315
316
|
--catalog-page-badge-dot-size: 6px;
|
|
316
317
|
--catalog-page-badge-dot-border-color: var(--color-static-white);
|
|
317
318
|
|
|
318
|
-
/**
|
|
319
|
-
* @tokens Catalog card metadata
|
|
320
|
-
*/
|
|
321
|
-
--catalog-card-metadata-owner-tag-left-padding: 2px;
|
|
322
|
-
|
|
323
319
|
|
|
324
320
|
/**
|
|
325
321
|
* @tokens Catalog table
|
|
@@ -327,13 +323,13 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
327
323
|
--catalog-table-border-color: var(--border-color-secondary);
|
|
328
324
|
--catalog-table-header-bg-color: var(--layer-color);
|
|
329
325
|
--catalog-table-header-font-weight: var(--font-weight-medium);
|
|
330
|
-
--catalog-table-header-cell-padding: 4px 8px;
|
|
331
|
-
--catalog-table-cell-padding: 4px 8px;
|
|
326
|
+
--catalog-table-header-cell-padding: 4px 6px 4px 8px;
|
|
327
|
+
--catalog-table-cell-padding: 4px 6px 4px 8px;
|
|
332
328
|
--catalog-table-row-hover-bg-color: var(--bg-color-hover, rgba(0, 0, 0, 0.04));
|
|
333
329
|
--catalog-table-empty-state-padding: 32px;
|
|
334
330
|
--catalog-table-empty-state-color: var(--text-color-secondary);
|
|
335
|
-
--catalog-table-title-cell-gap:
|
|
336
|
-
--catalog-table-entity-title-content-offset:
|
|
331
|
+
--catalog-table-title-cell-gap: var(--spacing-xs);
|
|
332
|
+
--catalog-table-entity-title-content-offset: 40px;
|
|
337
333
|
|
|
338
334
|
/**
|
|
339
335
|
* @tokens Catalog table header
|
|
@@ -503,8 +499,6 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
503
499
|
--catalog-history-pill-line-height: var(--line-height-base);
|
|
504
500
|
--catalog-history-pill-text-color: var(--text-color-primary);
|
|
505
501
|
--catalog-history-pill-min-width: calc(100% - 118px - var(--catalog-history-item-gap));
|
|
506
|
-
|
|
507
|
-
|
|
508
502
|
// @tokens End
|
|
509
503
|
|
|
510
504
|
/**
|
|
@@ -583,6 +577,20 @@ exports.catalog = (0, styled_components_1.css) `
|
|
|
583
577
|
--catalog-history-sidebar-version-tag-border-radius: var(--border-radius-xl);
|
|
584
578
|
--catalog-history-sidebar-revision-tag-border-radius: var(--border-radius-xl);
|
|
585
579
|
// @tokens End
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* @tokens Catalog entity type icon
|
|
583
|
+
*/
|
|
584
|
+
--catalog-table-icon-width-large: 32px;
|
|
585
|
+
--catalog-table-icon-height-large: 32px;
|
|
586
|
+
--catalog-table-icon-width-medium: 24px;
|
|
587
|
+
--catalog-table-icon-height-medium: 24px;
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* @tokens Catalog user entity cell
|
|
591
|
+
*/
|
|
592
|
+
--catalog-user-entity-cell-email-font-size: var(--font-size-base);
|
|
593
|
+
--catalog-user-entity-cell-email-line-height: var(--line-height-base);
|
|
586
594
|
`;
|
|
587
595
|
/* eslint-enable theme/no-raw-colors-in-styles */
|
|
588
596
|
//# sourceMappingURL=variables.js.map
|
|
@@ -24,7 +24,7 @@ exports.filter = (0, styled_components_1.css) `
|
|
|
24
24
|
--filter-option-margin: 0;
|
|
25
25
|
|
|
26
26
|
--filter-option-label-font-size: var(--font-size-base);
|
|
27
|
-
--filter-option-label-color: var(--text-color-
|
|
27
|
+
--filter-option-label-color: var(--text-color-primary);
|
|
28
28
|
|
|
29
29
|
--filter-option-checkbox-padding-left: var(--spacing-xs);
|
|
30
30
|
|
|
@@ -48,9 +48,9 @@ exports.Link = Link;
|
|
|
48
48
|
const React = __importStar(require("react"));
|
|
49
49
|
const react_1 = require("react");
|
|
50
50
|
const react_router_dom_1 = require("react-router-dom");
|
|
51
|
-
const
|
|
51
|
+
const ThemeDataContext_1 = require("../../core/contexts/ThemeDataContext");
|
|
52
52
|
function Link(props) {
|
|
53
|
-
const context = (0, react_1.useContext)(
|
|
53
|
+
const context = (0, react_1.useContext)(ThemeDataContext_1.ThemeDataContext);
|
|
54
54
|
if (context === null || context === void 0 ? void 0 : context.components) {
|
|
55
55
|
const { LinkComponent } = context.components;
|
|
56
56
|
return React.createElement(LinkComponent, Object.assign({}, props));
|
|
@@ -200,6 +200,7 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
|
|
|
200
200
|
(0, styled_components_1.css) `
|
|
201
201
|
color: ${deprecated ? 'var(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
202
202
|
background-color: var(--menu-item-bg-color-active);
|
|
203
|
+
font-weight: var(--menu-item-font-weight-active);
|
|
203
204
|
|
|
204
205
|
${ChevronDownIcon_1.ChevronDownIcon} path {
|
|
205
206
|
fill: var(--menu-item-color-active);
|