@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
@@ -43,6 +43,7 @@ const SearchInput_1 = require("../../components/Search/SearchInput");
43
43
  const SearchShortcut_1 = require("../../components/Search/SearchShortcut");
44
44
  const Button_1 = require("../../components/Button/Button");
45
45
  const utils_1 = require("../../core/utils");
46
+ const Portal_1 = require("../../components/Portal/Portal");
46
47
  const SearchItem_1 = require("../../components/Search/SearchItem");
47
48
  const SearchRecent_1 = require("../../components/Search/SearchRecent");
48
49
  const SearchSuggestedPages_1 = require("../../components/Search/SearchSuggestedPages");
@@ -169,71 +170,60 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
169
170
  const showAiSearchButton = askAi && mode === 'search';
170
171
  const showAiSearchItem = showAiSearchButton && query;
171
172
  const showHeaderButtons = showSearchFilterButton || showAiSearchButton;
172
- return (react_1.default.createElement(SearchOverlay, { "data-component-name": "Search/SearchDialog", ref: modalRef, onClick: handleOverlayClick, className: (0, utils_1.concatClassNames)('overlay', className) },
173
- react_1.default.createElement(SearchDialogWrapper, { className: "scroll-lock", role: "dialog" },
174
- react_1.default.createElement(SearchDialogHeader, null,
175
- product && (react_1.default.createElement(SearchProductTag, { color: "product" },
176
- product.name,
177
- react_1.default.createElement(CloseIcon_1.CloseIcon, { onClick: () => setProduct(undefined), color: "--icon-color-additional" }))),
178
- mode === 'search' ? (react_1.default.createElement(react_1.default.Fragment, null,
179
- react_1.default.createElement(SearchInput_1.SearchInput, { value: query, onChange: setQuery, placeholder: translate('search.label', 'Search docs...'), isLoading: isSearchLoading, inputRef: searchInputRef, onSubmit: () => {
180
- var _a;
181
- if (isSearchLoading)
182
- return;
183
- if (showAiSearchButton && aiQueryRef.current) {
184
- aiQueryRef.current.focus();
185
- }
186
- else {
187
- (_a = firstSearchResultRef.current) === null || _a === void 0 ? void 0 : _a.focus();
188
- }
189
- }, "data-translation-key": "search.label" }),
190
- showHeaderButtons && (react_1.default.createElement(SearchHeaderButtons, null,
191
- showAiSearchButton ? (react_1.default.createElement(SearchAiButton, { icon: react_1.default.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { color: "var(--search-ai-button-icon-color)" }), onClick: () => {
192
- setMode('ai-dialog');
193
- if (query.trim()) {
194
- aiSearch.askQuestion(query);
173
+ return (react_1.default.createElement(Portal_1.Portal, null,
174
+ react_1.default.createElement(SearchOverlay, { "data-component-name": "Search/SearchDialog", ref: modalRef, onClick: handleOverlayClick, className: (0, utils_1.concatClassNames)('overlay', className) },
175
+ react_1.default.createElement(SearchDialogWrapper, { className: "scroll-lock", role: "dialog" },
176
+ react_1.default.createElement(SearchDialogHeader, null,
177
+ product && (react_1.default.createElement(SearchProductTag, { color: "product" },
178
+ product.name,
179
+ react_1.default.createElement(CloseIcon_1.CloseIcon, { onClick: () => setProduct(undefined), color: "--icon-color-additional" }))),
180
+ mode === 'search' ? (react_1.default.createElement(react_1.default.Fragment, null,
181
+ react_1.default.createElement(SearchInput_1.SearchInput, { value: query, onChange: setQuery, placeholder: translate('search.label', 'Search docs...'), isLoading: isSearchLoading, inputRef: searchInputRef, onSubmit: () => {
182
+ var _a;
183
+ if (isSearchLoading)
184
+ return;
185
+ if (showAiSearchButton && aiQueryRef.current) {
186
+ aiQueryRef.current.focus();
195
187
  }
196
- telemetry.sendSearchAiOpenedMessage([
197
- {
198
- object: 'search',
199
- method: 'ai_search_button',
200
- },
201
- ]);
202
- } }, translate('search.ai.button', 'Search with AI'))) : null,
203
- showSearchFilterButton && (react_1.default.createElement(SearchFilterToggleButton, { icon: react_1.default.createElement(SettingsIcon_1.SettingsIcon, null), onClick: onFilterToggle })))))) : (react_1.default.createElement(AiDialogHeaderWrapper, null,
204
- initialMode === 'ai-dialog' ? (react_1.default.createElement(AiDialogHeaderTitle, null,
205
- react_1.default.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { color: "var(--search-ai-button-icon-color)", size: "1.25rem" }),
206
- translate('search.ai.assistant', 'Assistant'))) : (react_1.default.createElement(Button_1.Button, { variant: "secondary", onClick: () => {
207
- setMode('search');
208
- aiSearch.clearConversation();
209
- focusSearchInput();
210
- }, tabIndex: 0, icon: react_1.default.createElement(ChevronLeftIcon_1.ChevronLeftIcon, null) }, isMobile
211
- ? translate('search.ai.back', 'Back')
212
- : translate('search.ai.backToSearch', 'Back to search'))),
213
- react_1.default.createElement(AiDialogHeaderActionsWrapper, null,
214
- react_1.default.createElement(Button_1.Button, { variant: "secondary", disabled: !aiSearch.conversation.length, onClick: () => {
215
- refreshSearchSessionId();
188
+ else {
189
+ (_a = firstSearchResultRef.current) === null || _a === void 0 ? void 0 : _a.focus();
190
+ }
191
+ }, "data-translation-key": "search.label" }),
192
+ showHeaderButtons && (react_1.default.createElement(SearchHeaderButtons, null,
193
+ showAiSearchButton ? (react_1.default.createElement(SearchAiButton, { icon: react_1.default.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { color: "var(--search-ai-button-icon-color)" }), onClick: () => {
194
+ setMode('ai-dialog');
195
+ if (query.trim()) {
196
+ aiSearch.askQuestion(query);
197
+ }
198
+ telemetry.sendSearchAiOpenedMessage([
199
+ {
200
+ object: 'search',
201
+ method: 'ai_search_button',
202
+ },
203
+ ]);
204
+ } }, translate('search.ai.button', 'Search with AI'))) : null,
205
+ showSearchFilterButton && (react_1.default.createElement(SearchFilterToggleButton, { icon: react_1.default.createElement(SettingsIcon_1.SettingsIcon, null), onClick: onFilterToggle })))))) : (react_1.default.createElement(AiDialogHeaderWrapper, null,
206
+ initialMode === 'ai-dialog' ? (react_1.default.createElement(AiDialogHeaderTitle, null,
207
+ react_1.default.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { color: "var(--search-ai-button-icon-color)", size: "1.25rem" }),
208
+ translate('search.ai.assistant', 'Assistant'))) : (react_1.default.createElement(Button_1.Button, { variant: "secondary", onClick: () => {
209
+ setMode('search');
216
210
  aiSearch.clearConversation();
217
- }, tabIndex: 0, icon: react_1.default.createElement(EditIcon_1.EditIcon, null) }, translate('search.ai.newConversation', 'New conversation')),
218
- isMobile && react_1.default.createElement(Button_1.Button, { variant: "text", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, null), onClick: handleClose }))))),
219
- react_1.default.createElement(SearchDialogBody, null, mode === 'search' ? (react_1.default.createElement(react_1.default.Fragment, null,
220
- advancedSearch && isFilterOpen && (react_1.default.createElement(SearchDialogBodyFilterView, null,
221
- react_1.default.createElement(SearchFilter_1.SearchFilter, { facets: facets, filter: filter, query: query, quickFilterFields: [groupField], onFilterChange: onFilterChange, onFilterReset: onFilterReset, onFacetReset: onFacetReset }))),
222
- react_1.default.createElement(SearchDialogBodyMainView, null,
223
- react_1.default.createElement(SearchGroups_1.SearchGroups, { facets: facets, searchFilter: filter, onFilterChange: onFilterChange, onQuickFilterReset: onQuickFilterReset, groupField: groupField }),
224
- showAiSearchItem && (react_1.default.createElement(SearchWithAI, { onClick: () => {
225
- setMode('ai-dialog');
226
- if (query.trim()) {
227
- aiSearch.askQuestion(query);
228
- }
229
- telemetry.sendSearchAiOpenedMessage([
230
- {
231
- object: 'search',
232
- method: 'ai_search_input',
233
- },
234
- ]);
235
- }, onKeyDown: (e) => {
236
- if (e.key === 'Enter') {
211
+ focusSearchInput();
212
+ }, tabIndex: 0, icon: react_1.default.createElement(ChevronLeftIcon_1.ChevronLeftIcon, null) }, isMobile
213
+ ? translate('search.ai.back', 'Back')
214
+ : translate('search.ai.backToSearch', 'Back to search'))),
215
+ react_1.default.createElement(AiDialogHeaderActionsWrapper, null,
216
+ react_1.default.createElement(Button_1.Button, { variant: "secondary", disabled: !aiSearch.conversation.length, onClick: () => {
217
+ refreshSearchSessionId();
218
+ aiSearch.clearConversation();
219
+ }, tabIndex: 0, icon: react_1.default.createElement(EditIcon_1.EditIcon, null) }, translate('search.ai.newConversation', 'New conversation')),
220
+ isMobile && react_1.default.createElement(Button_1.Button, { variant: "text", icon: react_1.default.createElement(CloseIcon_1.CloseIcon, null), onClick: handleClose }))))),
221
+ react_1.default.createElement(SearchDialogBody, null, mode === 'search' ? (react_1.default.createElement(react_1.default.Fragment, null,
222
+ advancedSearch && isFilterOpen && (react_1.default.createElement(SearchDialogBodyFilterView, null,
223
+ react_1.default.createElement(SearchFilter_1.SearchFilter, { facets: facets, filter: filter, query: query, quickFilterFields: [groupField], onFilterChange: onFilterChange, onFilterReset: onFilterReset, onFacetReset: onFacetReset }))),
224
+ react_1.default.createElement(SearchDialogBodyMainView, null,
225
+ react_1.default.createElement(SearchGroups_1.SearchGroups, { facets: facets, searchFilter: filter, onFilterChange: onFilterChange, onQuickFilterReset: onQuickFilterReset, groupField: groupField }),
226
+ showAiSearchItem && (react_1.default.createElement(SearchWithAI, { onClick: () => {
237
227
  setMode('ai-dialog');
238
228
  if (query.trim()) {
239
229
  aiSearch.askQuestion(query);
@@ -244,60 +234,72 @@ function SearchDialog({ onClose, className, initialMode = 'search', }) {
244
234
  method: 'ai_search_input',
245
235
  },
246
236
  ]);
237
+ }, onKeyDown: (e) => {
238
+ if (e.key === 'Enter') {
239
+ setMode('ai-dialog');
240
+ if (query.trim()) {
241
+ aiSearch.askQuestion(query);
242
+ }
243
+ telemetry.sendSearchAiOpenedMessage([
244
+ {
245
+ object: 'search',
246
+ method: 'ai_search_input',
247
+ },
248
+ ]);
249
+ }
250
+ }, ref: aiQueryRef, tabIndex: 0, role: "option", "aria-selected": "true" },
251
+ react_1.default.createElement(AiStarsIcon_1.AiStarsIcon, { style: { flexShrink: 0 }, color: "var(--search-ai-icon-color)", size: "36px", background: "var(--search-ai-icon-bg-color)", margin: "0 var(--spacing-md) 0 0", borderRadius: "var(--border-radius-lg)" }),
252
+ react_1.default.createElement(QueryWrapper, null,
253
+ react_1.default.createElement(Typography_1.Typography, { fontWeight: "var(--font-weight-semibold)" }, query)),
254
+ react_1.default.createElement(Typography_1.Typography, null,
255
+ "- ",
256
+ translate('search.ai.label', 'Ask AI assistant')),
257
+ react_1.default.createElement(ReturnKeyIcon_1.ReturnKeyIcon, { color: "var(--search-item-text-color)" }))),
258
+ showResults ? (searchKeysWithResults.length ? (searchKeysWithResults.map((key, searchGroupKeyIdx) => {
259
+ const searchResultItems = items[key];
260
+ if (searchResultItems === null || searchResultItems === void 0 ? void 0 : searchResultItems.length) {
261
+ return (react_1.default.createElement(react_1.Fragment, { key: key },
262
+ react_1.default.createElement(SearchGroupTitle, { "data-testid": "search-group-title" }, key),
263
+ searchResultItems.map((item, idx, resultsArr) => mapItem(item, idx, resultsArr, searchGroupKeyIdx === 0 ? firstSearchResultRef : undefined)),
264
+ showLoadMore(key, searchResultItems.length || 0) && (react_1.default.createElement(SearchGroupFooter, { tabIndex: 0, "data-translation-key": "search.showMore", onKeyDown: (e) => {
265
+ if (e.key === 'Enter') {
266
+ setLoadMore({
267
+ groupKey: key,
268
+ offset: searchResultItems.length || 0,
269
+ });
270
+ }
271
+ }, onClick: () => setLoadMore({
272
+ groupKey: key,
273
+ offset: searchResultItems.length || 0,
274
+ }) }, translate('search.showMore', 'Show more')))));
247
275
  }
248
- }, ref: aiQueryRef, tabIndex: 0, role: "option", "aria-selected": "true" },
249
- react_1.default.createElement(AiStarsIcon_1.AiStarsIcon, { style: { flexShrink: 0 }, color: "var(--search-ai-icon-color)", size: "36px", background: "var(--search-ai-icon-bg-color)", margin: "0 var(--spacing-md) 0 0", borderRadius: "var(--border-radius-lg)" }),
250
- react_1.default.createElement(QueryWrapper, null,
251
- react_1.default.createElement(Typography_1.Typography, { fontWeight: "var(--font-weight-semibold)" }, query)),
252
- react_1.default.createElement(Typography_1.Typography, null,
253
- "- ",
254
- translate('search.ai.label', 'Ask AI assistant')),
255
- react_1.default.createElement(ReturnKeyIcon_1.ReturnKeyIcon, { color: "var(--search-item-text-color)" }))),
256
- showResults ? (searchKeysWithResults.length ? (searchKeysWithResults.map((key, searchGroupKeyIdx) => {
257
- const searchResultItems = items[key];
258
- if (searchResultItems === null || searchResultItems === void 0 ? void 0 : searchResultItems.length) {
259
- return (react_1.default.createElement(react_1.Fragment, { key: key },
260
- react_1.default.createElement(SearchGroupTitle, { "data-testid": "search-group-title" }, key),
261
- searchResultItems.map((item, idx, resultsArr) => mapItem(item, idx, resultsArr, searchGroupKeyIdx === 0 ? firstSearchResultRef : undefined)),
262
- showLoadMore(key, searchResultItems.length || 0) && (react_1.default.createElement(SearchGroupFooter, { tabIndex: 0, "data-translation-key": "search.showMore", onKeyDown: (e) => {
263
- if (e.key === 'Enter') {
264
- setLoadMore({
265
- groupKey: key,
266
- offset: searchResultItems.length || 0,
267
- });
268
- }
269
- }, onClick: () => setLoadMore({
270
- groupKey: key,
271
- offset: searchResultItems.length || 0,
272
- }) }, translate('search.showMore', 'Show more')))));
273
- }
274
- return null;
275
- })) : isSearchLoading ? (react_1.default.createElement(SearchMessage, { "data-translation-key": "search.loading" },
276
- react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { size: "26px", color: "var(--search-input-icon-color)" }),
277
- translate('search.loading', 'Loading...'))) : (react_1.default.createElement(SearchMessage, { "data-translation-key": "search.noResults" },
278
- react_1.default.createElement("b", null, translate('search.noResults.title', 'No results'))))) : (react_1.default.createElement(react_1.default.Fragment, null,
279
- react_1.default.createElement(SearchRecent_1.SearchRecent, { onSelect: (query, index) => {
280
- telemetry.sendSearchRecentClickedMessage([
281
- {
282
- object: 'search',
283
- query,
284
- index: index.toString(),
285
- searchSessionId,
286
- },
287
- ]);
288
- setQuery(query);
289
- focusSearchInput();
290
- } }),
291
- react_1.default.createElement(SearchSuggestedPages_1.SearchSuggestedPages, null)))))) : (react_1.default.createElement(SearchAiDialog_1.SearchAiDialog, { initialMessage: query, response: aiSearch.response, isGeneratingResponse: aiSearch.isGeneratingResponse, error: aiSearch.error, resources: aiSearch.resources, conversation: aiSearch.conversation, setConversation: aiSearch.setConversation, onMessageSent: aiSearch.askQuestion, toolCalls: aiSearch.toolCalls, contentSegments: aiSearch.contentSegments }))),
292
- react_1.default.createElement(SearchDialogFooter, null, mode === 'ai-dialog' ? (react_1.default.createElement(AiDisclaimer, null, translate('search.ai.disclaimer', 'AI search might provide incomplete or incorrect results. Verify important information.'))) : (react_1.default.createElement(react_1.default.Fragment, null,
293
- react_1.default.createElement(SearchShortcuts, null,
294
- react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.navigate", combination: "Tab", text: translate('search.keys.navigate', 'to navigate') }),
295
- react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.select", combination: "\u23CE", text: translate('search.keys.select', 'to select') }),
296
- react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.exit", combination: "Esc", text: translate('search.keys.exit', 'to exit') })),
297
- isSearchLoading && (react_1.default.createElement(SearchLoading, null,
298
- react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { size: "16px", color: "var(--search-input-icon-color)" }),
299
- translate('search.loading', 'Loading...'))),
300
- react_1.default.createElement(SearchCancelButton, { "data-translation-key": "search.cancel", variant: "secondary", size: "small", onClick: handleClose }, translate('search.cancel', 'Cancel'))))))));
276
+ return null;
277
+ })) : isSearchLoading ? (react_1.default.createElement(SearchMessage, { "data-translation-key": "search.loading" },
278
+ react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { size: "26px", color: "var(--search-input-icon-color)" }),
279
+ translate('search.loading', 'Loading...'))) : (react_1.default.createElement(SearchMessage, { "data-translation-key": "search.noResults" },
280
+ react_1.default.createElement("b", null, translate('search.noResults.title', 'No results'))))) : (react_1.default.createElement(react_1.default.Fragment, null,
281
+ react_1.default.createElement(SearchRecent_1.SearchRecent, { onSelect: (query, index) => {
282
+ telemetry.sendSearchRecentClickedMessage([
283
+ {
284
+ object: 'search',
285
+ query,
286
+ index: index.toString(),
287
+ searchSessionId,
288
+ },
289
+ ]);
290
+ setQuery(query);
291
+ focusSearchInput();
292
+ } }),
293
+ react_1.default.createElement(SearchSuggestedPages_1.SearchSuggestedPages, null)))))) : (react_1.default.createElement(SearchAiDialog_1.SearchAiDialog, { initialMessage: query, response: aiSearch.response, isGeneratingResponse: aiSearch.isGeneratingResponse, error: aiSearch.error, resources: aiSearch.resources, conversation: aiSearch.conversation, setConversation: aiSearch.setConversation, onMessageSent: aiSearch.askQuestion, toolCalls: aiSearch.toolCalls, contentSegments: aiSearch.contentSegments }))),
294
+ react_1.default.createElement(SearchDialogFooter, null, mode === 'ai-dialog' ? (react_1.default.createElement(AiDisclaimer, null, translate('search.ai.disclaimer', 'AI search might provide incomplete or incorrect results. Verify important information.'))) : (react_1.default.createElement(react_1.default.Fragment, null,
295
+ react_1.default.createElement(SearchShortcuts, null,
296
+ react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.navigate", combination: "Tab", text: translate('search.keys.navigate', 'to navigate') }),
297
+ react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.select", combination: "\u23CE", text: translate('search.keys.select', 'to select') }),
298
+ react_1.default.createElement(SearchShortcut_1.SearchShortcut, { "data-translation-key": "search.keys.exit", combination: "Esc", text: translate('search.keys.exit', 'to exit') })),
299
+ isSearchLoading && (react_1.default.createElement(SearchLoading, null,
300
+ react_1.default.createElement(SpinnerLoader_1.SpinnerLoader, { size: "16px", color: "var(--search-input-icon-color)" }),
301
+ translate('search.loading', 'Loading...'))),
302
+ react_1.default.createElement(SearchCancelButton, { "data-translation-key": "search.cancel", variant: "secondary", size: "small", onClick: handleClose }, translate('search.cancel', 'Cancel')))))))));
301
303
  }
