@redocly/theme 0.63.0-next.4 → 0.63.0-next.6

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 (136) hide show
  1. package/lib/components/Accordion/variables.js +2 -2
  2. package/lib/components/Buttons/DownloadButton.d.ts +6 -0
  3. package/lib/components/Buttons/DownloadButton.js +20 -0
  4. package/lib/components/Buttons/EmailButton.js +6 -1
  5. package/lib/components/Buttons/NewTabButton.js +6 -1
  6. package/lib/components/Catalog/Catalog.js +114 -50
  7. package/lib/components/Catalog/CatalogAvatar.d.ts +5 -0
  8. package/lib/components/Catalog/CatalogAvatar.js +92 -0
  9. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +26 -7
  10. package/lib/components/Catalog/CatalogCardView/CatalogCardView.js +10 -2
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +17 -17
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.js +4 -20
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.d.ts +7 -0
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.js +53 -0
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.js +3 -17
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.js +30 -9
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +16 -3
  18. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.js +8 -4
  19. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +11 -5
  20. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +1 -1
  21. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.js +1 -1
  22. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
  23. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +4 -1
  24. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.js +7 -2
  25. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
  26. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  27. package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +1 -1
  28. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +4 -2
  29. package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +25 -8
  30. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.d.ts +7 -0
  31. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +24 -0
  32. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.d.ts +6 -0
  33. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.js +26 -0
  34. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.d.ts +7 -0
  35. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +30 -0
  36. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.d.ts +13 -0
  37. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.js +30 -0
  38. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.d.ts +11 -0
  39. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.js +21 -0
  40. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.d.ts +7 -0
  41. package/lib/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.js +25 -0
  42. package/lib/components/Catalog/CatalogPageDescription.js +0 -6
  43. package/lib/components/Catalog/CatalogSelector.d.ts +0 -1
  44. package/lib/components/Catalog/CatalogSelector.js +50 -16
  45. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -1
  46. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +20 -5
  47. package/lib/components/Catalog/CatalogTableView/CatalogUserEntityCell.js +2 -23
  48. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +2 -1
  49. package/lib/components/Catalog/CatalogTagsWithTooltip.js +14 -6
  50. package/lib/components/Catalog/variables.js +78 -36
  51. package/lib/components/Filter/variables.js +1 -1
  52. package/lib/components/LoadMore/LoadMore.js +1 -0
  53. package/lib/components/Menu/MenuItem.js +1 -1
  54. package/lib/components/PageActions/PageActions.js +1 -2
  55. package/lib/components/Search/SearchDialog.js +1 -1
  56. package/lib/components/SidebarActions/SidebarActions.js +1 -1
  57. package/lib/components/Tooltip/AnchorTooltip.js +5 -2
  58. package/lib/components/Tooltip/JsTooltip.js +5 -2
  59. package/lib/components/UserMenu/UserMenu.js +1 -3
  60. package/lib/core/hooks/index.d.ts +1 -0
  61. package/lib/core/hooks/index.js +1 -0
  62. package/lib/core/hooks/use-is-truncated.d.ts +1 -0
  63. package/lib/core/hooks/use-is-truncated.js +19 -0
  64. package/lib/core/hooks/use-tabs.d.ts +1 -1
  65. package/lib/core/hooks/use-tabs.js +30 -17
  66. package/lib/core/types/hooks.d.ts +1 -0
  67. package/lib/core/types/l10n.d.ts +1 -1
  68. package/lib/core/types/tooltip.d.ts +1 -0
  69. package/lib/core/utils/custom-catalog-options-casing.d.ts +15 -0
  70. package/lib/core/utils/custom-catalog-options-casing.js +32 -0
  71. package/lib/core/utils/index.d.ts +1 -0
  72. package/lib/core/utils/index.js +1 -0
  73. package/lib/index.d.ts +1 -0
  74. package/lib/index.js +1 -0
  75. package/lib/markdoc/components/MarkdocExample/MarkdocExample.js +2 -2
  76. package/lib/markdoc/components/Tabs/Tabs.d.ts +1 -2
  77. package/lib/markdoc/components/Tabs/Tabs.js +9 -22
  78. package/package.json +4 -4
  79. package/src/components/Accordion/variables.ts +2 -2
  80. package/src/components/Buttons/DownloadButton.tsx +41 -0
  81. package/src/components/Buttons/EmailButton.tsx +18 -8
  82. package/src/components/Buttons/NewTabButton.tsx +19 -8
  83. package/src/components/Catalog/Catalog.tsx +157 -95
  84. package/src/components/Catalog/CatalogAvatar.tsx +68 -0
  85. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +29 -5
  86. package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +10 -2
  87. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +17 -17
  88. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode.tsx +4 -21
  89. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsNodeContent.tsx +82 -0
  90. package/src/components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode.tsx +4 -22
  91. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistoryButton.tsx +39 -10
  92. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +19 -3
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityVersionItem.tsx +8 -4
  94. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +12 -10
  95. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +5 -1
  96. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/OwnersProperty.tsx +1 -0
  97. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
  98. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +6 -2
  99. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +10 -2
  100. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
  101. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  102. package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +1 -1
  103. package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +30 -6
  104. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +31 -0
  105. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelHeader.tsx +34 -0
  106. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +40 -0
  107. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBar.tsx +54 -0
  108. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarControls.tsx +34 -0
  109. package/src/components/Catalog/CatalogMobileTopBar/CatalogMobileTopBarFiltersButton.tsx +39 -0
  110. package/src/components/Catalog/CatalogPageDescription.tsx +0 -6
  111. package/src/components/Catalog/CatalogSelector.tsx +23 -21
  112. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +37 -6
  113. package/src/components/Catalog/CatalogTableView/CatalogUserEntityCell.tsx +2 -26
  114. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +24 -9
  115. package/src/components/Catalog/variables.ts +78 -36
  116. package/src/components/Filter/variables.ts +1 -1
  117. package/src/components/LoadMore/LoadMore.tsx +1 -0
  118. package/src/components/Menu/MenuItem.tsx +1 -0
  119. package/src/components/PageActions/PageActions.tsx +1 -2
  120. package/src/components/Search/SearchDialog.tsx +1 -1
  121. package/src/components/SidebarActions/SidebarActions.tsx +1 -0
  122. package/src/components/Tooltip/AnchorTooltip.tsx +5 -1
  123. package/src/components/Tooltip/JsTooltip.tsx +5 -1
  124. package/src/components/UserMenu/UserMenu.tsx +1 -3
  125. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +1 -1
  126. package/src/core/hooks/index.ts +1 -0
  127. package/src/core/hooks/use-is-truncated.ts +20 -0
  128. package/src/core/hooks/use-tabs.ts +40 -21
  129. package/src/core/types/hooks.ts +1 -1
  130. package/src/core/types/l10n.ts +7 -0
  131. package/src/core/types/tooltip.ts +1 -0
  132. package/src/core/utils/custom-catalog-options-casing.ts +29 -0
  133. package/src/core/utils/index.ts +1 -0
  134. package/src/index.ts +1 -0
  135. package/src/markdoc/components/MarkdocExample/MarkdocExample.tsx +2 -6
  136. package/src/markdoc/components/Tabs/Tabs.tsx +4 -37
