@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.
Files changed (143) 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/components/SvgViewer/variables.dark.js +1 -1
  49. package/lib/core/constants/catalog.d.ts +1 -1
  50. package/lib/core/constants/catalog.js +1 -1
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  52. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  54. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  55. package/lib/core/hooks/index.d.ts +1 -0
  56. package/lib/core/hooks/index.js +1 -0
  57. package/lib/core/styles/dark.d.ts +3 -1
  58. package/lib/core/styles/dark.js +42 -31
  59. package/lib/core/styles/global.d.ts +6 -2
  60. package/lib/core/styles/global.js +54 -39
  61. package/lib/core/styles/palette.d.ts +6 -0
  62. package/lib/core/styles/palette.dark.d.ts +3 -0
  63. package/lib/core/styles/palette.dark.js +216 -0
  64. package/lib/core/styles/palette.js +179 -0
  65. package/lib/core/types/catalog.d.ts +23 -7
  66. package/lib/core/types/hooks.d.ts +6 -4
  67. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.d.ts +9 -0
  68. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.js +27 -0
  69. package/lib/icons/StopIcon/StopIcon.d.ts +9 -0
  70. package/lib/icons/StopIcon/StopIcon.js +22 -0
  71. package/lib/index.d.ts +3 -1
  72. package/lib/index.js +3 -1
  73. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +7 -0
  74. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +95 -0
  75. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +1 -0
  76. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +1 -0
  77. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +8 -0
  78. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +15 -0
  79. package/lib/markdoc/components/Heading/Heading.js +2 -2
  80. package/lib/markdoc/components/Mermaid/Mermaid.js +2 -0
  81. package/lib/markdoc/components/default.d.ts +1 -0
  82. package/lib/markdoc/components/default.js +1 -0
  83. package/package.json +2 -2
  84. package/src/components/Banner/Banner.tsx +7 -7
  85. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  86. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  87. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  88. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  104. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  105. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  106. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  108. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  109. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  110. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  111. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  112. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  113. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  114. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  115. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  116. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  117. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  118. package/src/components/Catalog/CatalogTags.tsx +115 -0
  119. package/src/components/Catalog/variables.ts +22 -14
  120. package/src/components/Search/SearchDialog.tsx +299 -293
  121. package/src/components/SvgViewer/variables.dark.ts +1 -1
  122. package/src/core/constants/catalog.ts +1 -1
  123. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  124. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  125. package/src/core/hooks/index.ts +1 -0
  126. package/src/core/styles/dark.ts +14 -2
  127. package/src/core/styles/global.ts +28 -13
  128. package/src/core/styles/palette.dark.ts +214 -0
  129. package/src/core/styles/palette.ts +177 -0
  130. package/src/core/types/catalog.ts +24 -8
  131. package/src/core/types/hooks.ts +5 -10
  132. package/src/icons/ColorPaletteIcon/ColorPaletteIcon.tsx +28 -0
  133. package/src/icons/StopIcon/StopIcon.tsx +23 -0
  134. package/src/index.ts +3 -1
  135. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +85 -0
  136. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +5 -0
  137. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +12 -0
  138. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  139. package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
  140. package/src/markdoc/components/default.ts +1 -0
  141. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  142. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  143. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
@@ -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
  };
@@ -3,12 +3,11 @@ import styled from 'styled-components';
3
3
 
4
4
  import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
5
5
  import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
6
- import { SortOption } from '@redocly/theme/core';
7
6
  import { CatalogViewMode } from '@redocly/theme/core';
8
7
 
9
8
  type CatalogMobileTopBarControlsProps = {
10
- setSortOption: (sortOption: SortOption | null) => void;
11
- sortOption: SortOption | null;
9
+ setSortOption: (sortOption: string | null) => void;
10
+ sortOption: string | null;
12
11
  viewMode: CatalogViewMode;
13
12
  setViewMode: (viewMode: CatalogViewMode) => void;
14
13
  };