302
304
  const SearchOverlay = styled_components_1.default.div `
303
305
  position: fixed;
@@ -1,5 +1,5 @@
1
1
  import type { EntityRelationType } from '../types/catalog';
2
- export declare const CATALOG_TAG_MAX_LENGTH = 15;
2
+ export declare const CATALOG_TAG_MAX_LENGTH = 12;
3
3
  export declare const PREDEFINED_ENTITY_TYPES: string[];
4
4
  export declare const reverseRelationMap: Record<EntityRelationType, EntityRelationType>;
5
5
  export declare const relationTypeMap: Record<EntityRelationType, string>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION_NOT_SPECIFIED = exports.GraphCustomEdgeType = exports.GraphCustomNodeType = exports.GraphHandleType = exports.relationTypeMap = exports.reverseRelationMap = exports.PREDEFINED_ENTITY_TYPES = exports.CATALOG_TAG_MAX_LENGTH = void 0;
4
- exports.CATALOG_TAG_MAX_LENGTH = 15;
4
+ exports.CATALOG_TAG_MAX_LENGTH = 12;
5
5
  exports.PREDEFINED_ENTITY_TYPES = [
6
6
  'service',
7
7
  'domain',
@@ -0,0 +1,8 @@
1
+ import type { EntitiesCatalogConfig } from '@redocly/config';
2
+ export type EntityWithTypeAndKey = {
3
+ type?: string;
4
+ key?: string;
5
+ };
6
+ export declare function useCatalogEntityLink(entitiesCatalogConfig: EntitiesCatalogConfig | undefined): {
7
+ getEntityLink: (entity: EntityWithTypeAndKey) => string | undefined;
8
+ };
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useCatalogEntityLink = useCatalogEntityLink;
4
+ const react_1 = require("react");
5
+ function isEntityExcluded(excludes, entityKey) {
6
+ var _a;
7
+ return (_a = excludes === null || excludes === void 0 ? void 0 : excludes.some((ex) => ex.key === entityKey)) !== null && _a !== void 0 ? _a : false;
8
+ }
9
+ function doesCatalogIncludeEntityType(config, entityType) {
10
+ var _a, _b;
11
+ const hasNoIncludes = !config.includes || config.includes.length === 0;
12
+ if (hasNoIncludes)
13
+ return true;
14
+ return (_b = (_a = config.includes) === null || _a === void 0 ? void 0 : _a.some((inc) => inc.type === entityType)) !== null && _b !== void 0 ? _b : false;
15
+ }
16
+ function useCatalogEntityLink(entitiesCatalogConfig) {
17
+ const catalogEntries = (0, react_1.useMemo)(() => {
18
+ const catalogs = entitiesCatalogConfig === null || entitiesCatalogConfig === void 0 ? void 0 : entitiesCatalogConfig.catalogs;
19
+ if (!catalogs)
20
+ return [];
21
+ return Object.entries(catalogs)
22
+ .filter((entry) => entry[1] != null)
23
+ .sort(([keyA], [keyB]) => (keyA === 'all' ? 1 : 0) - (keyB === 'all' ? 1 : 0));
24
+ }, [entitiesCatalogConfig]);
25
+ const getEntityLink = (entity) => {
26
+ var _a, _b;
27
+ if (!(entity === null || entity === void 0 ? void 0 : entity.key))
28
+ return undefined;
29
+ const entityType = (_a = entity.type) !== null && _a !== void 0 ? _a : '';
30
+ for (const [catalogKey, config] of catalogEntries) {
31
+ if (isEntityExcluded(config.excludes, entity.key))
32
+ continue;
33
+ if (!doesCatalogIncludeEntityType(config, entityType))
34
+ continue;
35
+ const slug = (_b = config.slug) !== null && _b !== void 0 ? _b : catalogKey;
36
+ return `catalogs/${slug}/entities/${entity.key}`;
37
+ }
38
+ return undefined;
39
+ };
40
+ return { getEntityLink };
41
+ }
42
+ //# sourceMappingURL=use-catalog-entity-link.js.map
@@ -1,10 +1,11 @@
1
1
  import { BaseEntity, CatalogColumn } from '../../../components/Catalog/CatalogTableView/CatalogTableView';
2
2
  type CatalogTableHeaderCellActionsProps<T extends BaseEntity> = {
3
3
  column: CatalogColumn<T>;
4
+ currentSortOption?: string | null;
4
5
  handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void;
5
6
  isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean;
6
7
  };
7
- export declare function useCatalogTableHeaderCellActions<T extends BaseEntity>({ column, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellActionsProps<T>): {
8
+ export declare function useCatalogTableHeaderCellActions<T extends BaseEntity>({ column, currentSortOption, handleSortClick, isColumnSorted, }: CatalogTableHeaderCellActionsProps<T>): {
8
9
  handleCellClick: () => void;
9
10
  sortKey: string | undefined;
10
11
  isUpActive: boolean;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCatalogTableHeaderCellActions = useCatalogTableHeaderCellActions;
4
- function useCatalogTableHeaderCellActions({ column, handleSortClick, isColumnSorted, }) {
4
+ function useCatalogTableHeaderCellActions({ column, currentSortOption, handleSortClick, isColumnSorted, }) {
5
5
  const sortKey = column.sortKey;
6
- const isUpActive = sortKey ? isColumnSorted(sortKey, 'desc') : false;
7
- const isDownActive = sortKey ? isColumnSorted(sortKey, 'asc') : false;
6
+ const isUpActive = Boolean(sortKey &&
7
+ (currentSortOption ? currentSortOption === sortKey : isColumnSorted(sortKey, 'desc')));
8
+ const isDownActive = Boolean(sortKey &&
9
+ (currentSortOption ? currentSortOption === `-${sortKey}` : isColumnSorted(sortKey, 'asc')));
8
10
  const handleCellClick = () => {
9
11
  if (!column.sortable || !sortKey)
10
12
  return;
@@ -46,6 +46,7 @@ export * from './use-page-actions';
46
46
  export * from './use-mcp-config';
47
47
  export * from './use-connect-mcp-button';
48
48
  export * from './catalog/use-catalog-entity-details';
49
+ export * from './catalog/use-catalog-entity-link';
49
50
  export * from './catalog/use-catalog-entity-schema';
50
51
  export * from './catalog/use-catalog-table-header-cell-actions';
51
52
  export * from './use-store';
@@ -62,6 +62,7 @@ __exportStar(require("./use-page-actions"), exports);
62
62
  __exportStar(require("./use-mcp-config"), exports);
63
63
  __exportStar(require("./use-connect-mcp-button"), exports);
64
64
  __exportStar(require("./catalog/use-catalog-entity-details"), exports);
65
+ __exportStar(require("./catalog/use-catalog-entity-link"), exports);
65
66
  __exportStar(require("./catalog/use-catalog-entity-schema"), exports);
66
67
  __exportStar(require("./catalog/use-catalog-table-header-cell-actions"), exports);
67
68
  __exportStar(require("./use-store"), exports);
@@ -1 +1,3 @@
1
- export declare const darkMode: import("styled-components").FlattenSimpleInterpolation;
1
+ export declare const darkMode: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
2
+ palette?: string;
3
+ }, any>>;
@@ -20,6 +20,7 @@ const variables_dark_15 = require("../../components/Tooltip/variables.dark");
20
20
  const variables_dark_16 = require("../../components/Banner/variables.dark");
21
21
  const variables_dark_17 = require("../../components/Admonition/variables.dark");
22
22
  const variables_dark_18 = require("../../components/SvgViewer/variables.dark");
23
+ const palette_dark_1 = require("./palette.dark");
23
24
  const replayDarkMode = (0, styled_components_1.css) `
