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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/lib/components/Banner/Banner.js +3 -3
  2. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  4. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  5. package/lib/components/Catalog/CatalogEntities.js +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  27. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  28. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  29. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  30. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  31. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  32. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  33. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  34. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  35. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  36. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  37. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  38. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  39. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  40. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  42. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  43. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  44. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  45. package/lib/components/Catalog/CatalogTags.js +62 -0
  46. package/lib/components/Catalog/variables.js +22 -14
  47. package/lib/components/Search/SearchDialog.js +118 -116
  48. package/lib/core/constants/catalog.d.ts +1 -1
  49. package/lib/core/constants/catalog.js +1 -1
  50. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  52. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  54. package/lib/core/hooks/index.d.ts +1 -0
  55. package/lib/core/hooks/index.js +1 -0
  56. package/lib/core/styles/dark.d.ts +3 -1
  57. package/lib/core/styles/dark.js +8 -1
  58. package/lib/core/styles/global.d.ts +6 -2
  59. package/lib/core/styles/global.js +18 -10
  60. package/lib/core/styles/palette.d.ts +6 -0
  61. package/lib/core/styles/palette.dark.d.ts +3 -0
  62. package/lib/core/styles/palette.dark.js +216 -0
  63. package/lib/core/styles/palette.js +179 -0
  64. package/lib/core/types/catalog.d.ts +23 -7
  65. package/lib/core/types/hooks.d.ts +6 -4
  66. package/lib/index.d.ts +1 -1
  67. package/lib/index.js +1 -1
  68. package/lib/markdoc/components/Heading/Heading.js +2 -2
  69. package/package.json +2 -2
  70. package/src/components/Banner/Banner.tsx +7 -7
  71. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  72. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  73. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  74. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  75. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  76. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  77. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  78. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  79. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  80. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  81. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  82. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  83. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  84. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  85. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  86. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  87. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  88. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  90. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  91. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  92. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  93. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  94. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  95. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  96. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  97. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  98. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  99. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  100. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  101. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  102. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  103. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  104. package/src/components/Catalog/CatalogTags.tsx +115 -0
  105. package/src/components/Catalog/variables.ts +22 -14
  106. package/src/components/Search/SearchDialog.tsx +299 -293
  107. package/src/core/constants/catalog.ts +1 -1
  108. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  109. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  110. package/src/core/hooks/index.ts +1 -0
  111. package/src/core/styles/dark.ts +10 -2
  112. package/src/core/styles/global.ts +20 -12
  113. package/src/core/styles/palette.dark.ts +214 -0
  114. package/src/core/styles/palette.ts +177 -0
  115. package/src/core/types/catalog.ts +24 -8
  116. package/src/core/types/hooks.ts +5 -10
  117. package/src/index.ts +1 -1
  118. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  119. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  120. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  121. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
package/src/index.ts CHANGED
@@ -136,7 +136,7 @@ export * from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableHe
136
136
  export * from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
137
137
  export * from '@redocly/theme/components/Catalog/CatalogSelector';
138
138
  export * from '@redocly/theme/components/Catalog/CatalogSortButton';
139
- export * from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
139
+ export * from '@redocly/theme/components/Catalog/CatalogTags';
140
140
  export * from '@redocly/theme/components/Catalog/CatalogViewModeToggle';
141
141
  export * from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton';
142
142
  export * from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar';
