@redocly/theme 0.64.0-next.1 → 0.64.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/lib/components/Admonition/Admonition.d.ts +1 -1
  2. package/lib/components/Admonition/Admonition.js +2 -0
  3. package/lib/components/Admonition/variables.dark.js +3 -0
  4. package/lib/components/Admonition/variables.js +13 -0
  5. package/lib/components/Banner/Banner.js +3 -3
  6. package/lib/components/Button/variables.dark.js +2 -2
  7. package/lib/components/Button/variables.js +3 -3
  8. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  9. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  10. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  11. package/lib/components/Catalog/CatalogEntities.js +1 -1
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +3 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  27. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  28. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  29. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  30. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  31. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  32. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  33. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  34. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  35. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  36. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  37. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  38. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  39. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  40. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  42. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  43. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  44. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  45. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  46. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  47. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  48. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  49. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  50. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  51. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  52. package/lib/components/Catalog/CatalogTags.js +62 -0
  53. package/lib/components/Catalog/variables.js +22 -14
  54. package/lib/components/Filter/variables.js +1 -1
  55. package/lib/components/Link/Link.js +2 -2
  56. package/lib/components/Menu/MenuItem.js +1 -0
  57. package/lib/components/Menu/variables.dark.js +2 -0
  58. package/lib/components/Menu/variables.js +4 -3
  59. package/lib/components/Search/SearchDialog.js +118 -116
  60. package/lib/components/SvgViewer/variables.dark.js +1 -1
  61. package/lib/components/Switch/variables.dark.js +2 -2
  62. package/lib/components/Switch/variables.js +1 -1
  63. package/lib/components/TableOfContent/TableOfContent.js +1 -0
  64. package/lib/components/TableOfContent/variables.js +3 -2
  65. package/lib/components/Toast/Toast.d.ts +14 -0
  66. package/lib/components/Toast/Toast.js +239 -0
  67. package/lib/components/Toast/variables.d.ts +1 -0
  68. package/lib/components/Toast/variables.js +64 -0
  69. package/lib/components/Tooltip/JsTooltip.js +1 -1
  70. package/lib/core/constants/catalog.d.ts +1 -1
  71. package/lib/core/constants/catalog.js +1 -1
  72. package/lib/core/constants/toast.d.ts +1 -0
  73. package/lib/core/constants/toast.js +5 -0
  74. package/lib/core/contexts/Toast/ToastContext.d.ts +2 -0
  75. package/lib/core/contexts/Toast/ToastContext.js +6 -0
  76. package/lib/core/contexts/Toast/ToastProvider.d.ts +3 -0
  77. package/lib/core/contexts/Toast/ToastProvider.js +156 -0
  78. package/lib/core/contexts/index.d.ts +2 -0
  79. package/lib/core/contexts/index.js +2 -0
  80. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  81. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  82. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  83. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  84. package/lib/core/hooks/index.d.ts +3 -0
  85. package/lib/core/hooks/index.js +3 -0
  86. package/lib/core/hooks/use-toast-logic.d.ts +18 -0
  87. package/lib/core/hooks/use-toast-logic.js +141 -0
  88. package/lib/core/hooks/use-toast.d.ts +11 -0
  89. package/lib/core/hooks/use-toast.js +17 -0
  90. package/lib/core/styles/dark.d.ts +3 -1
  91. package/lib/core/styles/dark.js +37 -33
  92. package/lib/core/styles/global.d.ts +6 -2
  93. package/lib/core/styles/global.js +56 -46
  94. package/lib/core/styles/palette.d.ts +6 -0
  95. package/lib/core/styles/palette.dark.d.ts +3 -0
  96. package/lib/core/styles/palette.dark.js +201 -0
  97. package/lib/core/styles/palette.js +175 -0
  98. package/lib/core/types/catalog.d.ts +23 -7
  99. package/lib/core/types/hooks.d.ts +6 -4
  100. package/lib/core/types/index.d.ts +1 -0
  101. package/lib/core/types/search.d.ts +1 -0
  102. package/lib/core/types/toast.d.ts +23 -0
  103. package/lib/core/types/toast.js +3 -0
  104. package/lib/core/utils/get-auto-dismiss-duration.d.ts +2 -0
  105. package/lib/core/utils/get-auto-dismiss-duration.js +15 -0
  106. package/lib/core/utils/index.d.ts +1 -0
  107. package/lib/core/utils/index.js +1 -0
  108. package/lib/icons/CheckboxIcon/CheckboxIcon.js +6 -4
  109. package/lib/icons/CheckboxIcon/variables.dark.js +2 -1
  110. package/lib/icons/CheckboxIcon/variables.js +3 -3
  111. package/lib/icons/IdeaIcon/IdeaIcon.d.ts +9 -0
  112. package/lib/icons/IdeaIcon/IdeaIcon.js +24 -0
  113. package/lib/icons/NewChatIcon/NewChatIcon.d.ts +11 -0
  114. package/lib/icons/NewChatIcon/NewChatIcon.js +25 -0
  115. package/lib/index.d.ts +5 -1
  116. package/lib/index.js +5 -1
  117. package/lib/markdoc/components/Heading/Heading.js +2 -2
  118. package/lib/markdoc/components/Mermaid/Mermaid.js +0 -2
  119. package/lib/markdoc/components/Tabs/variables.js +3 -3
  120. package/lib/markdoc/components/default.d.ts +0 -1
  121. package/lib/markdoc/components/default.js +0 -1
  122. package/lib/markdoc/tags/admonition.js +1 -1
  123. package/package.json +2 -2
  124. package/src/components/Admonition/Admonition.tsx +3 -1
  125. package/src/components/Admonition/variables.dark.ts +3 -0
  126. package/src/components/Admonition/variables.ts +13 -0
  127. package/src/components/Banner/Banner.tsx +7 -7
  128. package/src/components/Button/variables.dark.ts +2 -2
  129. package/src/components/Button/variables.ts +3 -3
  130. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  131. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  132. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  133. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  134. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +3 -1
  135. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  136. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  137. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  138. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  139. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  140. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  141. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  142. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  143. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  144. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  145. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  146. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  147. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  148. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  149. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  150. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  151. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  152. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  153. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  154. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  155. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  156. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  157. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  158. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  159. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  160. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  161. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  162. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  163. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  164. package/src/components/Catalog/CatalogTags.tsx +115 -0
  165. package/src/components/Catalog/variables.ts +22 -14
  166. package/src/components/Filter/variables.ts +1 -1
  167. package/src/components/Link/Link.tsx +1 -1
  168. package/src/components/Menu/MenuItem.tsx +5 -1
  169. package/src/components/Menu/variables.dark.ts +2 -0
  170. package/src/components/Menu/variables.ts +4 -3
  171. package/src/components/Search/SearchDialog.tsx +299 -293
  172. package/src/components/SvgViewer/variables.dark.ts +1 -1
  173. package/src/components/Switch/variables.dark.ts +2 -2
  174. package/src/components/Switch/variables.ts +1 -1
  175. package/src/components/TableOfContent/TableOfContent.tsx +1 -0
  176. package/src/components/TableOfContent/variables.ts +3 -2
  177. package/src/components/Toast/Toast.tsx +289 -0
  178. package/src/components/Toast/variables.ts +61 -0
  179. package/src/components/Tooltip/JsTooltip.tsx +1 -1
  180. package/src/core/constants/catalog.ts +1 -1
  181. package/src/core/constants/toast.ts +1 -0
  182. package/src/core/contexts/Toast/ToastContext.tsx +5 -0
  183. package/src/core/contexts/Toast/ToastProvider.tsx +206 -0
  184. package/src/core/contexts/index.ts +2 -0
  185. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  186. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  187. package/src/core/hooks/index.ts +3 -0
  188. package/src/core/hooks/use-toast-logic.ts +203 -0
  189. package/src/core/hooks/use-toast.ts +47 -0
  190. package/src/core/styles/dark.ts +9 -4
  191. package/src/core/styles/global.ts +30 -20
  192. package/src/core/styles/palette.dark.ts +199 -0
  193. package/src/core/styles/palette.ts +173 -0
  194. package/src/core/types/catalog.ts +24 -8
  195. package/src/core/types/hooks.ts +5 -10
  196. package/src/core/types/index.ts +1 -0
  197. package/src/core/types/search.ts +1 -0
  198. package/src/core/types/toast.ts +28 -0
  199. package/src/core/utils/get-auto-dismiss-duration.ts +20 -0
  200. package/src/core/utils/index.ts +1 -0
  201. package/src/icons/CheckboxIcon/CheckboxIcon.tsx +26 -17
  202. package/src/icons/CheckboxIcon/variables.dark.ts +2 -1
  203. package/src/icons/CheckboxIcon/variables.ts +3 -3
  204. package/src/icons/IdeaIcon/IdeaIcon.tsx +32 -0
  205. package/src/icons/NewChatIcon/NewChatIcon.tsx +39 -0
  206. package/src/index.ts +5 -1
  207. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  208. package/src/markdoc/components/Mermaid/Mermaid.tsx +0 -2
  209. package/src/markdoc/components/Tabs/variables.ts +3 -3
  210. package/src/markdoc/components/default.ts +0 -1
  211. package/src/markdoc/tags/admonition.ts +1 -1
  212. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  213. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  214. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +0 -7
  215. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +0 -95
  216. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +0 -1
  217. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +0 -1
  218. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +0 -8
  219. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +0 -15
  220. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
  221. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +0 -85
  222. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +0 -5
  223. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.64.0-next.1",
