@redocly/theme 0.56.0-next.4 → 0.56.0-rc.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 (83) hide show
  1. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +2 -4
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +3 -1
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +11 -4
  4. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -7
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +0 -4
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +2 -7
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +8 -2
  9. package/lib/components/Catalog/CatalogEntityIcon.d.ts +1 -2
  10. package/lib/components/Catalog/CatalogEntityIcon.js +29 -22
  11. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +1 -2
  12. package/lib/components/Catalog/CatalogEntityTypeIcon.js +23 -11
  13. package/lib/components/Catalog/CatalogPageDescription.js +2 -2
  14. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +14 -2
  15. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
  16. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -1
  17. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +30 -3
  18. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +2 -0
  19. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +30 -5
  20. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
  21. package/lib/components/Catalog/CatalogTagsWithTooltip.js +3 -3
  22. package/lib/components/Catalog/variables.js +5 -34
  23. package/lib/components/Menu/variables.js +0 -2
  24. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
  25. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +5 -0
  26. package/lib/components/Select/variables.js +2 -2
  27. package/lib/components/Tag/Tag.d.ts +1 -2
  28. package/lib/components/Tag/Tag.js +3 -3
  29. package/lib/components/Tag/variables.js +0 -14
  30. package/lib/components/Tags/CounterTag.d.ts +1 -1
  31. package/lib/components/Tags/HttpTag.d.ts +1 -1
  32. package/lib/core/constants/catalog.d.ts +1 -1
  33. package/lib/core/types/catalog.d.ts +1 -1
  34. package/lib/core/types/l10n.d.ts +1 -1
  35. package/lib/ext/process-scorecard.d.ts +5 -0
  36. package/lib/ext/process-scorecard.js +11 -0
  37. package/lib/index.d.ts +1 -0
  38. package/lib/index.js +1 -0
  39. package/package.json +3 -3
  40. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +3 -6
  41. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +15 -7
  42. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -7
  43. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +0 -4
  44. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +3 -2
  45. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +3 -10
  46. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +22 -4
  47. package/src/components/Catalog/CatalogEntityIcon.tsx +33 -33
  48. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +28 -23
  49. package/src/components/Catalog/CatalogPageDescription.tsx +3 -4
  50. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +16 -2
  51. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +2 -4
  52. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +35 -3
  53. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +35 -5
  54. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +4 -3
  55. package/src/components/Catalog/variables.ts +5 -34
  56. package/src/components/Menu/variables.ts +0 -2
  57. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +1 -0
  58. package/src/components/Select/variables.ts +2 -2
  59. package/src/components/Tag/Tag.tsx +2 -11
  60. package/src/components/Tag/variables.ts +0 -14
  61. package/src/core/constants/catalog.ts +1 -1
  62. package/src/core/types/catalog.ts +1 -1
  63. package/src/core/types/l10n.ts +0 -4
  64. package/src/ext/process-scorecard.ts +13 -0
  65. package/src/index.ts +1 -0
  66. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +0 -6
  67. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +0 -19
  68. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +0 -6
  69. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +0 -55
  70. package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +0 -7
  71. package/lib/components/Catalog/CatalogEntityTypeTag.js +0 -36
  72. package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +0 -9
  73. package/lib/icons/MoleculesIcon/MoleculesIcon.js +0 -22
  74. package/lib/icons/NetworkIcon/NetworkIcon.d.ts +0 -9
  75. package/lib/icons/NetworkIcon/NetworkIcon.js +0 -23
  76. package/lib/icons/NotesIcon/NotesIcon.d.ts +0 -9
  77. package/lib/icons/NotesIcon/NotesIcon.js +0 -26
  78. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +0 -36
  79. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +0 -52
  80. package/src/components/Catalog/CatalogEntityTypeTag.tsx +0 -43
  81. package/src/icons/MoleculesIcon/MoleculesIcon.tsx +0 -23
  82. package/src/icons/NetworkIcon/NetworkIcon.tsx +0 -31
  83. package/src/icons/NotesIcon/NotesIcon.tsx +0 -43
