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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/lib/components/Banner/Banner.js +3 -3
  2. package/lib/components/Catalog/CatalogActionsRow.d.ts +3 -3
  3. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -6
  4. package/lib/components/Catalog/CatalogEntities.d.ts +2 -2
  5. package/lib/components/Catalog/CatalogEntities.js +1 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -8
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityMetadata.js +1 -1
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.js +1 -1
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +1 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +2 -1
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.js +2 -6
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +5 -5
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +1 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +15 -7
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.js +2 -2
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +3 -3
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +4 -1
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +3 -3
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +14 -2
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +3 -3
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +3 -3
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +13 -3
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +4 -3
  27. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +3 -2
  28. package/lib/components/Catalog/CatalogEntityTypeIcon.js +9 -9
  29. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +2 -3
  30. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +2 -3
  31. package/lib/components/Catalog/CatalogPageDescription.js +1 -1
  32. package/lib/components/Catalog/CatalogSortButton.d.ts +4 -5
  33. package/lib/components/Catalog/CatalogTableView/CatalogDomainsCell.js +6 -2
  34. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -2
  35. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.d.ts +5 -0
  36. package/lib/components/Catalog/CatalogTableView/CatalogLastUpdateCell.js +45 -0
  37. package/lib/components/Catalog/CatalogTableView/CatalogOwnersCell.js +5 -3
  38. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +2 -3
  39. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.js +3 -2
  40. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  41. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +15 -5
  42. package/lib/components/Catalog/CatalogTableView/CatalogTagsCell.js +3 -2
  43. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -2
  44. package/lib/components/Catalog/CatalogTags.d.ts +11 -0
  45. package/lib/components/Catalog/CatalogTags.js +62 -0
  46. package/lib/components/Catalog/variables.js +22 -14
  47. package/lib/components/Search/SearchDialog.js +118 -116
  48. package/lib/components/SvgViewer/variables.dark.js +1 -1
  49. package/lib/core/constants/catalog.d.ts +1 -1
  50. package/lib/core/constants/catalog.js +1 -1
  51. package/lib/core/hooks/catalog/use-catalog-entity-link.d.ts +8 -0
  52. package/lib/core/hooks/catalog/use-catalog-entity-link.js +42 -0
  53. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.d.ts +2 -1
  54. package/lib/core/hooks/catalog/use-catalog-table-header-cell-actions.js +5 -3
  55. package/lib/core/hooks/index.d.ts +1 -0
  56. package/lib/core/hooks/index.js +1 -0
  57. package/lib/core/styles/dark.d.ts +3 -1
  58. package/lib/core/styles/dark.js +42 -31
  59. package/lib/core/styles/global.d.ts +6 -2
  60. package/lib/core/styles/global.js +54 -39
  61. package/lib/core/styles/palette.d.ts +6 -0
  62. package/lib/core/styles/palette.dark.d.ts +3 -0
  63. package/lib/core/styles/palette.dark.js +216 -0
  64. package/lib/core/styles/palette.js +179 -0
  65. package/lib/core/types/catalog.d.ts +23 -7
  66. package/lib/core/types/hooks.d.ts +6 -4
  67. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.d.ts +9 -0
  68. package/lib/icons/ColorPaletteIcon/ColorPaletteIcon.js +27 -0
  69. package/lib/icons/StopIcon/StopIcon.d.ts +9 -0
  70. package/lib/icons/StopIcon/StopIcon.js +22 -0
  71. package/lib/index.d.ts +3 -1
  72. package/lib/index.js +3 -1
  73. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.d.ts +7 -0
  74. package/lib/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.js +95 -0
  75. package/lib/markdoc/components/ExcalidrawDiagram/variables.d.ts +1 -0
  76. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.d.ts +1 -0
  77. package/lib/markdoc/components/ExcalidrawDiagram/variables.dark.js +8 -0
  78. package/lib/markdoc/components/ExcalidrawDiagram/variables.js +15 -0
  79. package/lib/markdoc/components/Heading/Heading.js +2 -2
  80. package/lib/markdoc/components/Mermaid/Mermaid.js +2 -0
  81. package/lib/markdoc/components/default.d.ts +1 -0
  82. package/lib/markdoc/components/default.js +1 -0
  83. package/package.json +2 -2
  84. package/src/components/Banner/Banner.tsx +7 -7
  85. package/src/components/Catalog/CatalogActionsRow.tsx +3 -3
  86. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +4 -6
  87. package/src/components/Catalog/CatalogEntities.tsx +3 -3
  88. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +3 -24
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityMetadata.tsx +1 -1
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityMethodAndPath.tsx +1 -1
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +1 -0
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +2 -1
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty.tsx +8 -10
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +13 -8
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +1 -0
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +27 -15
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/TagsProperty.tsx +2 -2
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +9 -9
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +17 -9
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +4 -8
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -10
  104. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +4 -3
  105. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +18 -11
  106. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +3 -3
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +2 -3
  108. package/src/components/Catalog/CatalogPageDescription.tsx +1 -1
  109. package/src/components/Catalog/CatalogSortButton.tsx +5 -6
  110. package/src/components/Catalog/CatalogTableView/CatalogDomainsCell.tsx +6 -2
  111. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +2 -2
  112. package/src/components/Catalog/CatalogTableView/CatalogLastUpdateCell.tsx +54 -0
  113. package/src/components/Catalog/CatalogTableView/CatalogOwnersCell.tsx +5 -2
  114. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -3
  115. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +17 -7
  116. package/src/components/Catalog/CatalogTableView/CatalogTagsCell.tsx +3 -2
  117. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -2
  118. package/src/components/Catalog/CatalogTags.tsx +115 -0
  119. package/src/components/Catalog/variables.ts +22 -14
  120. package/src/components/Search/SearchDialog.tsx +299 -293
  121. package/src/components/SvgViewer/variables.dark.ts +1 -1
  122. package/src/core/constants/catalog.ts +1 -1
  123. package/src/core/hooks/catalog/use-catalog-entity-link.ts +46 -0
  124. package/src/core/hooks/catalog/use-catalog-table-header-cell-actions.ts +10 -2
  125. package/src/core/hooks/index.ts +1 -0
  126. package/src/core/styles/dark.ts +14 -2
  127. package/src/core/styles/global.ts +28 -13
  128. package/src/core/styles/palette.dark.ts +214 -0
  129. package/src/core/styles/palette.ts +177 -0
  130. package/src/core/types/catalog.ts +24 -8
  131. package/src/core/types/hooks.ts +5 -10
  132. package/src/icons/ColorPaletteIcon/ColorPaletteIcon.tsx +28 -0
  133. package/src/icons/StopIcon/StopIcon.tsx +23 -0
  134. package/src/index.ts +3 -1
  135. package/src/markdoc/components/ExcalidrawDiagram/ExcalidrawDiagram.tsx +85 -0
  136. package/src/markdoc/components/ExcalidrawDiagram/variables.dark.ts +5 -0
  137. package/src/markdoc/components/ExcalidrawDiagram/variables.ts +12 -0
  138. package/src/markdoc/components/Heading/Heading.tsx +2 -1
  139. package/src/markdoc/components/Mermaid/Mermaid.tsx +2 -0
  140. package/src/markdoc/components/default.ts +1 -0
  141. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +0 -10
  142. package/lib/components/Catalog/CatalogTagsWithTooltip.js +0 -57
  143. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +0 -101
