@redocly/theme 0.64.0-next.0 → 0.64.0-next.2
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/Banner/Banner.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/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/Search/SearchDialog.js +118 -116
- package/lib/components/SvgViewer/variables.dark.js +1 -1
- package/lib/core/constants/catalog.d.ts +1 -1
- package/lib/core/constants/catalog.js +1 -1
- 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 +1 -0
- package/lib/core/hooks/index.js +1 -0
- package/lib/core/styles/dark.d.ts +3 -1
- package/lib/core/styles/dark.js +42 -31
- package/lib/core/styles/global.d.ts +6 -2
- package/lib/core/styles/global.js +54 -39
- 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 +216 -0
- package/lib/core/styles/palette.js +179 -0
- package/lib/core/types/catalog.d.ts +23 -7
- package/lib/core/types/hooks.d.ts +6 -4
- package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.d.ts +9 -0
- package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.js +27 -0
- package/lib/icons/StopIcon/StopIcon.d.ts +9 -0
- package/lib/icons/StopIcon/StopIcon.js +22 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +3 -1
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +7 -0
- package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +95 -0
- package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +1 -0
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +1 -0
- package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +8 -0
- package/lib/markdoc/components/ExcalidrawDiagram/variables.js +15 -0
- package/lib/markdoc/components/Heading/Heading.js +2 -2
- package/lib/markdoc/components/Mermaid/Mermaid.js +2 -0
- package/lib/markdoc/components/default.d.ts +1 -0
- package/lib/markdoc/components/default.js +1 -0
- package/package.json +2 -2
- package/src/components/Banner/Banner.tsx +7 -7
- 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/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/Search/SearchDialog.tsx +299 -293
- package/src/components/SvgViewer/variables.dark.ts +1 -1
- package/src/core/constants/catalog.ts +1 -1
- 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 +1 -0
- package/src/core/styles/dark.ts +14 -2
- package/src/core/styles/global.ts +28 -13
- package/src/core/styles/palette.dark.ts +214 -0
- package/src/core/styles/palette.ts +177 -0
- package/src/core/types/catalog.ts +24 -8
- package/src/core/types/hooks.ts +5 -10
- package/src/icons/ColorPaletteIcon/ColorPaletteIcon.tsx +28 -0
- package/src/icons/StopIcon/StopIcon.tsx +23 -0
- package/src/index.ts +3 -1
- package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +85 -0
- package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +5 -0
- package/src/markdoc/components/ExcalidrawDiagram/variables.ts +12 -0
- package/src/markdoc/components/Heading/Heading.tsx +2 -1
- package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
- package/src/markdoc/components/default.ts +1 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import { SortOption } from '@redocly/theme/core/types';
|
|
5
4
|
import { CaretDownIcon } from '@redocly/theme/icons/CaretDownIcon/CaretDownIcon';
|
|
6
5
|
import { CaretUpIcon } from '@redocly/theme/icons/CaretUpIcon/CaretUpIcon';
|
|
7
6
|
import { useCatalogTableHeaderCellActions } from '@redocly/theme/core/hooks';
|
|
@@ -12,18 +11,20 @@ import {
|
|
|
12
11
|
|
|
13
12
|
export type CatalogTableHeaderCellProps<T extends BaseEntity> = {
|
|
14
13
|
column: CatalogColumn<T>;
|
|
15
|
-
currentSortOption?:
|
|
14
|
+
currentSortOption?: string | null;
|
|
16
15
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
17
16
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
export const CatalogTableHeaderCell = <T extends BaseEntity>({
|
|
21
20
|
column,
|
|
21
|
+
currentSortOption,
|
|
22
22
|
handleSortClick,
|
|
23
23
|
isColumnSorted,
|
|
24
24
|
}: CatalogTableHeaderCellProps<T>) => {
|
|
25
25
|
const { handleCellClick, sortKey, isUpActive, isDownActive } = useCatalogTableHeaderCellActions({
|
|
26
26
|
column,
|
|
27
|
+
currentSortOption,
|
|
27
28
|
handleSortClick,
|
|
28
29
|
isColumnSorted,
|
|
29
30
|
});
|
|
@@ -88,7 +89,7 @@ const SortIndicator = styled.div`
|
|
|
88
89
|
flex-direction: column;
|
|
89
90
|
align-items: center;
|
|
90
91
|
justify-content: center;
|
|
91
|
-
margin-left:
|
|
92
|
+
margin-left: 4px;
|
|
92
93
|
gap: 2px;
|
|
93
94
|
color: var(--catalog-table-header-sort-indicator-color);
|
|
94
95
|
`;
|
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
7
|
import { CatalogOwnersCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogOwnersCell';
|
|
8
8
|
import { CatalogDomainsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogDomainsCell';
|
|
@@ -12,6 +12,7 @@ import { CatalogTagsCell } from '@redocly/theme/components/Catalog/CatalogTableV
|
|
|
12
12
|
import { CatalogTableViewRow } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableViewRow';
|
|
13
13
|
import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag';
|
|
14
14
|
import { breakpoints } from '@redocly/theme/core';
|
|
15
|
+
import { CatalogLastUpdateCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogLastUpdateCell';
|
|
15
16
|
|
|
16
17
|
export type BaseEntity = {
|
|
17
18
|
id: string;
|
|
@@ -26,7 +27,7 @@ export type CatalogTableViewProps<T extends BaseEntity> = {
|
|
|
26
27
|
entitiesCatalogConfig?: EntitiesCatalogConfig;
|
|
27
28
|
catalogConfig: CatalogEntityConfig;
|
|
28
29
|
columns?: CatalogColumn<T>[];
|
|
29
|
-
currentSortOption?:
|
|
30
|
+
currentSortOption?: string | null;
|
|
30
31
|
onRowClick?: (entity: T) => void;
|
|
31
32
|
handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
|
|
32
33
|
isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
|
|
@@ -50,7 +51,7 @@ const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
|
|
|
50
51
|
title: 'Entity',
|
|
51
52
|
render: (entity) => <CatalogEntityCell entity={entity} />,
|
|
52
53
|
width: '3fr',
|
|
53
|
-
minWidth: '
|
|
54
|
+
minWidth: '164px',
|
|
54
55
|
sortable: true,
|
|
55
56
|
sortKey: 'title',
|
|
56
57
|
},
|
|
@@ -59,7 +60,7 @@ const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
|
|
|
59
60
|
title: 'Type',
|
|
60
61
|
render: (entity) => <CatalogEntityTypeTag entityType={entity.type} />,
|
|
61
62
|
width: '2fr',
|
|
62
|
-
minWidth: '
|
|
63
|
+
minWidth: '162px',
|
|
63
64
|
sortable: true,
|
|
64
65
|
sortKey: 'type',
|
|
65
66
|
},
|
|
@@ -70,7 +71,7 @@ const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
|
|
|
70
71
|
<CatalogDomainsCell domains={entity.domains?.map((domain) => domain.title) || []} />
|
|
71
72
|
),
|
|
72
73
|
width: '2fr',
|
|
73
|
-
minWidth: '
|
|
74
|
+
minWidth: '162px',
|
|
74
75
|
},
|
|
75
76
|
{
|
|
76
77
|
key: 'owners',
|
|
@@ -79,14 +80,23 @@ const baseColumns: CatalogColumn<BffCatalogEntity>[] = [
|
|
|
79
80
|
<CatalogOwnersCell owners={entity.owners?.map((owner) => owner.title) || []} />
|
|
80
81
|
),
|
|
81
82
|
width: '2fr',
|
|
82
|
-
minWidth: '
|
|
83
|
+
minWidth: '162px',
|
|
83
84
|
},
|
|
84
85
|
{
|
|
85
86
|
key: 'tags',
|
|
86
87
|
title: 'Tags',
|
|
87
88
|
render: (entity) => <CatalogTagsCell entity={entity} />,
|
|
88
89
|
width: '2fr',
|
|
89
|
-
minWidth: '
|
|
90
|
+
minWidth: '160px',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: 'lastUpdate',
|
|
94
|
+
title: 'Last update',
|
|
95
|
+
render: (entity) => <CatalogLastUpdateCell lastModified={entity.updatedAt} />,
|
|
96
|
+
width: '1fr',
|
|
97
|
+
minWidth: '112px',
|
|
98
|
+
sortable: true,
|
|
99
|
+
sortKey: 'updated_at',
|
|
90
100
|
},
|
|
91
101
|
];
|
|
92
102
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
4
|
-
import {
|
|
4
|
+
import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
|
|
5
5
|
|
|
6
6
|
export type CatalogTagsCellProps = {
|
|
7
7
|
entity: BffCatalogEntity;
|
|
@@ -10,7 +10,7 @@ export type CatalogTagsCellProps = {
|
|
|
10
10
|
export function CatalogTagsCell({ entity }: CatalogTagsCellProps) {
|
|
11
11
|
return (
|
|
12
12
|
<div data-component-name="Catalog/CatalogTableView/CatalogTagsCell">
|
|
13
|
-
<
|
|
13
|
+
<CatalogTags
|
|
14
14
|
data-testid="catalog-tags-cell"
|
|
15
15
|
items={entity.tags || []}
|
|
16
16
|
showPlaceholder={false}
|
|
@@ -18,6 +18,7 @@ export function CatalogTagsCell({ entity }: CatalogTagsCellProps) {
|
|
|
18
18
|
style: {
|
|
19
19
|
fontSize: 'var(--font-size-base)',
|
|
20
20
|
borderRadius: 'var(--border-radius)',
|
|
21
|
+
margin: 0,
|
|
21
22
|
},
|
|
22
23
|
borderless: true,
|
|
23
24
|
color: 'grey',
|
|
@@ -48,8 +48,8 @@ const EntityTitle = styled.div`
|
|
|
48
48
|
`;
|
|
49
49
|
|
|
50
50
|
export const Email = styled.div`
|
|
51
|
-
font-size: var(--catalog-
|
|
52
|
-
line-height: var(--catalog-
|
|
51
|
+
font-size: var(--catalog-user-entity-cell-email-font-size);
|
|
52
|
+
line-height: var(--catalog-user-entity-cell-email-line-height);
|
|
53
53
|
color: var(--color-blue-6);
|
|
54
54
|
white-space: nowrap;
|
|
55
55
|
overflow: hidden;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React, { JSX } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
|
|
5
|
+
import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
|
|
6
|
+
import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
|
|
7
|
+
import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
|
|
8
|
+
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
9
|
+
import { CatalogAvatar } from '@redocly/theme/components/Catalog/CatalogAvatar';
|
|
10
|
+
|
|
11
|
+
export type CatalogTagsProps = {
|
|
12
|
+
items: string[];
|
|
13
|
+
itemsToShow?: number;
|
|
14
|
+
showPlaceholder?: boolean;
|
|
15
|
+
tagProps?: TagProps;
|
|
16
|
+
showAvatars?: boolean;
|
|
17
|
+
maxItemLength?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function CatalogTags({
|
|
21
|
+
items,
|
|
22
|
+
itemsToShow = 1,
|
|
23
|
+
showPlaceholder = false,
|
|
24
|
+
showAvatars,
|
|
25
|
+
tagProps,
|
|
26
|
+
maxItemLength = CATALOG_TAG_MAX_LENGTH,
|
|
27
|
+
}: CatalogTagsProps): JSX.Element | null {
|
|
28
|
+
const { useTranslate } = useThemeHooks();
|
|
29
|
+
const { translate } = useTranslate();
|
|
30
|
+
|
|
31
|
+
if (!items || items.length === 0) {
|
|
32
|
+
if (showPlaceholder) {
|
|
33
|
+
return (
|
|
34
|
+
<CatalogTagsNotConnectedWrapper data-component-name="Catalog/CatalogTags">
|
|
35
|
+
{translate('catalog.notConnected', 'Not connected')}
|
|
36
|
+
</CatalogTagsNotConnectedWrapper>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const maxLength = showAvatars || tagProps?.icon ? maxItemLength - 3 : maxItemLength;
|
|
43
|
+
const isFirstItemTruncated = items[0]?.length > maxLength;
|
|
44
|
+
const anyItemHidden = items.length > itemsToShow;
|
|
45
|
+
|
|
46
|
+
const shouldUseVariantWithTooltip = anyItemHidden || isFirstItemTruncated;
|
|
47
|
+
|
|
48
|
+
if (shouldUseVariantWithTooltip) {
|
|
49
|
+
const displayedItems = items.slice(0, itemsToShow);
|
|
50
|
+
const remainingCount = items.length - itemsToShow;
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Tooltip tip={items.join(', ')} placement="bottom" className="catalog">
|
|
54
|
+
<CatalogTagsWrapper data-component-name="Catalog/CatalogTags">
|
|
55
|
+
{displayedItems.map((item, index) => (
|
|
56
|
+
<Tag
|
|
57
|
+
key={`${item}-${index}`}
|
|
58
|
+
{...tagProps}
|
|
59
|
+
{...(showAvatars && {
|
|
60
|
+
icon: <CatalogAvatar value={item} size="small" />,
|
|
61
|
+
style: {
|
|
62
|
+
...tagProps?.style,
|
|
63
|
+
paddingLeft: 'var(--catalog-tags-tag-left-padding)',
|
|
64
|
+
},
|
|
65
|
+
})}
|
|
66
|
+
textTransform="none"
|
|
67
|
+
maxLength={maxLength}
|
|
68
|
+
>
|
|
69
|
+
<CatalogHighlight>{item}</CatalogHighlight>
|
|
70
|
+
</Tag>
|
|
71
|
+
))}
|
|
72
|
+
|
|
73
|
+
{remainingCount > 0 && <MoreTagsButton>+ {remainingCount}</MoreTagsButton>}
|
|
74
|
+
</CatalogTagsWrapper>
|
|
75
|
+
</Tooltip>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<CatalogTagsWrapper data-component-name="Catalog/CatalogTags">
|
|
81
|
+
{items.map((item, index) => (
|
|
82
|
+
<Tag
|
|
83
|
+
key={`${item}-${index}`}
|
|
84
|
+
{...tagProps}
|
|
85
|
+
{...(showAvatars && {
|
|
86
|
+
icon: <CatalogAvatar value={item} size="small" />,
|
|
87
|
+
style: {
|
|
88
|
+
...tagProps?.style,
|
|
89
|
+
paddingLeft: 'var(--catalog-tags-tag-left-padding)',
|
|
90
|
+
},
|
|
91
|
+
})}
|
|
92
|
+
maxLength={maxLength}
|
|
93
|
+
>
|
|
94
|
+
<CatalogHighlight>{item}</CatalogHighlight>
|
|
95
|
+
</Tag>
|
|
96
|
+
))}
|
|
97
|
+
</CatalogTagsWrapper>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const CatalogTagsWrapper = styled.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
`;
|
|
105
|
+
|
|
106
|
+
const MoreTagsButton = styled.span`
|
|
107
|
+
font-size: var(--catalog-tags-more-button-font-size);
|
|
108
|
+
margin-left: var(--catalog-tags-more-button-margin-left);
|
|
109
|
+
`;
|
|
110
|
+
|
|
111
|
+
const CatalogTagsNotConnectedWrapper = styled.span`
|
|
112
|
+
font-size: var(--catalog-tags-not-connected-font-size);
|
|
113
|
+
line-height: var(--catalog-tags-not-connected-line-height);
|
|
114
|
+
color: var(--catalog-tags-not-connected-color);
|
|
115
|
+
`;
|
|
@@ -47,7 +47,7 @@ export const catalog = css`
|
|
|
47
47
|
--catalog-description-text-color: var(--text-color-secondary);
|
|
48
48
|
--catalog-description-font-weight: var(--font-weight-regular);
|
|
49
49
|
--catalog-description-font-size: var(--font-size-lg);
|
|
50
|
-
--catalog-description-margin: 0 0 var(--spacing-
|
|
50
|
+
--catalog-description-margin: 0 0 var(--spacing-base) 0;
|
|
51
51
|
--catalog-description-line-height: var(--line-height-lg);
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -152,6 +152,7 @@ export const catalog = css`
|
|
|
152
152
|
--catalog-tags-not-connected-font-size: var(--font-size-base);
|
|
153
153
|
--catalog-tags-not-connected-line-height: var(--line-height-base);
|
|
154
154
|
--catalog-tags-not-connected-color: var(--text-color-disabled);
|
|
155
|
+
--catalog-tags-tag-left-padding: 2px;
|
|
155
156
|
|
|
156
157
|
/**
|
|
157
158
|
* @tokens Catalog empty state
|
|
@@ -206,7 +207,7 @@ export const catalog = css`
|
|
|
206
207
|
* @tokens Catalog card
|
|
207
208
|
*/
|
|
208
209
|
--catalog-card-height: 241px;
|
|
209
|
-
--catalog-card-padding-vertical: var(--spacing-
|
|
210
|
+
--catalog-card-padding-vertical: var(--spacing-md);
|
|
210
211
|
--catalog-card-padding-horizontal: var(--spacing-md);
|
|
211
212
|
--catalog-card-gap: var(--spacing-sm);
|
|
212
213
|
--catalog-card-text-color: var(--text-color-secondary);
|
|
@@ -281,7 +282,7 @@ export const catalog = css`
|
|
|
281
282
|
/**
|
|
282
283
|
* @tokens Catalog card footer
|
|
283
284
|
*/
|
|
284
|
-
--catalog-card-footer-height:
|
|
285
|
+
--catalog-card-footer-height: 68px;
|
|
285
286
|
|
|
286
287
|
/**
|
|
287
288
|
* @tokens Catalog card description
|
|
@@ -313,11 +314,6 @@ export const catalog = css`
|
|
|
313
314
|
--catalog-page-badge-dot-size: 6px;
|
|
314
315
|
--catalog-page-badge-dot-border-color: var(--color-static-white);
|
|
315
316
|
|
|
316
|
-
/**
|
|
317
|
-
* @tokens Catalog card metadata
|
|
318
|
-
*/
|
|
319
|
-
--catalog-card-metadata-owner-tag-left-padding: 2px;
|
|
320
|
-
|
|
321
317
|
|
|
322
318
|
/**
|
|
323
319
|
* @tokens Catalog table
|
|
@@ -325,13 +321,13 @@ export const catalog = css`
|
|
|
325
321
|
--catalog-table-border-color: var(--border-color-secondary);
|
|
326
322
|
--catalog-table-header-bg-color: var(--layer-color);
|
|
327
323
|
--catalog-table-header-font-weight: var(--font-weight-medium);
|
|
328
|
-
--catalog-table-header-cell-padding: 4px 8px;
|
|
329
|
-
--catalog-table-cell-padding: 4px 8px;
|
|
324
|
+
--catalog-table-header-cell-padding: 4px 6px 4px 8px;
|
|
325
|
+
--catalog-table-cell-padding: 4px 6px 4px 8px;
|
|
330
326
|
--catalog-table-row-hover-bg-color: var(--bg-color-hover, rgba(0, 0, 0, 0.04));
|
|
331
327
|
--catalog-table-empty-state-padding: 32px;
|
|
332
328
|
--catalog-table-empty-state-color: var(--text-color-secondary);
|
|
333
|
-
--catalog-table-title-cell-gap:
|
|
334
|
-
--catalog-table-entity-title-content-offset:
|
|
329
|
+
--catalog-table-title-cell-gap: var(--spacing-xs);
|
|
330
|
+
--catalog-table-entity-title-content-offset: 40px;
|
|
335
331
|
|
|
336
332
|
/**
|
|
337
333
|
* @tokens Catalog table header
|
|
@@ -501,8 +497,6 @@ export const catalog = css`
|
|
|
501
497
|
--catalog-history-pill-line-height: var(--line-height-base);
|
|
502
498
|
--catalog-history-pill-text-color: var(--text-color-primary);
|
|
503
499
|
--catalog-history-pill-min-width: calc(100% - 118px - var(--catalog-history-item-gap));
|
|
504
|
-
|
|
505
|
-
|
|
506
500
|
// @tokens End
|
|
507
501
|
|
|
508
502
|
/**
|
|
@@ -581,5 +575,19 @@ export const catalog = css`
|
|
|
581
575
|
--catalog-history-sidebar-version-tag-border-radius: var(--border-radius-xl);
|
|
582
576
|
--catalog-history-sidebar-revision-tag-border-radius: var(--border-radius-xl);
|
|
583
577
|
// @tokens End
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* @tokens Catalog entity type icon
|
|
581
|
+
*/
|
|
582
|
+
--catalog-table-icon-width-large: 32px;
|
|
583
|
+
--catalog-table-icon-height-large: 32px;
|
|
584
|
+
--catalog-table-icon-width-medium: 24px;
|
|
585
|
+
--catalog-table-icon-height-medium: 24px;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* @tokens Catalog user entity cell
|
|
589
|
+
*/
|
|
590
|
+
--catalog-user-entity-cell-email-font-size: var(--font-size-base);
|
|
591
|
+
--catalog-user-entity-cell-email-line-height: var(--line-height-base);
|
|
584
592
|
`;
|
|
585
593
|
/* eslint-enable theme/no-raw-colors-in-styles */
|