@@ -7,9 +7,9 @@ export const catalog = css`
7
7
  * @tokens Catalog page
8
8
  */
9
9
  --catalog-page-padding-vertical: var(--spacing-xl);
10
- --catalog-page-padding-horizontal: var(--spacing-xxl);
10
+ --catalog-page-padding-horizontal: var(--spacing-xl);
11
11
  --catalog-page-padding: var(--catalog-page-padding-vertical) var(--catalog-page-padding-horizontal);
12
- --catalog-page-content-height: calc(100vh - var(--navbar-height) - var(--spacing-lg) * 2);
12
+ --catalog-page-padding-mobile: var(--catalog-page-padding-vertical) var(--spacing-base);
13
13
 
14
14
  --catalog-filter-padding-vertical-mobile: 0;
15
15
  --catalog-filter-padding-horizontal-mobile: var(--spacing-base);
@@ -29,9 +29,8 @@ export const catalog = css`
29
29
  /**
30
30
  * @tokens Catalog page content
31
31
  */
32
- --catalog-page-content-width-mobile: 90%;
33
- --catalog-page-content-width-desktop: 100%;
34
- --catalog-page-content-margin-mobile: 0 auto;
32
+ --catalog-page-content-width: 100%;
33
+ --catalog-page-content-margin: 0 auto;
35
34
 
36
35
  /**
37
36
  * @tokens Catalog page title
@@ -48,7 +47,7 @@ export const catalog = css`
48
47
  --catalog-description-text-color: var(--text-color-secondary);
49
48
  --catalog-description-font-weight: var(--font-weight-regular);
50
49
  --catalog-description-font-size: var(--font-size-lg);
51
- --catalog-description-margin: 0 0 var(--spacing-sm) 0;
50
+ --catalog-description-margin: 0 0 var(--spacing-xl) 0;
52
51
  --catalog-description-line-height: var(--line-height-lg);
53
52
 
54
53
  /**
@@ -80,14 +79,12 @@ export const catalog = css`
80
79
  /**
81
80
  * @tokens Catalog selector
82
81
  */
83
- --catalog-select-wrapper-margin-top: var(--spacing-xxs);
84
- --catalog-select-label-margin-bottom: var(--spacing-xxs);
85
- --catalog-select-label-font-weight: var(--filter-title-font-weight);
86
- --catalog-select-label-font-size: var(--filter-title-font-size);
87
- --catalog-select-label-line-height: var(--filter-title-line-height);
88
82
  --catalog-select-border-radius: var(--filter-input-border-radius);
89
- --catalog-select-input-padding: var(--select-input-padding-vertical) var(--spacing-sm);
90
83
  --catalog-select-icon-color: var(--input-t-icon-color);