@@ -14,7 +14,6 @@ const ArrowUpRightIcon_1 = require("../../../icons/ArrowUpRightIcon/ArrowUpRight
14
14
  const CatalogTagsWithTooltip_1 = require("../../../components/Catalog/CatalogTagsWithTooltip");
15
15
  const CatalogEntityIcon_1 = require("../../../components/Catalog/CatalogEntityIcon");
16
16
  const core_1 = require("../../../core");
17
- const Tooltip_1 = require("../../../components/Tooltip/Tooltip");
18
17
  function CatalogCard({ entity, catalogConfig }) {
19
18
  var _a, _b, _c;
20
19
  const { useTelemetry } = (0, hooks_1.useThemeHooks)();
@@ -26,9 +25,8 @@ function CatalogCard({ entity, catalogConfig }) {
26
25
  } },
27
26
  react_1.default.createElement(CardContent, null,
28
27
  react_1.default.createElement(CardHeader, null,
29
- react_1.default.createElement(Tooltip_1.TooltipComponent, { tip: entity.type, placement: "bottom", className: "catalog" },
30
- react_1.default.createElement(HeaderIconWrapper, null,
31
- react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type, defaultColor: true }))),
28
+ react_1.default.createElement(HeaderIconWrapper, null,
29
+ react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type })),
32
30
  react_1.default.createElement(CardTitle, null,
33
31
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title))),
34
32
  react_1.default.createElement(CardDescription, null,
@@ -6,5 +6,7 @@ export type CatalogEntityProps = {
6
6
  entitiesCatalogConfig: EntitiesCatalogConfig;
7
7
  catalogConfig: CatalogEntityConfig;
8
8
  initialRelations: BffCatalogRelatedEntityList;
9
+ mainCatalogLabelTranslationKey?: string;
10
+ mainCatalogSlug?: string;
9
11
  };
10
- export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }: CatalogEntityProps): React.JSX.Element;
12
+ export declare function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, mainCatalogLabelTranslationKey, mainCatalogSlug, }: CatalogEntityProps): React.JSX.Element;
@@ -18,9 +18,8 @@ const Menu_1 = require("../../../components/Menu/Menu");
18
18
  const Button_1 = require("../../../components/Button/Button");
19
19
  const CatalogEntityRelations_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations");
20
20
  const hooks_1 = require("../../../core/hooks");
21
- const SidebarActions_1 = require("../../../components/SidebarActions/SidebarActions");
22
- const CatalogEntitySchema_1 = require("../../../components/Catalog/CatalogEntity/CatalogEntitySchema");
23
- function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, }) {
21
+ const SidebarActions_1 = require("../../SidebarActions/SidebarActions");
22
+ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRelations, mainCatalogLabelTranslationKey, mainCatalogSlug, }) {
24
23
  var _a;
25
24
  const { useTranslate, useCatalog } = (0, hooks_1.useThemeHooks)();
26
25
  const { translate } = useTranslate();
@@ -39,6 +38,14 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
39
38
  ] }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
40
39
  react_1.default.createElement(CatalogPageContent, null,
41
40
  react_1.default.createElement(Breadcrumbs_1.Breadcrumbs, { additionalBreadcrumbs: [
41
+ ...(mainCatalogLabelTranslationKey
42
+ ? [
43
+ {
44
+ label: translate(mainCatalogLabelTranslationKey),
45
+ link: `catalogs/${mainCatalogSlug}`,
46
+ },
47
+ ]
48
+ : []),
42
49
  { label: linkToMainCatalogLabel, link: linkToMainCatalog },
43
50
  { label: entity.title },
44
51
  ] }),
@@ -46,7 +53,7 @@ function CatalogEntity({ entity, entitiesCatalogConfig, catalogConfig, initialRe
46
53
  react_1.default.createElement(CatalogPageDescription_1.CatalogPageDescription, { title: entity.title, description: (_a = entity.summary) !== null && _a !== void 0 ? _a : '', tag: entity.key }),
47
54
  react_1.default.createElement(CatalogEntityProperties_1.CatalogEntityProperties, { entity: entity }),
48
55
  react_1.default.createElement(CatalogTwoColumnsSection, null,
49
- entity.type === 'data-schema' ? (react_1.default.createElement(CatalogEntitySchema_1.CatalogEntitySchema, { entity: entity })) : (react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity })),
56
+ react_1.default.createElement(CatalogEntityMetadata_1.CatalogEntityMetadata, { entity: entity }),
50
57
  react_1.default.createElement(CatalogEntityLinks_1.CatalogEntityLinks, { entity: entity })),
51
58
  react_1.default.createElement(CatalogEntityRelations_1.CatalogEntityRelations, { entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, initialRelations: initialRelations })))));
52
59
  }
