@redocly/theme 0.70.0-next.2 → 0.70.0-next.4

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 (155) hide show
  1. package/lib/components/Catalog/Catalog.js +1 -1
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.js +2 -2
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +1 -1
  4. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.js +1 -1
  5. package/lib/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.js +2 -2
  6. package/lib/components/CodeBlock/CodeBlockControls.js +3 -5
  7. package/lib/components/Consent/Consent.d.ts +2 -0
  8. package/lib/components/Consent/Consent.js +17 -0
  9. package/lib/components/Consent/ConsentBanner.d.ts +2 -0
  10. package/lib/components/Consent/ConsentBanner.js +120 -0
  11. package/lib/components/Consent/ConsentDialog.d.ts +2 -0
  12. package/lib/components/Consent/ConsentDialog.js +128 -0
  13. package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
  14. package/lib/components/Consent/ConsentSettingsLink.js +35 -0
  15. package/lib/components/Consent/variables.d.ts +1 -0
  16. package/lib/components/Consent/variables.js +31 -0
  17. package/lib/components/Dropdown/Dropdown.js +3 -1
  18. package/lib/components/Footer/Footer.js +4 -1
  19. package/lib/components/JsonViewer/Helpers.d.ts +10 -2
  20. package/lib/components/JsonViewer/Helpers.js +29 -33
  21. package/lib/components/JsonViewer/JsonViewer.js +15 -18
  22. package/lib/components/Markdown/Markdown.js +3 -2
  23. package/lib/components/Markdown/styles/base-table.js +14 -1
  24. package/lib/components/Markdown/variables.js +1 -0
  25. package/lib/components/Menu/Menu.js +4 -0
  26. package/lib/components/Menu/MenuSelect.d.ts +7 -0
  27. package/lib/components/Menu/MenuSelect.js +129 -0
  28. package/lib/components/Menu/variables.js +43 -4
  29. package/lib/components/Navbar/Navbar.js +44 -5
  30. package/lib/components/Navbar/variables.js +3 -0
  31. package/lib/components/NavigationTabs/NavigationTab.d.ts +7 -0
  32. package/lib/components/NavigationTabs/NavigationTab.js +93 -0
  33. package/lib/components/NavigationTabs/NavigationTabContent.d.ts +7 -0
  34. package/lib/components/NavigationTabs/NavigationTabContent.js +50 -0
  35. package/lib/components/NavigationTabs/NavigationTabMenu.d.ts +7 -0
  36. package/lib/components/NavigationTabs/NavigationTabMenu.js +18 -0
  37. package/lib/components/NavigationTabs/NavigationTabs.d.ts +7 -0
  38. package/lib/components/NavigationTabs/NavigationTabs.js +97 -0
  39. package/lib/components/NavigationTabs/variables.d.ts +1 -0
  40. package/lib/components/NavigationTabs/variables.js +37 -0
  41. package/lib/components/Product/utils.js +1 -1
  42. package/lib/components/Search/SearchAiMessage.js +1 -1
  43. package/lib/components/Search/SearchAiResponse.js +1 -0
  44. package/lib/components/Search/SearchTrigger.js +8 -2
  45. package/lib/components/Sidebar/Sidebar.js +2 -2
  46. package/lib/components/TableOfContent/TableOfContent.js +2 -2
  47. package/lib/core/constants/common.d.ts +1 -0
  48. package/lib/core/constants/common.js +1 -0
  49. package/lib/core/constants/consent.d.ts +2 -0
  50. package/lib/core/constants/consent.js +30 -0
  51. package/lib/core/constants/index.d.ts +1 -0
  52. package/lib/core/constants/index.js +1 -0
  53. package/lib/core/hooks/index.d.ts +3 -0
  54. package/lib/core/hooks/index.js +3 -0
  55. package/lib/core/hooks/menu/use-mobile-menu-items.js +75 -51
  56. package/lib/core/hooks/menu/use-mobile-menu-levels.js +12 -7
  57. package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
  58. package/lib/core/hooks/use-consent-dialog.js +36 -0
  59. package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
  60. package/lib/core/hooks/use-consent-telemetry.js +42 -0
  61. package/lib/core/hooks/use-scroll-item-into-view.d.ts +2 -0
  62. package/lib/core/hooks/use-scroll-item-into-view.js +16 -0
  63. package/lib/core/hooks/use-theme-hooks.js +16 -0
  64. package/lib/core/styles/global.js +54 -42
  65. package/lib/core/types/consent.d.ts +54 -0
  66. package/lib/core/types/consent.js +3 -0
  67. package/lib/core/types/hooks.d.ts +7 -0
  68. package/lib/core/types/index.d.ts +2 -0
  69. package/lib/core/types/l10n.d.ts +1 -1
  70. package/lib/core/types/navigation-tabs.d.ts +49 -0
  71. package/lib/core/types/navigation-tabs.js +3 -0
  72. package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
  73. package/lib/core/utils/consent-settings-link-placement.js +15 -0
  74. package/lib/core/utils/index.d.ts +2 -0
  75. package/lib/core/utils/index.js +2 -0
  76. package/lib/core/utils/mcp.js +1 -1
  77. package/lib/core/utils/menu.d.ts +4 -0
  78. package/lib/core/utils/menu.js +48 -8
  79. package/lib/core/utils/navigation-tabs.d.ts +8 -0
  80. package/lib/core/utils/navigation-tabs.js +71 -0
  81. package/lib/core/utils/urls.js +3 -1
  82. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
  83. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
  84. package/lib/index.d.ts +6 -0
  85. package/lib/index.js +8 -1
  86. package/lib/layouts/PageLayout.js +1 -1
  87. package/lib/layouts/RootLayout.js +2 -2
  88. package/lib/markdoc/components/CodeWalkthrough/CodeFilters.js +1 -1
  89. package/lib/markdoc/components/CodeWalkthrough/CodePanel.js +3 -3
  90. package/lib/markdoc/components/CodeWalkthrough/CodeWalkthrough.js +1 -1
  91. package/package.json +3 -3
  92. package/src/components/Catalog/Catalog.tsx +1 -1
  93. package/src/components/Catalog/CatalogEntity/CatalogEntityHistory/CatalogEntityHistorySidebar.tsx +2 -2
  94. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +1 -1
  95. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanel.tsx +1 -1
  96. package/src/components/Catalog/CatalogMobileFiltersPanel/CatalogMobileFiltersPanelOverlay.tsx +2 -2
  97. package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
  98. package/src/components/Consent/Consent.tsx +18 -0
  99. package/src/components/Consent/ConsentBanner.tsx +110 -0
  100. package/src/components/Consent/ConsentDialog.tsx +210 -0
  101. package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
  102. package/src/components/Consent/variables.ts +28 -0
  103. package/src/components/Dropdown/Dropdown.tsx +4 -1
  104. package/src/components/Footer/Footer.tsx +2 -0
  105. package/src/components/JsonViewer/Helpers.tsx +46 -51
  106. package/src/components/JsonViewer/JsonViewer.tsx +23 -25
  107. package/src/components/Markdown/Markdown.tsx +3 -2
  108. package/src/components/Markdown/styles/base-table.ts +14 -1
  109. package/src/components/Markdown/variables.ts +1 -0
  110. package/src/components/Menu/Menu.tsx +5 -0
  111. package/src/components/Menu/MenuSelect.tsx +198 -0
  112. package/src/components/Menu/variables.ts +43 -4
  113. package/src/components/Navbar/Navbar.tsx +22 -5
  114. package/src/components/Navbar/variables.ts +3 -0
  115. package/src/components/NavigationTabs/NavigationTab.tsx +148 -0
  116. package/src/components/NavigationTabs/NavigationTabContent.tsx +66 -0
  117. package/src/components/NavigationTabs/NavigationTabMenu.tsx +40 -0
  118. package/src/components/NavigationTabs/NavigationTabs.tsx +83 -0
  119. package/src/components/NavigationTabs/variables.ts +34 -0
  120. package/src/components/Product/utils.ts +1 -1
  121. package/src/components/Search/SearchAiMessage.tsx +1 -1
  122. package/src/components/Search/SearchAiResponse.tsx +1 -0
  123. package/src/components/Search/SearchTrigger.tsx +11 -2
  124. package/src/components/Sidebar/Sidebar.tsx +2 -2
  125. package/src/components/TableOfContent/TableOfContent.tsx +2 -2
  126. package/src/core/constants/common.ts +1 -0
  127. package/src/core/constants/consent.ts +29 -0
  128. package/src/core/constants/index.ts +1 -0
  129. package/src/core/hooks/__mocks__/use-theme-hooks.ts +17 -0
  130. package/src/core/hooks/index.ts +3 -0
  131. package/src/core/hooks/menu/use-mobile-menu-items.ts +91 -56
  132. package/src/core/hooks/menu/use-mobile-menu-levels.ts +14 -6
  133. package/src/core/hooks/use-consent-dialog.ts +51 -0
  134. package/src/core/hooks/use-consent-telemetry.ts +56 -0
  135. package/src/core/hooks/use-scroll-item-into-view.ts +18 -0
  136. package/src/core/hooks/use-theme-hooks.ts +16 -0
  137. package/src/core/styles/global.ts +14 -2
  138. package/src/core/types/consent.ts +51 -0
  139. package/src/core/types/hooks.ts +7 -0
  140. package/src/core/types/index.ts +2 -0
  141. package/src/core/types/l10n.ts +25 -1
  142. package/src/core/types/navigation-tabs.ts +54 -0
  143. package/src/core/utils/consent-settings-link-placement.ts +18 -0
  144. package/src/core/utils/index.ts +2 -0
  145. package/src/core/utils/mcp.ts +1 -1
  146. package/src/core/utils/menu.ts +54 -9
  147. package/src/core/utils/navigation-tabs.ts +99 -0
  148. package/src/core/utils/urls.ts +3 -1
  149. package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
  150. package/src/index.ts +7 -0
  151. package/src/layouts/PageLayout.tsx +1 -1
  152. package/src/layouts/RootLayout.tsx +2 -2
  153. package/src/markdoc/components/CodeWalkthrough/CodeFilters.tsx +1 -1
  154. package/src/markdoc/components/CodeWalkthrough/CodePanel.tsx +3 -3
  155. package/src/markdoc/components/CodeWalkthrough/CodeWalkthrough.tsx +1 -1
