@redocly/theme 0.64.0-next.0 → 0.64.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/lib/components/Banner/Banner.js +3 -3
  2. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  4. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  5. package/lib/components/Catalog/CatalogEntities.js +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  27. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  28. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  29. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  30. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  31. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  32. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  33. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  34. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  35. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  36. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  37. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  38. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  39. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  40. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  42. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  43. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  44. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  45. package/lib/components/Catalog/CatalogTags.js +62 -0
  46. package/lib/components/Catalog/variables.js +22 -14
  47. package/lib/components/Search/SearchDialog.js +118 -116
  48. package/lib/components/SvgViewer/variables.dark.js +1 -1
  49. package/lib/core/constants/catalog.d.ts +1 -1
  50. package/lib/core/constants/catalog.js +1 -1
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  52. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  54. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  55. package/lib/core/hooks/index.d.ts +1 -0
  56. package/lib/core/hooks/index.js +1 -0
  57. package/lib/core/styles/dark.d.ts +3 -1
  58. package/lib/core/styles/dark.js +42 -31
  59. package/lib/core/styles/global.d.ts +6 -2
  60. package/lib/core/styles/global.js +54 -39
  61. package/lib/core/styles/palette.d.ts +6 -0
  62. package/lib/core/styles/palette.dark.d.ts +3 -0
  63. package/lib/core/styles/palette.dark.js +216 -0
  64. package/lib/core/styles/palette.js +179 -0
  65. package/lib/core/types/catalog.d.ts +23 -7
  66. package/lib/core/types/hooks.d.ts +6 -4
  67. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.d.ts +9 -0
  68. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.js +27 -0
  69. package/lib/icons/StopIcon/StopIcon.d.ts +9 -0
  70. package/lib/icons/StopIcon/StopIcon.js +22 -0
  71. package/lib/index.d.ts +3 -1
  72. package/lib/index.js +3 -1
  73. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +7 -0
  74. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +95 -0
  75. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +1 -0
  76. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +1 -0
  77. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +8 -0
  78. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +15 -0
  79. package/lib/markdoc/components/Heading/Heading.js +2 -2
  80. package/lib/markdoc/components/Mermaid/Mermaid.js +2 -0
  81. package/lib/markdoc/components/default.d.ts +1 -0
  82. package/lib/markdoc/components/default.js +1 -0
  83. package/package.json +2 -2
  84. package/src/components/Banner/Banner.tsx +7 -7
  85. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  86. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  87. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  88. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  104. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  105. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  106. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  108. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  109. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  110. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  111. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  112. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  113. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  114. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  115. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  116. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  117. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  118. package/src/components/Catalog/CatalogTags.tsx +115 -0
  119. package/src/components/Catalog/variables.ts +22 -14
  120. package/src/components/Search/SearchDialog.tsx +299 -293
  121. package/src/components/SvgViewer/variables.dark.ts +1 -1
  122. package/src/core/constants/catalog.ts +1 -1
  123. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  124. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  125. package/src/core/hooks/index.ts +1 -0
  126. package/src/core/styles/dark.ts +14 -2
  127. package/src/core/styles/global.ts +28 -13
  128. package/src/core/styles/palette.dark.ts +214 -0
  129. package/src/core/styles/palette.ts +177 -0
  130. package/src/core/types/catalog.ts +24 -8
  131. package/src/core/types/hooks.ts +5 -10
  132. package/src/icons/ColorPaletteIcon/ColorPaletteIcon.tsx +28 -0
  133. package/src/icons/StopIcon/StopIcon.tsx +23 -0
  134. package/src/index.ts +3 -1
  135. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +85 -0
  136. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +5 -0
  137. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +12 -0
  138. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  139. package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
  140. package/src/markdoc/components/default.ts +1 -0
  141. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  142. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  143. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
@@ -1,9 +1,8 @@
1
1
  import { JSX } from 'react';