3
+ "version": "0.64.0-next.3",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -81,7 +81,7 @@
81
81
  "openapi-sampler": "^1.7.2",
82
82
  "react-calendar": "5.1.0",
83
83
  "react-date-picker": "11.0.0",
84
- "@redocly/config": "0.44.1"
84
+ "@redocly/config": "0.46.0"
85
85
  },
86
86
  "scripts": {
87
87
  "watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
@@ -7,9 +7,10 @@ import { WarningCycleIcon } from '@redocly/theme/icons/WarningCycleIcon/WarningC
7
7
  import { CheckmarkOutlineIcon } from '@redocly/theme/icons/CheckmarkOutlineIcon/CheckmarkOutlineIcon';
8
8
  import { ErrorIcon } from '@redocly/theme/icons/ErrorIcon/ErrorIcon';
9
9
  import { InformationIcon } from '@redocly/theme/icons/InformationIcon/InformationIcon';
10
+ import { IdeaIcon } from '@redocly/theme/icons/IdeaIcon/IdeaIcon';
10
11
 
11
12
  type AdmonitionTypeProps = {
12
- type: 'warning' | 'success' | 'danger' | 'info';
13
+ type: 'warning' | 'success' | 'danger' | 'info' | 'default';
13
14
  };
14
15
 
15
16
  export type AdmonitionProps = Partial<AdmonitionTypeProps> & {
@@ -24,6 +25,7 @@ const IconsMap: Record<AdmonitionTypeProps['type'], FC<{ color?: string }>> = {
24
25
  success: CheckmarkOutlineIcon,
25
26
  danger: ErrorIcon,
26
27
  info: InformationIcon,
28
+ default: IdeaIcon,
27
29
  };
28
30
 
29
31
  export function Admonition({
@@ -12,4 +12,7 @@ export const admonitionDarkMode = css`
12
12
 
13
13
  --admonition-success-bg-color: color-mix(in srgb, var(--color-green-1) 40%, transparent); // @presenter Color
14
14
  --admonition-success-border: var(--admonition-border-width) var(--admonition-border-style) color-mix(in srgb, var(--color-green-3) 40%, transparent); // @presenter Border
15
+
16
+ --admonition-default-bg-color: color-mix(in srgb, var(--color-primary-bg, var(--admonition-default-bg-color-legacy)) 40%, transparent); // @presenter Color
17
+ --admonition-default-border: var(--admonition-border-width) var(--admonition-border-style) color-mix(in srgb, var(--color-primary-border, var(--admonition-default-border-color-legacy)) 40%, transparent); // @presenter Border
15
18
  `;
@@ -89,5 +89,18 @@ export const admonition = css`
89
89
  --admonition-success-border-width: var(--admonition-border-width); // @presenter Color
90
90
  --admonition-success-border: var(--admonition-success-border-width) var(--admonition-success-border-style) var(--admonition-success-border-color); // @presenter Border
91
91
 
92
+ /**
93
+ * @tokens Admonition type primary
94
+ */
95
+
96
+ --admonition-default-bg-color: var(--color-primary-bg, var(--admonition-default-bg-color-legacy)); // @presenter Color
97
+ --admonition-default-text-color: var(--admonition-heading-text-color); // @presenter Color
98
+ --admonition-default-heading-text-color: var(--admonition-heading-text-color); // @presenter Color
99
+ --admonition-default-icon-color: var(--color-primary-base, var(--admonition-default-icon-color-legacy)); // @presenter Color
100
+ --admonition-default-border-color: var(--color-primary-border, var(--admonition-default-border-color-legacy)); // @presenter Color
101
+ --admonition-default-border-style: var(--admonition-border-style); // @presenter Color
102
+ --admonition-default-border-width: var(--admonition-border-width); // @presenter Color
103
+ --admonition-default-border: var(--admonition-default-border-width) var(--admonition-default-border-style) var(--admonition-default-border-color); // @presenter Border
104
+
92
105
  // @tokens End
93
106
  `;
@@ -1,7 +1,7 @@
1
1
  import React, { useRef, useEffect, useState } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
- import type { BannerConfig } from '@redocly/config';
4
+ import type { ResolvedBannerConfig } from '@redocly/config';
5
5
  import type { JSX } from 'react';
6
6
 
7
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
@@ -23,11 +23,12 @@ function setBannerHeight(height: number): void {
23
23
  }
24
24
 
25
25
  export function Banner({ className }: BannerProps): JSX.Element | null {
26
- const { useBanner, useMarkdownText } = useThemeHooks();
26
+ const { useBanner, useMarkdocRenderer } = useThemeHooks();
27
27
  const { banner, dismissBanner } = useBanner();
28
- const [displayBanner, setDisplayBanner] = useState<BannerConfig | undefined>(undefined);
28
+ const [displayBanner, setDisplayBanner] = useState<ResolvedBannerConfig | undefined>(undefined);
29
29
  const [isVisible, setIsVisible] = useState(false);
30
- const markdownContent = useMarkdownText(displayBanner?.content || '');
30
+
31
+ const markdownContent = useMarkdocRenderer(displayBanner?.ast);
31
32
  const bannerRef = useRef<HTMLDivElement>(null);
32
33
 
33
34
  useEffect(() => {
@@ -101,8 +102,7 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
101
102
  return null;
102
103
  }
103
104
 
104
- const bannerColor =
105
- ((displayBanner as BannerConfig & { color?: BannerColor }).color as BannerColor) || 'info';
105
+ const bannerColor = displayBanner.color || 'info';
106
106
 
107
107
  return (
108
108
  <BannerWrapper
@@ -120,7 +120,7 @@ export function Banner({ className }: BannerProps): JSX.Element | null {
120
120
  variant="ghost"
121
121
  size="var(--banner-button-size)"
122
122
  icon={<CloseIcon color={`var(--banner-${bannerColor}-icon-color)`} size="16px" />}
123
- onClick={() => dismissBanner(displayBanner.content)}
123
+ onClick={() => dismissBanner(displayBanner.hash)}
124
124
  aria-label="Dismiss banner"
125
125
  />
126
126
  )}
@@ -17,8 +17,8 @@ export const buttonDarkMode = css`
17
17
  --button-bg-color-secondary-hover: var(--color-warm-grey-5);
18
18
  --button-bg-color-secondary-pressed: var(--color-warm-grey-6);
19
19
  --button-bg-color-secondary-danger-pressed: var(--color-raspberry-9);
20
- --button-bg-color-primary-hover: var(--color-blue-5);
21
- --button-bg-color-primary-pressed: var(--color-blue-4);
20
+ --button-bg-color-primary-hover: var(--color-primary-hover, var(--button-bg-color-primary-hover-legacy));
21
+ --button-bg-color-primary-pressed: var(--color-primary-active, var(--button-bg-color-primary-pressed-legacy));
22
22
  --button-bg-color-primary-danger-hover: var(--color-raspberry-5);
23
23
  --button-bg-color-primary-danger-pressed: var(--color-raspberry-4);
24
24
  --button-bg-color-disabled: var(--color-warm-grey-3);
@@ -24,9 +24,9 @@ export const button = css`
24
24
  --button-content-color-primary-hover: var(--color-blue-7); // @presenter Color
25
25
  --button-content-color-primary-pressed: var(--color-blue-8); // @presenter Color
26
26
 
27
- --button-bg-color-primary: var(--color-blue-6); // @presenter Color
28
- --button-bg-color-primary-hover: var(--color-blue-7); // @presenter Color
29
- --button-bg-color-primary-pressed: var(--color-blue-8); // @presenter Color
27
+ --button-bg-color-primary: var(--color-primary-base, var(--button-bg-color-primary-legacy)); // @presenter Color
28
+ --button-bg-color-primary-hover: var(--color-primary-hover, var(--button-bg-color-primary-hover-legacy)); // @presenter Color
29
+ --button-bg-color-primary-pressed: var(--color-primary-active, var(--button-bg-color-primary-pressed-legacy)); // @presenter Color
30
30
 
31
31
  --button-bg-color-primary-danger: var(--color-raspberry-6); // @presenter Color
32
32
  --button-bg-color-primary-danger-hover: var(--color-raspberry-7); // @presenter Color
@@ -1,7 +1,7 @@
1
1
  import React, { JSX } from 'react';
2
2
  import styled, { css } from 'styled-components';
3
3
 
4
- import { SortOption, CatalogViewMode } from '@redocly/theme/core/types';
4
+ import { CatalogViewMode } from '@redocly/theme/core/types';
5
5
  import { FilterInput } from '@redocly/theme/components/Filter/FilterInput';
6
6
  import { CatalogSortButton } from '@redocly/theme/components/Catalog/CatalogSortButton';
7
7
  import { CatalogViewModeToggle } from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
@@ -10,8 +10,8 @@ import { breakpoints } from '@redocly/theme/core';
10
10
  export type CatalogActionsRowProps = {
11
11
  searchQuery: string;
12
12
  setSearchQuery: (updatedTerm: string) => void;
13
- sortOption: SortOption | null;
14
- setSortOption: (option: SortOption | null) => void;
13
+ sortOption: string | null;
14
+ setSortOption: (option: string | null) => void;
15
15
  viewMode?: CatalogViewMode;
16
16
  onViewModeChange?: (mode: CatalogViewMode) => void;
17
17
  isDetailsPage?: boolean;
@@ -9,7 +9,7 @@ import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighl
9
9
  import { GraphIcon } from '@redocly/theme/icons/GraphIcon/GraphIcon';
10
10
  import { ArrowRightIcon } from '@redocly/theme/icons/ArrowRightIcon/ArrowRightIcon';
11
11
  import { ArrowUpRightIcon } from '@redocly/theme/icons/ArrowUpRightIcon/ArrowUpRightIcon';
12
- import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
12
+ import { CatalogTags } from '@redocly/theme/components/Catalog/CatalogTags';
13
13
  import { CatalogEntityIcon } from '@redocly/theme/components/Catalog/CatalogEntityIcon';
14
14
  import { getPathPrefix } from '@redocly/theme/core/utils';
15
15
 
@@ -54,7 +54,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
54
54
  <CardMetadataSection>
55
55
  <MetadataRow>
56
56
  <MetadataLabel>{translate('catalog.metadata.domains', 'Domains:')}</MetadataLabel>
57
- <CatalogTagsWithTooltip
57
+ <CatalogTags
58
58
  items={entity.domains?.map((domain) => domain.title) || []}
59
59
  showPlaceholder={true}
60
60
  tagProps={{
@@ -71,7 +71,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
71
71
 
72
72
  <MetadataRow>
73
73
  <MetadataLabel>{translate('catalog.metadata.owners', 'Owners:')}</MetadataLabel>
74
- <CatalogTagsWithTooltip
74
+ <CatalogTags
75
75
  items={entity.owners?.map((owner) => owner.key) || []}
76
76
  showPlaceholder={true}
77
77
  showAvatars={true}
@@ -80,7 +80,6 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
80
80
  fontSize: 'var(--catalog-card-font-size)',
81
81
  backgroundColor: 'var(--catalog-card-icon-bg-color)',
82
82
  borderRadius: 'var(--border-radius-xl)',
83
- paddingLeft: 'var(--catalog-card-metadata-owner-tag-left-padding)',
84
83
  },
85
84
  textTransform: 'none',
86
85
  variant: 'outline',
@@ -93,7 +92,7 @@ export function CatalogCard({ entity, catalogConfig }: CatalogCardProps): JSX.El
93
92
  <Divider />
94
93
 
95
94
  <CardFooter hasTags={!!entity.tags?.length}>
96
- <CatalogTagsWithTooltip
95
+ <CatalogTags
97
96
  items={entity.tags || []}
98
97
  tagProps={{
99
98
  style: {
@@ -179,7 +178,6 @@ const ArrowCircle = styled.div`
179
178
  const CardContent = styled.div`
180
179
  min-width: 0;
181
180
  padding: var(--catalog-card-padding-vertical) var(--catalog-card-padding-horizontal);
182
- height: 100%;
183
181
  `;
184
182
 
185
183
  const CardFooter = styled.div<{ hasTags: boolean }>`
@@ -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':
@@ -187,7 +187,9 @@ const VersionIcon = styled.div<{ $isCurrent?: boolean }>`
187
187
  flex-shrink: 0;
188
188
  border-radius: 50%;
189
189
  background-color: ${({ $isCurrent }) =>
190
- $isCurrent ? 'var(--color-primary-base)' : 'var(--catalog-avatar-bg-color)'};
190
+ $isCurrent
191
+ ? 'var(--color-primary-base, var(--color-blueberry-6))'
192
+ : 'var(--catalog-avatar-bg-color)'};
191
193
  transition: background-color 0.2s ease;
192
194
  margin-right: var(--catalog-history-sidebar-version-icon-margin-right);
193
195
 
@@ -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