@@ -8,6 +8,7 @@ import { SearchInput } from '@redocly/theme/components/Search/SearchInput';
8
8
  import { SearchShortcut } from '@redocly/theme/components/Search/SearchShortcut';
9
9
  import { Button } from '@redocly/theme/components/Button/Button';
10
10
  import { breakpoints, concatClassNames } from '@redocly/theme/core/utils';
11
+ import { Portal } from '@redocly/theme/components/Portal/Portal';
11
12
  import { SearchItem } from '@redocly/theme/components/Search/SearchItem';
12
13
  import { SearchRecent } from '@redocly/theme/components/Search/SearchRecent';
13
14
  import { SearchSuggestedPages } from '@redocly/theme/components/Search/SearchSuggestedPages';
@@ -207,149 +208,140 @@ export function SearchDialog({
207
208
  const showHeaderButtons = showSearchFilterButton || showAiSearchButton;
208
209
 
209
210
  return (
210
- <SearchOverlay
211
- data-component-name="Search/SearchDialog"
212
- ref={modalRef}
213
- onClick={handleOverlayClick}
214
- className={concatClassNames('overlay', className)}
215
- >
216
- <SearchDialogWrapper className="scroll-lock" role="dialog">
217
- <SearchDialogHeader>
218
- {product && (
219
- <SearchProductTag color="product">
220
- {product.name}
221
- <CloseIcon onClick={() => setProduct(undefined)} color="--icon-color-additional" />
222
- </SearchProductTag>
223
- )}
224
- {mode === 'search' ? (
225
- <>
226
- <SearchInput
227
- value={query}
228
- onChange={setQuery}
229
- placeholder={translate('search.label', 'Search docs...')}
230
- isLoading={isSearchLoading}
231
- inputRef={searchInputRef}
232
- onSubmit={() => {
233
- if (isSearchLoading) return;
234
-
235
- if (showAiSearchButton && aiQueryRef.current) {
236
- aiQueryRef.current.focus();
237
- } else {
238
- firstSearchResultRef.current?.focus();
239
- }
240
- }}
241
- data-translation-key="search.label"
242
- />
243
- {showHeaderButtons && (
244
- <SearchHeaderButtons>
245
- {showAiSearchButton ? (
246
- <SearchAiButton
247
- icon={<AiStarsGradientIcon color="var(--search-ai-button-icon-color)" />}
248
- onClick={() => {
249
- setMode('ai-dialog');
250
- if (query.trim()) {
251
- aiSearch.askQuestion(query);
252
- }
253
- telemetry.sendSearchAiOpenedMessage([
254
- {
255
- object: 'search',
256
- method: 'ai_search_button',
257
- },
258
- ]);
259
- }}
260
- >
261
- {translate('search.ai.button', 'Search with AI')}
262
- </SearchAiButton>
263
- ) : null}
264
- {showSearchFilterButton && (
265
- <SearchFilterToggleButton icon={<SettingsIcon />} onClick={onFilterToggle} />
266
- )}
267
- </SearchHeaderButtons>
268
- )}
269
- </>
270
- ) : (
271
- <AiDialogHeaderWrapper>
272
- {initialMode === 'ai-dialog' ? (
273
- <AiDialogHeaderTitle>
274
- <AiStarsGradientIcon color="var(--search-ai-button-icon-color)" size="1.25rem" />
275
- {translate('search.ai.assistant', 'Assistant')}
276
- </AiDialogHeaderTitle>
277
- ) : (
278
- <Button
279
- variant="secondary"
280
- onClick={() => {
281
- setMode('search');
282
- aiSearch.clearConversation();
283
- focusSearchInput();
284
- }}
285
- tabIndex={0}
286
- icon={<ChevronLeftIcon />}
287
- >
288
- {isMobile
289
- ? translate('search.ai.back', 'Back')
290
- : translate('search.ai.backToSearch', 'Back to search')}
291
- </Button>
292
- )}
293
- <AiDialogHeaderActionsWrapper>
294
- <Button
295
- variant="secondary"
296
- disabled={!aiSearch.conversation.length}
297
- onClick={() => {
298
- refreshSearchSessionId();
299
- aiSearch.clearConversation();
211
+ <Portal>
212
+ <SearchOverlay
213
+ data-component-name="Search/SearchDialog"
214
+ ref={modalRef}
215
+ onClick={handleOverlayClick}
216
+ className={concatClassNames('overlay', className)}
217
+ >
218
+ <SearchDialogWrapper className="scroll-lock" role="dialog">
219
+ <SearchDialogHeader>
220
+ {product && (
221
+ <SearchProductTag color="product">
222
+ {product.name}
223
+ <CloseIcon onClick={() => setProduct(undefined)} color="--icon-color-additional" />
224
+ </SearchProductTag>
225
+ )}
226
+ {mode === 'search' ? (
227
+ <>
228
+ <SearchInput
229
+ value={query}
230
+ onChange={setQuery}
231
+ placeholder={translate('search.label', 'Search docs...')}
232
+ isLoading={isSearchLoading}
233
+ inputRef={searchInputRef}
234
+ onSubmit={() => {
235
+ if (isSearchLoading) return;
236
+
237
+ if (showAiSearchButton && aiQueryRef.current) {
238
+ aiQueryRef.current.focus();
239
+ } else {
240
+ firstSearchResultRef.current?.focus();
241
+ }
300
242
  }}
301
- tabIndex={0}
302
- icon={<EditIcon />}
303
- >
304
- {translate('search.ai.newConversation', 'New conversation')}
305
- </Button>
306
- {isMobile && <Button variant="text" icon={<CloseIcon />} onClick={handleClose} />}
307
- </AiDialogHeaderActionsWrapper>
308
- </AiDialogHeaderWrapper>
309
- )}
310
- </SearchDialogHeader>
311
-
312
- <SearchDialogBody>
313
- {mode === 'search' ? (
314
- <>
315
- {advancedSearch && isFilterOpen && (
316
- <SearchDialogBodyFilterView>
317
- <SearchFilter
243
+ data-translation-key="search.label"
244
+ />
245
+ {showHeaderButtons && (
246
+ <SearchHeaderButtons>
247
+ {showAiSearchButton ? (
248
+ <SearchAiButton
249
+ icon={<AiStarsGradientIcon color="var(--search-ai-button-icon-color)" />}
250
+ onClick={() => {
251
+ setMode('ai-dialog');
252
+ if (query.trim()) {
253
+ aiSearch.askQuestion(query);
254
+ }
255
+ telemetry.sendSearchAiOpenedMessage([
256
+ {
257
+ object: 'search',
258
+ method: 'ai_search_button',
259
+ },
260
+ ]);
261
+ }}
262
+ >
263
+ {translate('search.ai.button', 'Search with AI')}
264
+ </SearchAiButton>
265
+ ) : null}
266
+ {showSearchFilterButton && (
267
+ <SearchFilterToggleButton icon={<SettingsIcon />} onClick={onFilterToggle} />
268
+ )}
269
+ </SearchHeaderButtons>
270
+ )}
271
+ </>
272
+ ) : (
273
+ <AiDialogHeaderWrapper>
274
+ {initialMode === 'ai-dialog' ? (
275
+ <AiDialogHeaderTitle>
276
+ <AiStarsGradientIcon
277
+ color="var(--search-ai-button-icon-color)"
278
+ size="1.25rem"
279
+ />
280
+ {translate('search.ai.assistant', 'Assistant')}
281
+ </AiDialogHeaderTitle>
282
+ ) : (
283
+ <Button
284
+ variant="secondary"
285
+ onClick={() => {
286
+ setMode('search');
287
+ aiSearch.clearConversation();
288
+ focusSearchInput();
289
+ }}
290
+ tabIndex={0}
291
+ icon={<ChevronLeftIcon />}
292
+ >
293
+ {isMobile
294
+ ? translate('search.ai.back', 'Back')
295
+ : translate('search.ai.backToSearch', 'Back to search')}
296
+ </Button>
297
+ )}
298
+ <AiDialogHeaderActionsWrapper>
299
+ <Button
300
+ variant="secondary"
301
+ disabled={!aiSearch.conversation.length}
302
+ onClick={() => {
303
+ refreshSearchSessionId();
304
+ aiSearch.clearConversation();
305
+ }}
306
+ tabIndex={0}
307
+ icon={<EditIcon />}
308
+ >
309
+ {translate('search.ai.newConversation', 'New conversation')}
310
+ </Button>
311
+ {isMobile && <Button variant="text" icon={<CloseIcon />} onClick={handleClose} />}
312
+ </AiDialogHeaderActionsWrapper>
313
+ </AiDialogHeaderWrapper>
314
+ )}
315
+ </SearchDialogHeader>
316
+
317
+ <SearchDialogBody>
318
+ {mode === 'search' ? (
319
+ <>
320
+ {advancedSearch && isFilterOpen && (
321
+ <SearchDialogBodyFilterView>
322
+ <SearchFilter
323
+ facets={facets}
324
+ filter={filter}
325
+ query={query}
326
+ quickFilterFields={[groupField]}
327
+ onFilterChange={onFilterChange}
328
+ onFilterReset={onFilterReset}
329
+ onFacetReset={onFacetReset}
330
+ />
331
+ </SearchDialogBodyFilterView>
332
+ )}
333
+ <SearchDialogBodyMainView>
334
+ <SearchGroups
318
335
  facets={facets}
319
- filter={filter}
320
- query={query}
321
- quickFilterFields={[groupField]}
336
+ searchFilter={filter}
322
337
  onFilterChange={onFilterChange}
323
- onFilterReset={onFilterReset}
324
- onFacetReset={onFacetReset}
338
+ onQuickFilterReset={onQuickFilterReset}
339
+ groupField={groupField}
325
340
  />
326
- </SearchDialogBodyFilterView>
327
- )}
328
- <SearchDialogBodyMainView>
329
- <SearchGroups
330
- facets={facets}
331
- searchFilter={filter}
332
- onFilterChange={onFilterChange}
333
- onQuickFilterReset={onQuickFilterReset}
334
- groupField={groupField}
335
- />
336
341
 
337
- {showAiSearchItem && (
338
- <SearchWithAI
339
- onClick={() => {
340
- setMode('ai-dialog');
341
- if (query.trim()) {
342
- aiSearch.askQuestion(query);
343
- }
344
- telemetry.sendSearchAiOpenedMessage([
345
- {
346
- object: 'search',
347
- method: 'ai_search_input',
348
- },
349
- ]);
350
- }}
351
- onKeyDown={(e) => {
352
- if (e.key === 'Enter') {
342
+ {showAiSearchItem && (
343
+ <SearchWithAI
344
+ onClick={() => {
353
345
  setMode('ai-dialog');
354
346
  if (query.trim()) {
355
347
  aiSearch.askQuestion(query);
@@ -360,167 +352,181 @@ export function SearchDialog({
360
352
  method: 'ai_search_input',
361
353
  },
362
354
  ]);
363
- }
364
- }}
365
- ref={aiQueryRef}
366
- tabIndex={0}
367
- role="option"
368
- aria-selected="true"
369
- >
370
- <AiStarsIcon
371
- style={{ flexShrink: 0 }}
372
- color="var(--search-ai-icon-color)"
373
- size="36px"
374
- background="var(--search-ai-icon-bg-color)"
375
- margin="0 var(--spacing-md) 0 0"
376
- borderRadius="var(--border-radius-lg)"
377
- />
378
- <QueryWrapper>
379
- <Typography fontWeight="var(--font-weight-semibold)">{query}</Typography>
380
- </QueryWrapper>
381
- <Typography>- {translate('search.ai.label', 'Ask AI assistant')}</Typography>
382
- <ReturnKeyIcon color="var(--search-item-text-color)" />
383
- </SearchWithAI>
384
- )}
385
- {showResults ? (
386
- searchKeysWithResults.length ? (
387
- searchKeysWithResults.map((key, searchGroupKeyIdx) => {
388
- const searchResultItems = items[key];
389
-
390
- if (searchResultItems?.length) {
391
- return (
392
- <Fragment key={key}>
393
- <SearchGroupTitle data-testid="search-group-title">
394
- {key}
395
- </SearchGroupTitle>
396
- {searchResultItems.map((item, idx, resultsArr) =>
397
- mapItem(
398
- item,
399
- idx,
400
- resultsArr,
401
- searchGroupKeyIdx === 0 ? firstSearchResultRef : undefined,
402
- ),
403
- )}
404
- {showLoadMore(key, searchResultItems.length || 0) && (
405
- <SearchGroupFooter
406
- tabIndex={0}
407
- data-translation-key="search.showMore"
408
- onKeyDown={(e) => {
409
- if (e.key === 'Enter') {
355
+ }}
356
+ onKeyDown={(e) => {
357
+ if (e.key === 'Enter') {
358
+ setMode('ai-dialog');
359
+ if (query.trim()) {
360
+ aiSearch.askQuestion(query);
361
+ }
362
+ telemetry.sendSearchAiOpenedMessage([
363
+ {
364
+ object: 'search',
365
+ method: 'ai_search_input',
366
+ },
367
+ ]);
368
+ }
369
+ }}
370
+ ref={aiQueryRef}
371
+ tabIndex={0}
372
+ role="option"
373
+ aria-selected="true"
374
+ >
375
+ <AiStarsIcon
376
+ style={{ flexShrink: 0 }}
377
+ color="var(--search-ai-icon-color)"
378
+ size="36px"
379
+ background="var(--search-ai-icon-bg-color)"
380
+ margin="0 var(--spacing-md) 0 0"
381
+ borderRadius="var(--border-radius-lg)"
382
+ />
383
+ <QueryWrapper>
384
+ <Typography fontWeight="var(--font-weight-semibold)">{query}</Typography>
385
+ </QueryWrapper>
386
+ <Typography>- {translate('search.ai.label', 'Ask AI assistant')}</Typography>
387
+ <ReturnKeyIcon color="var(--search-item-text-color)" />
388
+ </SearchWithAI>
389
+ )}
390
+ {showResults ? (
391
+ searchKeysWithResults.length ? (
392
+ searchKeysWithResults.map((key, searchGroupKeyIdx) => {
393
+ const searchResultItems = items[key];
394
+
395
+ if (searchResultItems?.length) {
396
+ return (
397
+ <Fragment key={key}>
398
+ <SearchGroupTitle data-testid="search-group-title">
399
+ {key}
400
+ </SearchGroupTitle>
401
+ {searchResultItems.map((item, idx, resultsArr) =>
402
+ mapItem(
403
+ item,
404
+ idx,
405
+ resultsArr,
406
+ searchGroupKeyIdx === 0 ? firstSearchResultRef : undefined,
407
+ ),
408
+ )}
409
+ {showLoadMore(key, searchResultItems.length || 0) && (
410
+ <SearchGroupFooter
411
+ tabIndex={0}
412
+ data-translation-key="search.showMore"
413
+ onKeyDown={(e) => {
414
+ if (e.key === 'Enter') {
415
+ setLoadMore({
416
+ groupKey: key,
417
+ offset: searchResultItems.length || 0,
418
+ });
419
+ }
420
+ }}
421
+ onClick={() =>
410
422
  setLoadMore({
411
423
  groupKey: key,
412
424
  offset: searchResultItems.length || 0,
413
- });
425
+ })
414
426
  }
415
- }}
416
- onClick={() =>
417
- setLoadMore({
418
- groupKey: key,
419
- offset: searchResultItems.length || 0,
420
- })
421
- }
422
- >
423
- {translate('search.showMore', 'Show more')}
424
- </SearchGroupFooter>
425
- )}
426
- </Fragment>
427
- );
428
- }
429
-
430
- return null;
431
- })
432
- ) : isSearchLoading ? (
433
- <SearchMessage data-translation-key="search.loading">
434
- <SpinnerLoader size="26px" color="var(--search-input-icon-color)" />
435
- {translate('search.loading', 'Loading...')}
436
- </SearchMessage>
427
+ >
428
+ {translate('search.showMore', 'Show more')}
429
+ </SearchGroupFooter>
430
+ )}
431
+ </Fragment>
432
+ );
433
+ }
434
+
435
+ return null;
436
+ })
437
+ ) : isSearchLoading ? (
438
+ <SearchMessage data-translation-key="search.loading">
439
+ <SpinnerLoader size="26px" color="var(--search-input-icon-color)" />
440
+ {translate('search.loading', 'Loading...')}
441
+ </SearchMessage>
442
+ ) : (
443
+ <SearchMessage data-translation-key="search.noResults">
444
+ <b>{translate('search.noResults.title', 'No results')}</b>
445
+ </SearchMessage>
446
+ )
437
447
  ) : (
438
- <SearchMessage data-translation-key="search.noResults">
439
- <b>{translate('search.noResults.title', 'No results')}</b>
440
- </SearchMessage>
441
- )
442
- ) : (
443
- <>
444
- <SearchRecent
445
- onSelect={(query, index) => {
446
- telemetry.sendSearchRecentClickedMessage([
447
- {
448
- object: 'search',
449
- query,
450
- index: index.toString(),
451
- searchSessionId,
452
- },
453
- ]);
454
- setQuery(query);
455
- focusSearchInput();
456
- }}
457
- />
458
- <SearchSuggestedPages />
459
- </>
448
+ <>
449
+ <SearchRecent
450
+ onSelect={(query, index) => {
451
+ telemetry.sendSearchRecentClickedMessage([
452
+ {
453
+ object: 'search',
454
+ query,
455
+ index: index.toString(),
456
+ searchSessionId,
457
+ },
458
+ ]);
459
+ setQuery(query);
460
+ focusSearchInput();
461
+ }}
462
+ />
463
+ <SearchSuggestedPages />
464
+ </>
465
+ )}
466
+ </SearchDialogBodyMainView>
467
+ </>
468
+ ) : (
469
+ <SearchAiDialog
470
+ initialMessage={query}
471
+ response={aiSearch.response}
472
+ isGeneratingResponse={aiSearch.isGeneratingResponse}
473
+ error={aiSearch.error}
474
+ resources={aiSearch.resources}
475
+ conversation={aiSearch.conversation}
476
+ setConversation={aiSearch.setConversation}
477
+ onMessageSent={aiSearch.askQuestion}
478
+ toolCalls={aiSearch.toolCalls}
479
+ contentSegments={aiSearch.contentSegments}
480
+ />
481
+ )}
482
+ </SearchDialogBody>
483
+ <SearchDialogFooter>
484
+ {mode === 'ai-dialog' ? (
485
+ <AiDisclaimer>
486
+ {translate(
487
+ 'search.ai.disclaimer',
488
+ 'AI search might provide incomplete or incorrect results. Verify important information.',
460
489
  )}
461
- </SearchDialogBodyMainView>
462
- </>
463
- ) : (
464
- <SearchAiDialog
465
- initialMessage={query}
466
- response={aiSearch.response}
467
- isGeneratingResponse={aiSearch.isGeneratingResponse}
468
- error={aiSearch.error}
469
- resources={aiSearch.resources}
470
- conversation={aiSearch.conversation}
471
- setConversation={aiSearch.setConversation}
472
- onMessageSent={aiSearch.askQuestion}
473
- toolCalls={aiSearch.toolCalls}
474
- contentSegments={aiSearch.contentSegments}
475
- />
476
- )}
477
- </SearchDialogBody>
478
- <SearchDialogFooter>
479
- {mode === 'ai-dialog' ? (
480
- <AiDisclaimer>
481
- {translate(
482
- 'search.ai.disclaimer',
483
- 'AI search might provide incomplete or incorrect results. Verify important information.',
484
- )}
485
- </AiDisclaimer>
486
- ) : (
487
- <>
488
- <SearchShortcuts>
489
- <SearchShortcut
490
- data-translation-key="search.keys.navigate"
491
- combination="Tab"
492
- text={translate('search.keys.navigate', 'to navigate')}
493
- />
494
- <SearchShortcut
495
- data-translation-key="search.keys.select"
496
- combination="⏎"
497
- text={translate('search.keys.select', 'to select')}
498
- />
499
- <SearchShortcut
500
- data-translation-key="search.keys.exit"
501
- combination="Esc"
502
- text={translate('search.keys.exit', 'to exit')}
503
- />
504
- </SearchShortcuts>
505
- {isSearchLoading && (
506
- <SearchLoading>
507
- <SpinnerLoader size="16px" color="var(--search-input-icon-color)" />
508
- {translate('search.loading', 'Loading...')}
509
- </SearchLoading>
510
- )}
511
- <SearchCancelButton
512
- data-translation-key="search.cancel"
513
- variant="secondary"
514
- size="small"
515
- onClick={handleClose}
516
- >
517
- {translate('search.cancel', 'Cancel')}
518
- </SearchCancelButton>
519
- </>
520
- )}
521
- </SearchDialogFooter>
522
- </SearchDialogWrapper>
523
- </SearchOverlay>
490
+ </AiDisclaimer>
491
+ ) : (
492
+ <>
493
+ <SearchShortcuts>
494
+ <SearchShortcut
495
+ data-translation-key="search.keys.navigate"
496
+ combination="Tab"
497
+ text={translate('search.keys.navigate', 'to navigate')}
498
+ />
499
+ <SearchShortcut
500
+ data-translation-key="search.keys.select"
501
+ combination="⏎"
502
+ text={translate('search.keys.select', 'to select')}
503
+ />
504
+ <SearchShortcut
505
+ data-translation-key="search.keys.exit"
506
+ combination="Esc"
507
+ text={translate('search.keys.exit', 'to exit')}
508
+ />
509
+ </SearchShortcuts>
510
+ {isSearchLoading && (
511
+ <SearchLoading>
512
+ <SpinnerLoader size="16px" color="var(--search-input-icon-color)" />
513
+ {translate('search.loading', 'Loading...')}
514
+ </SearchLoading>
515
+ )}
516
+ <SearchCancelButton
517
+ data-translation-key="search.cancel"
518
+ variant="secondary"
519
+ size="small"
520
+ onClick={handleClose}
521
+ >
522
+ {translate('search.cancel', 'Cancel')}
523
+ </SearchCancelButton>
524
+ </>
525
+ )}
526
+ </SearchDialogFooter>
527
+ </SearchDialogWrapper>
528
+ </SearchOverlay>
529
+ </Portal>
524
530
  );
525
531
  }
526
532
 
@@ -1,5 +1,5 @@
1
1
  import { css } from 'styled-components';
2
2
 
3
3
  export const svgViewerDarkMode = css`
4
- --svg-viewer-bg-color: var(--color-warm-grey-9);
4
+ --svg-viewer-bg-color: var(--color-warm-grey-3);
5
5
  `;
@@ -1,6 +1,6 @@
1
1
  import type { EntityRelationType } from '../types/catalog';
2
2
 
3
- export const CATALOG_TAG_MAX_LENGTH = 15;
3
+ export const CATALOG_TAG_MAX_LENGTH = 12;
4
4
 
5
5
  export const PREDEFINED_ENTITY_TYPES = [
6
6
  'service',