2
- import { SortOption } from '../../../core';
3
2
  import { CatalogViewMode } from '../../../core';
4
3
  type CatalogMobileTopBarControlsProps = {
5
- setSortOption: (sortOption: SortOption | null) => void;
6
- sortOption: SortOption | null;
4
+ setSortOption: (sortOption: string | null) => void;
5
+ sortOption: string | null;
7
6
  viewMode: CatalogViewMode;
8
7
  setViewMode: (viewMode: CatalogViewMode) => void;
9
8
  };
@@ -36,7 +36,7 @@ const CatalogDescription = styled_components_1.default.p `
36
36
  color: var(--catalog-description-text-color);
37
37
  font-weight: var(--catalog-description-font-weight);
38
38
  font-size: var(--catalog-description-font-size);
39
- margin: var(--catalog-description-margin);
39
+ margin: 0;
40
40
  line-height: var(--catalog-description-line-height);
41
41
  display: -webkit-box;
42
42
  -webkit-line-clamp: 3;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { SortOption } from '../../core/types';
3
2
  export type CatalogSortButtonProps = {
4
- onSortChange: (sortOption: SortOption | null) => void;
5
- currentSort?: SortOption | null;
3
+ onSortChange: (sortOption: string | null) => void;
4
+ currentSort?: string | null;
6
5
  };
7
6
  export declare function CatalogSortButton({ onSortChange, currentSort, }: {
8
- onSortChange: (sortOption: SortOption | null) => void;
9
- currentSort?: SortOption | null;
7
+ onSortChange: (sortOption: string | null) => void;
8
+ currentSort?: string | null;
10
9
  }): React.JSX.Element;
@@ -5,14 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogDomainsCell = CatalogDomainsCell;
7
7
  const react_1 = __importDefault(require("react"));
8
- const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
8
+ const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
9
+ const GraphIcon_1 = require("../../../icons/GraphIcon/GraphIcon");
9
10
  function CatalogDomainsCell({ domains }) {
10
11
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogDomainsCell" },
11
- react_1.default.createElement(CatalogTagsWithTooltip_1.CatalogTagsWithTooltip, { "data-testid": "catalog-domains-cell", items: domains, showPlaceholder: false, tagProps: {
12
+ react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-domains-cell", items: domains, showPlaceholder: false, tagProps: {
13
+ variant: 'outline',
14
+ icon: react_1.default.createElement(GraphIcon_1.GraphIcon, null),
12
15
  style: {
13
16
  fontSize: 'var(--font-size-base)',
14
17
  backgroundColor: 'transparent',
15
18
  borderRadius: 'var(--border-radius-xl)',
19
+ margin: 0,
16
20
  },
17
21
  textTransform: 'none',
18
22
  } })));
@@ -10,7 +10,7 @@ const CatalogHighlight_1 = require("../../../components/Catalog/CatalogHighlight
10
10
  const CatalogEntityTypeIcon_1 = require("../../../components/Catalog/CatalogEntityTypeIcon");
11
11
  function CatalogEntityCell({ entity }) {
12
12
  return (react_1.default.createElement(EntityTitleCellWrapper, { "data-component-name": "Catalog/CatalogTableView/CatalogEntityCell" },
13
- react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type }),
13
+ react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type, size: "large", defaultColors: true }),
14
14
  react_1.default.createElement(EntityTitleContent, null,
15
15
  react_1.default.createElement(EntityTitle, { "data-component-name": "Catalog/CatalogTableView/CatalogEntityTitle" },
16
16
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title)),
@@ -28,7 +28,7 @@ const EntityTitleContent = styled_components_1.default.div `
28
28
  flex-direction: column;
29
29
  max-width: calc(
30
30
  100% - var(--catalog-table-entity-title-content-offset)
31
- ); /* Account for icon width (30px) + gap (12px) */
31
+ ); /* Account for icon width (32px) + gap (8px) */
32
32
  overflow: hidden;
