@redocly/theme 0.83.0-rc.2 → 0.83.0-rc.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 (86) hide show
  1. package/lib/components/Breadcrumbs/Breadcrumb.d.ts +0 -1
  2. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
  3. package/lib/components/Buttons/EditPageButton.d.ts +0 -1
  4. package/lib/components/Buttons/EmailButton.d.ts +0 -1
  5. package/lib/components/Buttons/NewTabButton.d.ts +0 -1
  6. package/lib/components/Catalog/Catalog.d.ts +0 -1
  7. package/lib/components/Catalog/CatalogActions.d.ts +0 -1
  8. package/lib/components/Catalog/CatalogCard.d.ts +0 -1
  9. package/lib/components/Catalog/CatalogInfoBlock.d.ts +0 -1
  10. package/lib/components/CodeBlock/CodeBlockTabs.d.ts +0 -1
  11. package/lib/components/ColorModeSwitcher/ColorModeIcon.d.ts +0 -1
  12. package/lib/components/ColorModeSwitcher/ColorModeSwitcher.d.ts +0 -1
  13. package/lib/components/Dropdown/DropdownMenu.js +21 -28
  14. package/lib/components/Dropdown/DropdownMenuItem.js +2 -0
  15. package/lib/components/Feedback/Comment.d.ts +0 -1
  16. package/lib/components/Feedback/Mood.d.ts +0 -1
  17. package/lib/components/Feedback/Rating.d.ts +0 -1
  18. package/lib/components/Feedback/Reasons.d.ts +0 -1
  19. package/lib/components/Feedback/ReportDialog.d.ts +0 -1
  20. package/lib/components/Feedback/Scale.d.ts +0 -1
  21. package/lib/components/Feedback/Sentiment.d.ts +0 -1
  22. package/lib/components/Feedback/Stars.d.ts +0 -1
  23. package/lib/components/Filter/Filter.d.ts +0 -1
  24. package/lib/components/Filter/FilterCheckboxes.d.ts +0 -1
  25. package/lib/components/Filter/FilterContent.d.ts +0 -1
  26. package/lib/components/Filter/FilterDateRange.d.ts +0 -1
  27. package/lib/components/Filter/FilterInput.d.ts +0 -1
  28. package/lib/components/Filter/FilterPopover.d.ts +0 -1
  29. package/lib/components/Filter/FilterSelect.d.ts +0 -1
  30. package/lib/components/Footer/Footer.d.ts +0 -1
  31. package/lib/components/Footer/FooterColumn.d.ts +0 -1
  32. package/lib/components/Footer/FooterCopyright.d.ts +0 -1
  33. package/lib/components/Footer/FooterItem.d.ts +0 -1
  34. package/lib/components/Image/Image.d.ts +0 -1
  35. package/lib/components/LanguagePicker/LanguagePicker.d.ts +0 -1
  36. package/lib/components/LastUpdated/LastUpdated.d.ts +0 -1
  37. package/lib/components/Loading/Loading.d.ts +0 -1
  38. package/lib/components/Logo/Logo.d.ts +0 -1
  39. package/lib/components/Menu/Menu.d.ts +0 -1
  40. package/lib/components/Menu/MenuItem.js +12 -3
  41. package/lib/components/Menu/MenuMobile.d.ts +0 -1
  42. package/lib/components/Navbar/Navbar.d.ts +0 -1
  43. package/lib/components/Navbar/Navbar.js +1 -9
  44. package/lib/components/Navbar/NavbarItem.d.ts +0 -1
  45. package/lib/components/Navbar/NavbarMenu.d.ts +0 -1
  46. package/lib/components/PageNavigation/NextButton.d.ts +0 -1
  47. package/lib/components/PageNavigation/PageNavigation.d.ts +0 -1
  48. package/lib/components/PageNavigation/PreviousButton.d.ts +0 -1
  49. package/lib/components/Product/Product.d.ts +0 -1
  50. package/lib/components/Product/ProductPicker.d.ts +0 -1
  51. package/lib/components/Search/Search.d.ts +0 -1
  52. package/lib/components/Search/SearchDialog.d.ts +0 -1
  53. package/lib/components/Search/SearchHighlight.d.ts +0 -1
  54. package/lib/components/Search/SearchItem.d.ts +0 -1
  55. package/lib/components/Search/SearchRecent.d.ts +0 -1
  56. package/lib/components/Search/SearchShortcut.d.ts +0 -1
  57. package/lib/components/Search/SearchSuggestedPages.d.ts +0 -1
  58. package/lib/components/Search/SearchTrigger.d.ts +0 -1
  59. package/lib/components/SidebarActions/ChangeViewButton.d.ts +0 -1
  60. package/lib/components/SidebarLogo/SidebarLogo.d.ts +0 -1
  61. package/lib/components/TableOfContent/TableOfContent.d.ts +0 -1
  62. package/lib/components/UserMenu/LoginButton.d.ts +0 -1
  63. package/lib/components/UserMenu/LogoutMenuItem.d.ts +0 -1
  64. package/lib/components/UserMenu/UserAvatar.d.ts +0 -1
  65. package/lib/components/UserMenu/UserInfoMenuItem.d.ts +0 -1
  66. package/lib/components/UserMenu/UserMenu.js +15 -6
  67. package/lib/components/UserMenu/UserMenuMobile.d.ts +0 -1
  68. package/lib/components/UserMenu/UserMenuMobile.js +2 -1
  69. package/lib/core/hooks/menu/use-nested-menu.d.ts +0 -1
  70. package/lib/core/hooks/use-codeblock-tabs-controls.d.ts +0 -1
  71. package/lib/core/types/hooks.d.ts +0 -1
  72. package/lib/core/types/sidebar.d.ts +1 -0
  73. package/lib/core/utils/media-css.js +1 -1
  74. package/lib/layouts/Forbidden.d.ts +0 -1
  75. package/lib/layouts/NotFound.d.ts +0 -1
  76. package/lib/layouts/OIDCForbidden.d.ts +0 -1
  77. package/lib/markdoc/components/Mermaid/Mermaid.d.ts +0 -1
  78. package/package.json +4 -4
  79. package/src/components/Dropdown/DropdownMenu.tsx +21 -28
  80. package/src/components/Dropdown/DropdownMenuItem.tsx +2 -0
  81. package/src/components/Menu/MenuItem.tsx +14 -2
  82. package/src/components/Navbar/Navbar.tsx +1 -13
  83. package/src/components/UserMenu/UserMenu.tsx +28 -15
  84. package/src/components/UserMenu/UserMenuMobile.tsx +3 -2
  85. package/src/core/types/sidebar.ts +1 -0
  86. package/src/core/utils/media-css.ts +1 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type BreadcrumbProps = {
3
2
  label: string;
4
3
  link?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare function Breadcrumbs(props: {
3
2
  className?: string;
4
3
  }): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type EditPageButtonProps = {
3
2
  to: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type EmailButtonProps = {
3
2
  data: string;
4
3
  dataTestId?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type NewTabButtonProps = {
3
2
  data: string;
4
3
  dataTestId?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CatalogConfig } from '../../config';
3
2
  export type CatalogProps = {
4
3
  pageProps: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedFilter } from '../../core/types';
3
2
  export type CatalogActionsProps = {
4
3
  onOpenFilter: () => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { CatalogItem } from '../../core/types';
3
2
  export type CatalogCardProps = {
4
3
  item: CatalogItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type CatalogInfoBlockProps = {
3
2
  metadata?: {
4
3
  scorecardLevel?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FileTabs } from '../../components/CodeBlock/CodeBlock';
3
2
  export type CodeBlockTabsProps = {
4
3
  tabs: FileTabs;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type ColorModeIconProps = {
3
2
  mode?: 'dark' | 'light' | string;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type ColorModeSwitcherProps = {
3
2
  className?: string;
4
3
  };
@@ -19,35 +19,28 @@ function DropdownMenu(props) {
19
19
  }
20
20
  exports.DropdownMenu = DropdownMenu;
21
21
  const DropdownMenuWrapper = styled_components_1.default.ul `
22
- && {
23
- font-size: var(--dropdown-menu-font-size);
24
- font-weight: var(--dropdown-menu-font-weight);
25
- line-height: var(--dropdown-menu-line-height);
26
- color: var(--dropdown-menu-text-color);
22
+ font-size: var(--dropdown-menu-font-size);
23
+ font-weight: var(--dropdown-menu-font-weight);
24
+ line-height: var(--dropdown-menu-line-height);
25
+ color: var(--dropdown-menu-text-color);
27
26
 
28
- margin: 0;
29
- min-width: var(--dropdown-menu-min-width);
30
- max-width: var(--dropdown-menu-max-width);
31
- max-height: var(--dropdown-menu-max-height);
32
- padding: var(--dropdown-menu-padding);
33
- background-color: var(--dropdown-menu-bg-color);
34
- border-radius: var(--dropdown-menu-border-radius);
35
- box-shadow: var(--dropdown-menu-box-shadow);
36
- border: 1px solid var(--dropdown-menu-border-color);
37
- list-style-type: none;
38
- white-space: nowrap;
39
- overflow-x: hidden;
40
- overflow-y: auto;
41
- z-index: var(--z-index-surface);
27
+ margin: 0;
28
+ min-width: var(--dropdown-menu-min-width);
29
+ max-width: var(--dropdown-menu-max-width);
30
+ max-height: var(--dropdown-menu-max-height);
31
+ padding: var(--dropdown-menu-padding);
32
+ background-color: var(--dropdown-menu-bg-color);
33
+ border-radius: var(--dropdown-menu-border-radius);
34
+ box-shadow: var(--dropdown-menu-box-shadow);
35
+ border: 1px solid var(--dropdown-menu-border-color);
36
+ list-style-type: none;
37
+ white-space: nowrap;
38
+ overflow-x: hidden;
39
+ overflow-y: auto;
40
+ z-index: var(--z-index-surface);
42
41
 
43
- display: flex;
44
- flex-direction: column;
45
- gap: var(--dropdown-menu-item-gap);
46
-
47
- a {
48
- text-decoration: none;
49
- color: var(--dropdown-menu-text-color);
50
- }
51
- }
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: var(--dropdown-menu-item-gap);
52
45
  `;
53
46
  //# sourceMappingURL=DropdownMenu.js.map
@@ -93,6 +93,8 @@ const DropdownMenuItemWrapper = styled_components_1.default.li `
93
93
  background-color: var(--dropdown-menu-item-bg-color);
94
94
  color: var(--dropdown-menu-item-color);
95
95
 
96
+ text-decoration: none;
97
+
96
98
  &:hover {
97
99
  background-color: var(--dropdown-menu-item-bg-color-hover);
98
100
  color: var(--dropdown-menu-item-color-hover);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type CommentProps = {
3
2
  onSubmit: (value: {
4
3
  comment: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare enum MOOD_STATES {
3
2
  SATISFIED = "satisfied",
4
3
  NEUTRAL = "neutral",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const FEEDBACK_MAX_RATING = 5;
3
2
  export type RatingProps = {
4
3
  onSubmit: (value: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type ReasonsProps = {
3
2
  onChange: (value: string[]) => void;
4
3
  settings: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SubmitFeedbackParams } from '../../core/types';
3
2
  export type ReportDialogProps = {
4
3
  location: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const MAX_SCALE = 10;
3
2
  export type ScaleProps = {
4
3
  onSubmit: (value: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SentimentProps = {
3
2
  onSubmit: (value: {
4
3
  score: number;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type StarsProps = {
3
2
  max?: number;
4
3
  name?: string;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FilterProps } from '../../core/types';
3
2
  export declare function Filter({ filter, filterValuesCasing }: FilterProps): JSX.Element | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FilterProps } from '../../core/types';
3
2
  export declare function FilterCheckboxes({ filter, filterValuesCasing }: FilterProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedFilter } from '../../core/types';
3
2
  import type { ThemeConfig } from '../../config';
4
3
  export type FilterContentProps = {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FilterProps } from '../../core/types';
3
2
  export declare function FilterDateRange({ filter }: FilterProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type FilterInputProps = {
3
2
  value: string;
4
3
  onChange: (newValue: string) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedFilter } from '../../core/types';
3
2
  import type { ThemeConfig } from '../../config';
4
3
  export type FilterPopoverProps = {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { FilterProps } from '../../core/types';
3
2
  export declare function FilterSelect({ filter, filterValuesCasing }: FilterProps): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type FooterProps = {
3
2
  className?: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItem } from '@redocly/config';
3
2
  export type FooterColumnProps = {
4
3
  column: ResolvedNavItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type FooterCopyrightProps = {
3
2
  copyrightText: string;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItem } from '@redocly/config';
3
2
  export type FooterItemProps = {
4
3
  item: ResolvedNavItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type ImageProps = {
3
2
  src?: string;
4
3
  srcSet?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type LanguagePickerProps = {
3
2
  onChangeLanguage: (newLang: string) => void;
4
3
  onlyIcon?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const FORMATS: {
3
2
  timeago: (date: Date, locale: string) => string;
4
3
  iso: (date: Date) => string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type LoadingProps = {
3
2
  color: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { LogoConfig } from '../../core/types';
3
2
  export type LogoProps = {
4
3
  config: LogoConfig;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DrilldownMenuItemDetails, ItemState } from '../../core/types';
3
2
  export type MenuListProps = {
4
3
  items: ItemState[];
@@ -61,7 +61,7 @@ function MenuItem(props) {
61
61
  }
62
62
  };
63
63
  const chevron = hasChevron ? (isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" }))) : null;
64
- const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, depth: depth, withChevron: hasChevron, onClick: handleOnClick, ref: labelRef, role: item.link ? 'none' : 'link' },
64
+ const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, onClick: handleOnClick, ref: labelRef, role: item.link ? 'none' : 'link' },
65
65
  chevron,
66
66
  item.icon ? react_1.default.createElement(MenuItemIcon, { src: item.icon }) : null,
67
67
  react_1.default.createElement(MenuItemLabelTextWrapper, null,
@@ -161,9 +161,9 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
161
161
  ${depth ? 'var(--menu-item-nested-offset) * ' + depth : '0px'}
162
162
  )`};
163
163
 
164
- ${({ active }) => active &&
164
+ ${({ active, deprecated }) => active &&
165
165
  (0, styled_components_1.css) `
166
- color: var(--menu-item-color-active);
166
+ color: ${deprecated ? '(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
167
167
  background-color: var(--menu-item-bg-color-active);
168
168
 
169
169
  &:hover {
@@ -171,6 +171,15 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
171
171
  }
172
172
  `};
173
173
 
174
+ ${({ deprecated }) => deprecated &&
175
+ (0, styled_components_1.css) `
176
+ color: var(--menu-content-color-disabled);
177
+
178
+ &:hover {
179
+ color: var(--menu-content-color-disabled);
180
+ }
181
+ `};
182
+
174
183
  &:hover {
175
184
  color: var(--menu-item-color-hover);
176
185
  background: var(--menu-item-bg-color-hover);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type MobileMenuProps = {
3
2
  className?: string;
4
3
  hideUserProfile?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type NavbarProps = {
3
2
  className?: string;
4
3
  };
@@ -51,8 +51,7 @@ function Navbar({ className }) {
51
51
  openMobileMenu();
52
52
  telemetry.send('mobile_menu_button_open_clicked', {});
53
53
  }, icon: isOpen ? react_1.default.createElement(CloseIcon_1.CloseIcon, null) : react_1.default.createElement(MenuIcon_1.MenuIcon, null) }),
54
- hideUserMenu ? null : (react_1.default.createElement(UserMenuWrapper, null,
55
- react_1.default.createElement(UserMenu_1.UserMenu, null))))));
54
+ hideUserMenu ? null : react_1.default.createElement(UserMenu_1.UserMenu, null))));
56
55
  }
57
56
  exports.Navbar = Navbar;
58
57
  const NavbarWrapper = styled_components_1.default.nav `
@@ -92,13 +91,6 @@ const NavbarRow = styled_components_1.default.div `
92
91
  gap: var(--navbar-menu-items-gap);
93
92
  max-width: var(--navbar-container-max-width);
94
93
  `;
95
- const UserMenuWrapper = styled_components_1.default.div `
96
- display: none;
97
-
98
- @media screen and (min-width: ${utils_1.breakpoints.medium}) {
99
- display: block;
100
- }
101
- `;
102
94
  const MobileMenuButton = (0, styled_components_1.default)(Button_1.Button) `
103
95
  margin-left: 0px !important;
104
96
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItem } from '@redocly/config';
3
2
  export type NavbarItemProps = {
4
3
  navItem: ResolvedNavItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedConfigLinks } from '@redocly/config';