@@ -14,18 +14,12 @@ const UserEmailProperty_1 = require("../../../../components/Catalog/CatalogEntit
14
14
  const DomainsProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty");
15
15
  const OwnersProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty");
16
16
  const ContactProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty");
17
- const FormatProperty_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty");
18
17
  const propertyRenderers = [
19
18
  {
20
19
  key: 'type',
21
20
  condition: (entity) => !!entity.type,
22
21
  component: EntityTypeProperty_1.EntityTypeProperty,
23
22
  },
24
- {
25
- key: 'format',
26
- condition: (entity) => { var _a; return entity.type === 'data-schema' && !!((_a = entity.metadata) === null || _a === void 0 ? void 0 : _a.specType); },
27
- component: FormatProperty_1.FormatProperty,
28
- },
29
23
  {
30
24
  key: 'contact',
31
25
  condition: (entity) => { var _a, _b; return !!((_b = (_a = entity.contact) === null || _a === void 0 ? void 0 : _a.slack) === null || _b === void 0 ? void 0 : _b.channels); },
@@ -38,7 +32,7 @@ const propertyRenderers = [
38
32
  },
39
33
  {
40
34
  key: 'tags',
41
- condition: (entity) => { var _a; return !!((_a = entity.tags) === null || _a === void 0 ? void 0 : _a.length); },
35
+ condition: (entity) => !!entity.tags,
42
36
  component: TagsProperty_1.TagsProperty,
43
37
  },
44
38
  {
@@ -37,7 +37,6 @@ const CardHeader = styled_components_1.default.div `
37
37
  display: flex;
38
38
  align-items: center;
39
39
  gap: var(--catalog-card-content-gap);
40
- font-weight: var(--font-weight-medium);
41
40
  `;
42
41
  const CardContent = styled_components_1.default.div `
43
42
  flex: 1;
@@ -45,8 +44,5 @@ const CardContent = styled_components_1.default.div `
45
44
  align-items: center;
46
45
  gap: var(--catalog-card-content-gap);
47
46
  flex-wrap: wrap;
48
- color: var(--text-color-primary);
49
- font-size: var(--font-size-lg);
50
- line-height: var(--line-height-lg);
51
47
  `;
52
48
  //# sourceMappingURL=CatalogEntityPropertyCard.js.map
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DomainsProperty = DomainsProperty;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const GraphIcon_1 = require("../../../../icons/GraphIcon/GraphIcon");
9
- const Tag_1 = require("../../../../components/Tag/Tag");
10
- const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
9
+ const theme_1 = require("../../../../index.js");
10
+ const CatalogEntityPropertyCard_1 = require("./CatalogEntityPropertyCard");
11
11
  function DomainsProperty({ entity }) {
12
12
  const { domains = [] } = entity;
13
13
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty" },
14
14
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
15
15
  react_1.default.createElement(GraphIcon_1.GraphIcon, null),
16
- "Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(Tag_1.Tag, { key: domain === null || domain === void 0 ? void 0 : domain.id, style: { backgroundColor: 'var(--bg-color)' } },
16
+ "Domains"), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(theme_1.Tag, { key: domain === null || domain === void 0 ? void 0 : domain.id, style: { backgroundColor: 'var(--bg-color)' } },
17
17
  react_1.default.createElement(GraphIcon_1.GraphIcon, null), domain === null || domain === void 0 ? void 0 :
18
18
  domain.title)))) })));
19
19
  }
@@ -8,18 +8,13 @@ const react_1 = __importDefault(require("react"));
8
8
  const EntityTypeIcon_1 = require("../../../../icons/EntityTypeIcon/EntityTypeIcon");
9
9
  const utils_1 = require("../../../../core/utils");
10
10
  const CatalogEntityTypeIcon_1 = require("../../../../components/Catalog/CatalogEntityTypeIcon");
11
- const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard");
12
- const formatEntityType = (entityType) => {
13
- return (0, utils_1.capitalize)(entityType.startsWith('api-')
14
- ? entityType.replace('api-', 'API-').replace(/-/g, ' ')
15
- : entityType.replace(/-/g, ' '));
16
- };
11
+ const CatalogEntityPropertyCard_1 = require("./CatalogEntityPropertyCard");
17
12
  function EntityTypeProperty({ entity }) {
18
13
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty" },
19
14
  react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null,
20
15
  react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null),
21
16
  "Entity type"), content: react_1.default.createElement(react_1.default.Fragment, null,
22
17
  react_1.default.createElement(CatalogEntityTypeIcon_1.CatalogEntityTypeIcon, { entityType: entity.type }),
23
- formatEntityType(entity.type)) })));
18
+ react_1.default.createElement("strong", null, (0, utils_1.capitalize)(entity.type))) })));
24
19
  }
25
20
  //# sourceMappingURL=EntityTypeProperty.js.map
@@ -5,9 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogEntityDefaultRelations = CatalogEntityDefaultRelations;
7
7
  const react_1 = __importDefault(require("react"));
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const CatalogTableView_1 = require("../../../../components/Catalog/CatalogTableView/CatalogTableView");
8
10
  const CatalogEntityCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogEntityCell");
11
+ const Tag_1 = require("../../../../components/Tag/Tag");
9
12
  const CatalogEntityRelationsTable_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable");
10
- const CatalogEntityTypeTag_1 = require("../../../../components/Catalog/CatalogEntityTypeTag");
11
13
  const CatalogEntityRelationCell_1 = require("../../../../components/Catalog/CatalogTableView/CatalogEntityRelationCell");
12
14
  const columns = [
13
15
  {
@@ -21,7 +23,7 @@ const columns = [
21
23
  {
22
24
  key: 'type',
23
25
  title: 'Type',
24
- render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
26
+ render: (entity) => (react_1.default.createElement(EntityTypeTag, { color: (0, CatalogTableView_1.getEntityTagColor)(entity.type) }, entity.type)),
25
27
  sortable: true,
26
28
  sortKey: 'type',
27
29
  width: '1fr',
@@ -37,4 +39,8 @@ function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery,
37
39
  return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations" },
38
40
  react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { entity: entity, catalogConfig: catalogConfig, entitiesCatalogConfig: entitiesCatalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, heading: "Related entities", columns: columns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore })));
39
41
  }
42
+ const EntityTypeTag = (0, styled_components_1.default)(Tag_1.Tag) `
43
+ font-size: var(--font-size-base);
44
+ background-color: transparent;
45
+ `;
40
46
  //# sourceMappingURL=CatalogEntityDefaultRelations.js.map
@@ -1,6 +1,5 @@
1
1
  import { JSX } from 'react';
2
2
  export type CatalogEntityIconProps = {
3
3
  entityType: string;
4
- defaultColor?: boolean;
5
4
  };
6
- export declare function CatalogEntityIcon({ entityType, defaultColor, }: CatalogEntityIconProps): JSX.Element;
5
+ export declare function CatalogEntityIcon({ entityType }: CatalogEntityIconProps): JSX.Element;
@@ -9,29 +9,36 @@ const CodeIcon_1 = require("../../icons/CodeIcon/CodeIcon");
9
9
  const GraphIcon_1 = require("../../icons/GraphIcon/GraphIcon");
10
10
  const PeopleIcon_1 = require("../../icons/PeopleIcon/PeopleIcon");
11
11
  const UserIcon_1 = require("../../icons/UserIcon/UserIcon");
12
- const NetworkIcon_1 = require("../../icons/NetworkIcon/NetworkIcon");
13
- const MoleculesIcon_1 = require("../../icons/MoleculesIcon/MoleculesIcon");
14
- const getIconColor = (entityType) => `var(--catalog-entity-icon-color-${entityType})`;
15
- const getEntityIcon = ({ entityType, defaultColor }) => {
16
- const iconColor = defaultColor
17
- ? `var(--catalog-entity-icon-color)`
18
- : getIconColor(entityType);
19
- const entityIconMap = {
20
- service: react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
21
- domain: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor }),
22
- team: react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor }),
23
- user: react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor }),
24
- 'api-description': react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
25
- 'data-schema': react_1.default.createElement(NetworkIcon_1.NetworkIcon, { color: iconColor }),
26
- 'api-operation': react_1.default.createElement(MoleculesIcon_1.MoleculesIcon, { color: iconColor }),
27
- };
28
- return entityIconMap[entityType];
12
+ const iconColor = 'var(--catalog-entity-icon-color)';
13
+ const entityIconMap = {
14
+ service: react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
15
+ domain: react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor }),
16
+ team: react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor }),
17
+ user: react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor }),
18
+ 'api-description': react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
19
+ 'data-schema': react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
20
+ 'api-operation': react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor }),
29
21
  };
30
- function CatalogEntityIcon({ entityType, defaultColor = false, }) {
31
- const icon = getEntityIcon({ entityType, defaultColor });
32
- if (!icon) {
33
- throw new Error(`Unhandled entity type: ${entityType}`);
22
+ function CatalogEntityIcon({ entityType }) {
23
+ const key = entityType.toLowerCase();
24
+ switch (key) {
25
+ case 'service':
26
+ return entityIconMap.service;
27
+ case 'domain':
28
+ return entityIconMap.domain;
29
+ case 'team':
30
+ return entityIconMap.team;
31
+ case 'user':
32
+ return entityIconMap.user;
33
+ case 'api-description':
34
+ return entityIconMap['api-description'];
35
+ case 'data-schema':
36
+ return entityIconMap.service;
37
+ case 'api-operation':
38
+ return entityIconMap.service;
39
+ default:
40
+ const exhaustiveCheck = key;
41
+ throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
34
42
  }
35
- return icon;
36
43
  }
37
44
  //# sourceMappingURL=CatalogEntityIcon.js.map
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  export type CatalogEntityTypeIconProps = {
3
3
  entityType: string;
4
- defaultColor?: boolean;
5
4
  };
6
- export declare function CatalogEntityTypeIcon({ entityType, defaultColor, }: CatalogEntityTypeIconProps): React.JSX.Element;
5
+ export declare function CatalogEntityTypeIcon({ entityType }: CatalogEntityTypeIconProps): React.JSX.Element;
@@ -6,10 +6,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CatalogEntityTypeIcon = CatalogEntityTypeIcon;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- const CatalogEntityIcon_1 = require("../../components/Catalog/CatalogEntityIcon");
10
- function CatalogEntityTypeIcon({ entityType, defaultColor = false, }) {
11
- return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon", entityType: entityType, defaultColor: defaultColor },
12
- react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entityType, defaultColor: defaultColor })));
9
+ const CodeIcon_1 = require("../../icons/CodeIcon/CodeIcon");
10
+ const GraphIcon_1 = require("../../icons/GraphIcon/GraphIcon");
11
+ const PeopleIcon_1 = require("../../icons/PeopleIcon/PeopleIcon");
12
+ const UserIcon_1 = require("../../icons/UserIcon/UserIcon");
13
+ const getEntityIcon = (entityType) => {
14
+ const iconColor = 'var(--catalog-entity-icon-color)';
15
+ switch (entityType.toLowerCase()) {
16
+ case 'service':
17
+ return react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor });
18
+ case 'domain':
19
+ return react_1.default.createElement(GraphIcon_1.GraphIcon, { color: iconColor });
20
+ case 'team':
21
+ return react_1.default.createElement(PeopleIcon_1.PeopleIcon, { color: iconColor });
22
+ case 'user':
23
+ return react_1.default.createElement(UserIcon_1.UserIcon, { color: iconColor });
24
+ default:
25
+ return react_1.default.createElement(CodeIcon_1.CodeIcon, { color: iconColor });
26
+ }
27
+ };
28
+ function CatalogEntityTypeIcon({ entityType }) {
29
+ return (react_1.default.createElement(IconContainer, { "data-component-name": "Catalog/CatalogEntityTypeIcon" }, getEntityIcon(entityType)));
13
30
  }
14
31
  const IconContainer = styled_components_1.default.div `
15
32
  display: flex;
@@ -18,13 +35,8 @@ const IconContainer = styled_components_1.default.div `
18
35
  width: var(--catalog-table-icon-width);
19
36
  height: var(--catalog-table-icon-height);
20
37
  border-radius: var(--catalog-table-icon-border-radius);
21
- background-color: ${({ defaultColor, entityType }) => defaultColor
22
- ? 'var(--catalog-entity-bg-color)'
23
- : `var(--catalog-entity-bg-color-${entityType})`};
38
+ background-color: var(--catalog-table-icon-bg-color);
24
39
  flex-shrink: 0;
25
- border: 1px solid
26
- ${({ defaultColor, entityType }) => defaultColor
27
- ? 'var(--catalog-entity-border-color)'
28
- : `var(--catalog-entity-border-color-${entityType})`};
40
+ border: var(--catalog-table-icon-border-width) solid var(--catalog-table-icon-border-color);
29
41
  `;
30
42
  //# sourceMappingURL=CatalogEntityTypeIcon.js.map
@@ -8,12 +8,12 @@ const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const utils_1 = require("../../core/utils");
10
10
  const H3_1 = require("../../components/Typography/H3");
11
- const Tag_1 = require("../../components/Tag/Tag");
11
+ const CounterTag_1 = require("../Tags/CounterTag");
12
12
  function CatalogPageDescription({ title, titleTranslationKey, description, descriptionTranslationKey, tag, }) {
13
13
  return (react_1.default.createElement(CatalogPageDescriptionWrapper, null,
14
14
  react_1.default.createElement(CatalogTitleWrapper, null,
15
15
  react_1.default.createElement(CatalogTitle, { "data-translation-key": titleTranslationKey }, title),
16
- react_1.default.createElement(Tag_1.Tag, { borderless: true, textTransform: "none" }, tag)),
16
+ react_1.default.createElement(CounterTag_1.CounterTag, { borderless: true }, tag)),
17
17
  react_1.default.createElement(CatalogDescription, { "data-translation-key": descriptionTranslationKey }, description)));
18
18
  }
19
19
  const CatalogPageDescriptionWrapper = styled_components_1.default.div `
@@ -7,10 +7,11 @@ exports.CatalogEntityCell = CatalogEntityCell;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const CatalogHighlight_1 = require("../../../components/Catalog/CatalogHighlight");
10
- const CatalogEntityTypeIcon_1 = require("../../../components/Catalog/CatalogEntityTypeIcon");
10
+ const CatalogEntityIcon_1 = require("../../../components/Catalog/CatalogEntityIcon");
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, defaultColor: true }),
13
+ react_1.default.createElement(IconContainer, null,
14
+ react_1.default.createElement(CatalogEntityIcon_1.CatalogEntityIcon, { entityType: entity.type })),
14
15
  react_1.default.createElement(EntityTitleContent, null,
15
16
  react_1.default.createElement(EntityTitle, null,
16
17
  react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, entity.title)),
@@ -23,6 +24,17 @@ const EntityTitleCellWrapper = styled_components_1.default.div `
23
24
  gap: var(--catalog-table-title-cell-gap);
24
25
  max-width: 100%;
25
26
  `;
27
+ const IconContainer = styled_components_1.default.div `
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ width: var(--catalog-table-icon-width);
32
+ height: var(--catalog-table-icon-height);
33
+ border-radius: var(--catalog-table-icon-border-radius);
34
+ background-color: var(--catalog-table-icon-bg-color);
35
+ flex-shrink: 0;
36
+ border: var(--catalog-table-icon-border-width) solid var(--catalog-table-icon-border-color);
37
+ `;
26
38
  const EntityTitleContent = styled_components_1.default.div `
27
39
  display: flex;
28
40
  flex-direction: column;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { SortOption } from '../../../core/types';
3
- import { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
3
+ import { BaseEntity, CatalogColumn } from './CatalogTableView';
4
4
  export type CatalogTableHeaderCellProps<T extends BaseEntity> = {
5
5
  column: CatalogColumn<T>;
6
6
  setSortOption: (sortOption: SortOption | null) => void;
@@ -1,6 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
3
- import { SortOption } from '../../../core/types';
3
+ import { EntityType, SortOption } from '../../../core/types';
4
4
  export type BaseEntity = {
5
5
  id: string;
6
6
  key: string;
@@ -27,4 +27,5 @@ export type CatalogColumn<T> = {
27
27
  sortable?: boolean;
28
28
  sortKey?: string;
29
29
  };
30
+ export declare const getEntityTagColor: (type: EntityType) => string;
30
31
  export declare const CatalogTableView: <T extends BaseEntity>({ entities, entitiesCatalogConfig, catalogConfig, columns, setSortOption, currentSortOption, handleSortClick, isColumnSorted, }: CatalogTableViewProps<T>) => React.JSX.Element;
@@ -3,16 +3,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CatalogTableView = void 0;
6
+ exports.CatalogTableView = exports.getEntityTagColor = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
+ const Tag_1 = require("../../../components/Tag/Tag");
9
10
  const CatalogOwnersCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogOwnersCell");
10
11
  const CatalogDomainsCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogDomainsCell");
11
12
  const CatalogEntityCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogEntityCell");
12
13
  const CatalogTableHeaderCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogTableHeaderCell");
13
14
  const CatalogTagsCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogTagsCell");
14
15
  const CatalogTableViewRow_1 = require("../../../components/Catalog/CatalogTableView/CatalogTableViewRow");
15
- const CatalogEntityTypeTag_1 = require("../../../components/Catalog/CatalogEntityTypeTag");
16
+ const getEntityTagColor = (type) => {
17
+ switch (type) {
18
+ case 'service':
19
+ return 'blue';
20
+ case 'domain':
21
+ return 'grass';
22
+ case 'team':
23
+ return 'purple';
24
+ case 'user':
25
+ return 'yellow';
26
+ case 'api-description':
27
+ return 'sky';
28
+ case 'data-schema':
29
+ return 'sky';
30
+ case 'api-operation':
31
+ return 'sky';
32
+ default:
33
+ const exhaustiveCheck = type;
34
+ throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
35
+ }
36
+ };
37
+ exports.getEntityTagColor = getEntityTagColor;
16
38
  const baseColumns = [
17
39
  {
18
40
  key: 'entity',
@@ -26,7 +48,7 @@ const baseColumns = [
26
48
  {
27
49
  key: 'type',
28
50
  title: 'Type',
29
- render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
51
+ render: (entity) => (react_1.default.createElement(EntityTypeTag, { color: (0, exports.getEntityTagColor)(entity.type) }, entity.type)),
30
52
  width: '2fr',
31
53
  minWidth: '120px',
32
54
  sortable: true,
@@ -66,6 +88,11 @@ const CatalogTableView = ({ entities, entitiesCatalogConfig, catalogConfig, colu
66
88
  react_1.default.createElement("div", null, entities.map((entity) => (react_1.default.createElement(CatalogTableViewRow_1.CatalogTableViewRow, { key: entity.id, entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, columns: columns }))))));
67
89
  };
68
90
  exports.CatalogTableView = CatalogTableView;
91
+ const EntityTypeTag = (0, styled_components_1.default)(Tag_1.Tag) `
92
+ font-size: var(--font-size-base);
93
+ background-color: transparent;
94
+ text-transform: lowercase;
95
+ `;
69
96
  const CatalogTableWrapper = styled_components_1.default.div `
70
97
  width: 100%;
71
98
  border-bottom: 1px solid var(--catalog-table-border-color);
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
3
+ import { EntityType } from '../../../core/types';
3
4
  export type BaseEntity = {
4
5
  id: string;
5
6
  key: string;
@@ -22,4 +23,5 @@ export type CatalogColumn<T> = {
22
23
  sortable?: boolean;
23
24
  sortKey?: string;
24
25
  };
26
+ export declare const getEntityTagColor: (type: EntityType) => string;
25
27
  export declare const CatalogTableViewRow: <T extends BaseEntity>({ entity, entitiesCatalogConfig, catalogConfig, columns, }: CatalogTableViewRowProps<T>) => React.JSX.Element;
@@ -3,15 +3,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CatalogTableViewRow = void 0;
6
+ exports.CatalogTableViewRow = exports.getEntityTagColor = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
+ const Tag_1 = require("../../../components/Tag/Tag");
9
10
  const CatalogOwnersCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogOwnersCell");
10
11
  const CatalogDomainsCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogDomainsCell");
11
12
  const CatalogEntityCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogEntityCell");
12
13
  const CatalogTagsCell_1 = require("../../../components/Catalog/CatalogTableView/CatalogTagsCell");
13
14
  const useCatalogTableViewRow_1 = require("../../../core/hooks/catalog/useCatalogTableViewRow");
14
- const CatalogEntityTypeTag_1 = require("../../../components/Catalog/CatalogEntityTypeTag");
15
+ const getEntityTagColor = (type) => {
16
+ switch (type) {
17
+ case 'service':
18
+ return 'blue';
19
+ case 'domain':
20
+ return 'grass';
21
+ case 'team':
22
+ return 'purple';
23
+ case 'user':
24
+ return 'yellow';
25
+ case 'api-description':
26
+ return 'sky';
27
+ case 'data-schema':
28
+ return 'sky';
29
+ case 'api-operation':
30
+ return 'sky';
31
+ default:
32
+ const exhaustiveCheck = type;
33
+ throw new Error(`Unhandled entity type: ${exhaustiveCheck}`);
34
+ }
35
+ };
36
+ exports.getEntityTagColor = getEntityTagColor;
15
37
  const baseColumns = [
16
38
  {
17
39
  key: 'entity',
@@ -25,7 +47,7 @@ const baseColumns = [
25
47
  {
26
48
  key: 'type',
27
49
  title: 'Type',
28
- render: (entity) => react_1.default.createElement(CatalogEntityTypeTag_1.CatalogEntityTypeTag, { entityType: entity.type }),
50
+ render: (entity) => (react_1.default.createElement(EntityTypeTag, { color: (0, exports.getEntityTagColor)(entity.type) }, entity.type)),
29
51
  width: '2fr',
30
52
  minWidth: '120px',
31
53
  sortable: true,
@@ -72,6 +94,11 @@ const CatalogTableViewRow = ({ entity, entitiesCatalogConfig, catalogConfig, col
72
94
  return (react_1.default.createElement(TableRow, { key: entity.id, columnsWidths: columns.map((column) => column.width || '1fr'), columnsMinWidths: columns.map((column) => column.minWidth || 'auto'), onClick: () => handleRowClick() }, columns.map((column) => (react_1.default.createElement(TableCell, { key: column.key, className: column.key === 'entity' ? '' : 'tooltip-cell-container' }, column.render(entity))))));
73
95
  };
74
96
  exports.CatalogTableViewRow = CatalogTableViewRow;
97
+ const EntityTypeTag = (0, styled_components_1.default)(Tag_1.Tag) `
98
+ font-size: var(--font-size-base);
99
+ background-color: transparent;
100
+ text-transform: lowercase;
101
+ `;
75
102
  const TableRow = styled_components_1.default.div `
76
103
  display: grid;
77
104
  grid-template-columns: ${({ columnsWidths, columnsMinWidths }) => columnsWidths
@@ -100,7 +127,5 @@ const TableCell = styled_components_1.default.div `
100
127
  &.tooltip-cell-container {
101
128
  overflow: visible;
102
129
  }
103
-
104
- height: 52px;
105
130
  `;
106
131
  //# sourceMappingURL=CatalogTableViewRow.js.map
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { TagProps } from '../../components/Tag/Tag';
2
+ import { TagProps } from '../Tag/Tag';
3
3
  export type CatalogTagsWithTooltipProps = {
4
4
  items: string[];
5
5
  itemsToShow?: number;
@@ -7,9 +7,9 @@ exports.CatalogTagsWithTooltip = CatalogTagsWithTooltip;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
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");
10
+ const Tag_1 = require("../Tag/Tag");
11
+ const CatalogHighlight_1 = require("./CatalogHighlight");
12
+ const Tooltip_1 = require("../Tooltip/Tooltip");
13
13
  function CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = true, tagProps, }) {
14
14
  if (!items || items.length === 0) {
15
15
  if (showPlaceholder) {
@@ -101,36 +101,6 @@ exports.catalog = (0, styled_components_1.css) `
101
101
  * @tokens Catalog entity icon
102
102
  */
103
103
  --catalog-entity-icon-color: var(--color-primary-base);
104
- --catalog-entity-border-color: var(--border-color-secondary);
105
- --catalog-entity-bg-color: var(--bg-color-tonal);
106
-
107
- --catalog-entity-icon-color-service: var(--color-blue-6);
108
- --catalog-entity-border-color-service: var(--color-blueberry-3);
109
- --catalog-entity-bg-color-service: var(--color-blue-1);
110
-
111
- --catalog-entity-icon-color-domain: var(--color-grass-8);
112
- --catalog-entity-border-color-domain: var(--color-grass-4);
113
- --catalog-entity-bg-color-domain: var(--color-grass-1);
114
-
115
- --catalog-entity-icon-color-team: var(--color-purple-7);
116
- --catalog-entity-border-color-team: var(--color-purple-4);
117
- --catalog-entity-bg-color-team: var(--color-purple-1);
118
-
119
- --catalog-entity-icon-color-user: var(--color-orange-7);
120
- --catalog-entity-border-color-user: var(--color-orange-4);
121
- --catalog-entity-bg-color-user: var(--color-orange-1);
122
-
123
- --catalog-entity-icon-color-api-description: var(--color-sky-8);
124
- --catalog-entity-border-color-api-description: var(--color-sky-5);
125
- --catalog-entity-bg-color-api-description: var(--color-sky-1);
126
-
127
- --catalog-entity-icon-color-data-schema: var(--color-carrot-8);
128
- --catalog-entity-border-color-data-schema: var(--color-carrot-6);
129
- --catalog-entity-bg-color-data-schema: var(--color-carrot-1);
130
-
131
- --catalog-entity-icon-color-api-operation: var(--color-raspberry-7);
132
- --catalog-entity-border-color-api-operation: var(--color-raspberry-3);
133
- --catalog-entity-bg-color-api-operation: var(--color-raspberry-1);
134
104
 
135
105
  /**
136
106
  * @tokens Catalog tags
@@ -287,8 +257,8 @@ exports.catalog = (0, styled_components_1.css) `
287
257
  --catalog-table-border-color: var(--border-color-primary);
288
258
  --catalog-table-header-bg-color: var(--bg-color-secondary);
289
259
  --catalog-table-header-font-weight: var(--font-weight-medium);
290
- --catalog-table-header-cell-padding: 4px 8px;
291
- --catalog-table-cell-padding: 4px 8px;
260
+ --catalog-table-header-cell-padding: 5px 8px;
261
+ --catalog-table-cell-padding: 5px 8px;
292
262
  --catalog-table-row-hover-bg-color: var(--bg-color-hover, rgba(0, 0, 0, 0.04));
293
263
  --catalog-table-empty-state-padding: 32px;
294
264
  --catalog-table-empty-state-color: var(--text-color-secondary);
@@ -306,8 +276,8 @@ exports.catalog = (0, styled_components_1.css) `
306
276
  /**
307
277
  * @tokens Catalog table icon
308
278
  */
309
- --catalog-table-icon-width: 32px;
310
- --catalog-table-icon-height: 32px;
279
+ --catalog-table-icon-width: 30px;
280
+ --catalog-table-icon-height: 30px;
311
281
  --catalog-table-icon-border-radius: 4px;
312
282
  --catalog-table-icon-bg-color: var(--bg-color-tonal);
313
283
  --catalog-table-icon-border-color: var(--border-color-secondary);
@@ -377,6 +347,7 @@ exports.catalog = (0, styled_components_1.css) `
377
347
  --catalog-empty-state-font-size: var(--font-size-base);
378
348
  --catalog-empty-state-line-height: var(--line-height-base);
379
349
 
350
+
380
351
  --catalog-avatar-bg-color: #ededf2;
381
352
  // @tokens End
382
353
  `;