33
33
  `;
34
34
  const EntityTitle = styled_components_1.default.div `
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export type CatalogLastUpdateCellProps = {
3
+ lastModified: string;
4
+ };
5
+ export declare function CatalogLastUpdateCell({ lastModified, }: CatalogLastUpdateCellProps): React.ReactElement;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CatalogLastUpdateCell = CatalogLastUpdateCell;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
10
+ function formatLastModified(isoString) {
11
+ const date = new Date(isoString);
12
+ if (Number.isNaN(date.getTime())) {
13
+ return isoString;
14
+ }
15
+ return date.toLocaleDateString('en-US', {
16
+ year: 'numeric',
17
+ month: 'short',
18
+ day: 'numeric',
19
+ timeZone: 'UTC',
20
+ });
21
+ }
22
+ function formatLastModifiedTooltip(isoString) {
23
+ const date = new Date(isoString);
24
+ if (Number.isNaN(date.getTime())) {
25
+ return isoString;
26
+ }
27
+ return date.toLocaleString('en-US', {
28
+ year: 'numeric',
29
+ month: 'short',
30
+ day: 'numeric',
31
+ hour: '2-digit',
32
+ minute: '2-digit',
33
+ second: '2-digit',
34
+ hour12: false,
35
+ timeZone: 'UTC',
36
+ });
37
+ }
38
+ function CatalogLastUpdateCell({ lastModified, }) {
39
+ return (react_1.default.createElement(CatalogLastUpdateCellWrapper, { "data-component-name": "Catalog/CatalogTableView/CatalogLastUpdateCell" },
40
+ react_1.default.createElement(Tooltip_1.Tooltip, { tip: formatLastModifiedTooltip(lastModified), placement: "bottom" }, formatLastModified(lastModified))));
41
+ }
42
+ const CatalogLastUpdateCellWrapper = styled_components_1.default.div `
43
+ color: var(--text-color-helper);
44
+ `;
45
+ //# sourceMappingURL=CatalogLastUpdateCell.js.map
@@ -5,16 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogOwnersCell = CatalogOwnersCell;
7
7
  const react_1 = __importDefault(require("react"));
8
- const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
8
+ const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
9
9
  function CatalogOwnersCell({ owners }) {
10
10
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogOwnersCell" },
11
- react_1.default.createElement(CatalogTagsWithTooltip_1.CatalogTagsWithTooltip, { "data-testid": "catalog-owners-cell", items: owners, showPlaceholder: false, tagProps: {
11
+ react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-owners-cell", items: owners, showPlaceholder: false, tagProps: {
12
+ variant: 'outline',
12
13
  style: {
13
14
  fontSize: 'var(--font-size-base)',
14
15
  backgroundColor: 'transparent',
15
16
  borderRadius: 'var(--border-radius-xl)',
17
+ margin: 0,
16
18
  },
17
19
  textTransform: 'none',
18
- } })));
20
+ }, showAvatars: true })));
19
21
  }