24
25
  /**
25
26
  * @tokens Replay Colors
@@ -242,6 +243,12 @@ exports.darkMode = (0, styled_components_1.css) `
242
243
  --color-black: #ffffff;
243
244
  --color-white: #000000;
244
245
 
246
+
247
+ --color-brand-pink-subtle-bg: var(--color-brand-subtle-1);
248
+ --color-brand-pink-subtle-bg-hover: var(--color-brand-subtle-2);
249
+ --color-brand-pink-subtle-border: var(--color-brand-subtle-3);
250
+ --color-brand-pink-subtle-border-hover: var(--color-brand-subtle-4);
251
+
245
252
  --color-hover-base: #32343E;
246
253
 
247
254
  --bg-color: var(--color-warm-grey-2);
@@ -348,7 +355,7 @@ exports.darkMode = (0, styled_components_1.css) `
348
355
  ${variables_dark_17.admonitionDarkMode}
349
356
  ${variables_dark_18.svgViewerDarkMode}
350
357
  ${badgesDarkMode}
351
-
358
+ ${palette_dark_1.activeBrandPaletteDark}
352
359
  /**
353
360
  * @tokens Dark Theme Scrollbar Config
354
361
  * @presenter Color
@@ -1,2 +1,6 @@
1
- export declare const styles: import("styled-components").FlattenSimpleInterpolation;
2
- export declare const GlobalStyle: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
1
+ export declare const styles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
2
+ palette?: string;
3
+ }, any>>;
4
+ export declare const GlobalStyle: import("styled-components").GlobalStyleComponent<{
5
+ palette?: string;
6
+ }, import("styled-components").DefaultTheme>;
@@ -46,6 +46,7 @@ const variables_41 = require("../../markdoc/components/CodeWalkthrough/variables
46
46
  const variables_42 = require("../../components/SkipContent/variables");
47
47
  const variables_43 = require("../../components/PageActions/variables");
48
48
  const variables_44 = require("../../components/SvgViewer/variables");
49
+ const palette_1 = require("./palette");
49
50
  const dark_1 = require("./dark");
50
51
  const themeColors = (0, styled_components_1.css) `
51
52
  /* === Palette === */
