@redocly/theme 0.61.1 → 0.62.0-custom.1

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 (217) hide show
  1. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.d.ts +1 -0
  2. package/lib/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.js +12 -0
  3. package/lib/components/Badge/Badge.d.ts +2 -1
  4. package/lib/components/Badge/Badge.js +24 -2
  5. package/lib/components/Banner/Banner.js +19 -1
  6. package/lib/components/Banner/variables.js +1 -0
  7. package/lib/components/Breadcrumbs/Breadcrumb.js +1 -1
  8. package/lib/components/Breadcrumbs/BreadcrumbDropdown.js +9 -6
  9. package/lib/components/Breadcrumbs/Breadcrumbs.js +24 -15
  10. package/lib/components/Buttons/AIAssistantButton.js +7 -4
  11. package/lib/components/Buttons/EditPageButton.js +4 -26
  12. package/lib/components/Catalog/CatalogEntities.js +10 -8
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +2 -2
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +3 -3
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +6 -13
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +13 -11
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +7 -5
  19. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +9 -7
  20. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +1 -1
  21. package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -2
  22. package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +1 -1
  23. package/lib/components/CodeBlock/CodeBlockControls.js +8 -6
  24. package/lib/components/Dropdown/Dropdown.js +1 -1
  25. package/lib/components/Dropdown/variables.js +1 -0
  26. package/lib/components/Feedback/Comment.js +17 -4
  27. package/lib/components/Feedback/Mood.js +6 -3
  28. package/lib/components/Feedback/Rating.js +6 -3
  29. package/lib/components/Feedback/Scale.js +6 -3
  30. package/lib/components/Feedback/Sentiment.js +6 -3
  31. package/lib/components/Filter/FilterCheckboxes.js +1 -1
  32. package/lib/components/JsonViewer/JsonViewer.js +2 -2
  33. package/lib/components/JsonViewer/{Helpers.js → helpers.js} +2 -1
  34. package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
  35. package/lib/components/Markdown/Markdown.js +2 -2
  36. package/lib/components/Menu/MenuItem.js +41 -15
  37. package/lib/components/Menu/variables.js +3 -3
  38. package/lib/components/Navbar/NavbarItem.js +1 -1
  39. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.d.ts +1 -0
  40. package/lib/components/OpenApiDocs/hooks/AdditionalOverviewInfo.js +12 -0
  41. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.d.ts +1 -0
  42. package/lib/components/OpenApiDocs/hooks/AfterOpenApiDescription.js +6 -0
  43. package/lib/components/PageActions/PageActions.js +25 -8
  44. package/lib/components/Search/SearchAiDialog.d.ts +4 -2
  45. package/lib/components/Search/SearchAiDialog.js +23 -4
  46. package/lib/components/Search/SearchAiMessage.d.ts +4 -2
  47. package/lib/components/Search/SearchAiMessage.js +82 -23
  48. package/lib/components/Search/SearchDialog.js +50 -25
  49. package/lib/components/Select/variables.js +2 -2
  50. package/lib/components/SvgViewer/SvgViewer.d.ts +15 -0
  51. package/lib/components/SvgViewer/SvgViewer.js +312 -0
  52. package/lib/components/SvgViewer/variables.d.ts +1 -0
  53. package/lib/components/SvgViewer/variables.dark.d.ts +1 -0
  54. package/lib/components/SvgViewer/variables.dark.js +8 -0
  55. package/lib/components/SvgViewer/variables.js +17 -0
  56. package/lib/components/Tag/Tag.js +1 -1
  57. package/lib/components/Tag/variables.dark.js +6 -0
  58. package/lib/components/Tag/variables.js +6 -0
  59. package/lib/components/Tooltip/Tooltip.d.ts +2 -3
  60. package/lib/components/Tooltip/Tooltip.js +66 -113
  61. package/lib/components/Tooltip/variables.dark.js +4 -0
  62. package/lib/components/Tooltip/variables.js +3 -3
  63. package/lib/components/UserMenu/LoginButton.d.ts +8 -2
  64. package/lib/components/UserMenu/LoginButton.js +4 -3
  65. package/lib/core/constants/feedback.d.ts +2 -0
  66. package/lib/core/constants/feedback.js +6 -0
  67. package/lib/core/constants/index.d.ts +1 -0
  68. package/lib/core/constants/index.js +1 -0
  69. package/lib/core/constants/search.d.ts +5 -1
  70. package/lib/core/constants/search.js +24 -1
  71. package/lib/core/hooks/search/use-search-dialog.js +2 -2
  72. package/lib/core/hooks/use-color-switcher.js +3 -1
  73. package/lib/core/hooks/use-mcp-config.js +2 -1
  74. package/lib/core/hooks/use-modal-scroll-lock.js +24 -10
  75. package/lib/core/hooks/use-outside-click.d.ts +3 -1
  76. package/lib/core/hooks/use-outside-click.js +8 -4
  77. package/lib/core/hooks/use-page-actions.d.ts +1 -1
  78. package/lib/core/hooks/use-page-actions.js +50 -14
  79. package/lib/core/hooks/use-product-picker.js +1 -1
  80. package/lib/core/hooks/use-unique-svg-ids.d.ts +6 -0
  81. package/lib/core/hooks/use-unique-svg-ids.js +15 -0
  82. package/lib/core/openapi/index.d.ts +2 -0
  83. package/lib/core/openapi/index.js +5 -1
  84. package/lib/core/styles/dark.js +13 -0
  85. package/lib/core/styles/global.js +38 -15
  86. package/lib/core/types/catalog.d.ts +1 -1
  87. package/lib/core/types/hooks.d.ts +23 -2
  88. package/lib/core/types/l10n.d.ts +1 -1
  89. package/lib/core/types/search.d.ts +24 -0
  90. package/lib/core/types/search.js +9 -1
  91. package/lib/core/utils/content-segments.d.ts +2 -0
  92. package/lib/core/utils/content-segments.js +22 -0
  93. package/lib/core/utils/index.d.ts +1 -0
  94. package/lib/core/utils/index.js +1 -0
  95. package/lib/core/utils/transform-revisions-to-version-history.js +18 -68
  96. package/lib/ext/process-scorecard.d.ts +49 -0
  97. package/lib/ext/process-scorecard.js +12 -0
  98. package/lib/icons/DirectionRightIcon/DirectionRightIcon.d.ts +5 -0
  99. package/lib/icons/DirectionRightIcon/DirectionRightIcon.js +24 -0
  100. package/lib/icons/FitToViewIcon/FitToViewIcon.d.ts +9 -0
  101. package/lib/icons/FitToViewIcon/FitToViewIcon.js +25 -0
  102. package/lib/index.d.ts +8 -0
  103. package/lib/index.js +8 -0
  104. package/lib/layouts/DocumentationLayout.js +4 -25
  105. package/lib/layouts/DocumentationLayoutBottom.d.ts +11 -0
  106. package/lib/layouts/DocumentationLayoutBottom.js +28 -0
  107. package/lib/layouts/DocumentationLayoutTop.d.ts +13 -0
  108. package/lib/layouts/DocumentationLayoutTop.js +33 -0
  109. package/lib/layouts/Forbidden.js +22 -18
  110. package/lib/markdoc/components/Cards/Card.js +1 -0
  111. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
  112. package/lib/markdoc/components/Heading/Heading.js +40 -2
  113. package/lib/markdoc/components/LoginButton/LoginButton.d.ts +9 -0
  114. package/lib/markdoc/components/LoginButton/LoginButton.js +48 -0
  115. package/lib/markdoc/components/Mermaid/Mermaid.js +70 -2
  116. package/lib/markdoc/components/default.d.ts +1 -0
  117. package/lib/markdoc/components/default.js +1 -0
  118. package/lib/markdoc/default.d.ts +6 -0
  119. package/lib/markdoc/default.js +2 -0
  120. package/lib/markdoc/tags/login-button.d.ts +2 -0
  121. package/lib/markdoc/tags/login-button.js +32 -0
  122. package/package.json +10 -10
  123. package/src/components/AsyncApiDocs/hooks/AfterAsyncApiChannelDescription.tsx +10 -0
  124. package/src/components/Badge/Badge.tsx +18 -2
  125. package/src/components/Banner/Banner.tsx +23 -1
  126. package/src/components/Banner/variables.ts +1 -0
  127. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -3
  128. package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +11 -8
  129. package/src/components/Breadcrumbs/Breadcrumbs.tsx +24 -15
  130. package/src/components/Buttons/AIAssistantButton.tsx +7 -4
  131. package/src/components/Buttons/EditPageButton.tsx +13 -34
  132. package/src/components/Catalog/CatalogEntities.tsx +10 -8
  133. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
  134. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +3 -4
  135. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +5 -21
  136. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +1 -1
  137. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +13 -11
  138. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +7 -5
  139. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +9 -7
  140. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +1 -2
  141. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +9 -5
  142. package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -1
  143. package/src/components/CodeBlock/CodeBlockControls.tsx +16 -10
  144. package/src/components/Dropdown/Dropdown.tsx +1 -1
  145. package/src/components/Dropdown/variables.ts +1 -0
  146. package/src/components/Feedback/Comment.tsx +22 -4
  147. package/src/components/Feedback/Mood.tsx +6 -2
  148. package/src/components/Feedback/Rating.tsx +6 -2
  149. package/src/components/Feedback/Scale.tsx +6 -2
  150. package/src/components/Feedback/Sentiment.tsx +6 -2
  151. package/src/components/Filter/FilterCheckboxes.tsx +1 -1
  152. package/src/components/JsonViewer/JsonViewer.tsx +1 -2
  153. package/src/components/JsonViewer/{Helpers.tsx → helpers.tsx} +1 -0
  154. package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
  155. package/src/components/Markdown/Markdown.tsx +2 -2
  156. package/src/components/Menu/MenuItem.tsx +61 -16
  157. package/src/components/Menu/variables.ts +3 -3
  158. package/src/components/Navbar/NavbarItem.tsx +3 -1
  159. package/src/components/OpenApiDocs/hooks/AdditionalOverviewInfo.tsx +10 -0
  160. package/src/components/OpenApiDocs/hooks/AfterOpenApiDescription.tsx +2 -0
  161. package/src/components/PageActions/PageActions.tsx +38 -15
  162. package/src/components/Search/SearchAiDialog.tsx +31 -2
  163. package/src/components/Search/SearchAiMessage.tsx +103 -17
  164. package/src/components/Search/SearchDialog.tsx +70 -37
  165. package/src/components/Select/variables.ts +2 -2
  166. package/src/components/SvgViewer/SvgViewer.tsx +405 -0
  167. package/src/components/SvgViewer/variables.dark.ts +5 -0
  168. package/src/components/SvgViewer/variables.ts +14 -0
  169. package/src/components/Tag/Tag.tsx +2 -1
  170. package/src/components/Tag/variables.dark.ts +6 -0
  171. package/src/components/Tag/variables.ts +6 -0
  172. package/src/components/Tooltip/Tooltip.tsx +77 -120
  173. package/src/components/Tooltip/variables.dark.ts +4 -0
  174. package/src/components/Tooltip/variables.ts +3 -3
  175. package/src/components/UserMenu/LoginButton.tsx +23 -8
  176. package/src/core/constants/feedback.ts +2 -0
  177. package/src/core/constants/index.ts +1 -0
  178. package/src/core/constants/search.ts +27 -1
  179. package/src/core/hooks/__mocks__/use-theme-hooks.ts +10 -1
  180. package/src/core/hooks/search/use-search-dialog.ts +2 -2
  181. package/src/core/hooks/use-color-switcher.ts +3 -1
  182. package/src/core/hooks/use-mcp-config.ts +2 -1
  183. package/src/core/hooks/use-modal-scroll-lock.ts +29 -10
  184. package/src/core/hooks/use-outside-click.ts +16 -5
  185. package/src/core/hooks/use-page-actions.ts +77 -30
  186. package/src/core/hooks/use-product-picker.ts +1 -1
  187. package/src/core/hooks/use-unique-svg-ids.ts +12 -0
  188. package/src/core/openapi/index.ts +2 -0
  189. package/src/core/styles/dark.ts +14 -0
  190. package/src/core/styles/global.ts +38 -15
  191. package/src/core/types/catalog.ts +1 -1
  192. package/src/core/types/hooks.ts +29 -1
  193. package/src/core/types/l10n.ts +13 -1
  194. package/src/core/types/search.ts +19 -0
  195. package/src/core/utils/content-segments.ts +27 -0
  196. package/src/core/utils/index.ts +1 -0
  197. package/src/core/utils/transform-revisions-to-version-history.ts +19 -99
  198. package/src/ext/process-scorecard.ts +59 -0
  199. package/src/icons/DirectionRightIcon/DirectionRightIcon.tsx +35 -0
  200. package/src/icons/FitToViewIcon/FitToViewIcon.tsx +26 -0
  201. package/src/index.ts +8 -0
  202. package/src/layouts/DocumentationLayout.tsx +4 -30
  203. package/src/layouts/DocumentationLayoutBottom.tsx +42 -0
  204. package/src/layouts/DocumentationLayoutTop.tsx +52 -0
  205. package/src/layouts/Forbidden.tsx +36 -21
  206. package/src/markdoc/components/Cards/Card.tsx +1 -0
  207. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
  208. package/src/markdoc/components/Heading/Heading.tsx +52 -4
  209. package/src/markdoc/components/LoginButton/LoginButton.tsx +38 -0
  210. package/src/markdoc/components/Mermaid/Mermaid.tsx +57 -8
  211. package/src/markdoc/components/default.ts +1 -0
  212. package/src/markdoc/default.ts +2 -0
  213. package/src/markdoc/tags/login-button.ts +30 -0
  214. package/lib/components/Tooltip/TooltipWrapper.d.ts +0 -12
  215. package/lib/components/Tooltip/TooltipWrapper.js +0 -34
  216. package/src/components/Tooltip/TooltipWrapper.tsx +0 -70
  217. /package/lib/components/JsonViewer/{Helpers.d.ts → helpers.d.ts} +0 -0
