@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
@@ -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';
@@ -2,6 +2,7 @@ import { css } from 'styled-components';
2
2
 
3
3
  import { scorecardDarkMode } from '@redocly/theme/components/Scorecard/variables.dark';
4
4
  import { mermaidDarkMode } from '@redocly/theme/markdoc/components/Mermaid/variables.dark'
5
+ import { excalidrawDarkMode } from '@redocly/theme/markdoc/components/ExcalidrawDiagram/variables.dark'
5
6
  import { menuDarkMode } from '@redocly/theme/components/Menu/variables.dark';
6
7
  import { buttonDarkMode } from '@redocly/theme/components/Button/variables.dark';
7
8
  import { aiAssistantButtonDarkMode } from '@redocly/theme/components/Buttons/variables.dark';
@@ -18,7 +19,9 @@ import { bannerDarkMode } from '@redocly/theme/components/Banner/variables.dark'
18
19
  import { admonitionDarkMode } from '@redocly/theme/components/Admonition/variables.dark';
19
20
  import { svgViewerDarkMode } from '@redocly/theme/components/SvgViewer/variables.dark';
20
21
 
21
- const replayDarkMode = css`
22
+ import { activeBrandPaletteDark } from './palette.dark';
23
+
24
+ const replayDarkMode = css<{ palette?: string }>`
22
25
  /**
23
26
  * @tokens Replay Colors
24
27
  * @presenter Color
@@ -43,6 +46,8 @@ const replayDarkMode = css`
43
46
  --replay-runtime-expression-bg-color: rgba(147, 166, 249, 0.16); // @presenter Color
44
47
  --replay-operators-color: rgba(168, 143, 88, 1); // @presenter Color
45
48
 
49
+ --replay-ai-user-message-gradient: linear-gradient(73.52deg, rgba(113, 94, 254, 0.16) 10.13%, rgba(255, 92, 220, 0.16) 87.29%);
50
+
46
51
  // @tokens End
47
52
  `;
48
53
 
@@ -241,6 +246,12 @@ export const darkMode = css`
241
246
  --color-black: #ffffff;
242
247
  --color-white: #000000;
243
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
+
244
255
  --color-hover-base: #32343E;
245
256
 
246
257
  --bg-color: var(--color-warm-grey-2);
@@ -335,6 +346,7 @@ export const darkMode = css`
335
346
  ${statusCodeDarkMode}
336
347
  ${menuDarkMode}
337
348
  ${mermaidDarkMode}
349
+ ${excalidrawDarkMode}
338
350
  ${scorecardDarkMode}
339
351
  ${replayDarkMode}
340
352
  ${switcherDarkMode}
@@ -346,7 +358,7 @@ export const darkMode = css`
346
358
  ${admonitionDarkMode}
347
359
  ${svgViewerDarkMode}
348
360
  ${badgesDarkMode}
349
-
361
+ ${activeBrandPaletteDark}
350
362
  /**
351
363
  * @tokens Dark Theme Scrollbar Config
352
364
  * @presenter Color
@@ -29,6 +29,7 @@ import { markdown } from '@redocly/theme/components/Markdown/variables';
29
29
  import { banner } from '@redocly/theme/components/Banner/variables';
30
30
  import { markdownTabs } from '@redocly/theme/markdoc/components/Tabs/variables';
31
31
  import { mermaid } from '@redocly/theme/markdoc/components/Mermaid/variables';
32
+ import { excalidraw } from '@redocly/theme/markdoc/components/ExcalidrawDiagram/variables';
32
33
  import { lastUpdated } from '@redocly/theme/components/LastUpdated/variables';
33
34
  import { logo } from '@redocly/theme/components/Logo/variables';
34
35
  import { statusCode } from '@redocly/theme/components/StatusCode/variables';
@@ -44,6 +45,7 @@ import { skipContent } from '@redocly/theme/components/SkipContent/variables';
44
45
  import { pageActions } from '@redocly/theme/components/PageActions/variables';
45
46
  import { svgViewer } from '@redocly/theme/components/SvgViewer/variables';
46
47
 
48
+ import { activeBrandPaletteLight } from './palette';
47
49
  import { darkMode } from './dark';
48
50
 
49
51
  const themeColors = css`
@@ -225,16 +227,22 @@ const themeColors = css`
225
227
  --color-white: #ffffff;
226
228
  --color-static-white: #ffffff;
227
229
 
228
- --color-primary-bg: var(--color-blueberry-1);
229
- --color-primary-bg-hover: var(--color-blueberry-2);
230
- --color-primary-border: var(--color-blueberry-3);
231
- --color-primary-border-hover: var(--color-blueberry-4);
232
- --color-primary-hover: var(--color-blueberry-5);
233
- --color-primary-base: var(--color-blueberry-6);
234
- --color-primary-active: var(--color-blueberry-7);
235
- --color-primary-text-hover: var(--color-blueberry-8);
236
- --color-primary-text: var(--color-blueberry-9);
237
- --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);
238
246
 
239
247
  --color-success-bg: var(--color-green-1);
240
248
  --color-success-bg-hover: var(--color-green-2);
@@ -1167,7 +1175,7 @@ const icon = css`
1167
1175
 
1168
1176
  --icon-color-primary: var(--color-warm-grey-11); // @presenter Color
1169
1177
  --icon-color-secondary: var(--color-warm-grey-8); // @presenter Color
1170
- --icon-color-on-color: var(--color-warm-grey-1); // @presenter Color
1178
+ --icon-color-on-color: var(--color-static-white); // @presenter Color
1171
1179
  --icon-color-interactive: var(--color-blueberry-6); // @presenter Color
1172
1180
  --icon-color-inverse: var(--color-white); // @presenter Color
1173
1181
  --icon-color-disabled: var(--color-warm-grey-5); // @presenter Color
@@ -1251,11 +1259,16 @@ const replay = css`
1251
1259
  --replay-runtime-expression-bg-color: rgba(54, 90, 249, 0.08); // @presenter Color
1252
1260
  --replay-operators-color: rgba(193, 142, 31, 1); // @presenter Color
1253
1261
 
1262
+ --replay-ai-gradient-soft: linear-gradient(62.6deg, rgba(113, 94, 254, 0.16) 0%, rgba(255, 92, 220, 0.16) 100%);
1263
+ --replay-ai-gradient-disabled: linear-gradient(62.6deg, rgba(113, 94, 254, 0.6) 0%, rgba(255, 92, 220, 0.6) 100%);
1264
+ --replay-ai-user-message-gradient: linear-gradient(73.52deg, rgba(113, 94, 254, 0.08) 10.13%, rgba(255, 92, 220, 0.08) 87.29%);
1265
+
1266
+ --replay-ai-send-button-disabled-border: 1px solid #ffffff33;
1254
1267
  // @tokens End
1255
1268
  `;
1256
1269
 
1257
1270
 
1258
- export const styles = css`
1271
+ export const styles = css<{ palette?: string }>`
1259
1272
  :root {
1260
1273
  ${accordion}
1261
1274
  ${admonition}
@@ -1289,6 +1302,7 @@ export const styles = css`
1289
1302
  ${markdown}
1290
1303
  ${markdownTabs}
1291
1304
  ${mermaid}
1305
+ ${excalidraw}
1292
1306
  ${menu}
1293
1307
  ${mobileMenu}
1294
1308
  ${modal}
@@ -1302,6 +1316,7 @@ export const styles = css`
1302
1316
  ${sizeAndSpace}
1303
1317
  ${tag}
1304
1318
  ${themeColors}
1319
+ ${activeBrandPaletteLight}
1305
1320
  ${tile}
1306
1321
  ${toc}
1307
1322
  ${tooltip}
@@ -1341,6 +1356,6 @@ export const styles = css`
1341
1356
  ${browserOverrides}
1342
1357
  `;
1343
1358
 
1344
- export const GlobalStyle = createGlobalStyle`
1359
+ export const GlobalStyle = createGlobalStyle<{ palette?: string }>`
1345
1360
  ${styles};
1346
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
+ };