84
+ --catalog-select-accordion-header-padding: 12px 16px 8px 16px;
85
+ --catalog-select-accordion-body-padding: 0px 16px 12px 16px;
86
+ --catalog-select-select-line-height: 1.15em;
87
+ --catalog-select-select-input-padding: 8px 12px;
91
88
 
92
89
  /**
93
90
  * @tokens Catalog highlight
@@ -95,6 +92,18 @@ export const catalog = css`
95
92
  --catalog-highlight-bg-color: var(--search-highlight-bg-color);
96
93
  --catalog-highlight-text-color: var(--search-highlight-text-color);
97
94
 
95
+ /**
96
+ * @tokens Catalog entity
97
+ */
98
+
99
+ --catalog-entity-max-width: 1072px;
100
+ --catalog-spacing-large: calc(var(--spacing-unit) * 16);
101
+ --catalog-entity-padding: var(--spacing-xl) var(--catalog-spacing-large);
102
+ --catalog-entity-padding-large: var(--spacing-lg) var(--catalog-spacing-large);
103
+ --catalog-entity-padding-medium: var(--spacing-lg) var(--spacing-xl);
104
+ --catalog-entity-padding-small: var(--spacing-lg) var(--spacing-base);
105
+ --catalog-entity-margin: 0 auto;
106
+
98
107
  /**
99
108
  * @tokens Catalog entity icon
100
109
  */
@@ -137,10 +146,12 @@ export const catalog = css`
137
146
  /**
138
147
  * @tokens Catalog tags
139
148
  */
140
- --catalog-tags-wrapper-gap: var(--spacing-xs) calc(var(--spacing-xs) - 5px);
141
149
  --catalog-tags-more-button-font-size: var(--font-size-base);
142
150
  --catalog-tags-more-button-margin-left: 4px;
143
151
  --catalog-tags-placeholder-bg-color: var(--bg-color);
152
+ --catalog-tags-not-connected-font-size: var(--font-size-base);
153
+ --catalog-tags-not-connected-line-height: var(--line-height-base);
154
+ --catalog-tags-not-connected-color: var(--text-color-disabled);
144
155
 
145
156
  /**
146
157
  * @tokens Catalog empty state
@@ -153,7 +164,12 @@ export const catalog = css`
153
164
  */
154
165
  --catalog-actions-row-margin-bottom: var(--spacing-xl);
155
166
  --catalog-controls-wrapper-gap: var(--spacing-sm);
167
+
168
+ /**
169
+ * @tokens Catalog filter
170
+ */
156
171
  --catalog-filter-input-width: 360px;
172
+ --catalog-filter-content-header-padding: var(--spacing-base) var(--spacing-base) var(--spacing-sm) var(--spacing-base);
157
173
 
158
174
  /**
159
175
  * @tokens Catalog search input wrapper
@@ -186,17 +202,10 @@ export const catalog = css`
186
202
  --catalog-sidebar-display-desktop: flex;
187
203
  --catalog-sidebar-menu-container-padding-top: 0;
188
204
 
189
- /**
190
- * @tokens Catalog page description responsive
191
- */
192
- --catalog-page-description-display-mobile: none;
193
- --catalog-page-description-display-desktop: block;
194
-
195
205
  /**
196
206
  * @tokens Catalog card
197
207
  */
198
208
  --catalog-card-height: 241px;
199
- --catalog-card-min-width: 400px;
200
209
  --catalog-card-padding-vertical: var(--spacing-base);
201
210
  --catalog-card-padding-horizontal: var(--spacing-md);
202
211
  --catalog-card-gap: var(--spacing-sm);
@@ -211,7 +220,7 @@ export const catalog = css`
211
220
  --catalog-card-border-color-hover: var(--border-color-primary);
212
221
  --catalog-card-border-radius: var(--border-radius-lg);
213
222
  --catalog-cards-group-margin: 0 0 var(--spacing-base) 0;
214
- --catalog-cards-group-gap: var(--spacing-xl);
223
+ --catalog-cards-group-gap: var(--spacing-lg);
215
224
 
216
225
  /**
217
226
  * @tokens Catalog card icon
@@ -231,7 +240,7 @@ export const catalog = css`
231
240
  --catalog-metadata-section-gap: var(--spacing-xs);
232
241
  --catalog-metadata-label-font-size: var(--font-size-base);
233
242
  --catalog-metadata-label-font-weight: var(--font-weight-medium);
234
- --catalog-metadata-label-color: var(--text-color-secondary);
243
+ --catalog-metadata-label-color: var(--text-color-description);
235
244
  --catalog-metadata-column-half-gap: var(--spacing-sm);
236
245
  --catalog-metadata-heading-size: var(--font-size-md);
237
246
 