20
22
  //# sourceMappingURL=CatalogOwnersCell.js.map
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { SortOption } from '../../../core/types';
3
2
  import { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
4
3
  export type CatalogTableHeaderCellProps<T extends BaseEntity> = {
5
4
  column: CatalogColumn<T>;
6
- currentSortOption?: SortOption | null;
5
+ currentSortOption?: string | null;
7
6
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
8
7
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
9
8
  };
10
- export declare const CatalogTableHeaderCell: <T extends BaseEntity>({ column, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellProps<T>) => React.JSX.Element;
9
+ export declare const CatalogTableHeaderCell: <T extends BaseEntity>({ column, currentSortOption, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellProps<T>) => React.JSX.Element;
@@ -42,9 +42,10 @@ const styled_components_1 = __importStar(require("styled-components"));
42
42
  const CaretDownIcon_1 = require("../../../icons/CaretDownIcon/CaretDownIcon");
43
43
  const CaretUpIcon_1 = require("../../../icons/CaretUpIcon/CaretUpIcon");
44
44
  const hooks_1 = require("../../../core/hooks");
45
- const CatalogTableHeaderCell = ({ column, handleSortClick, isColumnSorted, }) => {
45
+ const CatalogTableHeaderCell = ({ column, currentSortOption, handleSortClick, isColumnSorted, }) => {
46
46
  const { handleCellClick, sortKey, isUpActive, isDownActive } = (0, hooks_1.useCatalogTableHeaderCellActions)({
47
47
  column,
48
+ currentSortOption,
48
49
  handleSortClick,
49
50
  isColumnSorted,
50
51
  });
@@ -81,7 +82,7 @@ const SortIndicator = styled_components_1.default.div `
81
82
  flex-direction: column;
82
83
  align-items: center;
83
84
  justify-content: center;
84
- margin-left: 8px;
85
+ margin-left: 4px;
85
86
  gap: 2px;
86
87
  color: var(--catalog-table-header-sort-indicator-color);
87
88
  `;
@@ -1,6 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
3
- import type { SortOption } from '../../../core/types';
4
3
  export type BaseEntity = {
5
4
  id: string;
6
5
  key: string;
@@ -13,7 +12,7 @@ export type CatalogTableViewProps<T extends BaseEntity> = {
13
12
  entitiesCatalogConfig?: EntitiesCatalogConfig;
14
13
  catalogConfig: CatalogEntityConfig;
15
14
  columns?: CatalogColumn<T>[];
16
- currentSortOption?: SortOption | null;
15
+ currentSortOption?: string | null;
17
16
  onRowClick?: (entity: T) => void;
18
17
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
19
18
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
@@ -14,13 +14,14 @@ const CatalogTagsCell_1 = require("../../../components/Catalog/CatalogTableView/
14
14
  const CatalogTableViewRow_1 = require("../../../components/Catalog/CatalogTableView/CatalogTableViewRow");
15
15
  const CatalogEntityTypeTag_1 = require("../../../components/Catalog/CatalogEntityTypeTag");
16
16
  const core_1 = require("../../../core");
17
+ const CatalogLastUpdateCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogLastUpdateCell");
17
18
  const baseColumns = [
18
19
  {
19
20
  key: 'entity',
20
21
  title: 'Entity',
21
22
  render: (entity) => react_1.default.createElement(CatalogEntityCell_1.CatalogEntityCell, { entity: entity }),
22
23
  width: '3fr',
23
- minWidth: '250px',
24
+ minWidth: '164px',
24
25
  sortable: true,
25
26
  sortKey: 'title',
26
27
  },
@@ -29,7 +30,7 @@ const baseColumns = [
29
30
  title: 'Type',
30
31
  render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
31
32
  width: '2fr',
32
- minWidth: '120px',
33
+ minWidth: '162px',
33
34
  sortable: true,
34
35
  sortKey: 'type',
35
36
  },
@@ -41,7 +42,7 @@ const baseColumns = [
41
42
  return (react_1.default.createElement(CatalogDomainsCell_1.CatalogDomainsCell, { domains: ((_a = entity.domains) === null || _a === void 0 ? void 0 : _a.map((domain) => domain.title)) || [] }));
42
43
  },
43
44
  width: '2fr',
44
- minWidth: '150px',
45
+ minWidth: '162px',
45
46
  },
46
47
  {
47
48
  key: 'owners',
@@ -51,14 +52,23 @@ const baseColumns = [
51
52
  return (react_1.default.createElement(CatalogOwnersCell_1.CatalogOwnersCell, { owners: ((_a = entity.owners) === null || _a === void 0 ? void 0 : _a.map((owner) => owner.title)) || [] }));
52
53
  },
53
54
  width: '2fr',
54
- minWidth: '150px',
55
+ minWidth: '162px',
55
56
  },
56
57
  {
57
58
  key: 'tags',
58
59
  title: 'Tags',
59
60
  render: (entity) => react_1.default.createElement(CatalogTagsCell_1.CatalogTagsCell, { entity: entity }),
60
61
  width: '2fr',
61
- minWidth: '120px',
62
+ minWidth: '160px',
63
+ },
64
+ {
65
+ key: 'lastUpdate',
66
+ title: 'Last update',
67
+ render: (entity) => react_1.default.createElement(CatalogLastUpdateCell_1.CatalogLastUpdateCell, { lastModified: entity.updatedAt }),
68
+ width: '1fr',
69
+ minWidth: '112px',
70
+ sortable: true,
71
+ sortKey: 'updated_at',
62
72
  },
63
73
  ];
64
74
  const CatalogTableView = ({ entities, entitiesCatalogConfig, catalogConfig, columns = baseColumns, currentSortOption, onRowClick, handleSortClick, isColumnSorted, style, contentMinWidth, }) => {
@@ -5,13 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogTagsCell = CatalogTagsCell;
7
7
  const react_1 = __importDefault(require("react"));
8
- const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
8
+ const CatalogTags_1 = require("../../../components/Catalog/CatalogTags");
9
9
  function CatalogTagsCell({ entity }) {
10
10
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogTableView/CatalogTagsCell" },
11
- react_1.default.createElement(CatalogTagsWithTooltip_1.CatalogTagsWithTooltip, { "data-testid": "catalog-tags-cell", items: entity.tags || [], showPlaceholder: false, tagProps: {
11
+ react_1.default.createElement(CatalogTags_1.CatalogTags, { "data-testid": "catalog-tags-cell", items: entity.tags || [], showPlaceholder: false, tagProps: {
12
12
  style: {
13
13
  fontSize: 'var(--font-size-base)',
14
14
  borderRadius: 'var(--border-radius)',
15
+ margin: 0,
15
16
  },
16
17
  borderless: true,
17
18
  color: 'grey',
@@ -38,8 +38,8 @@ const EntityTitle = styled_components_1.default.div `
38
38
  text-overflow: ellipsis;
39
39
  `;
40
40
  exports.Email = styled_components_1.default.div `
41
- font-size: var(--catalog-table-entity-summary-font-size);
42
- line-height: var(--catalog-table-entity-summary-line-height);
41
+ font-size: var(--catalog-user-entity-cell-email-font-size);
42
+ line-height: var(--catalog-user-entity-cell-email-line-height);
43
43
  color: var(--color-blue-6);
44
44
  white-space: nowrap;
45
45
  overflow: hidden;
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { TagProps } from '../../components/Tag/Tag';
3
+ export type CatalogTagsProps = {
4
+ items: string[];
5
+ itemsToShow?: number;
6
+ showPlaceholder?: boolean;
7
+ tagProps?: TagProps;
8
+ showAvatars?: boolean;
9
+ maxItemLength?: number;
10
+ };
11
+ export declare function CatalogTags({ items, itemsToShow, showPlaceholder, showAvatars, tagProps, maxItemLength, }: CatalogTagsProps): JSX.Element | null;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CatalogTags = CatalogTags;
7
+ const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const constants_1 = require("../../core/constants");
10
+ const Tag_1 = require("../../components/Tag/Tag");
11
+ const Tooltip_1 = require("../../components/Tooltip/Tooltip");
12
+ const CatalogHighlight_1 = require("../../components/Catalog/CatalogHighlight");
13
+ const hooks_1 = require("../../core/hooks");
14
+ const CatalogAvatar_1 = require("../../components/Catalog/CatalogAvatar");
15
+ function CatalogTags({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, maxItemLength = constants_1.CATALOG_TAG_MAX_LENGTH, }) {
16
+ var _a;
17
+ const { useTranslate } = (0, hooks_1.useThemeHooks)();
18
+ const { translate } = useTranslate();
19
+ if (!items || items.length === 0) {
20
+ if (showPlaceholder) {
21
+ return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTags" }, translate('catalog.notConnected', 'Not connected')));
22
+ }
23
+ return null;
24
+ }
25
+ const maxLength = showAvatars || (tagProps === null || tagProps === void 0 ? void 0 : tagProps.icon) ? maxItemLength - 3 : maxItemLength;
26
+ const isFirstItemTruncated = ((_a = items[0]) === null || _a === void 0 ? void 0 : _a.length) > maxLength;
27
+ const anyItemHidden = items.length > itemsToShow;
28
+ const shouldUseVariantWithTooltip = anyItemHidden || isFirstItemTruncated;
29
+ if (shouldUseVariantWithTooltip) {
30
+ const displayedItems = items.slice(0, itemsToShow);
31
+ const remainingCount = items.length - itemsToShow;
32
+ return (react_1.default.createElement(Tooltip_1.Tooltip, { tip: items.join(', '), placement: "bottom", className: "catalog" },
33
+ react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" },
34
+ displayedItems.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
35
+ icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
36
+ style: Object.assign(Object.assign({}, tagProps === null || tagProps === void 0 ? void 0 : tagProps.style), { paddingLeft: 'var(--catalog-tags-tag-left-padding)' }),
37
+ }), { textTransform: "none", maxLength: maxLength }),
38
+ react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
39
+ remainingCount > 0 && react_1.default.createElement(MoreTagsButton, null,
40
+ "+ ",
41
+ remainingCount))));
42
+ }
43
+ return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTags" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
44
+ icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
45
+ style: Object.assign(Object.assign({}, tagProps === null || tagProps === void 0 ? void 0 : tagProps.style), { paddingLeft: 'var(--catalog-tags-tag-left-padding)' }),
46
+ }), { maxLength: maxLength }),
47
+ react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
48
+ }
49
+ const CatalogTagsWrapper = styled_components_1.default.div `
50
+ display: flex;
51
+ flex-wrap: wrap;
52
+ `;
53
+ const MoreTagsButton = styled_components_1.default.span `
54
+ font-size: var(--catalog-tags-more-button-font-size);
55
+ margin-left: var(--catalog-tags-more-button-margin-left);
56
+ `;
57
+ const CatalogTagsNotConnectedWrapper = styled_components_1.default.span `
58
+ font-size: var(--catalog-tags-not-connected-font-size);
59
+ line-height: var(--catalog-tags-not-connected-line-height);
60
+ color: var(--catalog-tags-not-connected-color);
61
+ `;
62
+ //# sourceMappingURL=CatalogTags.js.map
@@ -49,7 +49,7 @@ exports.catalog = (0, styled_components_1.css) `
49
49
  --catalog-description-text-color: var(--text-color-secondary);
50
50
  --catalog-description-font-weight: var(--font-weight-regular);
51
51
  --catalog-description-font-size: var(--font-size-lg);
52
- --catalog-description-margin: 0 0 var(--spacing-xl) 0;
52
+ --catalog-description-margin: 0 0 var(--spacing-base) 0;
53
53
  --catalog-description-line-height: var(--line-height-lg);
54
54
 
55
55
  /**
@@ -154,6 +154,7 @@ exports.catalog = (0, styled_components_1.css) `
154
154
  --catalog-tags-not-connected-font-size: var(--font-size-base);
155
155
  --catalog-tags-not-connected-line-height: var(--line-height-base);
156
156
  --catalog-tags-not-connected-color: var(--text-color-disabled);
157
+ --catalog-tags-tag-left-padding: 2px;
157
158
 
158
159
  /**
159
160
  * @tokens Catalog empty state
@@ -208,7 +209,7 @@ exports.catalog = (0, styled_components_1.css) `
208
209
  * @tokens Catalog card
209
210
  */
210
211
  --catalog-card-height: 241px;
211
- --catalog-card-padding-vertical: var(--spacing-base);
212
+ --catalog-card-padding-vertical: var(--spacing-md);
212
213
  --catalog-card-padding-horizontal: var(--spacing-md);
213
214
  --catalog-card-gap: var(--spacing-sm);
214
215
  --catalog-card-text-color: var(--text-color-secondary);
@@ -283,7 +284,7 @@ exports.catalog = (0, styled_components_1.css) `
283
284
  /**
284
285
  * @tokens Catalog card footer
285
286
  */
286
- --catalog-card-footer-height: 72px;
287
+ --catalog-card-footer-height: 68px;
287
288
 
288
289
  /**
289
290
  * @tokens Catalog card description
@@ -315,11 +316,6 @@ exports.catalog = (0, styled_components_1.css) `
315
316
  --catalog-page-badge-dot-size: 6px;
316
317
  --catalog-page-badge-dot-border-color: var(--color-static-white);
317
318
 
318
- /**
319
- * @tokens Catalog card metadata
320
- */
321
- --catalog-card-metadata-owner-tag-left-padding: 2px;
322
-
323
319
 
324
320
  /**
325
321
  * @tokens Catalog table
@@ -327,13 +323,13 @@ exports.catalog = (0, styled_components_1.css) `
327
323
  --catalog-table-border-color: var(--border-color-secondary);
328
324
  --catalog-table-header-bg-color: var(--layer-color);
329
325
  --catalog-table-header-font-weight: var(--font-weight-medium);
330
- --catalog-table-header-cell-padding: 4px 8px;
331
- --catalog-table-cell-padding: 4px 8px;
326
+ --catalog-table-header-cell-padding: 4px 6px 4px 8px;
327
+ --catalog-table-cell-padding: 4px 6px 4px 8px;
332
328
  --catalog-table-row-hover-bg-color: var(--bg-color-hover, rgba(0, 0, 0, 0.04));
333
329
  --catalog-table-empty-state-padding: 32px;
334
330
  --catalog-table-empty-state-color: var(--text-color-secondary);
335
- --catalog-table-title-cell-gap: 12px;
336
- --catalog-table-entity-title-content-offset: 42px;
331
+ --catalog-table-title-cell-gap: var(--spacing-xs);
332
+ --catalog-table-entity-title-content-offset: 40px;
337
333
 
338
334
  /**
339
335
  * @tokens Catalog table header
@@ -503,8 +499,6 @@ exports.catalog = (0, styled_components_1.css) `
503
499
  --catalog-history-pill-line-height: var(--line-height-base);
504
500
  --catalog-history-pill-text-color: var(--text-color-primary);
505
501
  --catalog-history-pill-min-width: calc(100% - 118px - var(--catalog-history-item-gap));
506
-
507
-
508
502
  // @tokens End
509
503
 
510
504
  /**
@@ -583,6 +577,20 @@ exports.catalog = (0, styled_components_1.css) `
583
577
  --catalog-history-sidebar-version-tag-border-radius: var(--border-radius-xl);
584
578
  --catalog-history-sidebar-revision-tag-border-radius: var(--border-radius-xl);
585
579
  // @tokens End
580
+
581
+ /**
582
+ * @tokens Catalog entity type icon
583
+ */
584
+ --catalog-table-icon-width-large: 32px;
585
+ --catalog-table-icon-height-large: 32px;
586
+ --catalog-table-icon-width-medium: 24px;
587
+ --catalog-table-icon-height-medium: 24px;
588
+
589
+ /**
590
+ * @tokens Catalog user entity cell
591
+ */
592
+ --catalog-user-entity-cell-email-font-size: var(--font-size-base);
593
+ --catalog-user-entity-cell-email-line-height: var(--line-height-base);
586
594
  `;
587
595
  /* eslint-enable theme/no-raw-colors-in-styles */
588
596
  //# sourceMappingURL=variables.js.map