3
2
  export type NavbarMenuProps = {
4
3
  menuItems: ResolvedConfigLinks;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItemWithLink } from '@redocly/config';
3
2
  export type NextPageType = {
4
3
  nextPage?: ResolvedNavItemWithLink | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItemWithLink } from '@redocly/config';
3
2
  export type PageNavigationType = {
4
3
  nextPage?: ResolvedNavItemWithLink | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ResolvedNavItemWithLink } from '@redocly/config';
3
2
  export type PreviousPageType = {
4
3
  prevPage?: ResolvedNavItemWithLink | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { ProductConfig } from '../../config';
3
2
  export type ProductProps = {
4
3
  product: ProductConfig;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function ProductPicker(): JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchProps = {
3
2
  className?: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchDialogProps = {
3
2
  onClose: () => void;
4
3
  className?: string;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function highlight(text: string | string[]): JSX.Element | string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { SearchDocument } from '../../core/types';
3
2
  type ActiveItem<T> = T & {
4
3
  active?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchRecentProps = {
3
2
  onSelect: (value: string) => void;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchShortcutProps = {
3
2
  combination: string;
4
3
  text: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchSuggestedPagesProps = {
3
2
  className?: string;
4
3
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SearchTriggerProps = {
3
2
  onClick: () => void;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { LayoutVariant } from '../../components/SidebarActions/SidebarActions';
3
2
  export type ChangeViewButtonProps = {
4
3
  layout: LayoutVariant;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type SidebarLogoProps = {
3
2
  imageUrl?: string;
4
3
  href?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MdHeading } from '../../core/types';
3
2
  export type TableOfContentProps = {
4
3
  headings?: Array<MdHeading | null> | null | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type LoginButtonProps = {
3
2
  href: string;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type LogoutMenuItemProps = {
3
2
  iconOnly?: boolean;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type UserAvatarProps = {
3
2
  picture?: string;
4
3
  className?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type UserInfoMenuItemProps = {
3
2
  name: string;
4
3
  email?: string;
@@ -15,14 +15,16 @@ const UserAvatar_1 = require("../../components/UserMenu/UserAvatar");
15
15
  const UserInfoMenuItem_1 = require("../../components/UserMenu/UserInfoMenuItem");
16
16
  const Dropdown_1 = require("../../components/Dropdown/Dropdown");
17
17
  const LogoutMenuItem_1 = require("../../components/UserMenu/LogoutMenuItem");
18
+ const core_1 = require("../../core");
18
19
  function UserMenu({ className }) {
19
20
  const { userMenu } = (0, hooks_1.useThemeConfig)();
20
21
  const { useTranslate, useUserMenu } = (0, hooks_1.useThemeHooks)();
21
22
  const { userData, hasDeveloperOnboarding, loginUrl } = useUserMenu();
22
23
  const { translate } = useTranslate();
23
24
  if (!(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated)) {
24
- if (loginUrl) {
25
- return react_1.default.createElement(LoginButton_1.LoginButton, { href: loginUrl, "data-testid": "login-btn" });
25
+ if (loginUrl && !(userMenu === null || userMenu === void 0 ? void 0 : userMenu.hideLoginButton)) {
26
+ return (react_1.default.createElement(UserMenuWrapper, { "data-component-name": "UserMenu/UserMenu" },
27
+ react_1.default.createElement(LoginButton_1.LoginButton, { href: loginUrl, "data-testid": "login-btn" })));
26
28
  }
27
29
  else {
28
30
  return null;
@@ -42,11 +44,19 @@ function UserMenu({ className }) {
42
44
  ...customItems,
43
45
  react_1.default.createElement(LogoutMenuItem_1.LogoutMenuItem, { key: "logout" }),
44
46
  ];
45
- return (react_1.default.createElement(StyledDropdown, { className: className, alignment: "end", "data-component-name": "UserMenu/UserMenu", trigger: react_1.default.createElement(UserMenuTrigger, { role: "button" },
46
- react_1.default.createElement(UserAvatar_1.UserAvatar, { picture: userData.picture })) },
47
- react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, items)));
47
+ return (react_1.default.createElement(UserMenuWrapper, { "data-component-name": "UserMenu/UserMenu" },
48
+ react_1.default.createElement(StyledDropdown, { className: className, alignment: "end", trigger: react_1.default.createElement(UserMenuTrigger, { role: "button" },
49
+ react_1.default.createElement(UserAvatar_1.UserAvatar, { picture: userData.picture })) },
50
+ react_1.default.createElement(DropdownMenu_1.DropdownMenu, null, items))));
48
51
  }
49
52
  exports.UserMenu = UserMenu;
53
+ const UserMenuWrapper = styled_components_1.default.div `
54
+ display: none;
55
+
56
+ @media screen and (min-width: ${core_1.breakpoints.medium}) {
57
+ display: block;
58
+ }
59
+ `;
50
60
  const UserMenuTrigger = styled_components_1.default.div.attrs(() => ({
51
61
  'data-testid': 'user-menu-button',
52
62
  })) `
@@ -59,7 +69,6 @@ const UserMenuTrigger = styled_components_1.default.div.attrs(() => ({
59
69
  const StyledDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown).attrs(() => ({
60
70
  dataAttributes: {
61
71
  'data-testid': 'user-menu-dropdown',
62
- 'data-component-name': 'UserMenu/UserMenu',
63
72
  },
64
73
  })) `
65
74
  --dropdown-menu-font-size: var(--user-menu-dropdown-font-size);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type UserMenuMobileProps = {
3
2
  className?: string;
4
3
  };
@@ -13,8 +13,9 @@ const LoginButton_1 = require("../../components/UserMenu/LoginButton");
13
13
  function UserMenuMobile({ className }) {
14
14
  const { useUserMenu } = (0, hooks_1.useThemeHooks)();
15
15
  const { userData, loginUrl } = useUserMenu();
16
+ const { userMenu: userMenuSettings } = (0, hooks_1.useThemeConfig)();
16
17
  if (!(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated)) {
17
- if (loginUrl) {
18
+ if (loginUrl && !(userMenuSettings === null || userMenuSettings === void 0 ? void 0 : userMenuSettings.hideLoginButton)) {
18
19
  return (react_1.default.createElement(UserMenuMobileWrapper, { "data-component-name": "UserMenu/UserMenuMobile", className: className },
19
20
  react_1.default.createElement(UserMenuMobileLoginButton, { href: loginUrl })));
20
21
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { MenuItemProps } from '../../../core/types';
3
2
  type NestedMenuProps = MenuItemProps & {
4
3
  labelRef?: React.RefObject<HTMLElement>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { FileTabs } from '../../components/CodeBlock/CodeBlock';
3
2
  type CodeBlockTabsProps = {
4
3
  tabs: FileTabs;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { PageProps, ResolvedNavItemWithLink, Version } from '@redocly/config';
3
2
  import type { Callback, TFunction as TFunc } from 'i18next';
4
3
  import type { To, Location } from 'react-router-dom';
@@ -41,6 +41,7 @@ export type ItemState = Omit<SidebarNavItem, 'items'> & {
41
41
  menuStyle?: MenuStyle;
42
42
  languageInsensitive?: boolean;
43
43
  modified?: boolean;
44
+ deprecated?: boolean;
44
45
  };
45
46
  export type DrilldownMenuItemDetails = {
46
47
  previousLink?: string;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.breakpoints = void 0;
4
- exports.breakpoints = { small: '700px', medium: '1050px', large: '1200px' };
4
+ exports.breakpoints = { small: '672px', medium: '960px', large: '1280px' };
5
5
  //# sourceMappingURL=media-css.js.map
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function Forbidden(): JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function NotFound(): JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare function OIDCForbidden(): JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type MermaidProps = {
3
2
  diagramHtml: string;
4
3
  'data-source'?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.83.0-rc.2",
3
+ "version": "0.83.0-rc.4",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -46,7 +46,7 @@
46
46
  "@storybook/react": "7.6.19",
47
47
  "@storybook/react-webpack5": "7.6.19",
48
48
  "@storybook/testing-library": "0.2.2",
49
- "@storybook/theming": "7.6.19",
49
+ "@storybook/theming": "8.0.0",
50
50
  "@testing-library/jest-dom": "6.1.5",
51
51
  "@testing-library/react": "14.1.2",
52
52
  "@testing-library/user-event": "14.5.1",
@@ -76,7 +76,7 @@
76
76
  "react-router-dom": "6.21.1",
77
77
  "rimraf": "5.0.5",
78
78
  "storybook": "7.6.19",
79
- "storybook-addon-pseudo-states": "2.2.1",
79
+ "storybook-addon-pseudo-states": "3.1.1",
80
80
  "storybook-design-token": "3.1.0",
81
81
  "styled-components": "5.3.11",
82
82
  "styled-system": "5.1.5",
@@ -98,7 +98,7 @@
98
98
  "timeago.js": "^4.0.2",
99
99
  "i18next": "^22.4.12",
100
100
  "nprogress": "^0.2.0",
101
- "@redocly/config": "0.83.0-rc.2"
101
+ "@redocly/config": "0.83.0-rc.4"
102
102
  },
103
103
  "scripts": {
104
104
  "start": "npm-run-all --parallel storybook storybook:tokens:watch",
@@ -42,34 +42,27 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
42
42
  }
43
43
 
44
44
  const DropdownMenuWrapper = styled.ul`
45
- && {
46
- font-size: var(--dropdown-menu-font-size);
47
- font-weight: var(--dropdown-menu-font-weight);
48
- line-height: var(--dropdown-menu-line-height);
49
- color: var(--dropdown-menu-text-color);
45
+ font-size: var(--dropdown-menu-font-size);
46
+ font-weight: var(--dropdown-menu-font-weight);
47
+ line-height: var(--dropdown-menu-line-height);
48
+ color: var(--dropdown-menu-text-color);
50
49
 
51
- margin: 0;
52
- min-width: var(--dropdown-menu-min-width);
53
- max-width: var(--dropdown-menu-max-width);
54
- max-height: var(--dropdown-menu-max-height);
55
- padding: var(--dropdown-menu-padding);
56
- background-color: var(--dropdown-menu-bg-color);
57
- border-radius: var(--dropdown-menu-border-radius);
58
- box-shadow: var(--dropdown-menu-box-shadow);
59
- border: 1px solid var(--dropdown-menu-border-color);
60
- list-style-type: none;
61
- white-space: nowrap;
62
- overflow-x: hidden;
63
- overflow-y: auto;
64
- z-index: var(--z-index-surface);
50
+ margin: 0;
51
+ min-width: var(--dropdown-menu-min-width);
52
+ max-width: var(--dropdown-menu-max-width);
53
+ max-height: var(--dropdown-menu-max-height);
54
+ padding: var(--dropdown-menu-padding);
55
+ background-color: var(--dropdown-menu-bg-color);
56
+ border-radius: var(--dropdown-menu-border-radius);
57
+ box-shadow: var(--dropdown-menu-box-shadow);
58
+ border: 1px solid var(--dropdown-menu-border-color);
59
+ list-style-type: none;
60
+ white-space: nowrap;
61
+ overflow-x: hidden;
62
+ overflow-y: auto;
63
+ z-index: var(--z-index-surface);
65
64
 
66
- display: flex;
67
- flex-direction: column;
68
- gap: var(--dropdown-menu-item-gap);
69
-
70
- a {
71
- text-decoration: none;
72
- color: var(--dropdown-menu-text-color);
73
- }
74
- }
65
+ display: flex;
66
+ flex-direction: column;
67
+ gap: var(--dropdown-menu-item-gap);
75
68
  `;
@@ -133,6 +133,8 @@ const DropdownMenuItemWrapper = styled.li<{
133
133
  background-color: var(--dropdown-menu-item-bg-color);
134
134
  color: var(--dropdown-menu-item-color);
135
135
 
136
+ text-decoration: none;
137
+
136
138
  &:hover {
137
139
  background-color: var(--dropdown-menu-item-bg-color-hover);
138
140
  color: var(--dropdown-menu-item-color-hover);
@@ -58,6 +58,7 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
58
58
  const label = item.label && (
59
59
  <MenuItemLabelWrapper
60
60
  active={item.active}
61
+ deprecated={item.deprecated}
61
62
  depth={depth}
62
63
  withChevron={hasChevron}
63
64
  onClick={handleOnClick}
@@ -207,6 +208,7 @@ const MenuItemLabelWrapper = styled.li<{
207
208
  active?: boolean;
208
209
  depth?: number;
209
210
  withChevron?: boolean;
211
+ deprecated?: boolean;
210
212
  }>`
211
213
  display: flex;
212
214
  position: relative;
@@ -227,10 +229,10 @@ const MenuItemLabelWrapper = styled.li<{
227
229
  ${depth ? 'var(--menu-item-nested-offset) * ' + depth : '0px'}
228
230
  )`};
229
231
 
230
- ${({ active }) =>
232
+ ${({ active, deprecated }) =>
231
233
  active &&
232
234
  css`
233
- color: var(--menu-item-color-active);
235
+ color: ${deprecated ? '(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
234
236
  background-color: var(--menu-item-bg-color-active);
235
237
 
236
238
  &:hover {
@@ -238,6 +240,16 @@ const MenuItemLabelWrapper = styled.li<{
238
240
  }
239
241
  `};
240
242
 
243
+ ${({ deprecated }) =>
244
+ deprecated &&
245
+ css`
246
+ color: var(--menu-content-color-disabled);
247
+
248
+ &:hover {
249
+ color: var(--menu-content-color-disabled);
250
+ }
251
+ `};
252
+
241
253
  &:hover {
242
254
  color: var(--menu-item-color-hover);
243
255
  background: var(--menu-item-bg-color-hover);
@@ -66,11 +66,7 @@ export function Navbar({ className }: NavbarProps): JSX.Element | null {
66
66
  }
67
67
  icon={isOpen ? <CloseIcon /> : <MenuIcon />}
68
68
  />
69
- {hideUserMenu ? null : (
70
- <UserMenuWrapper>
71
- <UserMenu />
72
- </UserMenuWrapper>
73
- )}
69
+ {hideUserMenu ? null : <UserMenu />}
74
70
  </NavbarRow>
75
71
  </NavbarWrapper>
76
72
  );
@@ -115,14 +111,6 @@ const NavbarRow = styled.div`
115
111
  max-width: var(--navbar-container-max-width);
116
112
  `;
117
113
 
118
- const UserMenuWrapper = styled.div`
119
- display: none;
120
-
121
- @media screen and (min-width: ${breakpoints.medium}) {
122
- display: block;
123
- }
124
- `;
125
-
126
114
  const MobileMenuButton = styled(Button)`
127
115
  margin-left: 0px !important;
128
116
 
@@ -12,6 +12,7 @@ import { UserAvatar } from '@redocly/theme/components/UserMenu/UserAvatar';
12
12
  import { UserInfoMenuItem } from '@redocly/theme/components/UserMenu/UserInfoMenuItem';
13
13
  import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
14
14
  import { LogoutMenuItem } from '@redocly/theme/components/UserMenu/LogoutMenuItem';
15
+ import { breakpoints } from '@redocly/theme/core';
15
16
 
16
17
  export type UserMenuProps = {
17
18
  className?: string;
@@ -28,8 +29,12 @@ export function UserMenu({ className }: UserMenuProps) {
28
29
  const { translate } = useTranslate();
29
30
 
30
31
  if (!userData?.isAuthenticated) {
31
- if (loginUrl) {
32
- return <LoginButton href={loginUrl} data-testid="login-btn" />;
32
+ if (loginUrl && !userMenu?.hideLoginButton) {
33
+ return (
34
+ <UserMenuWrapper data-component-name="UserMenu/UserMenu">
35
+ <LoginButton href={loginUrl} data-testid="login-btn" />
36
+ </UserMenuWrapper>
37
+ );
33
38
  } else {
34
39
  return null;
35
40
  }
@@ -70,21 +75,30 @@ export function UserMenu({ className }: UserMenuProps) {
70
75
  ];
71
76
 
72
77
  return (
73
- <StyledDropdown
74
- className={className}
75
- alignment="end"
76
- data-component-name="UserMenu/UserMenu"
77
- trigger={
78
- <UserMenuTrigger role="button">
79
- <UserAvatar picture={userData.picture} />
80
- </UserMenuTrigger>
81
- }
82
- >
83
- <DropdownMenu>{items}</DropdownMenu>
84
- </StyledDropdown>
78
+ <UserMenuWrapper data-component-name="UserMenu/UserMenu">
79
+ <StyledDropdown
80
+ className={className}
81
+ alignment="end"
82
+ trigger={
83
+ <UserMenuTrigger role="button">
84
+ <UserAvatar picture={userData.picture} />
85
+ </UserMenuTrigger>
86
+ }
87
+ >
88
+ <DropdownMenu>{items}</DropdownMenu>
89
+ </StyledDropdown>
90
+ </UserMenuWrapper>
85
91
  );
86
92
  }
87
93
 
94
+ const UserMenuWrapper = styled.div`
95
+ display: none;
96
+
97
+ @media screen and (min-width: ${breakpoints.medium}) {
98
+ display: block;
99
+ }
100
+ `;
101
+
88
102
  const UserMenuTrigger = styled.div.attrs(() => ({
89
103
  'data-testid': 'user-menu-button',
90
104
  }))`
@@ -98,7 +112,6 @@ const UserMenuTrigger = styled.div.attrs(() => ({
98
112
  const StyledDropdown = styled(Dropdown).attrs(() => ({
99
113
  dataAttributes: {
100
114
  'data-testid': 'user-menu-dropdown',
101
- 'data-component-name': 'UserMenu/UserMenu',
102
115
  },
103
116
  }))`
104
117
  --dropdown-menu-font-size: var(--user-menu-dropdown-font-size);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
 
4
- import { useThemeHooks } from '@redocly/theme/core/hooks';
4
+ import { useThemeConfig, useThemeHooks } from '@redocly/theme/core/hooks';
5
5
  import { UserAvatar } from '@redocly/theme/components/UserMenu/UserAvatar';
6
6
  import { LogoutMenuItem } from '@redocly/theme/components/UserMenu/LogoutMenuItem';
7
7
  import { LoginButton } from '@redocly/theme/components/UserMenu/LoginButton';
@@ -13,9 +13,10 @@ export type UserMenuMobileProps = {
13
13
  export function UserMenuMobile({ className }: UserMenuMobileProps): JSX.Element | null {
14
14
  const { useUserMenu } = useThemeHooks();
15
15
  const { userData, loginUrl } = useUserMenu();
16
+ const { userMenu: userMenuSettings } = useThemeConfig();
16
17
 
17
18
  if (!userData?.isAuthenticated) {
18
- if (loginUrl) {
19
+ if (loginUrl && !userMenuSettings?.hideLoginButton) {
19
20
  return (
20
21
  <UserMenuMobileWrapper data-component-name="UserMenu/UserMenuMobile" className={className}>
21
22
  <UserMenuMobileLoginButton href={loginUrl} />
@@ -49,6 +49,7 @@ export type ItemState = Omit<SidebarNavItem, 'items'> & {
49
49
  menuStyle?: MenuStyle;
50
50
  languageInsensitive?: boolean;
51
51
  modified?: boolean; //item from openapi-docs sidebar
52
+ deprecated?: boolean; //item from openapi-docs sidebar
52
53
  };
53
54
 
54
55
  export type DrilldownMenuItemDetails = {
@@ -4,4 +4,4 @@ export type Breakpoints = {
4
4
  large: `${number}px`;
5
5
  };
6
6
 
7
- export const breakpoints: Breakpoints = { small: '700px', medium: '1050px', large: '1200px' };
7
+ export const breakpoints: Breakpoints = { small: '672px', medium: '960px', large: '1280px' };