@redocly/theme 0.64.0-next.1 → 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.
Files changed (121) hide show
  1. package/lib/components/Banner/Banner.js +3 -3
  2. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  4. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  5. package/lib/components/Catalog/CatalogEntities.js +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  27. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  28. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  29. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  30. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  31. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  32. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  33. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  34. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  35. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  36. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  37. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  38. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  39. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  40. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  42. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  43. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  44. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  45. package/lib/components/Catalog/CatalogTags.js +62 -0
  46. package/lib/components/Catalog/variables.js +22 -14
  47. package/lib/components/Search/SearchDialog.js +118 -116
  48. package/lib/core/constants/catalog.d.ts +1 -1
  49. package/lib/core/constants/catalog.js +1 -1
  50. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  52. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  54. package/lib/core/hooks/index.d.ts +1 -0
  55. package/lib/core/hooks/index.js +1 -0
  56. package/lib/core/styles/dark.d.ts +3 -1
  57. package/lib/core/styles/dark.js +8 -1
  58. package/lib/core/styles/global.d.ts +6 -2
  59. package/lib/core/styles/global.js +18 -10
  60. package/lib/core/styles/palette.d.ts +6 -0
  61. package/lib/core/styles/palette.dark.d.ts +3 -0
  62. package/lib/core/styles/palette.dark.js +216 -0
  63. package/lib/core/styles/palette.js +179 -0
  64. package/lib/core/types/catalog.d.ts +23 -7
  65. package/lib/core/types/hooks.d.ts +6 -4
  66. package/lib/index.d.ts +1 -1
  67. package/lib/index.js +1 -1
  68. package/lib/markdoc/components/Heading/Heading.js +2 -2
  69. package/package.json +2 -2
  70. package/src/components/Banner/Banner.tsx +7 -7
  71. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  72. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  73. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  74. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  75. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  76. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  77. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  78. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  79. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  80. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  81. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  82. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  83. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  84. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  85. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  86. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  87. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  88. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  90. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  91. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  92. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  93. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  94. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  95. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  96. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  97. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  98. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  99. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  100. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  101. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  102. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  103. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  104. package/src/components/Catalog/CatalogTags.tsx +115 -0
  105. package/src/components/Catalog/variables.ts +22 -14
  106. package/src/components/Search/SearchDialog.tsx +299 -293
  107. package/src/core/constants/catalog.ts +1 -1
  108. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  109. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  110. package/src/core/hooks/index.ts +1 -0
  111. package/src/core/styles/dark.ts +10 -2
  112. package/src/core/styles/global.ts +20 -12
  113. package/src/core/styles/palette.dark.ts +214 -0
  114. package/src/core/styles/palette.ts +177 -0
  115. package/src/core/types/catalog.ts +24 -8
  116. package/src/core/types/hooks.ts +5 -10
  117. package/src/index.ts +1 -1
  118. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  119. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  120. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  121. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
@@ -2,7 +2,7 @@ import React, { JSX, useEffect } from 'react';
2
2
 
3
3
  import type { CatalogEntityConfig } from '@redocly/config';
4
4
 
