@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
@@ -0,0 +1,46 @@
1
+ import { useMemo } from 'react';
2
+
3
+ import type { EntitiesCatalogConfig } from '@redocly/config';
4
+
5
+ export type EntityWithTypeAndKey = { type?: string; key?: string };
6
+
7
+ function isEntityExcluded(
8
+ excludes: Array<{ key: string }> | undefined,
9
+ entityKey: string,
10
+ ): boolean {
11
+ return excludes?.some((ex) => ex.key === entityKey) ?? false;
12
+ }
13
+
14
+ function doesCatalogIncludeEntityType(
15
+ config: { includes?: Array<{ type: string }> },
16
+ entityType: string,
17
+ ): boolean {
18
+ const hasNoIncludes = !config.includes || config.includes.length === 0;
19
+ if (hasNoIncludes) return true;
20
+ return config.includes?.some((inc) => inc.type === entityType) ?? false;
21
+ }
22
+
23
+ export function useCatalogEntityLink(entitiesCatalogConfig: EntitiesCatalogConfig | undefined) {
24
+ const catalogEntries = useMemo(() => {
25
+ const catalogs = entitiesCatalogConfig?.catalogs;
26
+ if (!catalogs) return [];
27
+ return Object.entries(catalogs)
28
+ .filter((entry): entry is [string, NonNullable<(typeof entry)[1]>] => entry[1] != null)
29
+ .sort(([keyA], [keyB]) => (keyA === 'all' ? 1 : 0) - (keyB === 'all' ? 1 : 0));
30
+ }, [entitiesCatalogConfig]);
31
+
32
+ const getEntityLink = (entity: EntityWithTypeAndKey): string | undefined => {
33
+ if (!entity?.key) return undefined;
34
+ const entityType = entity.type ?? '';
35
+
36
+ for (const [catalogKey, config] of catalogEntries) {
37
+ if (isEntityExcluded(config.excludes, entity.key)) continue;
38
+ if (!doesCatalogIncludeEntityType(config, entityType)) continue;
39
+ const slug = config.slug ?? catalogKey;
40
+ return `catalogs/${slug}/entities/${entity.key}`;
41
+ }
42
+ return undefined;
43
+ };
44
+
45
+ return { getEntityLink };
46
+ }
@@ -5,18 +5,26 @@ import {
5
5
 
6
6
  type CatalogTableHeaderCellActionsProps<T extends BaseEntity> = {
7
7
  column: CatalogColumn<T>;
8
+ currentSortOption?: string | null;
8
9
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
9
10
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
10
11
  };
11
12
 
12
13
  export function useCatalogTableHeaderCellActions<T extends BaseEntity>({
13
14
  column,
15
+ currentSortOption,
14
16
  handleSortClick,
15
17
  isColumnSorted,
16
18
  }: CatalogTableHeaderCellActionsProps<T>) {
17
19
  const sortKey = column.sortKey;
18
- const isUpActive = sortKey ? isColumnSorted(sortKey, 'desc') : false;
19
- const isDownActive = sortKey ? isColumnSorted(sortKey, 'asc') : false;
20
+ const isUpActive = Boolean(
21
+ sortKey &&
22
+ (currentSortOption ? currentSortOption === sortKey : isColumnSorted(sortKey, 'desc')),
23
+ );
24
+ const isDownActive = Boolean(
25
+ sortKey &&
26
+ (currentSortOption ? currentSortOption === `-${sortKey}` : isColumnSorted(sortKey, 'asc')),
27
+ );
20
28
 
21
29
  const handleCellClick = (): void => {
22
30
  if (!column.sortable || !sortKey) return;
@@ -46,6 +46,7 @@ export * from './use-page-actions';
46
46
  export * from './use-mcp-config';
47
47
  export * from './use-connect-mcp-button';
48
48
  export * from './catalog/use-catalog-entity-details';
49
+ export * from './catalog/use-catalog-entity-link';
49
50
  export * from './catalog/use-catalog-entity-schema';
50
51
  export * from './catalog/use-catalog-table-header-cell-actions';
51
52
  export * from './use-store';
@@ -19,7 +19,9 @@ import { bannerDarkMode } from '@redocly/theme/components/Banner/variables.dark'
19
19
  import { admonitionDarkMode } from '@redocly/theme/components/Admonition/variables.dark';
20
20
  import { svgViewerDarkMode } from '@redocly/theme/components/SvgViewer/variables.dark';
21
21
 
22
- const replayDarkMode = css`
22
+ import { activeBrandPaletteDark } from './palette.dark';
23
+
24
+ const replayDarkMode = css<{ palette?: string }>`
23
25
  /**
24
26
  * @tokens Replay Colors
25
27
  * @presenter Color
@@ -244,6 +246,12 @@ export const darkMode = css`
244
246
  --color-black: #ffffff;
245
247
  --color-white: #000000;
246
248
 
249
+
250
+ --color-brand-pink-subtle-bg: var(--color-brand-subtle-1);
251
+ --color-brand-pink-subtle-bg-hover: var(--color-brand-subtle-2);
252
+ --color-brand-pink-subtle-border: var(--color-brand-subtle-3);
253
+ --color-brand-pink-subtle-border-hover: var(--color-brand-subtle-4);
254
+
247
255
  --color-hover-base: #32343E;
248
256
 
249
257
  --bg-color: var(--color-warm-grey-2);
@@ -350,7 +358,7 @@ export const darkMode = css`
350
358
  ${admonitionDarkMode}
351
359
  ${svgViewerDarkMode}
352
360
  ${badgesDarkMode}
353
-
361
+ ${activeBrandPaletteDark}
354
362
  /**
355
363
  * @tokens Dark Theme Scrollbar Config
356
364
  * @presenter Color
@@ -45,6 +45,7 @@ import { skipContent } from '@redocly/theme/components/SkipContent/variables';
45
45
  import { pageActions } from '@redocly/theme/components/PageActions/variables';
46
46
  import { svgViewer } from '@redocly/theme/components/SvgViewer/variables';
47
47
 
48
+ import { activeBrandPaletteLight } from './palette';
48
49
  import { darkMode } from './dark';
49
50
 
50
51
  const themeColors = css`
@@ -226,16 +227,22 @@ const themeColors = css`
226
227
  --color-white: #ffffff;
227
228
  --color-static-white: #ffffff;
228
229
 
229
- --color-primary-bg: var(--color-blueberry-1);
230
- --color-primary-bg-hover: var(--color-blueberry-2);
231
- --color-primary-border: var(--color-blueberry-3);
232
- --color-primary-border-hover: var(--color-blueberry-4);
233
- --color-primary-hover: var(--color-blueberry-5);
234
- --color-primary-base: var(--color-blueberry-6);
235
- --color-primary-active: var(--color-blueberry-7);
236
- --color-primary-text-hover: var(--color-blueberry-8);
237
- --color-primary-text: var(--color-blueberry-9);
238
- --color-primary-text-active: var(--color-blueberry-10);
230
+ --color-primary-bg: var(--color-brand-1);
231
+ --color-primary-bg-hover: var(--color-brand-2);
232
+ --color-primary-border: var(--color-brand-3);
233
+ --color-primary-border-hover: var(--color-brand-4);
234
+ --color-primary-hover: var(--color-brand-8);
235
+ --color-primary-base: var(--color-brand-6);
236
+ --color-primary-active: var(--color-brand-7);
237
+ --color-primary-text-hover: var(--color-brand-9);
238
+ --color-primary-text: var(--color-brand-8);
239
+ --color-primary-text-active: var(--color-brand-7);
240
+ --color-primary-text-on-color: var(--text-color-on-color);
241
+
242
+ --color-brand-pink-subtle-bg: var(--color-brand-1);
243
+ --color-brand-pink-subtle-bg-hover: var(--color-brand-2);
244
+ --color-brand-pink-subtle-border: var(--color-brand-3);
245
+ --color-brand-pink-subtle-border-hover: var(--color-brand-4);
239
246
 
240
247
  --color-success-bg: var(--color-green-1);
241
248
  --color-success-bg-hover: var(--color-green-2);
@@ -1261,7 +1268,7 @@ const replay = css`
1261
1268
  `;
1262
1269
 
1263
1270
 
1264
- export const styles = css`
1271
+ export const styles = css<{ palette?: string }>`
1265
1272
  :root {
1266
1273
  ${accordion}
1267
1274
  ${admonition}
@@ -1309,6 +1316,7 @@ export const styles = css`
1309
1316
  ${sizeAndSpace}
1310
1317
  ${tag}
1311
1318
  ${themeColors}
1319
+ ${activeBrandPaletteLight}
1312
1320
  ${tile}
1313
1321
  ${toc}
1314
1322
  ${tooltip}
@@ -1348,6 +1356,6 @@ export const styles = css`
1348
1356
  ${browserOverrides}
1349
1357
  `;
1350
1358
 
1351
- export const GlobalStyle = createGlobalStyle`
1359
+ export const GlobalStyle = createGlobalStyle<{ palette?: string }>`
1352
1360
  ${styles};
1353
1361
  `;
@@ -0,0 +1,214 @@
1
+ import { css, type FlattenSimpleInterpolation } from 'styled-components';
2
+
3
+ function brandPaletteDark(palette: string | undefined): FlattenSimpleInterpolation {
4
+ switch (palette) {
5
+ case 'default':
6
+ return css`
7
+ --color-brand-1: var(--color-blueberry-1);
8
+ --color-brand-2: var(--color-blueberry-2);
9
+ --color-brand-3: var(--color-blueberry-3);
10
+ --color-brand-4: var(--color-blueberry-4);
11
+ --color-brand-5: var(--color-blueberry-5);
12
+ --color-brand-6: var(--color-blueberry-6);
13
+ --color-brand-7: var(--color-blueberry-7);
14
+ --color-brand-8: var(--color-blueberry-8);
15
+ --color-brand-9: var(--color-blueberry-9);
16
+ --color-brand-10: var(--color-blueberry-10);
17
+ --color-brand-11: var(--color-blueberry-11);
18
+ `;
19
+ case 'slate':
20
+ return css`
21
+ --color-brand-1: #2a2b33;
22
+ --color-brand-2: #3b3c45;
23
+ --color-brand-3: #555761;
24
+ --color-brand-4: #6e6f7a;
25
+ --color-brand-5: #9b9ca8;
26
+ --color-brand-6: #fbfbfc;
27
+ --color-brand-7: #ededf2;
28
+ --color-brand-8: #dcdde5;
29
+ --color-brand-9: #c4c6d1;
30
+ --color-brand-10: #9b9ca8;
31
+ --color-brand-11: #6e6f7a;
32
+ --color-brand-subtle-1: #2a2b3366;
33
+ --color-brand-subtle-2: #3b3c4566;
34
+ --color-brand-subtle-3: #55576166;
35
+ --color-brand-subtle-4: #6e6f7a66;
36
+ --text-color-on-color: #000000;
37
+ `;
38
+ case 'pink':
39
+ return css`
40
+ --color-brand-1: #4f2841;
41
+ --color-brand-2: #6a3055;
42
+ --color-brand-3: #853668;
43
+ --color-brand-4: #a03a7b;
44
+ --color-brand-5: #bb3d8d;
45
+ --color-brand-6: #d6409f;
46
+ --color-brand-7: #de59ad;
47
+ --color-brand-8: #e677bd;
48
+ --color-brand-9: #ef99cf;
49
+ --color-brand-10: #f7bfe2;
50
+ --color-brand-11: #ffe8f7;
51
+ --color-brand-subtle-1: #4f284166;
52
+ --color-brand-subtle-2: #6a305566;
53
+ --color-brand-subtle-3: #85366866;
54
+ --color-brand-subtle-4: #a03a7b66;
55
+ --text-color-on-color: #ffffff;
56
+ `;
57
+ case 'coral':
58
+ return css`
59
+ --color-brand-1: #4f282b;
60
+ --color-brand-2: #6d3338;
61
+ --color-brand-3: #8b3c42;
62
+ --color-brand-4: #a9434c;
63
+ --color-brand-5: #c74b55;
64
+ --color-brand-6: #e5535f;
65
+ --color-brand-7: #ea6a75;
66
+ --color-brand-8: #ef858d;
67
+ --color-brand-9: #f5a3aa;
68
+ --color-brand-10: #fac5c9;
69
+ --color-brand-11: #ffe8ea;
70
+ --color-brand-subtle-1: #4f282b66;
71
+ --color-brand-subtle-2: #6d333866;
72
+ --color-brand-subtle-3: #8b3c4266;
73
+ --color-brand-subtle-4: #a9434c66;
74
+ --text-color-on-color: #ffffff;
75
+ `;
76
+ case 'amber':
77
+ return css`
78
+ --color-brand-1: #4f3c28;
79
+ --color-brand-2: #71512e;
80
+ --color-brand-3: #93632f;
81
+ --color-brand-4: #b6732a;
82
+ --color-brand-5: #d88121;
83
+ --color-brand-6: #fa8d15;
84
+ --color-brand-7: #fb9f3a;
85
+ --color-brand-8: #fcb261;
86
+ --color-brand-9: #fdc78c;
87
+ --color-brand-10: #feddba;
88
+ --color-brand-11: #fff4e8;
89
+ --color-brand-subtle-1: #4f3c2866;
90
+ --color-brand-subtle-2: #71512e66;
91
+ --color-brand-subtle-3: #93632f66;
92
+ --color-brand-subtle-4: #b6732a66;
93
+ --text-color-on-color: #ffffff;
94
+ `;
95
+ case 'jade':
96
+ return css`
97
+ --color-brand-1: #284f45;
98
+ --color-brand-2: #2a6052;
99
+ --color-brand-3: #2b715e;
100
+ --color-brand-4: #2b816b;
101
+ --color-brand-5: #2a9277;
102
+ --color-brand-6: #29a383;
103
+ --color-brand-7: #42b597;
104
+ --color-brand-8: #61c8ad;
105
+ --color-brand-9: #88dac4;
106
+ --color-brand-10: #b5edde;
107
+ --color-brand-11: #e8fff9;
108
+ --color-brand-subtle-1: #284f4566;
109
+ --color-brand-subtle-2: #2a605266;
110
+ --color-brand-subtle-3: #2b715e66;
111
+ --color-brand-subtle-4: #2b816b66;
112
+ --text-color-on-color: #ffffff;
113
+ `;
114
+ case 'cyan':
115
+ return css`
116
+ --color-brand-1: #28484f;
117
+ --color-brand-2: #285c67;
118
+ --color-brand-3: #246e7f;
119
+ --color-brand-4: #1b8097;
120
+ --color-brand-5: #0f91af;
121
+ --color-brand-6: #00a2c7;
122
+ --color-brand-7: #22b2d2;
123
+ --color-brand-8: #4ac2dd;
124
+ --color-brand-9: #79d4e9;
125
+ --color-brand-10: #aee7f4;
126
+ --color-brand-11: #e8fbff;
127
+ --color-brand-subtle-1: #28484f66;
128
+ --color-brand-subtle-2: #285c6766;
129
+ --color-brand-subtle-3: #246e7f66;
130
+ --color-brand-subtle-4: #1b809766;
131
+ --text-color-on-color: #ffffff;
132
+ `;
133
+ case 'ocean':
134
+ return css`
135
+ --color-brand-1: #283e4f;
136
+ --color-brand-2: #2d5472;
137
+ --color-brand-3: #2a6795;
138
+ --color-brand-4: #2277b9;
139
+ --color-brand-5: #1384dc;
140
+ --color-brand-6: #0090ff;
141
+ --color-brand-7: #29a2ff;
142
+ --color-brand-8: #56b5ff;
143
+ --color-brand-9: #85caff;
144
+ --color-brand-10: #b6dfff;
145
+ --color-brand-11: #e8f5ff;
146
+ --color-brand-subtle-1: #283e4f66;
147
+ --color-brand-subtle-2: #2d547266;
148
+ --color-brand-subtle-3: #2a679566;
149
+ --color-brand-subtle-4: #2277b966;
150
+ --text-color-on-color: #ffffff;
151
+ `;
152
+ case 'indigo':
153
+ return css`
154
+ --color-brand-1: #28314f;
155
+ --color-brand-2: #303e6b;
156
+ --color-brand-3: #364988;
157
+ --color-brand-4: #3952a4;
158
+ --color-brand-5: #3c5bc1;
159
+ --color-brand-6: #3e63dd;
160
+ --color-brand-7: #5879e4;
161
+ --color-brand-8: #7691eb;
162
+ --color-brand-9: #99aef1;
163
+ --color-brand-10: #bfcdf8;
164
+ --color-brand-11: #e8edff;
165
+ --color-brand-subtle-1: #28314f66;
166
+ --color-brand-subtle-2: #303e6b66;
167
+ --color-brand-subtle-3: #36498866;
168
+ --color-brand-subtle-4: #3952a466;
169
+ --text-color-on-color: #ffffff;
170
+ `;
171
+ case 'iris':
172
+ return css`
173
+ --color-brand-1: #2e2e4f;
174
+ --color-brand-2: #3a3a6a;
175
+ --color-brand-3: #434385;
176
+ --color-brand-4: #4c4ca0;
177
+ --color-brand-5: #5353bb;
178
+ --color-brand-6: #5b5bd6;
179
+ --color-brand-7: #7070de;
180
+ --color-brand-8: #8a8ae6;
181
+ --color-brand-9: #a7a7ef;
182
+ --color-brand-10: #c8c8f7;
183
+ --color-brand-11: #ebebff;
184
+ --color-brand-subtle-1: #2e2e4f80;
185
+ --color-brand-subtle-2: #3a3a6a80;
186
+ --color-brand-subtle-3: #43438580;
187
+ --color-brand-subtle-4: #4c4ca080;
188
+ --text-color-on-color: #ffffff;
189
+ `;
190
+ default:
191
+ return css`
192
+ --color-brand-1: #232a61;
193
+ --color-brand-2: #222d7a;
194
+ --color-brand-3: #1e2f93;
195
+ --color-brand-4: #2f46b7;
196
+ --color-brand-5: #4561db;
197
+ --color-brand-6: #5f81ff;
198
+ --color-brand-7: #87a3ff;
199
+ --color-brand-8: #9fb7ff;
200
+ --color-brand-9: #bfd0ff;
201
+ --color-brand-10: #dfe8ff;
202
+ --color-brand-11: #f0f4ff;
203
+ --color-brand-subtle-1: #232a6166;
204
+ --color-brand-subtle-2: #222d7a66;
205
+ --color-brand-subtle-3: #1e2f9366;
206
+ --color-brand-subtle-4: #2f46b766;
207
+ --text-color-on-color: #ffffff;
208
+ `;
209
+ }
210
+ }
211
+
212
+ export const activeBrandPaletteDark = css<{ palette?: string }>`
213
+ ${({ palette }) => brandPaletteDark(palette)}
214
+ `;
@@ -0,0 +1,177 @@
1
+ import { css, type FlattenSimpleInterpolation } from 'styled-components';
2
+
3
+ function brandPaletteLight(palette: string | undefined): FlattenSimpleInterpolation {
4
+ switch (palette) {
5
+ case 'default':
6
+ return css`
7
+ --color-brand-1: var(--color-blueberry-1);
8
+ --color-brand-2: var(--color-blueberry-2);
9
+ --color-brand-3: var(--color-blueberry-3);
10
+ --color-brand-4: var(--color-blueberry-4);
11
+ --color-brand-5: var(--color-blueberry-5);
12
+ --color-brand-6: var(--color-blueberry-6);
13
+ --color-brand-7: var(--color-blueberry-7);
14
+ --color-brand-8: var(--color-blueberry-8);
15
+ --color-brand-9: var(--color-blueberry-9);
16
+ --color-brand-10: var(--color-blueberry-10);
17
+ --color-brand-11: var(--color-blueberry-11);
18
+ `;
19
+ case 'slate':
20
+ return css`
21
+ --color-brand-1: #ededf2;
22
+ --color-brand-2: #dcdde5;
23
+ --color-brand-3: #c4c6d1;
24
+ --color-brand-4: #9b9ca8;
25
+ --color-brand-5: #6e6f7a;
26
+ --color-brand-6: #1a1c21;
27
+ --color-brand-7: #22242b;
28
+ --color-brand-8: #2a2b33;
29
+ --color-brand-9: #3b3c45;
30
+ --color-brand-10: #555761;
31
+ --color-brand-11: #6e6f7a;
32
+ --text-color-on-color: #ffffff;
33
+ `;
34
+ case 'pink':
35
+ return css`
36
+ --color-brand-1: #ffe8f7;
37
+ --color-brand-2: #f7bfe2;
38
+ --color-brand-3: #ef99cf;
39
+ --color-brand-4: #e677bd;
40
+ --color-brand-5: #de59ad;
41
+ --color-brand-6: #d6409f;
42
+ --color-brand-7: #bb3d8d;
43
+ --color-brand-8: #a03a7b;
44
+ --color-brand-9: #853668;
45
+ --color-brand-10: #6a3055;
46
+ --color-brand-11: #4f2841;
47
+ --text-color-on-color: #ffffff;
48
+ `;
49
+ case 'coral':
50
+ return css`
51
+ --color-brand-1: #ffe8ea;
52
+ --color-brand-2: #fac5c9;
53
+ --color-brand-3: #f5a3aa;
54
+ --color-brand-4: #ef858d;
55
+ --color-brand-5: #ea6a75;
56
+ --color-brand-6: #e5535f;
57
+ --color-brand-7: #c74b55;
58
+ --color-brand-8: #a9434c;
59
+ --color-brand-9: #8b3c42;
60
+ --color-brand-10: #6d3338;
61
+ --color-brand-11: #4f282b;
62
+ --text-color-on-color: #ffffff;
63
+ `;
64
+ case 'amber':
65
+ return css`
66
+ --color-brand-1: #fff4e8;
67
+ --color-brand-2: #feddba;
68
+ --color-brand-3: #fdc78c;
69
+ --color-brand-4: #fcb261;
70
+ --color-brand-5: #fb9f3a;
71
+ --color-brand-6: #fa8d15;
72
+ --color-brand-7: #d88121;
73
+ --color-brand-8: #b6732a;
74
+ --color-brand-9: #93632f;
75
+ --color-brand-10: #71512e;
76
+ --color-brand-11: #4f3c28;
77
+ --text-color-on-color: #ffffff;
78
+ `;
79
+ case 'jade':
80
+ return css`
81
+ --color-brand-1: #e8fff9;
82
+ --color-brand-2: #b5edde;
83
+ --color-brand-3: #88dac4;
84
+ --color-brand-4: #61c8ad;
85
+ --color-brand-5: #42b597;
86
+ --color-brand-6: #29a383;
87
+ --color-brand-7: #2a9277;
88
+ --color-brand-8: #2b816b;
89
+ --color-brand-9: #2b715e;
90
+ --color-brand-10: #2a6052;
91
+ --color-brand-11: #284f45;
92
+ --text-color-on-color: #ffffff;
93
+ `;
94
+ case 'cyan':
95
+ return css`
96
+ --color-brand-1: #e8fbff;
97
+ --color-brand-2: #aee7f4;
98
+ --color-brand-3: #79d4e9;
99
+ --color-brand-4: #4ac2dd;
100
+ --color-brand-5: #22b2d2;
101
+ --color-brand-6: #00a2c7;
102
+ --color-brand-7: #0f91af;
103
+ --color-brand-8: #1b8097;
104
+ --color-brand-9: #246e7f;
105
+ --color-brand-10: #285c67;
106
+ --color-brand-11: #28484f;
107
+ --text-color-on-color: #ffffff;
108
+ `;
109
+ case 'ocean':
110
+ return css`
111
+ --color-brand-1: #e8f5ff;
112
+ --color-brand-2: #b6dfff;
113
+ --color-brand-3: #85caff;
114
+ --color-brand-4: #56b5ff;
115
+ --color-brand-5: #29a2ff;
116
+ --color-brand-6: #0090ff;
117
+ --color-brand-7: #1384dc;
118
+ --color-brand-8: #2277b9;
119
+ --color-brand-9: #2a6795;
120
+ --color-brand-10: #2d5472;
121
+ --color-brand-11: #283e4f;
122
+ --text-color-on-color: #ffffff;
123
+ `;
124
+ case 'indigo':
125
+ return css`
126
+ --color-brand-1: #e8edff;
127
+ --color-brand-2: #b5d7ff;
128
+ --color-brand-3: #99aef1;
129
+ --color-brand-4: #7691eb;
130
+ --color-brand-5: #5879e4;
131
+ --color-brand-6: #3e63dd;
132
+ --color-brand-7: #3c5bc1;
133
+ --color-brand-8: #3952a4;
134
+ --color-brand-9: #364988;
135
+ --color-brand-10: #303e6b;
136
+ --color-brand-11: #28314f;
137
+ --text-color-on-color: #ffffff;
138
+ `;
139
+ case 'iris':
140
+ return css`
141
+ --color-brand-1: #ebebff;
142
+ --color-brand-2: #c8c8f7;
143
+ --color-brand-3: #a7a7ef;
144
+ --color-brand-4: #8a8ae6;
145
+ --color-brand-5: #7070de;
146
+ --color-brand-6: #5b5bd6;
147
+ --color-brand-7: #5353bb;
148
+ --color-brand-8: #4c4ca0;
149
+ --color-brand-9: #434385;
150
+ --color-brand-10: #3a3a6a;
151
+ --color-brand-11: #2e2e4f;
152
+ --text-color-on-color: #ffffff;
153
+ `;
154
+ default:
155
+ return css`
156
+ --color-brand-1: #f0f4ff;
157
+ --color-brand-2: #dfe8ff;
158
+ --color-brand-3: #bfd0ff;
159
+ --color-brand-4: #9fb7ff;
160
+ --color-brand-5: #87a3ff;
161
+ --color-brand-6: #5f81ff;
162
+ --color-brand-7: #4561db;
163
+ --color-brand-8: #2f46b7;
164
+ --color-brand-9: #1e2f93;
165
+ --color-brand-10: #222d7a;
166
+ --color-brand-11: #232a61;
167
+ --text-color-on-color: #ffffff;
168
+ `;
169
+ }
170
+ }
171
+
172
+ /**
173
+ * @tokens Palette
174
+ */
175
+ export const activeBrandPaletteLight = css<{ palette?: string }>`
176
+ ${({ palette }) => brandPaletteLight(palette)}
177
+ `;
@@ -4,8 +4,6 @@ import { ENTITY_RELATION_TYPES } from '@redocly/config';
4
4
  import type { CatalogEntityConfig, EntitiesCatalogConfig, LayoutVariant } from '@redocly/config';
5
5
  import type { CatalogFilterConfig } from '@redocly/theme/config';
6
6
 
7
- export type SortOption = 'title' | '-title' | 'type' | '-type';
8
-
9
7
  export type FilterResult = {
10
8
  value: string;
11
9
  count: number;
@@ -26,8 +24,8 @@ export type UseCatalogResponse = {
26
24
  filterQuery: string;
27
25
  searchQuery: string;
28
26
  setSearchQuery: (query: string) => void;
29
- sortOption: SortOption | null;
30
- setSortOption: (option: SortOption | null) => void;
27
+ sortOption: string | null;
28
+ setSortOption: (option: string | null) => void;
31
29
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
32
30
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
33
31
  viewMode: CatalogViewMode;
@@ -41,8 +39,8 @@ export type UseCatalogResponse = {
41
39
  };
42
40
 
43
41
  export type UseCatalogSortResponse = {
44
- sortOption: SortOption | null;
45
- setSortOption: (option: SortOption | null) => void;
42
+ sortOption: string | null;
43
+ setSortOption: (option: string | null) => void;
46
44
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
47
45
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
48
46
  };
@@ -162,8 +160,8 @@ export type BffCatalogRelatedEntity = {
162
160
  metadata?: Record<string, any>;
163
161
  version?: string | null;
164
162
  revision?: string | null;
165
- readonly createdAt: string | null;
166
- readonly updatedAt: string | null;
163
+ readonly createdAt: string;
164
+ readonly updatedAt: string;
167
165
  };
168
166
 
169
167
  export type BffCatalogEntity = {
@@ -260,3 +258,21 @@ export type SidebarConnectedEntity = {
260
258
  key: string;
261
259
  version?: string;
262
260
  };
261
+
262
+ export type CatalogEntityPageProps = {
263
+ status: 'success';
264
+ entity: BffCatalogEntity;
265
+ relatedEntity: BffCatalogRelatedEntity | null;
266
+ relations: BffCatalogRelatedEntityList;
267
+ entitiesCatalogConfig: EntitiesCatalogConfig;
268
+ catalogConfig: CatalogEntityConfig;
269
+ sharedDataIds?: Record<string, string>;
270
+ };
271
+
272
+ export type CatalogEntityProps = {
273
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
274
+ RedocSchema: React.ComponentType<any>;
275
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
276
+ StoreProvider: React.ComponentType<any>;
277
+ GraphqlTypeRenderer?: React.ComponentType<{ sdl: string; typeName: string }>;
278
+ };
@@ -1,11 +1,6 @@
1
+ import type { ResolvedBannerConfig } from '@redocly/config';
1
2
  import type { AsyncApiRealmUI } from '@redocly/realm-asyncapi-sdk';
2
- import type {
3
- BannerConfig,
4
- PageData,
5
- PageProps,
6
- ResolvedNavItemWithLink,
7
- Version,
8
- } from '@redocly/config';
3
+ import type { PageData, PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
9
4
  import type { ShikiTransformer } from '@shikijs/types';
10
5
  import type { Callback, TFunction as TFunc } from 'i18next';
11
6
  import type { To, Location, NavigateFunction } from 'react-router-dom';
@@ -19,7 +14,6 @@ import type {
19
14
  UseCatalogProps,
20
15
  CatalogApiParams,
21
16
  CatalogApiResults,
22
- SortOption,
23
17
  } from './catalog';
24
18
  import type { UserMenuData } from './user-menu';
25
19
  import type { ItemState } from './sidebar';
@@ -91,7 +85,7 @@ export type ThemeHooks = {
91
85
  currentItemSiblings?: BreadcrumbItem[];
92
86
  };
93
87
  useBanner: () => {
94
- banner: BannerConfig | undefined;
88
+ banner: ResolvedBannerConfig | undefined;
95
89
  dismissBanner: (content: string) => void;
96
90
  };
97
91
  useSearch: (
@@ -140,6 +134,7 @@ export type ThemeHooks = {
140
134
  contentSegments: ContentSegment[];
141
135
  };
142
136
  useMarkdownText: (text: string) => React.ReactNode;
137
+ useMarkdocRenderer: (ast: unknown) => React.ReactNode;
143
138
  useFacetQuery: (field: string) => {
144
139
  searchFacet: SearchFacet | null;
145
140
  setSearchFacet: React.Dispatch<React.SetStateAction<SearchFacet | null>>;
@@ -165,7 +160,7 @@ export type ThemeHooks = {
165
160
  }
166
161
  | undefined;
167
162
  useCatalog: (props?: UseCatalogProps) => UseCatalogResponse;
168
- useCatalogSort: (defaultSortOption?: SortOption | null) => UseCatalogSortResponse;
163
+ useCatalogSort: (defaultSortOption?: string | null) => UseCatalogSortResponse;
169
164
  useCatalogSearch: () => UseCatalogSearchResponse;
170
165
  useFetchCatalogEntities: (
171
166
  params: CatalogApiParams,