@@ -7,8 +7,7 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
7
7
  import { MenuContainer } from '@redocly/theme/components/Menu/MenuContainer';
8
8
  import { transformRevisionsToVersionHistory } from '@redocly/theme/core/utils';
9
9
  import { DEFAULT_LOCALE_PLACEHOLDER } from '@redocly/theme/core/constants';
10
-
11
- import { CatalogEntityVersionItem } from './CatalogEntityVersionItem';
10
+ import { CatalogEntityVersionItem } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem';
12
11
 
13
12
  export type CatalogHistorySidebarProps = {
14
13
  entityKey: string;
@@ -129,10 +128,10 @@ export function CatalogEntityHistorySidebar({
129
128
 
130
129
  const SidebarOverlay = styled.div`
131
130
  position: fixed;
132
- top: var(--navbar-height);
131
+ top: calc(var(--navbar-height) + var(--banner-height, 0));
133
132
  left: 0;
134
133
  width: var(--sidebar-width);
135
- height: calc(100vh - var(--navbar-height));
134
+ height: calc(100vh - var(--navbar-height) - var(--banner-height, 0));
136
135
  background-color: var(--catalog-history-sidebar-bg-color);
137
136
  border-right: 1px solid var(--catalog-history-sidebar-border-color);
138
137
  display: flex;
@@ -53,9 +53,6 @@ export function CatalogEntityVersionItem({
53
53
 
54
54
  const singleRevisionLink = buildRevisionUrl(basePath, group.singleRevisionDate, group.version);
55
55
 
56
- const isClickable = hasRevisions || Boolean(singleRevisionLink);
57
- const isSingleRevisionActive = Boolean(singleRevisionLink && group.isCurrent);
58
-
59
56
  const versionTitle = isNotSpecifiedVersion
60
57
  ? `${translate('catalog.history.version.label', 'Version')}: ${translate('catalog.history.version.notSpecified', 'not specified')}`
61
58
  : `${translate('catalog.history.version.label', 'Version')}: ${group.version}`;
@@ -64,9 +61,7 @@ export function CatalogEntityVersionItem({
64
61
  <VersionButton
65
62
  type="button"
66
63
  onClick={() => hasRevisions && onToggle(group.version)}
67
- $isClickable={isClickable}
68
64
  $isCurrent={group.isCurrent}
69
- $isActive={isSingleRevisionActive}
70
65
  >
71
66
  <VersionIcon $isCurrent={group.isCurrent}>
72
67
  {group.isCurrent ? (
@@ -155,34 +150,23 @@ export function CatalogEntityVersionItem({
155
150
  }
156
151
 
157
152
  const VersionButton = styled.button<{
158
- $isClickable?: boolean;
159
153
  $isCurrent?: boolean;
160
- $isActive?: boolean;
161
154
  }>`
162
155
  all: unset;
163
156
  display: flex;
164
157
  align-items: center;
165
158
  width: calc(100% - var(--catalog-history-sidebar-version-icon-margin-right));
166
159
  padding: var(--catalog-history-sidebar-version-header-padding);
167
- cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};
160
+ cursor: pointer;
168
161
  border-radius: var(--catalog-history-sidebar-version-header-border-radius);
169
162
  transition: 0.2s ease;
170
163
  text-decoration: none;
171
164
  color: inherit;
172
- background-color: ${({ $isActive }) =>
173
- $isActive ? 'var(--catalog-history-sidebar-revision-item-bg-color-active)' : 'transparent'};
165
+ background-color: 'transparent';
174
166
 
175
- ${({ $isClickable, $isActive }) =>
176
- $isClickable &&
177
- `
178
- &:hover {
179
- background-color: ${
180
- $isActive
181
- ? 'var(--catalog-history-sidebar-revision-item-bg-color-active)'
182
- : 'var(--catalog-history-sidebar-version-header-bg-color-hover)'
183
- };
184
- }
185
- `}
167
+ &:hover {
168
+ background-color: var(--catalog-history-sidebar-version-header-bg-color-hover);
169
+ }
186
170
 
187
171
  ${({ $isCurrent }) =>
188
172
  !$isCurrent &&
@@ -2,7 +2,7 @@ import React, { JSX } from 'react';
2
2
 
3
3
  import { BffCatalogEntity } from '@redocly/theme/core/types';
4
4
  import { TagsIcon } from '@redocly/theme/icons/TagsIcon/TagsIcon';
5
- import { CatalogTagsWithTooltip } from '@redocly/theme';
5
+ import { CatalogTagsWithTooltip } from '@redocly/theme/components/Catalog/CatalogTagsWithTooltip';
6
6
  import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard';
7
7
  import { useThemeHooks } from '@redocly/theme/core/hooks';
8
8
 
@@ -62,17 +62,19 @@ export function CatalogEntityRelationsTable({
62
62
 
63
63
  const onRowClick = (relatedEntity: BffCatalogRelatedEntity) => {
64
64
  if (searchQuery) {
65
- telemetry.sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage({
66
- id: relatedEntity.id,
67
- object: 'catalog_entity',
68
- uri: getEntityDetailsLink(relatedEntity),
69
- query: searchQuery,
70
- entityKey: entity.key,
71
- entityType: entity.type,
72
- relationType: reverseRelationMap[relatedEntity.relationType],
73
- relatedEntityKey: relatedEntity.key,
74
- relatedEntityType: relatedEntity.type,
75
- });
65
+ telemetry.sendCatalogEntitiesRelatedEntitiesListSearchResultClickMessage([
66
+ {
67
+ id: relatedEntity.id,
68
+ object: 'catalog_entity',
69
+ uri: getEntityDetailsLink(relatedEntity),
70
+ query: searchQuery,
71
+ entityKey: entity.key,
72
+ entityType: entity.type,
73
+ relationType: reverseRelationMap[relatedEntity.relationType],
74
+ relatedEntityKey: relatedEntity.key,
75
+ relatedEntityType: relatedEntity.type,
76
+ },
77
+ ]);
76
78
  }
77
79
  };
78
80
 
@@ -52,11 +52,13 @@ export function CatalogEntitySchema({
52
52
  iconPosition="right"
53
53
  size="medium"
54
54
  onCopyClick={() =>
55
- telemetry.sendCatalogEntitiesCopyDataSchemaClickedMessage({
56
- id: entity.id,
57
- object: 'catalog_entity',
58
- uri: getEntityDetailsLink(entity),
59
- })
55
+ telemetry.sendCatalogEntitiesCopyDataSchemaClickedMessage([
56
+ {
57
+ id: entity.id,
58
+ object: 'catalog_entity',
59
+ uri: getEntityDetailsLink(entity),
60
+ },
61
+ ])
60
62
  }
61
63
  ></CopyButton>
62
64
  )}
@@ -102,13 +102,15 @@ export function CatalogFilterCheckboxes({
102
102
  role="link"
103
103
  onClick={() => {
104
104
  filter.toggleOption(value);
105
- telemetry.sendCatalogEntitiesFilterCheckboxToggledMessage({
106
- id: filter.property + '--' + value,
107
- object: 'checkbox',
108
- uri: window.location.href,
109
- category: filter.property,
110
- value: value,
111
- });
105
+ telemetry.sendCatalogEntitiesFilterCheckboxToggledMessage([
106
+ {
107
+ id: filter.property + '--' + value,
108
+ object: 'checkbox',
109
+ uri: window.location.href,
110
+ category: filter.property,
111
+ value: value,
112
+ },
113
+ ]);
112
114
  }}
113
115
  >
114
116
  <CheckboxIcon
@@ -10,8 +10,7 @@ import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTabl
10
10
  import { CatalogTagsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTagsCell';
11
11
  import { useCatalogEntityDetails } from '@redocly/theme/core/hooks';
12
12
  import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag';
13
-
14
- import { Link } from '../../Link/Link';
13
+ import { Link } from '@redocly/theme/components/Link/Link';
15
14
 
16
15
  export type BaseEntity = {
17
16
  id: string;
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
 
4
4
  import { CATALOG_TAG_MAX_LENGTH } from '@redocly/theme/core/constants';
5
5
  import { Tag, TagProps } from '@redocly/theme/components/Tag/Tag';
6
- import { TooltipComponent } from '@redocly/theme/components/Tooltip/Tooltip';
6
+ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
7
7
  import { CatalogHighlight } from '@redocly/theme/components/Catalog/CatalogHighlight';
8
8
  import { useThemeHooks } from '@redocly/theme/core/hooks';
9
9
 
@@ -27,8 +27,12 @@ export function CatalogTagsWithTooltip({
27
27
  if (showPlaceholder) {
28
28
  return (
29
29
  <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
30
- {/* eslint-disable-next-line theme/require-translate */}
31
- <Tag style={{ backgroundColor: 'var(--catalog-tags-placeholder-bg-color)' }} color="grey">
30
+ <Tag
31
+ variant="outline"
32
+ style={{ backgroundColor: 'var(--catalog-tags-placeholder-bg-color)' }}
33
+ color="grey"
34
+ // eslint-disable-next-line theme/require-translate
35
+ >
32
36
  N/A
33
37
  </Tag>
34
38
  </CatalogTagsWrapper>
@@ -53,7 +57,7 @@ export function CatalogTagsWithTooltip({
53
57
  const remainingCount = items.length - itemsToShow;
54
58
 
55
59
  return (
56
- <TooltipComponent tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
60
+ <Tooltip tip={items.join(', ')} placement="bottom" className="catalog" width="400px">
57
61
  <CatalogTagsWrapper data-component-name="Catalog/CatalogTagsWithTooltip">
58
62
  {displayedItems.map((item, index) => (
59
63
  <Tag
@@ -70,7 +74,7 @@ export function CatalogTagsWithTooltip({
70
74
  +{remainingCount} {translate('catalog.tags.more', 'more')}
71
75
  </MoreTagsButton>
72
76
  </CatalogTagsWrapper>
73
- </TooltipComponent>
77
+ </Tooltip>
74
78
  );
75
79
  }
76
80
 
@@ -52,7 +52,9 @@ function ScorecardBadge(props: {
52
52
  return (
53
53
  <Link to={slug}>
54
54
  <Tag
55
- onClick={() => telemetry.sendScorecardLinkClickedMessage({ action: 'click' })}
55
+ onClick={() =>
56
+ telemetry.sendScorecardLinkClickedMessage([{ object: 'link', action: 'click' }])
57
+ }
56
58
  withStatusDot
57
59
  statusDotColor={`var(${colorVariable})`}
58
60
  >
@@ -6,7 +6,7 @@ import type { CodeBlockItems } from '@redocly/theme/components/CodeBlock/CodeBlo
6
6
 
7
7
  import { CodeBlockTabs } from '@redocly/theme/components/CodeBlock/CodeBlockTabs';
8
8
  import { CopyButton } from '@redocly/theme/components/Buttons/CopyButton';
9
- import { TooltipWrapper } from '@redocly/theme/components/Tooltip/TooltipWrapper';
9
+ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
10
10
  import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
11
11
  import { DeselectIcon } from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
12
12
  import { MaximizeIcon } from '@redocly/theme/icons/MaximizeIcon/MaximizeIcon';
@@ -86,9 +86,10 @@ export function CodeBlockControls({
86
86
  <ControlsWrapper>
87
87
  {dropdown && <CodeBlockDropdown {...dropdown} />}
88
88
  {report && !report.hidden && !report?.props?.hide ? (
89
- <TooltipWrapper
89
+ <Tooltip
90
90
  tip={translate('codeSnippet.report.tooltipText', 'Report a problem')}
91
91
  placement="top"
92
+ arrowPosition="right"
92
93
  >
93
94
  <ControlButton
94
95
  variant="text"
@@ -99,13 +100,14 @@ export function CodeBlockControls({
99
100
  >
100
101
  {controlsType != 'icon' && (report.props?.buttonText || 'Report')}
101
102
  </ControlButton>
102
- </TooltipWrapper>
103
+ </Tooltip>
103
104
  ) : null}
104
105
 
105
106
  {expand && !codeSnippet?.expand?.hide ? (
106
- <TooltipWrapper
107
+ <Tooltip
107
108
  tip={translate('codeSnippet.expand.tooltipText', 'Expand all')}
108
109
  placement="top"
110
+ arrowPosition="right"
109
111
  >
110
112
  <ControlButton
111
113
  variant="text"
@@ -116,13 +118,14 @@ export function CodeBlockControls({
116
118
  >
117
119
  {controlsType !== 'icon' && (expand?.label || 'Expand all')}
118
120
  </ControlButton>
119
- </TooltipWrapper>
121
+ </Tooltip>
120
122
  ) : null}
121
123
 
122
124
  {collapse && !codeSnippet?.collapse?.hide ? (
123
- <TooltipWrapper
125
+ <Tooltip
124
126
  tip={translate('codeSnippet.collapse.tooltipText', 'Collapse all')}
125
127
  placement="top"
128
+ arrowPosition="right"
126
129
  >
127
130
  <ControlButton
128
131
  variant="text"
@@ -133,7 +136,7 @@ export function CodeBlockControls({
133
136
  >
134
137
  {controlsType !== 'icon' && (expand?.label || 'Collapse all')}
135
138
  </ControlButton>
136
- </TooltipWrapper>
139
+ </Tooltip>
137
140
  ) : null}
138
141
 
139
142
  {select ? (
@@ -161,9 +164,10 @@ export function CodeBlockControls({
161
164
  ) : null}
162
165
 
163
166
  {copy && !codeSnippet?.copy?.hide ? (
164
- <TooltipWrapper
167
+ <Tooltip
165
168
  tip={translate('codeSnippet.copy.tooltipText', 'Copy to clipboard')}
166
169
  placement="top"
170
+ arrowPosition="right"
167
171
  >
168
172
  <StyledCopyButton
169
173
  data={copy.data}
@@ -178,11 +182,13 @@ export function CodeBlockControls({
178
182
  if (copy?.onClick) {
179
183
  copy?.onClick?.();
180
184
  } else {
181
- telemetry.sendCopyCodeSnippetClickedMessage({ snippetType: 'copy' });
185
+ telemetry.sendCopyCodeSnippetClickedMessage([
186
+ { object: 'code_snippet', snippetType: 'copy' },
187
+ ]);
182
188
  }
183
189
  }}
184
190
  />
185
- </TooltipWrapper>
191
+ </Tooltip>
186
192
  ) : null}
187
193
  </ControlsWrapper>
188
194
  </>
@@ -142,5 +142,5 @@ const ChildrenWrapper = styled.div<{ placement?: string; alignment?: string; isO
142
142
  right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
143
143
  display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
144
144
 
145
- z-index: var(--z-index-raised);
145
+ z-index: var(--dropdown-menu-z-index);
146
146
  `;
@@ -8,6 +8,7 @@ export const dropdown = css`
8
8
  --dropdown-menu-font-weight: var(--font-weight-regular); // @presenter FontWeight
9
9
  --dropdown-menu-line-height: var(--line-height-base); // @presenter LineHeight
10
10
  --dropdown-menu-text-color: var(--text-color-secondary); // @presenter Color
11
+ --dropdown-menu-z-index: var(--z-index-raised); // @presenter ZIndex
11
12
 
12
13
  --dropdown-menu-padding-top: var(--spacing-xxs);
13
14
  --dropdown-menu-min-width: 100px;
@@ -6,6 +6,7 @@ import type { JSX } from 'react';
6
6
  import { useOutsideClick, useThemeHooks } from '@redocly/theme/core/hooks';
7
7
  import { RadioCheckButtonIcon } from '@redocly/theme/icons/RadioCheckButtonIcon/RadioCheckButtonIcon';
8
8
  import { Button } from '@redocly/theme/components/Button/Button';
9
+ import { MAX_CONTEXT_LENGTH } from '@redocly/theme/core/constants';
9
10
 
10
11
  export type CommentProps = {
11
12
  onSubmit: (value: { comment: string }) => void;
@@ -32,18 +33,21 @@ export function Comment({
32
33
  const { label, submitText } = settings || {};
33
34
  const [text, setText] = React.useState('');
34
35
  const [submitValue, setSubmitValue] = React.useState('');
36
+ const [isMaxLengthReached, setIsMaxLengthReached] = React.useState(false);
35
37
  const modalRef = useRef<HTMLDivElement>(null);
36
38
 
37
39
  useOutsideClick(modalRef, onCancel);
38
40
 
39
41
  const send = () => {
40
- if (!text) return;
41
- setSubmitValue(text);
42
- onSubmit({ comment: text });
42
+ const trimmedText = text.trim();
43
+ if (!trimmedText) return;
44
+ setSubmitValue(trimmedText);
45
+ onSubmit({ comment: trimmedText });
43
46
  };
44
47
  const handleTextAreaChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
45
48
  const commentValue = e.target.value;
46
49
  setText(commentValue);
50
+ setIsMaxLengthReached(commentValue.length >= MAX_CONTEXT_LENGTH);
47
51
 
48
52
  if (!standAlone) {
49
53
  onSubmit({ comment: commentValue });
@@ -81,7 +85,15 @@ export function Comment({
81
85
  {label ||
82
86
  translate('feedback.settings.comment.label', 'Please share your feedback with us.')}
83
87
  </Label>
84
- <TextArea rows={3} onChange={handleTextAreaChange} />
88
+ <TextArea rows={3} maxLength={MAX_CONTEXT_LENGTH} onChange={handleTextAreaChange} />
89
+ {isMaxLengthReached && (
90
+ <MaxLengthMessage data-translation-key="feedback.settings.comment.maxLength">
91
+ {translate('feedback.settings.comment.maxLength', {
92
+ maxLength: MAX_CONTEXT_LENGTH,
93
+ defaultValue: `Maximum content length of ${MAX_CONTEXT_LENGTH} characters reached`,
94
+ })}
95
+ </MaxLengthMessage>
96
+ )}
85
97
  {standAlone && (
86
98
  <ButtonsContainer>
87
99
  {onCancel && (
@@ -175,3 +187,9 @@ const ButtonsContainer = styled.div`
175
187
  margin-top: var(--spacing-xs);
176
188
  gap: var(--spacing-xs);
177
189
  `;
190
+
191
+ const MaxLengthMessage = styled.div`
192
+ font-size: var(--font-size-sm);
193
+ color: var(--text-color-secondary);
194
+ margin-top: var(--spacing-xxs);
195
+ `;
@@ -14,6 +14,7 @@ import { Button } from '@redocly/theme/components/Button/Button';
14
14
  import { FaceDissatisfiedIcon } from '@redocly/theme/icons/FaceDissatisfiedIcon/FaceDissatisfiedIcon';
15
15
  import { FaceSatisfiedIcon } from '@redocly/theme/icons/FaceSatisfiedIcon/FaceSatisfiedIcon';
16
16
  import { FaceNeutralIcon } from '@redocly/theme/icons/FaceNeutralIcon/FaceNeutralIcon';
17
+ import { MAX_EMAIL_LENGTH } from '@redocly/theme/core/constants';
17
18
 
18
19
  export enum MOOD_STATES {
19
20
  SATISFIED = 'satisfied',
@@ -135,11 +136,13 @@ export function Mood({ settings, onSubmit, className }: MoodProps): JSX.Element
135
136
  const displayFeedbackEmail = !!score && !optionalEmailSettings?.hide && !userData.isAuthenticated;
136
137
 
137
138
  const onSubmitMoodForm = () => {
139
+ const trimmedComment = comment?.trim() || undefined;
140
+ const trimmedEmail = email?.trim() || undefined;
138
141
  onSubmit({
139
142
  score: remapScore(score),
140
- comment,
143
+ comment: trimmedComment,
141
144
  reasons,
142
- email,
145
+ email: trimmedEmail,
143
146
  });
144
147
  setIsSubmitted(true);
145
148
  };
@@ -255,6 +258,7 @@ export function Mood({ settings, onSubmit, className }: MoodProps): JSX.Element
255
258
  translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com')
256
259
  }
257
260
  type="email"
261
+ maxLength={MAX_EMAIL_LENGTH}
258
262
  required={!!email}
259
263
  onKeyDown={(e) => {
260
264
  if (e.key === 'Enter') {
@@ -12,6 +12,7 @@ import { RadioCheckButtonIcon } from '@redocly/theme/icons/RadioCheckButtonIcon/
12
12
  import { Comment } from '@redocly/theme/components/Feedback/Comment';
13
13
  import { Stars } from '@redocly/theme/components/Feedback/Stars';
14
14
  import { Button } from '@redocly/theme/components/Button/Button';
15
+ import { MAX_EMAIL_LENGTH } from '@redocly/theme/core/constants';
15
16
 
16
17
  export const FEEDBACK_MAX_RATING = 5;
17
18
 
@@ -64,12 +65,14 @@ export function Rating({ settings, onSubmit, className }: RatingProps): JSX.Elem
64
65
  };
65
66
 
66
67
  const onSubmitRatingForm = () => {
68
+ const trimmedComment = comment?.trim() || undefined;
69
+ const trimmedEmail = email?.trim() || undefined;
67
70
  onSubmit({
68
71
  score,
69
- comment,
72
+ comment: trimmedComment,
70
73
  reasons,
71
74
  max: FEEDBACK_MAX_RATING,
72
- email,
75
+ email: trimmedEmail,
73
76
  });
74
77
  setIsSubmitted(true);
75
78
  };
@@ -168,6 +171,7 @@ export function Rating({ settings, onSubmit, className }: RatingProps): JSX.Elem
168
171
  translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com')
169
172
  }
170
173
  type="email"
174
+ maxLength={MAX_EMAIL_LENGTH}
171
175
  required={!!email}
172
176
  onKeyDown={(e) => {
173
177
  if (e.key === 'Enter') {
@@ -12,6 +12,7 @@ import { RadioCheckButtonIcon } from '@redocly/theme/icons/RadioCheckButtonIcon/
12
12
  import { Comment } from '@redocly/theme/components/Feedback/Comment';
13
13
  import { Reasons } from '@redocly/theme/components/Feedback/Reasons';
14
14
  import { Button } from '@redocly/theme/components/Button/Button';
15
+ import { MAX_EMAIL_LENGTH } from '@redocly/theme/core/constants';
15
16
 
16
17
  export const MAX_SCALE = 10;
17
18
 
@@ -96,12 +97,14 @@ export function Scale({ settings, onSubmit, className }: ScaleProps): JSX.Elemen
96
97
  };
97
98
 
98
99
  const onSubmitScaleForm = () => {
100
+ const trimmedComment = comment?.trim() || undefined;
101
+ const trimmedEmail = email?.trim() || undefined;
99
102
  onSubmit({
100
103
  score,
101
- comment,
104
+ comment: trimmedComment,
102
105
  reasons,
103
106
  max: MAX_SCALE,
104
- email,
107
+ email: trimmedEmail,
105
108
  });
106
109
  setIsSubmitted(true);
107
110
  };
@@ -193,6 +196,7 @@ export function Scale({ settings, onSubmit, className }: ScaleProps): JSX.Elemen
193
196
  translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com')
194
197
  }
195
198
  type="email"
199
+ maxLength={MAX_EMAIL_LENGTH}
196
200
  required={!!email}
197
201
  onKeyDown={(e) => {
198
202
  if (e.key === 'Enter') {
@@ -13,6 +13,7 @@ import { Comment } from '@redocly/theme/components/Feedback/Comment';
13
13
  import { Button } from '@redocly/theme/components/Button/Button';
14
14
  import { ThumbDownIcon } from '@redocly/theme/icons/ThumbDownIcon/ThumbDownIcon';
15
15
  import { ThumbUpIcon } from '@redocly/theme/icons/ThumbUpIcon/ThumbUpIcon';
16
+ import { MAX_EMAIL_LENGTH } from '@redocly/theme/core/constants';
16
17
 
17
18
  export type SentimentProps = {
18
19
  onSubmit: (value: {
@@ -117,11 +118,13 @@ export function Sentiment({ settings, onSubmit, className }: SentimentProps): JS
117
118
  };
118
119
 
119
120
  const onSubmitSentimentForm = () => {
121
+ const trimmedComment = comment?.trim() || undefined;
122
+ const trimmedEmail = email?.trim() || undefined;
120
123
  onSubmit({
121
124
  score,
122
- comment,
125
+ comment: trimmedComment,
123
126
  reasons,
124
- email,
127
+ email: trimmedEmail,
125
128
  });
126
129
  setIsSubmitted(true);
127
130
  };
@@ -227,6 +230,7 @@ export function Sentiment({ settings, onSubmit, className }: SentimentProps): JS
227
230
  translate('feedback.settings.optionalEmail.placeholder', 'yourname@example.com')
228
231
  }
229
232
  type="email"
233
+ maxLength={MAX_EMAIL_LENGTH}
230
234
  required={!!email}
231
235
  onKeyDown={(e) => {
232
236
  if (e.key === 'Enter') {
@@ -36,7 +36,7 @@ export function FilterCheckboxes({
36
36
  role="link"
37
37
  onClick={() => {
38
38
  filter.toggleOption(value);
39
- telemetry.sendFilterCheckboxToggledMessage({ id });
39
+ telemetry.sendFilterCheckboxToggledMessage([{ object: 'checkbox', id }]);
40
40
  }}
41
41
  >
42
42
  <CheckboxIcon
@@ -5,8 +5,7 @@ import type { JSX } from 'react';
5
5
  import type { CodeBlockControlsProps } from '@redocly/theme/components/CodeBlock/CodeBlockControls';
6
6
 
7
7
  import { CodeBlock } from '@redocly/theme/components/CodeBlock/CodeBlock';
8
-
9
- import { JsonValue } from './Helpers';
8
+ import { JsonValue } from '@redocly/theme/components/JsonViewer/helpers';
10
9
 
11
10
  export type PanelType = 'request' | 'responses' | 'request-samples' | 'response-samples';
12
11
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable check-file/filename-naming-convention */
1
2
  import React, { useEffect } from 'react';
2
3
  import styled from 'styled-components';
3
4
 
@@ -40,7 +40,7 @@ export function LanguagePicker(props: LanguagePickerProps): JSX.Element | null {
40
40
  onAction: () => {
41
41
  setLocale(locale.code);
42
42
  props.onChangeLanguage(locale.code);
43
- telemetry.sendLanguagePickerLocaleChangedMessage({ locale: locale.code });
43
+ telemetry.sendLanguagePickerLocaleChangedMessage([{ object: 'locale', locale: locale.code }]);
44
44
  },
45
45
  active: locale.code === currentLocale.code,
46
46
  suffix: locale.code === currentLocale.code && <CheckmarkIcon />,
@@ -58,7 +58,7 @@ export const Markdown = styled.main.attrs<{
58
58
  ${markdownLinksCss}
59
59
 
60
60
  a[name], [id] {
61
- scroll-margin-top: var(--navbar-height);
61
+ scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
62
62
  }
63
63
 
64
64
  img,
@@ -76,7 +76,7 @@ export const Markdown = styled.main.attrs<{
76
76
  font-family: var(--heading-font-family);
77
77
  position: relative;
78
78
 
79
- scroll-margin-top: var(--navbar-height);
79
+ scroll-margin-top: calc(var(--navbar-height) + var(--banner-height));
80
80
  }
81
81
 
82
82
  strong {