@@ -254,10 +263,20 @@ export const catalog = css`
254
263
  */
255
264
  --catalog-card-title-color: var(--text-color-primary);
256
265
  --catalog-card-title-min-height: var(--spacing-xxl);
257
- --catalog-card-title-font-size: var(--font-size-lg);
258
- --catalog-card-title-font-weight: var(--font-weight-bold);
259
- --catalog-card-title-line-height: var(--line-height-lg);
260
- --catalog-card-title-line-clamp: 2;
266
+ --catalog-card-title-font-size: var(--font-size-xl);
267
+ --catalog-card-title-font-weight: var(--font-weight-medium);
268
+ --catalog-card-title-line-height: var(--line-height-xl);
269
+ --catalog-card-title-height: 34px;
270
+ --catalog-card-title-display: flex;
271
+ --catalog-card-title-align-items: center;
272
+ --catalog-card-title-margin-bottom: 2px;
273
+
274
+ /**
275
+ * @tokens Catalog card summary
276
+ */
277
+ --catalog-card-summary-font-size: var(--font-size-base);
278
+ --catalog-card-summary-font-weight: var(--font-weight-regular);
279
+ --catalog-card-summary-line-height: var(--line-height-base);
261
280
 
262
281
  /**
263
282
  * @tokens Catalog card footer
@@ -294,11 +313,17 @@ export const catalog = css`
294
313
  --catalog-page-badge-dot-size: 6px;
295
314
  --catalog-page-badge-dot-border-color: var(--color-static-white);
296
315
 
316
+ /**
317
+ * @tokens Catalog card metadata
318
+ */
319
+ --catalog-card-metadata-owner-tag-left-padding: 2px;
320
+
321
+
297
322
  /**
298
323
  * @tokens Catalog table
299
324
  */
300
- --catalog-table-border-color: var(--border-color-primary);
301
- --catalog-table-header-bg-color: var(--bg-color-secondary);
325
+ --catalog-table-border-color: var(--border-color-secondary);
326
+ --catalog-table-header-bg-color: var(--layer-color);
302
327
  --catalog-table-header-font-weight: var(--font-weight-medium);
303
328
  --catalog-table-header-cell-padding: 4px 8px;
304
329
  --catalog-table-cell-padding: 4px 8px;
@@ -329,7 +354,7 @@ export const catalog = css`
329
354
  /**
330
355
  * @tokens Catalog table entity title
331
356
  */
332
- --catalog-table-entity-title-font-size: var(--catalog-card-title-font-size);
357
+ --catalog-table-entity-title-font-size: var(--font-size-lg);
333
358
  --catalog-table-entity-title-line-height: var(--line-height-lg);
334
359
  --catalog-table-entity-title-font-weight: var(--font-weight-medium);
335
360
 
@@ -390,16 +415,27 @@ export const catalog = css`
390
415
  --catalog-empty-state-font-size: var(--font-size-base);
391
416
  --catalog-empty-state-line-height: var(--line-height-base);
392
417
 
418
+ /**
419
+ * @tokens Catalog avatar
420
+ */
393
421
  --catalog-avatar-bg-color: #ededf2;
422
+ --catalog-avatar-small-size: 20px;
423
+ --catalog-avatar-medium-size: 32px;
424
+ --catalog-avatar-large-size: 40px;
425
+ --catalog-avatar-font-size-small: 10px;
426
+ --catalog-avatar-font-size-medium: var(--font-size-base);
427
+ --catalog-avatar-font-size-large: var(--font-size-lg);
428
+ --catalog-avatar-font-weight: var(--font-weight-regular);
429
+ --catalog-avatar-line-height: var(--line-height-base);
394
430
  // @tokens End
395
431
 
396
432
  /**
397
433
  * @tokens Catalog entity relations node
398
434
  */
399
- --catalog-entity-relations-node-padding-vertical: 10px;
400
- --catalog-entity-relations-node-padding-horizontal: 14px;
435
+ --catalog-entity-relations-node-padding-vertical: 8px;
436
+ --catalog-entity-relations-node-padding-horizontal: 12px;
401
437
  --catalog-entity-relations-node-padding: var(--catalog-entity-relations-node-padding-vertical) var(--catalog-entity-relations-node-padding-horizontal);
402
- --catalog-entity-relations-node-gap: 8px;
438
+ --catalog-entity-relations-node-gap: 4px;
403
439
  --catalog-entity-relations-node-border-radius: 10px;
404
440
 
405
441
  --catalog-entity-relations-node-bg-color: var(--layer-color);
@@ -410,7 +446,6 @@ export const catalog = css`
410
446
  --catalog-entity-relations-node-border-style: var(--border-style);
411
447
 
412
448
  --catalog-entity-relations-node-font-weight: var(--font-weight-regular);
413
- --catalog-entity-relations-node-font-weight-root: 600;
414
449
 
415
450
  --catalog-entity-relations-node-root-bg-color: var(--color-blue-6);
416
451
  --catalog-entity-relations-node-root-text-color: var(--color-static-white);
@@ -438,14 +473,17 @@ export const catalog = css`
438
473
  /**
439
474
  * @tokens Catalog history button
440
475
  */