@@ -1,24 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildVersionSection = exports.buildLanguagesGroup = exports.isItemActive = exports.mapNavbarItems = void 0;
3
+ exports.buildNavigationTabsSelect = exports.buildVersionSection = exports.buildLanguagesGroup = exports.isItemActive = exports.mapNavbarItems = void 0;
4
4
  exports.getMenuItemType = getMenuItemType;
5
5
  const common_1 = require("../constants/common");
6
6
  const urls_1 = require("./urls");
7
+ const navigation_tabs_1 = require("./navigation-tabs");
7
8
  const TRANSLATION_KEYS = {
8
9
  version: 'mobileMenu.version',
9
10
  };
10
11
  const mapNavbarItems = (items, defaultLocale, currentLocale, locales, location) => {
11
- return items.map((navItem) => { var _a; return (Object.assign(Object.assign(Object.assign(Object.assign({}, navItem), (navItem.items && {
12
+ return items.map((navItem) => { var _a; return (Object.assign(Object.assign(Object.assign({}, navItem), (navItem.items && {
12
13
  items: (0, exports.mapNavbarItems)(navItem.items, defaultLocale, currentLocale, locales, location),
13
- })), ('link' in navItem && { link: navItem.link || '/' })), { active: 'link' in navItem &&
14
- (0, exports.isItemActive)(navItem, defaultLocale, currentLocale, locales, location), hasActiveSubItem: !!((_a = navItem.items) === null || _a === void 0 ? void 0 : _a.find((item) => (0, exports.isItemActive)(item, defaultLocale, currentLocale, locales, location))) })); });
14
+ })), { active: (0, exports.isItemActive)(navItem, defaultLocale, currentLocale, locales, location), hasActiveSubItem: !!((_a = navItem.items) === null || _a === void 0 ? void 0 : _a.find((item) => (0, exports.isItemActive)(item, defaultLocale, currentLocale, locales, location))) })); });
15
15
  };