5
- import { BffCatalogEntity, BffCatalogEntityList, SortOption } from '@redocly/theme/core/types';
5
+ import { BffCatalogEntity, BffCatalogEntityList } from '@redocly/theme/core/types';
6
6
  import {
7
7
  useThemeHooks,
8
8
  useCatalogEntities,
@@ -24,7 +24,7 @@ export type CatalogEntitiesProps = {
24
24
  viewMode: string;
25
25
  setEntitiesCounter: (counter: number) => void;
26
26
  initialEntitiesList?: BffCatalogEntityList;
27
- sortOption: SortOption | null;
27
+ sortOption: string | null;
28
28
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
29
29
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
30
30
  };
@@ -66,7 +66,7 @@ export function CatalogEntities(props: CatalogEntitiesProps): JSX.Element {
66
66
  initialFilter && filterQuery
67
67
  ? `(${initialFilter}) AND (${filterQuery})`
68
68
  : initialFilter || filterQuery,
69
- sort: sortOption || undefined,
69
+ sort: sortOption || (viewMode === 'table' ? 'updated_at' : 'type,title'),
70
70
  search: searchQuery,
71
71
  },
72
72
  props.initialEntitiesList,
@@ -2,12 +2,9 @@ import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import { Route, Routes, useSearchParams } from 'react-router-dom';
4
4
 
5
- import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
6
- import type {
7
- BffCatalogEntity,
8
- BffCatalogRelatedEntity,
9
- BffCatalogRelatedEntityList,
10
- } from '@redocly/theme/core/types';
5
+ import type { CatalogEntityConfig } from '@redocly/config';
6
+ import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types';
7
+ import type { CatalogEntityPageProps, CatalogEntityProps } from '@redocly/theme/core/types';
11
8
 
12
9
  import { breakpoints } from '@redocly/theme/core/utils';
13
10
  import { CatalogPageDescription } from '@redocly/theme/components/Catalog/CatalogPageDescription';
@@ -22,24 +19,6 @@ import { CatalogEntityMethodAndPath } from '@redocly/theme/components/Catalog/Ca
22
19
  import { CatalogEntityRelationsGraph } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsGraph.lazy';
23
20
  import { CatalogEntityHistorySidebar } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar';
24
21
 
25
- export type CatalogEntityProps = {
26
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
27
- RedocSchema: React.ComponentType<any>;
28
- /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
29
- StoreProvider: React.ComponentType<any>;
30
- GraphqlTypeRenderer?: React.ComponentType<{ sdl: string; typeName: string }>;
31
- };
32
-
33
- type CatalogEntityPageProps = {
34
- status: 'success';
35
- entity: BffCatalogEntity;
36
- relatedEntity: BffCatalogRelatedEntity | null;
37
- relations: BffCatalogRelatedEntityList;
38
- entitiesCatalogConfig: EntitiesCatalogConfig;
39
- catalogConfig: CatalogEntityConfig;
40
- sharedDataIds?: Record<string, string>;
41
- };
42
-
43
22
  const renderFirstColumnEntitySection = (entity: BffCatalogEntity): React.ReactElement => {
44
23
  switch (entity.type) {
45
24
  case 'api-operation':
@@ -85,7 +85,7 @@ const MetadataWrapper = styled.div`
85
85
  border-radius: var(--border-radius);
86
86
  background-color: var(--catalog-metadata-bg-color);
87
87
  transition: all 0.2s ease-in-out;
88
- margin: var(--spacing-lg) 0;
88
+ margin-bottom: var(--spacing-base);
89
89
  `;
90
90
 
91
91
  const Label = styled.span`
@@ -52,7 +52,7 @@ const LinksWrapper = styled.div`
52
52
  border-radius: var(--border-radius);
53
53
  background-color: var(--catalog-metadata-bg-color);
54
54
  transition: all 0.2s ease-in-out;
55
- margin: var(--spacing-lg) 0;
55
+ margin: 0 0 var(--spacing-base) 0;
56
56
  `;
57
57
 
58
58
  const Label = styled.div`
@@ -81,6 +81,7 @@ const CatalogEntityPropertiesGridWrapper = styled.div`
81
81
  display: grid;
82
82
  gap: var(--spacing-base);
83
83
  grid-template-columns: 1fr;
84
+ margin-bottom: var(--spacing-lg);
84
85
 
85
86
  @media screen and (min-width: ${breakpoints.small}) {
86
87
  grid-template-columns: repeat(2, 1fr);
@@ -64,10 +64,11 @@ const CardHeader = styled.div`
64
64
  const CardContent = styled.div`
65
65
  flex: 1;
66
66
  display: flex;
67
- align-items: flex-end;
67
+ align-items: center;
68
68
  gap: var(--catalog-card-content-gap);
69
69
  flex-wrap: wrap;
70
70
  color: var(--text-color-primary);
71
71
  font-size: var(--font-size-lg);
72
72
  line-height: var(--line-height-lg);
73
+ font-weight: var(--font-weight-semibold);
73
74
  `;
@@ -2,9 +2,9 @@ import React, { JSX } from 'react';
2
2
 
3
3
  import { BffCatalogEntity } from '@redocly/theme/core/types';
4
4
  import { SlackIcon } from '@redocly/theme/icons/SlackIcon/SlackIcon';
5
- import { Tag } from '@redocly/theme/components/Tag/Tag';
6
5
  import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
6
  import { useThemeHooks } from '@redocly/theme/core/hooks';
7
+ import { Button } from '@redocly/theme/components/Button/Button';
8
8
 
9
9
  export type ContactPropertyProps = {
10
10
  entity: BffCatalogEntity;
@@ -28,18 +28,16 @@ export function ContactProperty({ entity }: ContactPropertyProps): JSX.Element {
28
28
  content={
29
29
  <>
30
30
  {channels?.map((channel) => (
31
- <Tag
31
+ <Button
32
32
  key={channel.name}
33
- textTransform="none"
34
- style={{ backgroundColor: 'var(--bg-color)', cursor: 'pointer' }}
35
- onClick={() => {
36
- if (channel.url) {
37
- window.open(channel.url, '_blank');
38
- }
39
- }}
33
+ variant="outlined"
34
+ size="small"
35
+ style={{ backgroundColor: 'var(--bg-color)' }}
36
+ to={channel.url}
37
+ external={true}
40
38
  >
41
39
  {channel.name}
42
- </Tag>
40
+ </Button>
43
41
  ))}
44
42
  </>
45
43
  }
@@ -1,17 +1,19 @@
1
1
  import React, { JSX } from 'react';
2
2
 
3
- import { BffCatalogEntity } from '@redocly/theme/core/types';
3
+ import { BffCatalogEntity, CatalogEntityPageProps } from '@redocly/theme/core/types';
4
4
  import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
5
- import { Tag } from '@redocly/theme/components/Tag/Tag';
6
5
  import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
- import { useThemeHooks } from '@redocly/theme/core/hooks';
6
+ import { useCatalogEntityLink, useThemeHooks } from '@redocly/theme/core/hooks';
7
+ import { Button } from '@redocly/theme/components/Button/Button';
8
8
 
9
9
  export type DomainsPropertyProps = {
10
10
  entity: BffCatalogEntity;
11
11
  };
12
12
 
13
13
  export function DomainsProperty({ entity }: DomainsPropertyProps): JSX.Element {
14
- const { useTranslate } = useThemeHooks();
14
+ const { useTranslate, usePageProps } = useThemeHooks();
15
+ const { entitiesCatalogConfig } = usePageProps<CatalogEntityPageProps>();
16
+ const { getEntityLink } = useCatalogEntityLink(entitiesCatalogConfig);
15
17
  const { translate } = useTranslate();
16
18
 
17
19
  const { domains = [] } = entity;
@@ -28,14 +30,17 @@ export function DomainsProperty({ entity }: DomainsPropertyProps): JSX.Element {
28
30
  content={
29
31
  <>
30
32
  {domains?.map((domain) => (
31
- <Tag
33
+ <Button
32
34
  key={domain?.id}
35
+ variant="outlined"
36
+ size="small"
33
37
  style={{ backgroundColor: 'var(--bg-color)' }}
34
- variant="outline"
38
+ to={getEntityLink(domain)}
39
+ icon={<GraphIcon />}
40
+ external={true}
35
41
  >
36
- <GraphIcon />
37
42
  {domain?.title}
38
- </Tag>
43
+ </Button>
39
44
  ))}
40
45
  </>
41
46
  }
@@ -26,6 +26,7 @@ export function FormatProperty({ entity }: FormatPropertyProps): JSX.Element {
26
26
  content={
27
27
  <>
28
28
  <Tag
29
+ variant="outline"
29
30
  textTransform="none"
30
31
  key={entity.metadata?.specType}
31
32
  style={{ backgroundColor: 'var(--bg-color)' }}
@@ -1,18 +1,22 @@
1
1
  import React, { JSX } from 'react';
2
2
 
3
- import { BffCatalogEntity } from '@redocly/theme/core/types';
3
+ import { BffCatalogEntity, CatalogEntityPageProps } from '@redocly/theme/core/types';
4
+ import { useCatalogEntityLink } from '@redocly/theme/core/hooks';
4
5
  import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
5
- import { Tag } from '@redocly/theme/components/Tag/Tag';
6
6
  import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
8
+ import { Button } from '@redocly/theme/components/Button/Button';
9
+ import { CatalogAvatar } from '@redocly/theme/components/Catalog/CatalogAvatar';
8
10
 
9
11
  export type OwnersPropertyProps = {
10
12
  entity: BffCatalogEntity;
11
13
  };
12
14
 
13
15
  export function OwnersProperty({ entity }: OwnersPropertyProps): JSX.Element {
14
- const { useTranslate } = useThemeHooks();
16
+ const { useTranslate, usePageProps } = useThemeHooks();
15
17
  const { translate } = useTranslate();
18
+ const { entitiesCatalogConfig } = usePageProps<CatalogEntityPageProps>();
19
+ const { getEntityLink } = useCatalogEntityLink(entitiesCatalogConfig);
16
20
 
17
21
  const { owners = [] } = entity;
18
22
 
@@ -27,18 +31,26 @@ export function OwnersProperty({ entity }: OwnersPropertyProps): JSX.Element {
27
31
  }
28
32
  content={
29
33
  <>
30
- {owners.map((owner) => (
31
- <Tag
32
- key={owner?.id}
33
- style={{
34
- backgroundColor: 'var(--bg-color)',
35
- borderRadius: 'var(--border-radius-xl)',
36
- }}
37
- variant="outline"
38
- >
39
- {owner?.title}
40
- </Tag>
41
- ))}
34
+ {owners.map((owner) => {
35
+ const entityLink = getEntityLink(owner);
36
+ return (
37
+ <Button
38
+ key={owner?.id}
39
+ variant="outlined"
40
+ size="small"
41
+ style={{
42
+ backgroundColor: 'var(--bg-color)',
43
+ borderRadius: 'var(--border-radius-xl)',
44
+ paddingLeft: '2px',
45
+ }}
46
+ to={entityLink}
47
+ icon={<CatalogAvatar value={owner?.key} size="small" />}
48
+ external={true}
49
+ >
50
+ {owner?.title}
51
+ </Button>
52
+ );
53
+ })}
42
54
  </>
43
55
  }
44
56
  />
@@ -2,7 +2,7 @@ import React, { JSX } from 'react';
2
2
 
3
3
  import { BffCatalogEntity } from '@redocly/theme/core/types';
4
4
  import { TagsIcon } from '@redocly/theme/icons/TagsIcon/TagsIcon';
5
- import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
5
+ import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
6
6
  import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
8
8
 
@@ -24,7 +24,7 @@ export function TagsProperty({ entity }: TagsPropertyProps): JSX.Element {
24
24
  </>
25
25
  }
26
26
  content={
27
- <CatalogTagsWithTooltip
27
+ <CatalogTags
28
28
  itemsToShow={8}
29
29
  items={entity.tags || []}
30
30
  tagProps={{
@@ -2,11 +2,7 @@ import React, { JSX, ReactNode } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
5
- import type {
6
- BffCatalogEntity,
7
- BffCatalogRelatedEntity,
8
- SortOption,
9
- } from '@redocly/theme/core/types';
5
+ import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types';
10
6
 
11
7
  import { Tabs, TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
12
8
  import { EntityTypeIcon } from '@redocly/theme/icons/EntityTypeIcon/EntityTypeIcon';
@@ -27,8 +23,8 @@ export type CatalogEntityApiDescriptionRelationsProps = {
27
23
  searchQuery: string;
28
24
  setSearchQuery: (query: string) => void;
29
25
  setFilter: (filter?: string) => void;
30
- sortOption: SortOption | null;
31
- setSortOption: (sortOption: SortOption | null) => void;
26
+ sortOption: string | null;
27
+ setSortOption: (sortOption: string | null) => void;
32
28
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
33
29
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
34
30
  shouldShowLoadMore: boolean;
@@ -50,7 +46,7 @@ export function CatalogEntityApiDescriptionRelations({
50
46
  shouldShowLoadMore,
51
47
  }: CatalogEntityApiDescriptionRelationsProps): JSX.Element {
52
48
  return (
53
- <div data-component-name="Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations">
49
+ <TabsWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations">
54
50
  <Tabs key={entity.id} size={TabsSize.MEDIUM}>
55
51
  <TabItem
56
52
  label="Operations"
@@ -121,10 +117,14 @@ export function CatalogEntityApiDescriptionRelations({
121
117
  />
122
118
  </TabItem>
123
119
  </Tabs>
124
- </div>
120
+ </TabsWrapper>
125
121
  );
126
122
  }
127
123
 
128
124
  const TabItem = styled.div<{ label: string; icon?: ReactNode }>`
129
125
  padding: var(--spacing-sm);
130
126
  `;
127
+
128
+ const TabsWrapper = styled.div`
129
+ --md-tabs-container-margin: none;
130
+ `;
@@ -2,17 +2,14 @@ import React, { JSX } from 'react';
2
2
 
3
3
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
4
4
  import type { ListType } from '@redocly/theme/core/types';
5
- import type {
6
- BffCatalogEntity,
7
- BffCatalogRelatedEntity,
8
- SortOption,
9
- } from '@redocly/theme/core/types';
5
+ import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types';
10
6
 
11
7
  import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
12
8
  import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
13
9
  import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
14
10
  import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag';
15
11
  import { CatalogEntityRelationCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityRelationCell';
12
+ import { CatalogLastUpdateCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogLastUpdateCell';
16
13
 
17
14
  export type CatalogEntityDefaultRelationsProps = {
18
15
  entity: BffCatalogEntity;
@@ -25,8 +22,8 @@ export type CatalogEntityDefaultRelationsProps = {
25
22
  };
26
23
  searchQuery: string;
27
24
  setSearchQuery: (query: string) => void;
28
- sortOption: SortOption | null;
29
- setSortOption: (sortOption: SortOption | null) => void;
25
+ sortOption: string | null;
26
+ setSortOption: (sortOption: string | null) => void;
30
27
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
31
28
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
32
29
  shouldShowLoadMore: boolean;
@@ -81,7 +78,7 @@ function getRelationsTableColumns(listType?: ListType): CatalogColumn<BffCatalog
81
78
  render: (entity) => <CatalogEntityCell entity={entity} />,
82
79
  sortable: true,
83
80
  sortKey: 'title',
84
- width: '2.5fr',
81
+ width: '4fr',
85
82
  },
86
83
  {
87
84
  key: 'type',
@@ -89,7 +86,7 @@ function getRelationsTableColumns(listType?: ListType): CatalogColumn<BffCatalog
89
86
  render: (entity) => <CatalogEntityTypeTag entityType={entity.type} />,
90
87
  sortable: true,
91
88
  sortKey: 'type',
92
- width: '1fr',
89
+ width: '2fr',
93
90
  },
94
91
  {
95
92
  key: 'relationType',
@@ -100,7 +97,18 @@ function getRelationsTableColumns(listType?: ListType): CatalogColumn<BffCatalog
100
97
  relationRole={entity.relationRole}
101
98
  />
102
99
  ),
100
+ width: '2fr',
101
+ sortable: true,
102
+ sortKey: 'relation_type',
103
+ },
104
+ {
105
+ key: 'lastUpdate',
106
+ title: 'Last update',
107
+ render: (entity) => <CatalogLastUpdateCell lastModified={entity.updatedAt} />,
103
108
  width: '1fr',
109
+ minWidth: '112px',
110
+ sortable: true,
111
+ sortKey: 'updated_at',
104
112
  },
105
113
  ];
106
114
 
@@ -32,7 +32,7 @@ export function CatalogEntityRelations({
32
32
  setSearchQuery,
33
33
  }: CatalogEntityRelationsProps): JSX.Element | null {
34
34
  const { useCatalogSort, useFetchCatalogEntitiesRelations } = useThemeHooks();
35
- const { sortOption, setSortOption, handleSortClick, isColumnSorted } = useCatalogSort('title');
35
+ const { sortOption, setSortOption, handleSortClick, isColumnSorted } = useCatalogSort();
36
36
 
37
37
  const [filter, setFilter] = useState<string | undefined>(ENTITY_DEFAULT_FILTERS[entity.type]);
38
38
 
@@ -3,11 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
5
5
  import type { ListType } from '@redocly/theme/core/types';
6
- import type {
7
- BffCatalogEntity,
8
- BffCatalogRelatedEntity,
9
- SortOption,
10
- } from '@redocly/theme/core/types';
6
+ import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types';
11
7
 
12
8
  import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
13
9
  import { CatalogActionsRow } from '@redocly/theme/components/Catalog/CatalogActionsRow';
@@ -28,8 +24,8 @@ export type CatalogEntityRelationsTableProps = {
28
24
  setSearchQuery: (query: string) => void;
29
25
  heading?: string;
30
26
  columns: CatalogColumn<BffCatalogRelatedEntity>[];
31
- sortOption: SortOption | null;
32
- setSortOption: (sortOption: SortOption | null) => void;
27
+ sortOption: string | null;
28
+ setSortOption: (sortOption: string | null) => void;
33
29
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
34
30
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
35
31
  shouldShowLoadMore: boolean;
@@ -112,7 +108,7 @@ const CatalogEntityRelationsTableWrapper = styled.div`
112
108
  `;
113
109
 
114
110
  const Heading = styled.h2`
115
- margin: var(--spacing-base) 0;
111
+ margin: 0 0 var(--spacing-base) 0;
116
112
  font-size: var(--font-size-md);
117
113
  color: var(--catalog-metadata-heading-color);
118
114
  `;
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
5
5
  import type { ListType } from '@redocly/theme/core/types';
6
- import type { BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
6
+ import type { BffCatalogRelatedEntity } from '@redocly/theme/core/types';
7
7
 
8
8
  import { ArrowDownIcon } from '@redocly/theme/icons/ArrowDownIcon/ArrowDownIcon';
9
9
  import { LoadMore } from '@redocly/theme/components/LoadMore/LoadMore';
@@ -24,7 +24,7 @@ export type CatalogEntityRelationsTableContentProps = {
24
24
  };
25
25
  searchQuery: string;
26
26
  columns: CatalogColumn<BffCatalogRelatedEntity>[];
27
- sortOption: SortOption | null;
27
+ sortOption: string | null;
28
28
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
29
29
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
30
30
  shouldShowLoadMore: boolean;
@@ -2,11 +2,7 @@ import React, { JSX, ReactNode } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
5
- import type {
6
- BffCatalogEntity,
7
- BffCatalogRelatedEntity,
8
- SortOption,
9
- } from '@redocly/theme/core/types';
5
+ import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types';
10
6
 
11
7
  import { Tabs, TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
12
8
  import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
@@ -16,6 +12,7 @@ import { Tag } from '@redocly/theme/components/Tag/Tag';
16
12
  import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
17
13
  import { CatalogUserEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogUserEntityCell';
18
14
  import { CatalogEntityDefaultRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations';
15
+ import { CatalogLastUpdateCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogLastUpdateCell';
19
16
 
20
17
  const teamColumns: CatalogColumn<BffCatalogRelatedEntity>[] = [
21
18
  {
@@ -24,12 +21,12 @@ const teamColumns: CatalogColumn<BffCatalogRelatedEntity>[] = [
24
21
  render: (entity) => (
25
22
  <CatalogUserEntityCell name={entity.title} email={entity.metadata?.email as string} />
26
23
  ),
27
- width: '2fr',
24
+ width: '3fr',
28
25
  sortable: true,
29
26
  sortKey: 'title',
30
27
  },
31
28
  {
32
- key: 'metadata',
29
+ key: 'metadata.role',
33
30
  title: 'Role',
34
31
  render: (entity) => (entity.metadata?.role ? <Tag>{entity.metadata?.role}</Tag> : null),
35
32
  width: '2fr',
@@ -38,7 +35,16 @@ const teamColumns: CatalogColumn<BffCatalogRelatedEntity>[] = [
38
35
  key: 'description',
39
36
  title: 'Description',
40
37
  render: (entity) => <EntityDescription>{entity.summary}</EntityDescription>,
41
- width: '3fr',
38
+ width: '2fr',
39
+ },
40
+ {
41
+ key: 'lastUpdate',
42
+ title: 'Last update',
43
+ render: (entity) => <CatalogLastUpdateCell lastModified={entity.updatedAt} />,
44
+ width: '1fr',
45
+ minWidth: '112px',
46
+ sortable: true,
47
+ sortKey: 'updated_at',
42
48
  },
43
49
  ];
44
50
 
@@ -55,8 +61,8 @@ export type CatalogEntityTeamRelationsProps = {
55
61
  searchQuery: string;
56
62
  setSearchQuery: (query: string) => void;
57
63
  setFilter: (filter: string) => void;
58
- sortOption: SortOption | null;
59
- setSortOption: (sortOption: SortOption | null) => void;
64
+ sortOption: string | null;
65
+ setSortOption: (sortOption: string | null) => void;
60
66
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
61
67
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
62
68
  shouldShowLoadMore: boolean;
@@ -40,7 +40,7 @@ export function CatalogEntitySchema({
40
40
  });
41
41
 
42
42
  return (
43
- <MetadataWrapper data-component-name="Catalog/CatalogEntity/CatalogEntityMetadata">
43
+ <MetadataWrapper data-component-name="Catalog/CatalogEntity/CatalogEntitySchema">
44
44
  <HeaderWrapper>
45
45
  <Heading>{translate('catalog.entity.schema.title')}</Heading>
46
46
  {!isGraphql && (
@@ -89,8 +89,7 @@ const MetadataWrapper = styled.div`
89
89
  flex-direction: column;
90
90
  border-radius: var(--border-radius);
91
91
  background-color: var(--catalog-metadata-bg-color);
92
- margin-top: var(--spacing-base);
93
- margin-bottom: var(--spacing-xs);
92
+ margin-bottom: var(--spacing-lg);
94
93
  `;
95
94
 
96
95
  const SchemaContentWrapper = styled.div`
@@ -110,6 +109,8 @@ const HeaderWrapper = styled.div`
110
109
 
111
110
  const Heading = styled.h2`
112
111
  font-size: var(--catalog-metadata-heading-size);
112
+ line-height: var(--line-height-lg);
113
+ margin: 0;
113
114
  `;
114
115
 
115
116
  const SplitViewWrapper = styled.div`
@@ -6,33 +6,40 @@ import { PREDEFINED_ENTITY_TYPES } from '@redocly/theme/core';
6
6
 
7
7
  export type CatalogEntityTypeIconProps = {
8
8
  entityType: string;
9
- defaultColor?: boolean;
9
+ defaultColors?: boolean;
10
+ size?: 'large' | 'medium';
10
11
  };
11
12
 
12
13
  export function CatalogEntityTypeIcon({
13
14
  entityType,
14
- defaultColor = false,
15
+ defaultColors = false,
16
+ size = 'medium',
15
17
  }: CatalogEntityTypeIconProps) {
16
18
  return (
17
19
  <IconContainer
18
20
  data-component-name="Catalog/CatalogEntityTypeIcon"
19
21
  entityType={entityType}
20
- defaultColor={defaultColor}
22
+ defaultColors={defaultColors}
23
+ size={size}
21
24
  >
22
- <CatalogEntityIcon entityType={entityType} defaultColor={defaultColor} />
25
+ <CatalogEntityIcon entityType={entityType} defaultColor={false} />
23
26
  </IconContainer>
24
27
  );
25
28
  }
26
29
 
27
- const IconContainer = styled.div<{ entityType: string; defaultColor: boolean }>`
30
+ const IconContainer = styled.div<{
31
+ entityType: string;
32
+ defaultColors: boolean;
33
+ size: 'large' | 'medium';
34
+ }>`
28
35
  display: flex;
29
36
  align-items: center;
30
37
  justify-content: center;
31
- width: var(--catalog-table-icon-width);
32
- height: var(--catalog-table-icon-height);
38
+ width: ${({ size }) => (size === 'large' ? 'var(--catalog-table-icon-width-large)' : 'var(--catalog-table-icon-width-medium)')};
39
+ height: ${({ size }) => (size === 'large' ? 'var(--catalog-table-icon-height-large)' : 'var(--catalog-table-icon-height-medium)')};
33
40
  border-radius: var(--catalog-table-icon-border-radius);
34
- background-color: ${({ defaultColor, entityType }) => {
35
- if (defaultColor) {
41
+ background-color: ${({ defaultColors, entityType }) => {
42
+ if (defaultColors) {
36
43
  return 'var(--catalog-entity-bg-color)';
37
44
  }
38
45
  if (PREDEFINED_ENTITY_TYPES.includes(entityType)) {
@@ -42,8 +49,8 @@ const IconContainer = styled.div<{ entityType: string; defaultColor: boolean }>`
42
49
  }};
43
50
  flex-shrink: 0;
44
51
  border: 1px solid
45
- ${({ defaultColor, entityType }) => {
46
- if (defaultColor) {
52
+ ${({ defaultColors, entityType }) => {
53
+ if (defaultColors) {
47
54
  return 'var(--catalog-entity-border-color)';
48
55
  }
49
56
  if (PREDEFINED_ENTITY_TYPES.includes(entityType)) {
@@ -3,14 +3,14 @@ import styled from 'styled-components';
3
3
 
4
4
  import { CatalogMobileTopBarFiltersButton } from '@redocly/theme/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton';
5
5
  import { CatalogMobileTopBarControls } from '@redocly/theme/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls';
6
- import { breakpoints, SortOption } from '@redocly/theme/core';
6
+ import { breakpoints } from '@redocly/theme/core';
7
7
  import { CatalogViewMode } from '@redocly/theme/core';
8
8
 
9
9
  type CatalogMobileTopBarProps = {
10
10
  setMobileFiltersPanelOpen: (open: boolean) => void;
11
11
  activeFiltersCount: number;
12
- setSortOption: (sortOption: SortOption | null) => void;
13
- sortOption: SortOption | null;
12
+ setSortOption: (sortOption: string | null) => void;
13
+ sortOption: string | null;
14
14
  viewMode: CatalogViewMode;
15
15
  setViewMode: (viewMode: CatalogViewMode) => void;
16
16
  };