476
+ --catalog-history-button-width: 252px;
477
+ --catalog-history-button-item-width: 244px;
441
478
  --catalog-history-separator-border-color: var(--border-color-secondary);
442
479
  --catalog-history-separator-margin-bottom: var(--spacing-sm);
443
480
  --catalog-history-item-padding: var(--spacing-xxs);
444
481
  --catalog-history-item-margin-bottom: calc(var(--spacing-xxs) * -1);
445
- --catalog-history-item-gap: var(--spacing-xxs);
482
+ --catalog-history-item-gap: var(--spacing-xs);
446
483
  --catalog-history-item-border-radius: var(--menu-item-label-border-radius);
447
484
  --catalog-history-item-bg-color-hover: var(--menu-item-bg-color-hover);
448
485
  --catalog-history-icon-size: 16px;
486
+ --catalog-history-content-max-width: 212px;
449
487
  --catalog-history-text-font-family: var(--font-family-base);
450
488
  --catalog-history-text-font-size: var(--font-size-base);
451
489
  --catalog-history-text-font-weight: var(--font-weight-regular);
@@ -456,12 +494,15 @@ export const catalog = css`
456
494
  --catalog-history-pill-padding-horizontal: var(--spacing-xs);
457
495
  --catalog-history-pill-border-color: var(--border-color-primary);
458
496
  --catalog-history-pill-border-radius: 12px;
459
- --catalog-history-pill-icon-size: 14px;
497
+ --catalog-history-pill-icon-size: 16px;
460
498
  --catalog-history-pill-icon-color: var(--color-green-8);
461
499
  --catalog-history-pill-font-family: var(--font-family-base);
462
500
  --catalog-history-pill-font-size: var(--font-size-base);
463
501
  --catalog-history-pill-line-height: var(--line-height-base);
464
502
  --catalog-history-pill-text-color: var(--text-color-primary);
503
+ --catalog-history-pill-min-width: calc(100% - 118px - var(--catalog-history-item-gap));
504
+
505
+
465
506
  // @tokens End
466
507
 
467
508
  /**
@@ -474,7 +515,7 @@ export const catalog = css`
474
515
  --catalog-history-sidebar-header-padding: var(--spacing-base) var(--spacing-sm) var(--spacing-base);
475
516
  --catalog-history-sidebar-header-font-family: var(--font-family-base);
476
517
  --catalog-history-sidebar-header-font-size: var(--font-size-base);
477
- --catalog-history-sidebar-header-font-weight: var(--font-weight-semibold);
518
+ --catalog-history-sidebar-header-font-weight: var(--font-weight-regular);
478
519
  --catalog-history-sidebar-header-line-height: var(--line-height-base);
479
520
  --catalog-history-sidebar-header-letter-spacing: 0;
480
521
  --catalog-history-sidebar-header-color: var(--text-color-primary);
@@ -511,6 +552,7 @@ export const catalog = css`
511
552
  --catalog-history-sidebar-version-date-color: var(--color-warm-grey-7);
512
553
 
513
554
  --catalog-history-sidebar-revisions-padding-left: 40px;
555
+ --catalog-history-sidebar-revisions-padding-bottom: var(--spacing-base);
514
556
 
515
557
  --catalog-history-sidebar-revision-item-padding: var(--spacing-xs) var(--spacing-sm);
516
558
  --catalog-history-sidebar-revision-item-border-radius: var(--border-radius-md);
@@ -14,7 +14,7 @@ export const filter = css`
14
14
 
15
15
  --filter-options-padding-vertical: 0;
16
16
  --filter-options-padding-horizontal: 0;
17
- --filter-options-gap: var(--spacing-sm);
17
+ --filter-options-gap: var(--spacing-xs);
18
18
  --filter-options-max-height: 350px;
19
19
 
20
20
  --filter-option-font-size: var(--font-size-base);