@@ -64,7 +64,8 @@ export function Heading({
64
64
  const { usePageProps } = useThemeHooks();
65
65
  const pageProps = usePageProps();
66
66
 
67
- const isMarkdownPage = pageProps?.metadata?.type === 'markdown';
67
+ const isMarkdownPage =
68
+ pageProps?.metadata?.type === 'markdown' || pageProps?.metadata?.type === 'asciidoc';
68
69
 
69
70
  const linkEl = (
70
71
  <a
@@ -1,10 +0,0 @@
1
- import { JSX } from 'react';
2
- import { TagProps } from '../../components/Tag/Tag';
3
- export type CatalogTagsWithTooltipProps = {
4
- items: string[];
5
- itemsToShow?: number;
6
- showPlaceholder?: boolean;
7
- tagProps?: TagProps;
8
- showAvatars?: boolean;
9
- };
10
- export declare function CatalogTagsWithTooltip({ items, itemsToShow, showPlaceholder, showAvatars, tagProps, }: CatalogTagsWithTooltipProps): JSX.Element | null;
@@ -1,57 +0,0 @@
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.CatalogTagsWithTooltip = CatalogTagsWithTooltip;
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 CatalogTagsWithTooltip({ items, itemsToShow = 1, showPlaceholder = false, showAvatars, tagProps, }) {
16
- const { useTranslate } = (0, hooks_1.useThemeHooks)();
17
- const { translate } = useTranslate();
18
- if (!items || items.length === 0) {
19
- if (showPlaceholder) {
20
- return (react_1.default.createElement(CatalogTagsNotConnectedWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, translate('catalog.notConnected', 'Not connected')));
21
- }
22
- return null;
23
- }
24
- if (items.length <= itemsToShow) {
25
- return (react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" }, items.map((item, index) => (react_1.default.createElement(Tag_1.Tag, Object.assign({ key: `${item}-${index}` }, tagProps, (showAvatars && {
26
- icon: react_1.default.createElement(CatalogAvatar_1.CatalogAvatar, { value: item, size: "small" }),
27
- }), { maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
28
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item))))));
29
- }
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", width: "400px" },
33
- react_1.default.createElement(CatalogTagsWrapper, { "data-component-name": "Catalog/CatalogTagsWithTooltip" },
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
- }), { textTransform: "none", maxLength: constants_1.CATALOG_TAG_MAX_LENGTH }),
37
- react_1.default.createElement(CatalogHighlight_1.CatalogHighlight, null, item)))),
38
- react_1.default.createElement(MoreTagsButton, null,
39
- "+",
40
- remainingCount,
41
- " ",
42
- translate('catalog.tags.more', 'more')))));
43
- }
44
- const CatalogTagsWrapper = styled_components_1.default.div `
45
- display: flex;
46
- flex-wrap: wrap;
47
- `;
48
- const MoreTagsButton = styled_components_1.default.span `
49
- font-size: var(--catalog-tags-more-button-font-size);
50
- margin-left: var(--catalog-tags-more-button-margin-left);
51
- `;
52
- const CatalogTagsNotConnectedWrapper = styled_components_1.default.span `
53
- font-size: var(--catalog-tags-not-connected-font-size);
54
- line-height: var(--catalog-tags-not-connected-line-height);
55
- color: var(--catalog-tags-not-connected-color);
56
- `;
57
- //# sourceMappingURL=CatalogTagsWithTooltip.js.map
@@ -1,101 +0,0 @@
1
- import React, { JSX } from 'react';
2
- import styled from 'styled-components';
3
-
4
- import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
5
- import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
6
- import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
7
- import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
8
- import { useThemeHooks } from '@redocly/theme/core/hooks';
9
- import { CatalogAvatar } from '@redocly/theme/components/Catalog/CatalogAvatar';
10
-
11
- export type CatalogTagsWithTooltipProps = {
12
- items: string[];
13
- itemsToShow?: number;
14
- showPlaceholder?: boolean;
15
- tagProps?: TagProps;
16
- showAvatars?: boolean;
17
- };
18
-
19
- export function CatalogTagsWithTooltip({
20
- items,
21
- itemsToShow = 1,
22
- showPlaceholder = false,
23
- showAvatars,
24
- tagProps,
25
- }: CatalogTagsWithTooltipProps): JSX.Element | null {
26
- const { useTranslate } = useThemeHooks();
27
- const { translate } = useTranslate();
28
-
29
- if (!items || items.length === 0) {
30
- if (showPlaceholder) {
31
- return (
32
- <CatalogTagsNotConnectedWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
33
- {translate('catalog.notConnected', 'Not connected')}
34
- </CatalogTagsNotConnectedWrapper>
35
- );
36
- }
37
- return null;
38
- }
39
-
40
- if (items.length <= itemsToShow) {
41
- return (
42
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
43
- {items.map((item, index) => (
44
- <Tag
45
- key={`${item}-${index}`}
46
- {...tagProps}
47
- {...(showAvatars && {
48
- icon: <CatalogAvatar value={item} size="small" />,
49
- })}
50
- maxLength={CATALOG_TAG_MAX_LENGTH}
51
- >
52
- <CatalogHighlight>{item}</CatalogHighlight>
53
- </Tag>
54
- ))}
55
- </CatalogTagsWrapper>
56
- );
57
- }
58
-
59
- const displayedItems = items.slice(0, itemsToShow);
60
- const remainingCount = items.length - itemsToShow;
61
-
62
- return (
63
- <Tooltip tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
64
- <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
65
- {displayedItems.map((item, index) => (
66
- <Tag
67
- key={`${item}-${index}`}
68
- {...tagProps}
69
- {...(showAvatars && {
70
- icon: <CatalogAvatar value={item} size="small" />,
71
- })}
72
- textTransform="none"
73
- maxLength={CATALOG_TAG_MAX_LENGTH}
74
- >
75
- <CatalogHighlight>{item}</CatalogHighlight>
76
- </Tag>
77
- ))}
78
-
79
- <MoreTagsButton>
80
- +{remainingCount} {translate('catalog.tags.more', 'more')}
81
- </MoreTagsButton>
82
- </CatalogTagsWrapper>
83
- </Tooltip>
84
- );
85
- }
86
-
87
- const CatalogTagsWrapper = styled.div`
88
- display: flex;
89
- flex-wrap: wrap;
90
- `;
91
-
92
- const MoreTagsButton = styled.span`
93
- font-size: var(--catalog-tags-more-button-font-size);
94
- margin-left: var(--catalog-tags-more-button-margin-left);
95
- `;
96
-
97
- const CatalogTagsNotConnectedWrapper = styled.span`
98
- font-size: var(--catalog-tags-not-connected-font-size);
99
- line-height: var(--catalog-tags-not-connected-line-height);
100
- color: var(--catalog-tags-not-connected-color);
101
- `;