@@ -226,16 +227,22 @@ const themeColors = (0, styled_components_1.css) `
226
227
  --color-white: #ffffff;
227
228
  --color-static-white: #ffffff;
228
229
 
229
- --color-primary-bg: var(--color-blueberry-1);
230
- --color-primary-bg-hover: var(--color-blueberry-2);
231
- --color-primary-border: var(--color-blueberry-3);
232
- --color-primary-border-hover: var(--color-blueberry-4);
233
- --color-primary-hover: var(--color-blueberry-5);
234
- --color-primary-base: var(--color-blueberry-6);
235
- --color-primary-active: var(--color-blueberry-7);
236
- --color-primary-text-hover: var(--color-blueberry-8);
237
- --color-primary-text: var(--color-blueberry-9);
238
- --color-primary-text-active: var(--color-blueberry-10);
230
+ --color-primary-bg: var(--color-brand-1);
231
+ --color-primary-bg-hover: var(--color-brand-2);
232
+ --color-primary-border: var(--color-brand-3);
233
+ --color-primary-border-hover: var(--color-brand-4);
234
+ --color-primary-hover: var(--color-brand-8);
235
+ --color-primary-base: var(--color-brand-6);
236
+ --color-primary-active: var(--color-brand-7);
237
+ --color-primary-text-hover: var(--color-brand-9);
238
+ --color-primary-text: var(--color-brand-8);
239
+ --color-primary-text-active: var(--color-brand-7);
240
+ --color-primary-text-on-color: var(--text-color-on-color);
241
+
242
+ --color-brand-pink-subtle-bg: var(--color-brand-1);
243
+ --color-brand-pink-subtle-bg-hover: var(--color-brand-2);
244
+ --color-brand-pink-subtle-border: var(--color-brand-3);
245
+ --color-brand-pink-subtle-border-hover: var(--color-brand-4);
239
246
 
240
247
  --color-success-bg: var(--color-green-1);
241
248
  --color-success-bg-hover: var(--color-green-2);
@@ -1286,6 +1293,7 @@ exports.styles = (0, styled_components_1.css) `
1286
1293
  ${sizeAndSpace}
1287
1294
  ${variables_6.tag}
1288
1295
  ${themeColors}
1296
+ ${palette_1.activeBrandPaletteLight}
1289
1297
  ${tile}
1290
1298
  ${variables_7.toc}
1291
1299
  ${variables_15.tooltip}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @tokens Palette
3
+ */
4
+ export declare const activeBrandPaletteLight: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
5
+ palette?: string;
6
+ }, any>>;
@@ -0,0 +1,3 @@
1
+ export declare const activeBrandPaletteDark: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<{
2
+ palette?: string;
3
+ }, any>>;