@@ -58,7 +58,7 @@ const CatalogDescription = styled.p`
58
58
  color: var(--catalog-description-text-color);
59
59
  font-weight: var(--catalog-description-font-weight);
60
60
  font-size: var(--catalog-description-font-size);
61
- margin: var(--catalog-description-margin);
61
+ margin: 0;
62
62
  line-height: var(--catalog-description-line-height);
63
63
  display: -webkit-box;
64
64
  -webkit-line-clamp: 3;
@@ -1,7 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
- import { SortOption } from '@redocly/theme/core/types';
5
4
  import { AscSortIcon } from '@redocly/theme/icons/AscSortIcon/AscSortIcon';
6
5
  import { DescSortIcon } from '@redocly/theme/icons/DescSortIcon/DescSortIcon';
7
6
  import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
@@ -10,16 +9,16 @@ import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMen
10
9
  import { useThemeHooks } from '@redocly/theme/core/hooks';
11
10
 
12
11
  export type CatalogSortButtonProps = {
13
- onSortChange: (sortOption: SortOption | null) => void;
14
- currentSort?: SortOption | null;
12
+ onSortChange: (sortOption: string | null) => void;
13
+ currentSort?: string | null;
15
14
  };
16
15
 
17
16
  export function CatalogSortButton({
18
17
  onSortChange,
19
18
  currentSort,
20
19
  }: {
21
- onSortChange: (sortOption: SortOption | null) => void;
22
- currentSort?: SortOption | null;
20
+ onSortChange: (sortOption: string | null) => void;
21
+ currentSort?: string | null;
23
22
  }) {
24
23
  const { useTranslate } = useThemeHooks();
25
24
  const { translate } = useTranslate();
@@ -27,7 +26,7 @@ export function CatalogSortButton({
27
26
  const toggleSort = useCallback(
28
27
  (field: string): void => {
29
28
  const newSort = currentSort === `-${field}` ? field : `-${field}`;
30
- onSortChange(newSort as SortOption);
29
+ onSortChange(newSort);
31
30
  },
32
31
  [currentSort, onSortChange],
33
32
  );
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
- import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
3
+ import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
4
+ import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
4
5
 
5
6
  export type CatalogDomainsCellProps = {
6
7
  domains: string[];
@@ -9,15 +10,18 @@ export type CatalogDomainsCellProps = {
9
10
  export function CatalogDomainsCell({ domains }: CatalogDomainsCellProps) {
10
11
  return (
11
12
  <div data-component-name="Catalog/CatalogTableView/CatalogDomainsCell">
12
- <CatalogTagsWithTooltip
13
+ <CatalogTags
13
14
  data-testid="catalog-domains-cell"
14
15
  items={domains}
15
16
  showPlaceholder={false}
16
17
  tagProps={{
18
+ variant: 'outline',
19
+ icon: <GraphIcon />,
17
20
  style: {
18
21
  fontSize: 'var(--font-size-base)',
19
22
  backgroundColor: 'transparent',
20
23
  borderRadius: 'var(--border-radius-xl)',
24
+ margin: 0,
21
25
  },
22
26
  textTransform: 'none',
23
27
  }}
@@ -13,7 +13,7 @@ export type CatalogEntityCellProps<T extends Entity> = {
13
13
  export function CatalogEntityCell<T extends Entity>({ entity }: CatalogEntityCellProps<T>) {
14
14
  return (
15
15
  <EntityTitleCellWrapper data-component-name="Catalog/CatalogTableView/CatalogEntityCell">
16
- <CatalogEntityTypeIcon entityType={entity.type} />
16
+ <CatalogEntityTypeIcon entityType={entity.type} size="large" defaultColors={true} />
17
17
  <EntityTitleContent>
18
18
  <EntityTitle data-component-name="Catalog/CatalogTableView/CatalogEntityTitle">
19
19
  <CatalogHighlight>{entity.title}</CatalogHighlight>
@@ -40,7 +40,7 @@ const EntityTitleContent = styled.div`
40
40
  flex-direction: column;
41
41
  max-width: calc(
42
42
  100% - var(--catalog-table-entity-title-content-offset)
43
- ); /* Account for icon width (30px) + gap (12px) */
43
+ ); /* Account for icon width (32px) + gap (8px) */
44
44
  overflow: hidden;
45
45
  `;
46
46
 
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
5
+
6
+ export type CatalogLastUpdateCellProps = {
7
+ lastModified: string;
8
+ };
9
+
10
+ function formatLastModified(isoString: string): string {
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
+
23
+ function formatLastModifiedTooltip(isoString: string): string {
24
+ const date = new Date(isoString);
25
+ if (Number.isNaN(date.getTime())) {
26
+ return isoString;
27
+ }
28
+ return date.toLocaleString('en-US', {
29
+ year: 'numeric',
30
+ month: 'short',
31
+ day: 'numeric',
32
+ hour: '2-digit',
33
+ minute: '2-digit',
34
+ second: '2-digit',
35
+ hour12: false,
36
+ timeZone: 'UTC',
37
+ });
38
+ }
39
+
40
+ export function CatalogLastUpdateCell({
41
+ lastModified,
42
+ }: CatalogLastUpdateCellProps): React.ReactElement {
43
+ return (
44
+ <CatalogLastUpdateCellWrapper data-component-name="Catalog/CatalogTableView/CatalogLastUpdateCell">
45
+ <Tooltip tip={formatLastModifiedTooltip(lastModified)} placement="bottom">
46
+ {formatLastModified(lastModified)}
47
+ </Tooltip>
48
+ </CatalogLastUpdateCellWrapper>
49
+ );
50
+ }
51
+
52
+ const CatalogLastUpdateCellWrapper = styled.div`
53
+ color: var(--text-color-helper);
54
+ `;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
3
+ import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
4
4
 
5
5
  export type CatalogOwnersCellProps = {
6
6
  owners: string[];
@@ -9,18 +9,21 @@ export type CatalogOwnersCellProps = {
9
9
  export function CatalogOwnersCell({ owners }: CatalogOwnersCellProps) {
10
10
  return (
11
11
  <div data-component-name="Catalog/CatalogTableView/CatalogOwnersCell">
12
- <CatalogTagsWithTooltip
12
+ <CatalogTags
13
13
  data-testid="catalog-owners-cell"
14
14
  items={owners}
15
15
  showPlaceholder={false}
16
16
  tagProps={{
17
+ variant: 'outline',
17
18
  style: {
18
19
  fontSize: 'var(--font-size-base)',
19
20
  backgroundColor: 'transparent',
20
21
  borderRadius: 'var(--border-radius-xl)',
22
+ margin: 0,
21
23
  },
22
24
  textTransform: 'none',
23
25
  }}
26
+ showAvatars={true}
24
27
  />
25
28
  </div>
26
29
  );