16
16
  exports.mapNavbarItems = mapNavbarItems;
17
17
  const isItemActive = (item, defaultLocale, currentLocale, locales, location) => {
18
+ if (!item.link)
19
+ return false;
18
20
  const pathHash = location.pathname + location.hash;
19
21
  const link = item.languageInsensitive
20
- ? item.link || ''
21
- : (0, urls_1.getPathnameForLocale)(item.link || '/', defaultLocale, currentLocale, locales);
22
+ ? item.link
23
+ : (0, urls_1.getPathnameForLocale)(item.link, defaultLocale, currentLocale, locales);
22
24
  return pathHash === (0, urls_1.withPathPrefix)(link);
23
25
  };
24
26
  exports.isItemActive = isItemActive;
@@ -34,7 +36,7 @@ const buildLanguagesGroup = (locales, defaultLocale, currentLocale) => {
34
36
  .filter((locale) => locale.code !== currentLocale)
35
37
  .map((locale) => {
36
38
  const newLangPathname = (0, urls_1.getPathnameForLocale)((0, urls_1.withoutPathPrefix)(location.pathname), defaultLocale, locale.code, locales);
37
- const newUrlWithLanguage = `${newLangPathname}${location.search}${location.hash}`;
39
+ const newUrlWithLanguage = `${(0, urls_1.addLeadingSlash)(newLangPathname)}${location.search}${location.hash}`;
38
40
  return {
39
41
  type: 'link',
40
42
  label: locale.name || locale.code || '',
@@ -71,9 +73,30 @@ const buildVersionSection = (translate, versions, activeVersion) => {
71
73
  ];
72
74
  };
73
75
  exports.buildVersionSection = buildVersionSection;
76
+ const buildNavigationTabsSelect = ({ navigationTabs, }) => {
77
+ var _a;
78
+ var _b;
79
+ const tabs = (_a = (0, navigation_tabs_1.toNavigationTabsConfig)({ state: navigationTabs })) === null || _a === void 0 ? void 0 : _a.items;
80
+ if (!tabs) {
81
+ return;
82
+ }
83
+ const activeTab = tabs.find((tab) => tab.active);
84
+ return {
85
+ type: common_1.MenuItemType.Select,
86
+ label: (_b = activeTab === null || activeTab === void 0 ? void 0 : activeTab.label) !== null && _b !== void 0 ? _b : 'Navigation tabs',
87
+ labelTranslationKey: activeTab ? activeTab.labelTranslationKey : 'navigationTabs.label',
88
+ items: tabs.map(toNavigationTabOption),
89
+ active: false,
90
+ hasActiveSubItem: !!activeTab,
91
+ };
92
+ };
93
+ exports.buildNavigationTabsSelect = buildNavigationTabsSelect;
74
94
  function getMenuItemType(item) {
75
95
  var _a, _b;
76
- if (item.type === common_1.MenuItemType.Separator) {
96
+ if (item.type === common_1.MenuItemType.Select) {
97
+ return common_1.MenuItemType.Select;
98
+ }
99
+ else if (item.type === common_1.MenuItemType.Separator) {
77
100
  return common_1.MenuItemType.Separator;
78
101
  }
79
102
  else if (item.menuStyle === 'drilldown') {
@@ -88,4 +111,21 @@ function getMenuItemType(item) {
88
111
  else
89
112
  return common_1.MenuItemType.Default;
90
113
  }
114
+ function toNavigationTabOption(tab) {
115
+ var _a;
116
+ const landing = tab.type === 'group' ? ((_a = tab.items.find((entry) => entry.active)) !== null && _a !== void 0 ? _a : tab.items[0]) : tab;
117
+ return {
118
+ type: tab.type,
119
+ label: tab.label,
120
+ labelTranslationKey: tab.labelTranslationKey,
121
+ icon: tab.icon,
122
+ srcSet: tab.srcSet,
123
+ link: landing === null || landing === void 0 ? void 0 : landing.link,
124
+ external: landing === null || landing === void 0 ? void 0 : landing.external,
125
+ target: landing === null || landing === void 0 ? void 0 : landing.target,
126
+ items: [],
127
+ active: !!tab.active,
128
+ hasActiveSubItem: false,
129
+ };
130
+ }
91
131
  //# sourceMappingURL=menu.js.map
@@ -0,0 +1,8 @@
1
+ import type { ThemeHooks } from '../types/hooks';
2
+ import type { NavigationTabsConfig, NavigationTabsState } from '../types/navigation-tabs';
3
+ type NavbarItemClickedPayload = Parameters<ReturnType<ThemeHooks['useTelemetry']>['sendNavbarMenuItemClickedMessage']>[0];
4
+ export declare function toNavigationTabsConfig({ state, }: {
5
+ state: NavigationTabsState | undefined;
6
+ }): NavigationTabsConfig | undefined;
7
+ export declare function getNavbarItemClickedPayload(type: 'link' | 'group'): NavbarItemClickedPayload;
8
+ export {};
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.toNavigationTabsConfig = toNavigationTabsConfig;
15
+ exports.getNavbarItemClickedPayload = getNavbarItemClickedPayload;
16
+ const get_base_data_attributes_1 = require("./telemetry/get-base-data-attributes");
17
+ function toNavigationTabsConfig({ state, }) {
18
+ const items = toNavigationTabEntries(state).map((entry) => entry.kind === 'menu'
19
+ ? {
20
+ type: 'group',
21
+ label: entry.tab.label,
22
+ labelTranslationKey: entry.tab.labelTranslationKey,
23
+ icon: entry.tab.icon,
24
+ srcSet: entry.tab.srcSet,
25
+ items: entry.entries.map((_a) => {
26
+ var { active } = _a, link = __rest(_a, ["active"]);
27
+ return toRowLink(link, active);
28
+ }),
29
+ active: entry.active,
30
+ }
31
+ : toRowLink(entry.link, entry.active));
32
+ return items.length ? { items } : undefined;
33
+ }
34
+ function getNavbarItemClickedPayload(type) {
35
+ return [
36
+ Object.assign(Object.assign({}, (0, get_base_data_attributes_1.getBaseDataAttributes)('navbarItem', 'navbar')), { type }),
37
+ ];
38
+ }
39
+ function toNavigationTabEntries(state) {
40
+ if (!(state === null || state === void 0 ? void 0 : state.tabs.length))
41
+ return [];
42
+ return state.tabs.flatMap((tab) => {
43
+ var _a;
44
+ const active = ((_a = state.activeTab) === null || _a === void 0 ? void 0 : _a.tabId) === tab.tabId;
45
+ if (tab.menu) {
46
+ const entries = tab.menu
47
+ .filter((menuEntry) => !!menuEntry.link)
48
+ .map((_a) => { var _b; var { tabId } = _a, link = __rest(_a, ["tabId"]); return (Object.assign(Object.assign({}, link), { active: active && tabId === ((_b = state.activeMenuEntry) === null || _b === void 0 ? void 0 : _b.tabId) })); });
49
+ return entries.length ? [{ kind: 'menu', tab, entries, active }] : [];
50
+ }
51
+ if (!tab.link)
52
+ return [];
53
+ return [
54
+ {
55
+ kind: 'link',
56
+ link: {
57
+ label: tab.label,
58
+ labelTranslationKey: tab.labelTranslationKey,
59
+ link: tab.link,
60
+ icon: tab.icon,
61
+ srcSet: tab.srcSet,
62
+ },
63
+ active,
64
+ },
65
+ ];
66
+ });
67
+ }
68
+ function toRowLink(link, active) {
69
+ return Object.assign(Object.assign({ type: 'link' }, link), { active });
70
+ }
71
+ //# sourceMappingURL=navigation-tabs.js.map
@@ -18,7 +18,9 @@ const common_1 = require("../constants/common");
18
18
  function combineUrls(baseURL, ...relativeURLs) {
19
19
  let res = baseURL;
20
20
  for (let relativeURL of relativeURLs) {
21
- res = relativeURL ? res.replace(/[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '') : res;
21
+ res = relativeURL
22
+ ? res.replace(/(?<![/\\])[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '')
23
+ : res;
22
24
  }
23
25
  return res;
24
26
  }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ declare const Icon: (props: IconProps) => React.JSX.Element;
4
+ export declare const ExpandCollapseIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<{
5
+ color?: string;
6
+ size?: string;
7
+ className?: string;
8
+ 'data-component-name'?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
10
+ color?: string;
11
+ size?: string;
12
+ className?: string;
13
+ 'data-component-name'?: string;
14
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
15
+ $collapse?: boolean;
16
+ }, "data-component-name"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<{
17
+ color?: string;
18
+ size?: string;
19
+ className?: string;
20
+ 'data-component-name'?: string;
21
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
22
+ color?: string;
23
+ size?: string;
24
+ className?: string;
25
+ 'data-component-name'?: string;
26
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
27
+ $collapse?: boolean;
28
+ }, "data-component-name">>> & string & Omit<typeof Icon, keyof React.Component<any, {}, any>>;
29
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ExpandCollapseIcon = void 0;
40
+ const react_1 = __importDefault(require("react"));
41
+ const styled_components_1 = __importStar(require("styled-components"));
42
+ const utils_1 = require("../../core/utils");
43
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
44
+ react_1.default.createElement("path", { className: "corner-top", d: "M12.2432 8.70703H11.2461L11.2422 4.75781L7.29297 4.75391V3.75781H12.2432V8.70703Z" }),
45
+ react_1.default.createElement("path", { className: "corner-bottom", d: "M4.75781 11.2422L8.70703 11.2461V12.2432H3.75781V7.29297H4.75391L4.75781 11.2422Z" })));
46
+ exports.ExpandCollapseIcon = (0, styled_components_1.default)(Icon).attrs({
47
+ 'data-component-name': 'icons/ExpandCollapseIcon/ExpandCollapseIcon',
48
+ }) `
49
+ path {
50
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
51
+ transform-box: view-box;
52
+ transition: transform 0.3s ease-in-out;
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ transition: none;
56
+ }
57
+ }
58
+
59
+ .corner-top {
60
+ transform-origin: 10.756px 5.244px;
61
+ }
62
+
63
+ .corner-bottom {
64
+ transform-origin: 5.244px 10.756px;
65
+ }
66
+
67
+ ${({ $collapse }) => $collapse &&
68
+ (0, styled_components_1.css) `
69
+ .corner-top {
70
+ transform: rotate(180deg);
71
+ }
72
+
73
+ .corner-bottom {
74
+ transform: rotate(-180deg);
75
+ }
76
+ `}
77
+
78
+ height: ${({ size }) => size || '16px'};
79
+ width: ${({ size }) => size || '16px'};
80
+ `;
81
+ //# sourceMappingURL=ExpandCollapseIcon.js.map
package/lib/index.d.ts CHANGED
@@ -46,6 +46,11 @@ export * from './components/Navbar/Navbar';
46
46
  export * from './components/Navbar/NavbarItem';
47
47
  export * from './components/Navbar/NavbarLogo';
48
48
  export * from './components/Navbar/NavbarMenu';
49
+ export * from './components/NavigationTabs/NavigationTabs';
50
+ export { NavigationTab } from './components/NavigationTabs/NavigationTab';
51
+ export type { NavigationTabProps } from './components/NavigationTabs/NavigationTab';
52
+ export * from './components/NavigationTabs/NavigationTabMenu';
53
+ export * from './components/NavigationTabs/NavigationTabContent';
49
54
  export * from './components/Footer/Footer';
50
55
  export * from './components/Footer/FooterColumn';
51
56
  export * from './components/Footer/FooterCopyright';
@@ -226,6 +231,7 @@ export * from './icons/LinkIcon/LinkIcon';
226
231
  export * from './icons/LaunchIcon/LaunchIcon';
227
232
  export * from './icons/MinimizeIcon/MinimizeIcon';
228
233
  export * from './icons/MaximizeIcon/MaximizeIcon';
234
+ export * from './icons/ExpandCollapseIcon/ExpandCollapseIcon';
229
235
  export * from './icons/MarkdownFullIcon/MarkdownFullIcon';
230
236
  export * from './icons/DocumentBlankIcon/DocumentBlankIcon';
231
237
  export * from './icons/WarningSquareIcon/WarningSquareIcon';
package/lib/index.js CHANGED
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.markdoc = void 0;
39
+ exports.markdoc = exports.NavigationTab = void 0;
40
40
  __exportStar(require("./core"), exports);
41
41
  __exportStar(require("./ext/configure"), exports);
42
42
  /* Components */
@@ -90,6 +90,12 @@ __exportStar(require("./components/Navbar/Navbar"), exports);
90
90
  __exportStar(require("./components/Navbar/NavbarItem"), exports);
91
91
  __exportStar(require("./components/Navbar/NavbarLogo"), exports);
92
92
  __exportStar(require("./components/Navbar/NavbarMenu"), exports);
93
+ /* NavigationTabs */
94
+ __exportStar(require("./components/NavigationTabs/NavigationTabs"), exports);
95
+ var NavigationTab_1 = require("./components/NavigationTabs/NavigationTab");
96
+ Object.defineProperty(exports, "NavigationTab", { enumerable: true, get: function () { return NavigationTab_1.NavigationTab; } });
97
+ __exportStar(require("./components/NavigationTabs/NavigationTabMenu"), exports);
98
+ __exportStar(require("./components/NavigationTabs/NavigationTabContent"), exports);
93
99
  /* Footer */
94
100
  __exportStar(require("./components/Footer/Footer"), exports);
95
101
  __exportStar(require("./components/Footer/FooterColumn"), exports);
@@ -289,6 +295,7 @@ __exportStar(require("./icons/LinkIcon/LinkIcon"), exports);
289
295
  __exportStar(require("./icons/LaunchIcon/LaunchIcon"), exports);
290
296
  __exportStar(require("./icons/MinimizeIcon/MinimizeIcon"), exports);
291
297
  __exportStar(require("./icons/MaximizeIcon/MaximizeIcon"), exports);
298
+ __exportStar(require("./icons/ExpandCollapseIcon/ExpandCollapseIcon"), exports);
292
299
  __exportStar(require("./icons/MarkdownFullIcon/MarkdownFullIcon"), exports);
293
300
  __exportStar(require("./icons/DocumentBlankIcon/DocumentBlankIcon"), exports);
294
301
  __exportStar(require("./icons/WarningSquareIcon/WarningSquareIcon"), exports);
@@ -16,7 +16,7 @@ function PageLayout({ sidebar, children, }) {
16
16
  const Container = styled_components_1.default.div `
17
17
  display: flex;
18
18
  flex-direction: row;
19
- min-height: calc(100vh - var(--navbar-height) - var(--banner-height));
19
+ min-height: calc(100vh - var(--navbar-offset));
20
20
 
21
21
  @media screen and (min-width: ${utils_1.breakpoints.max}) {
22
22
  max-width: var(--container-max-width);
@@ -11,8 +11,8 @@ const SkipContent_1 = require("../components/SkipContent/SkipContent");
11
11
  const AIAssistantButton_1 = require("../components/Buttons/AIAssistantButton");
12
12
  const hooks_1 = require("../core/hooks");
13
13
  function RootLayout({ children }) {
14
- const { useSearch } = (0, hooks_1.useThemeHooks)();
15
- const { askAi } = useSearch();
14
+ const { useSearchFeatures } = (0, hooks_1.useThemeHooks)();
15
+ const { askAi } = useSearchFeatures();
16
16
  return (react_1.default.createElement("div", { "data-component-name": "layouts/RootLayout" },
17
17
  react_1.default.createElement(SkipContent_1.SkipContent, null),
18
18
  react_1.default.createElement(Navbar_1.Navbar, null),
@@ -41,7 +41,7 @@ const FilterWrapper = styled_components_1.default.div `
41
41
  padding-right: var(--spacing-xl);
42
42
  padding-left: var(--spacing-xl);
43
43
  padding-bottom: var(--spacing-xs);
44
- top: var(--navbar-height);
44
+ top: var(--navbar-stack-height);
45
45
  background-color: var(--bg-color);
46
46
  z-index: var(--z-index-raised);
47
47
  max-width: var(--md-content-max-width);
@@ -68,9 +68,9 @@ const CodePanelWrapper = styled_components_1.default.div `
68
68
  border: 1px solid var(--code-panel-border-color);
69
69
  border-radius: var(--code-panel-border-radius);
70
70
  overflow: clip;
71
- --code-block-max-height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
72
- height: calc(100vh - var(--navbar-height) - 2 * var(--spacing-xl));
71
+ --code-block-max-height: calc(100vh - var(--navbar-stack-height) - 2 * var(--spacing-xl));
72
+ height: calc(100vh - var(--navbar-stack-height) - 2 * var(--spacing-xl));
73
73
  position: sticky;
74
- top: calc(var(--navbar-height) + var(--spacing-xl));
74
+ top: calc(var(--navbar-stack-height) + var(--spacing-xl));
75
75
  `;
76
76
  //# sourceMappingURL=CodePanel.js.map
@@ -95,7 +95,7 @@ const DocsPanel = styled_components_1.default.div `
95
95
  flex-direction: column;
96
96
 
97
97
  min-height: 0;
98
- min-height: calc(100vh - var(--navbar-height));
98
+ min-height: calc(100vh - var(--navbar-stack-height));
99
99
 
100
100
  padding-top: var(--spacing-xl);
101
101
  padding-right: var(--spacing-xs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.70.0-next.2",
3
+ "version": "0.70.0-next.4",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@babel/core": "7.29.7",
44
44
  "@markdoc/markdoc": "0.5.2",
45
- "@redocly/realm-asyncapi-sdk": "0.16.0-next.0",
45
+ "@redocly/realm-asyncapi-sdk": "0.16.0-next.2",
46
46
  "@shikijs/types": "3.21.0",
47
47
  "@testing-library/react": "16.3.0",
48
48
  "@testing-library/user-event": "14.6.1",
@@ -71,7 +71,7 @@
71
71
  "webpack": "5.105.2"
72
72
  },
73
73
  "dependencies": {
74
- "@redocly/config": "0.57.0",
74
+ "@redocly/config": "0.61.0",
75
75
  "@tanstack/react-query": "5.62.3",
76
76
  "@tanstack/react-virtual": "3.13.0",
77
77
  "@xyflow/react": "12.8.3",
@@ -256,7 +256,7 @@ const CatalogDescription = styled.p`
256
256
  const CatalogPageWrapper = styled.div`
257
257
  --sidebar-width: var(--catalog-sidebar-width);
258
258
 
259
- height: calc(100vh - var(--navbar-height) - var(--banner-height));
259
+ height: calc(100vh - var(--navbar-offset));
260
260
  display: flex;
261
261
  flex-direction: column;
262
262
  overflow: hidden;
@@ -164,10 +164,10 @@ export function CatalogEntityHistorySidebar({
164
164
 
165
165
  const SidebarOverlay = styled.div`
166
166
  position: fixed;
167
- top: calc(var(--navbar-height) + var(--banner-height));
167
+ top: var(--navbar-offset);
168
168
  left: 0;
169
169
  width: var(--sidebar-width);
170
- height: calc(100vh - var(--navbar-height) - var(--banner-height));
170
+ height: calc(100vh - var(--navbar-offset));
171
171
  padding: var(--catalog-history-sidebar-padding);
172
172
  background-color: var(--catalog-history-sidebar-bg-color);
173
173
  border-right: 1px solid var(--catalog-history-sidebar-border-color);
@@ -120,7 +120,7 @@ const SplitViewWrapper = styled.div`
120
120
  const SchemaSampleWrapper = styled.div`
121
121
  flex: 1;
122
122
  position: sticky;
123
- top: calc(var(--navbar-height) + var(--banner-height) + var(--spacing-md));
123
+ top: calc(var(--navbar-offset) + var(--spacing-md));
124
124
  align-self: flex-start;
125
125
  padding-top: var(--spacing-sm);
126
126
  `;
@@ -23,7 +23,7 @@ export function CatalogMobileFiltersPanel({
23
23
 
24
24
  const CatalogMobileFiltersPanelWrapper = styled.div`
25
25
  width: 100%;
26
- max-height: calc(100vh - var(--navbar-height) - var(--banner-height));
26
+ max-height: calc(100vh - var(--navbar-offset));
27
27
  overflow-y: auto;
28
28
  background: var(--sidebar-bg-color);
29
29
  display: flex;
@@ -27,10 +27,10 @@ export function CatalogMobileFiltersPanelOverlay({
27
27
  const CatalogMobileFiltersPanelOverlayWrapper = styled.div`
28
28
  display: none;
29
29
  position: fixed;
30
- top: calc(var(--navbar-height) + var(--banner-height));
30
+ top: var(--navbar-offset);
31
31
  left: 0;
32
32
  width: 100%;
33
- height: calc(100vh - var(--navbar-height) - var(--banner-height));
33
+ height: calc(100vh - var(--navbar-offset));
34
34
  z-index: 3;
35
35
  background: var(--bg-color);
36
36
  flex-direction: column;
@@ -10,8 +10,7 @@ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
10
10
  import type { ReportButtonProps } from '@redocly/theme/core/hooks';
11
11
  import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
12
12
  import { DeselectIcon } from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
13
- import { MaximizeIcon } from '@redocly/theme/icons/MaximizeIcon/MaximizeIcon';
14
- import { MinimizeIcon } from '@redocly/theme/icons/MinimizeIcon/MinimizeIcon';
13
+ import { ExpandCollapseIcon } from '@redocly/theme/icons/ExpandCollapseIcon/ExpandCollapseIcon';
15
14
  import { SelectIcon } from '@redocly/theme/icons/SelectIcon/SelectIcon';
16
15
  import { WarningSquareIcon } from '@redocly/theme/icons/WarningSquareIcon/WarningSquareIcon';
17
16
  import { Button } from '@redocly/theme/components/Button/Button';
@@ -116,16 +115,14 @@ export function CodeBlockControls({
116
115
  variant="text"
117
116
  size="small"
118
117
  data-testid="expand-all"
119
- icon={controlsType === 'icon' ? <MaximizeIcon /> : undefined}
118
+ icon={controlsType === 'icon' ? <ExpandCollapseIcon /> : undefined}
120
119
  aria-label="Expand all"
121
120
  onClick={expand?.onClick}
122
121
  >
123
122
  {controlsType !== 'icon' && (expand?.label || 'Expand all')}
124
123
  </ControlButton>
125
124
  </Tooltip>
126
- ) : null}
127
-
128
- {collapse && !codeSnippet?.collapse?.hide ? (
125
+ ) : collapse && !codeSnippet?.collapse?.hide ? (
129
126
  <Tooltip
130
127
  tip={
131
128
  collapse.props?.tooltip ||
@@ -138,7 +135,7 @@ export function CodeBlockControls({
138
135
  variant="text"
139
136
  size="small"
140
137
  data-testid="collapse-all"
141
- icon={controlsType === 'icon' ? <MinimizeIcon /> : undefined}
138
+ icon={controlsType === 'icon' ? <ExpandCollapseIcon $collapse /> : undefined}
142
139
  onClick={collapse?.onClick}
143
140
  aria-label="Collapse all"
144
141
  >
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+
3
+ import type { JSX } from 'react';
4
+
5
+ import { ConsentBanner } from '@redocly/theme/components/Consent/ConsentBanner';
6
+ import { ConsentDialog } from '@redocly/theme/components/Consent/ConsentDialog';
7
+ import { useConsentTelemetry } from '@redocly/theme/core/hooks';
8
+
9
+ export function Consent(): JSX.Element {
10
+ useConsentTelemetry();
11
+
12
+ return (
13
+ <>
14
+ <ConsentBanner />
15
+ <ConsentDialog />
16
+ </>
17
+ );
18
+ }