@@ -35,4 +35,5 @@ export function LoadMore({
35
35
  const LoadMoreWrapper = styled.div`
36
36
  display: flex;
37
37
  justify-content: center;
38
+ margin-top: var(--spacing-xs);
38
39
  `;
@@ -142,6 +142,7 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
142
142
  <MenuItemWrapper
143
143
  data-component-name="Menu/MenuItem"
144
144
  className={generateClassName({ type, item, className })}
145
+ role="listitem"
145
146
  >
146
147
  {item.link ? (
147
148
  <MenuItemLink
@@ -137,8 +137,7 @@ const StyledDropdownMenuItem = styled(DropdownMenuItem)`
137
137
  & > a {
138
138
  display: inline-block;
139
139
  width: 100%;
140
- padding: var(--dropdown-menu-item-padding-vertical)
141
- var(--dropdown-menu-item-padding-horizontal);
140
+ padding: var(--dropdown-menu-item-padding-vertical) var(--dropdown-menu-item-padding-horizontal);
142
141
  }
143
142
  }
144
143
  `;
@@ -75,7 +75,7 @@ export function SearchDialog({
75
75
  onQuickFilterReset,
76
76
  } = useSearchFilter(filter, setFilter);
77
77
  const { addSearchHistoryItem } = useRecentSearches();
78
- const aiSearch = useAiSearch({ filter });
78
+ const aiSearch = useAiSearch({ filter: filter, product: product?.name });
79
79
  useModalScrollLock(true);
80
80
  const searchInputRef = useRef<HTMLInputElement>(null);
81
81
  const modalRef = useRef<HTMLDivElement>(null);
@@ -64,6 +64,7 @@ export const SidebarActions = ({
64
64
  }}
65
65
  size="small"
66
66
  variant="outlined"
67
+ aria-label={collapsedSidebar ? 'Show sidebar' : 'Hide sidebar'}
67
68
  icon={collapsedSidebar ? <SidePanelOpenIcon /> : <SidePanelCloseIcon />}
68
69
  />
69
70
  </Tooltip>
@@ -22,6 +22,7 @@ function TooltipComponent({
22
22
  dataTestId,
23
23
  disabled = false,
24
24
  arrowPosition = 'center',
25
+ onClick,
25
26
  }: PropsWithChildren<Props>): JSX.Element {
26
27
  const tooltipWrapperRef = useRef<HTMLDivElement | null>(null);
27
28
  const tooltipBodyRef = useRef<HTMLDivElement | null>(null);
@@ -47,7 +48,10 @@ function TooltipComponent({
47
48
  ? {
48
49
  onMouseEnter: handleOpen,
49
50
  onMouseLeave: handleClose,
50
- onClick: handleClose,
51
+ onClick: (e: React.MouseEvent<HTMLDivElement>) => {
52
+ onClick?.(e);
53
+ handleClose();
54
+ },
51
55
  onFocus: handleOpen,
52
56
  onBlur: handleClose,
53
57
  }
@@ -18,6 +18,7 @@ function TooltipComponent({
18
18
  dataTestId,
19
19
  disabled = false,
20
20
  arrowPosition = 'center',
21
+ onClick,
21
22
  }: PropsWithChildren<TooltipProps>): JSX.Element {
22
23
  const ref = useRef<HTMLDivElement | null>(null);
23
24
  const { isOpened, handleOpen, handleClose } = useControl(isOpen);
@@ -98,7 +99,10 @@ function TooltipComponent({
98
99
  !disabled && {
99
100
  onMouseEnter: handleOpen,
100
101
  onMouseLeave: handleClose,
101
- onClick: handleClose,
102
+ onClick: (e: React.MouseEvent<HTMLDivElement>) => {
103
+ onClick?.(e);
104
+ handleClose();
105
+ },
102
106
  onFocus: handleOpen,
103
107
  onBlur: handleClose,
104
108
  };
@@ -121,9 +121,7 @@ const StyledDropdown = styled(Dropdown).attrs(() => ({
121
121
  --dropdown-menu-item-bg-color-active: var(--user-menu-dropdown-item-bg-color-active);
122
122
  --dropdown-menu-item-bg-color-hover: var(--user-menu-dropdown-item-bg-color-hover);
123
123
  --dropdown-menu-item-bg-color-disabled: var(--user-menu-dropdown-item-bg-color-disabled);
124
- --dropdown-menu-item-separator-border-color: var(
125
- --user-menu-dropdown-item-separator-border-color
126
- );
124
+ --dropdown-menu-item-separator-border-color: var(--user-menu-dropdown-item-separator-border-color);
127
125
  --dropdown-menu-item-color-dangerous: var(--user-menu-dropdown-item-color-dangerous);
128
126
  --dropdown-menu-item-color-disabled: var(--user-menu-dropdown-item-color-disabled);
129
127
  --dropdown-menu-item-color-active: var(--user-menu-dropdown-item-color-active);
@@ -26,7 +26,7 @@ type Params = {
26
26
 
27
27
  export function useCodeWalkthrough({ steps, attributes, root }: Params): WalkthroughState {
28
28
  const { filters, filesets, inputs, toggles, __idx } = attributes;
29
- /*
29
+ /*
30
30
  We only enable deep linking for the first CodeWalkthrough,
31
31
  because we don't expect more than one on the same page.
32
32
  Any subsequent walkthroughs have it disabled to avoid
@@ -49,3 +49,4 @@ export * from './catalog/use-catalog-entity-details';
49
49
  export * from './catalog/use-catalog-entity-schema';
50
50
  export * from './catalog/use-catalog-table-header-cell-actions';
51
51
  export * from './use-store';
52
+ export * from './use-is-truncated';
@@ -0,0 +1,20 @@
1
+ import { useRef, useState, useLayoutEffect } from 'react';
2
+
3
+ export function useIsTruncated<T extends HTMLElement>(
4
+ content: string | null,
5
+ ): [React.RefObject<T | null>, boolean] {
6
+ const ref = useRef<T | null>(null);
7
+ const [isTruncated, setIsTruncated] = useState(false);
8
+
9
+ useLayoutEffect(() => {
10
+ const el = ref.current;
11
+
12
+ if (!el) {
13
+ setIsTruncated(false);
14
+ } else {
15
+ setIsTruncated(el.scrollWidth > el.clientWidth);
16
+ }
17
+ }, [content]);
18
+
19
+ return [ref, isTruncated];
20
+ }
@@ -1,5 +1,5 @@
1
1
  import { useCallback, useRef, useState, useEffect, useMemo } from 'react';
2
- import { useSearchParams } from 'react-router-dom';
2
+ import { useLocation, useNavigate } from 'react-router-dom';
3
3
 
4
4
  type UseTabsProps = {
5
5
  activeTab: string;
@@ -284,48 +284,67 @@ export function useTabs({
284
284
  }
285
285
 
286
286
  export const useActiveTab = ({ initialTab, tabsId }: UseActiveTabProps) => {
287
- const [searchParams, setSearchParams] = useSearchParams();
288
- const initialTabValue = useMemo(
289
- () => getInitialTab({ initialTab, searchParams, tabsId }),
290
- // eslint-disable-next-line react-hooks/exhaustive-deps
291
- [],
292
- );
293
- const [activeTab, setActiveTab] = useState(initialTabValue);
294
- const prevActiveTabRef = useRef(activeTab);
287
+ const location = useLocation();
288
+ const navigate = useNavigate();
289
+ const [activeTab, setActiveTab] = useState<string | undefined>(undefined);
290
+ const resolvedActiveTab = activeTab ?? initialTab;
291
+ const prevActiveTabRef = useRef(resolvedActiveTab);
292
+
293
+ useEffect(() => {
294
+ if (activeTab !== undefined) {
295
+ return;
296
+ }
297
+
298
+ setActiveTab(getInitialTab({ initialTab, hash: location.hash, tabsId }));
299
+ }, [activeTab, initialTab, location.hash, tabsId]);
295
300
 
296
301
  useEffect(() => {
297
- const hasActiveTabChanged = prevActiveTabRef.current !== activeTab;
302
+ const hasActiveTabChanged = prevActiveTabRef.current !== resolvedActiveTab;
298
303
  if (!tabsId || !hasActiveTabChanged) {
299
304
  return;
300
305
  }
301
306
 
302
- prevActiveTabRef.current = activeTab;
307
+ prevActiveTabRef.current = resolvedActiveTab;
308
+ const nextHashParams = new URLSearchParams(
309
+ location.hash.startsWith('#') ? location.hash.slice(1) : location.hash,
310
+ );
311
+ nextHashParams.set(tabsId, resolvedActiveTab);
312
+ const nextHash = `#${nextHashParams.toString()}`;
303
313
 
304
- setSearchParams((searchParams) => {
305
- searchParams.set(tabsId, activeTab);
306
- return searchParams;
307
- });
308
- }, [activeTab, setSearchParams, tabsId]);
314
+ if (nextHash === location.hash) {
315
+ return;
316
+ }
317
+
318
+ navigate(
319
+ {
320
+ pathname: location.pathname,
321
+ search: location.search,
322
+ hash: nextHash,
323
+ },
324
+ { replace: true },
325
+ );
326
+ }, [resolvedActiveTab, navigate, location.pathname, location.search, location.hash, tabsId]);
309
327
 
310
328
  return useMemo(
311
329
  () => ({
312
- activeTab,
330
+ activeTab: resolvedActiveTab,
313
331
  setActiveTab,
314
332
  }),
315
- [activeTab],
333
+ [resolvedActiveTab],
316
334
  );
317
335
  };
318
336
 
319
337
  type GetInitialTabProps = {
320
338
  initialTab: string;
321
- searchParams: URLSearchParams;
339
+ hash: string;
322
340
  tabsId?: string;
323
341
  };
324
342
 
325
- const getInitialTab = ({ initialTab, searchParams, tabsId }: GetInitialTabProps) => {
343
+ const getInitialTab = ({ initialTab, hash, tabsId }: GetInitialTabProps): string => {
344
+ const hashParams = new URLSearchParams(hash.startsWith('#') ? hash.slice(1) : hash);
326
345
  let resultTab = initialTab;
327
346
  if (tabsId) {
328
- const tabFromUrl = searchParams.get(tabsId);
347
+ const tabFromUrl = hashParams.get(tabsId);
329
348
  resultTab = tabFromUrl ? tabFromUrl : resultTab;
330
349
  }
331
350
  return resultTab;
@@ -117,7 +117,7 @@ export type ThemeHooks = {
117
117
  advancedSearch?: boolean;
118
118
  askAi?: boolean;
119
119
  };
120
- useAiSearch: (options?: { filter?: SearchFilterItem[] }) => {
120
+ useAiSearch: (options?: { filter?: SearchFilterItem[]; product?: string }) => {
121
121
  askQuestion: (question: string, history?: AiSearchConversationItem[]) => void;
122
122
  isGeneratingResponse: boolean;
123
123
  question: string;
@@ -160,6 +160,7 @@ export type TranslationKey =
160
160
  | 'catalog.entity.schema.title'
161
161
  | 'catalog.entity.properties.apiDescription.title'
162
162
  | 'catalog.backToAllLabel'
163
+ | 'catalog.notConnected'
163
164
  | 'catalog.tags.more'
164
165
  | 'catalog.tags.label'
165
166
  | 'catalog.sort'
@@ -179,6 +180,7 @@ export type TranslationKey =
179
180
  | 'catalog.history.sidebar.title'
180
181
  | 'catalog.history.sidebar.close'
181
182
  | 'catalog.history.version.label'
183
+ | 'catalog.filters.close'
182
184
  | 'catalog.history.version.notSpecified'
183
185
  | 'catalog.history.version.default'
184
186
  | 'catalog.history.revisions.limitMessage'
@@ -275,6 +277,7 @@ export type TranslationKey =
275
277
  | 'openapi.actions.hide'
276
278
  | 'openapi.actions.more'
277
279
  | 'openapi.languages.title'
280
+ | 'openapi.languages.moreButton.tooltipText'
278
281
  | 'openapi.servers.title'
279
282
  | 'openapi.operations'
280
283
  | 'openapi.webhooks'
@@ -395,6 +398,10 @@ export type TranslationKey =
395
398
  | 'graphql.sample'
396
399
  | 'graphql.referenced'
397
400
  | 'graphql.content.fragment'
401
+ | 'button.copy.tooltipText'
402
+ | 'button.download.tooltipText'
403
+ | 'button.externalLink.tooltipText'
404
+ | 'button.email.tooltipText'
398
405
  | 'codeWalkthrough.download'
399
406
  | 'codeWalkthrough.preview'
400
407
  | 'time.justNow'
@@ -11,4 +11,5 @@ export type TooltipProps = {
11
11
  dataTestId?: string;
12
12
  disabled?: boolean;
13
13
  arrowPosition?: 'top' | 'bottom' | 'left' | 'right' | 'center';
14
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
14
15
  };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Converts a string to title case for catalog option labels.
3
+ * Splits on whitespace, hyphens, and underscores; capitalizes each word.
4
+ * The first word is rendered as "API" when it is "api" (case-insensitive).
5
+ *
6
+ * @param str - The raw string to format (e.g. from config or entity data).
7
+ * @returns The formatted label with words capitalized and joined by spaces.
8
+ *
9
+ * @example
10
+ * customCatalogOptionsCasing('api_spec') // 'API Spec'
11
+ * customCatalogOptionsCasing('my-custom-option') // 'My Custom Option'
12
+ * customCatalogOptionsCasing('user name') // 'User Name'
13
+ * customCatalogOptionsCasing(' api version ') // 'API Version'
14
+ */
15
+ export function customCatalogOptionsCasing(str: string): string {
16
+ const trimmedStr = str.trim();
17
+ if (!trimmedStr) return trimmedStr;
18
+
19
+ const words = trimmedStr.split(/[\s-_]+/);
20
+
21
+ return words
22
+ .map((word, index) => {
23
+ if (index === 0 && word.toLowerCase() === 'api') {
24
+ return 'API';
25
+ }
26
+ return word[0].toUpperCase() + word.slice(1);
27
+ })
28
+ .join(' ');
29
+ }
@@ -44,3 +44,4 @@ export * from './frontmatter-translate';
44
44
  export * from './transform-revisions-to-version-history';
45
45
  export * from './build-revision-url';
46
46
  export * from './content-segments';
47
+ export * from './custom-catalog-options-casing';
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from '@redocly/theme/components/Buttons/CopyButton';
33
33
  export * from '@redocly/theme/components/Buttons/EditPageButton';
34
34
  export * from '@redocly/theme/components/Buttons/EmailButton';
35
35
  export * from '@redocly/theme/components/Buttons/NewTabButton';
36
+ export * from '@redocly/theme/components/Buttons/DownloadButton';
36
37
  export * from '@redocly/theme/components/Buttons/AIAssistantButton';
37
38
  /* Markdown */
38
39
  export * from '@redocly/theme/components/Markdown/Markdown';
@@ -30,12 +30,8 @@ export function MarkdocExample(props: MarkdocExampleProps) {
30
30
  <div data-component-name="Markdoc/MarkdocExample/MarkdocExample">
31
31
  {renderLabels ? <Label>{codeLabel ? codeLabel : 'Code:'}</Label> : null}
32
32
  <CodeBlock lang={language} source={rawContent} header={{ title, controls: { copy: {} } }} />
33
- {renderDemo ? (
34
- <>
35
- {renderLabels ? <Label>{resultLabel ? resultLabel : 'Result:'}</Label> : null}
36
- {...demoContent}
37
- </>
38
- ) : null}
33
+ {renderDemo ? <>{renderLabels ? <Label>{resultLabel ? resultLabel : 'Result:'}</Label> : null}
34
+ {...demoContent}</> : null}
39
35
  </div>
40
36
  );
41
37
  }