@redocly/theme 0.46.2 → 0.46.3

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.
@@ -156,6 +156,13 @@ const SearchOverlay = styled_components_1.default.div `
156
156
  height: 100vh;
157
157
  background: var(--bg-color-modal-overlay);
158
158
  z-index: var(--z-index-overlay);
159
+
160
+ @media screen and (max-width: ${utils_1.breakpoints.small}) {
161
+ align-items: start;
162
+ position: fixed;
163
+ overflow: hidden;
164
+ overscroll-behavior: none;
165
+ }
159
166
  `;
160
167
  const SearchDialogWrapper = styled_components_1.default.div `
161
168
  display: flex;
@@ -168,9 +175,10 @@ const SearchDialogWrapper = styled_components_1.default.div `
168
175
  border-radius: 0;
169
176
 
170
177
  @media screen and (max-width: ${utils_1.breakpoints.small}) {
171
- /* Ignore resize on mobile */
178
+ min-height: -webkit-fill-available !important;
179
+ min-height: 100dvh !important;
180
+ height: auto !important;
172
181
  width: 100vw !important;
173
- height: 100vh !important;
174
182
  }
175
183
 
176
184
  @media screen and (min-width: ${utils_1.breakpoints.small}) {
@@ -196,6 +204,10 @@ const SearchDialogBody = styled_components_1.default.div `
196
204
  flex-direction: row;
197
205
  flex-grow: 1;
198
206
  overflow: hidden;
207
+
208
+ @media screen and (max-width: ${utils_1.breakpoints.small}) {
209
+ min-height: 0;
210
+ }
199
211
  `;
200
212
  const SearchDialogBodyMainView = styled_components_1.default.div `
201
213
  flex: 2;
@@ -8,7 +8,6 @@ const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const DropdownMenu_1 = require("../../components/Dropdown/DropdownMenu");
10
10
  const DropdownMenuItem_1 = require("../../components/Dropdown/DropdownMenuItem");
11
- const GridIcon_1 = require("../../icons/GridIcon/GridIcon");
12
11
  const hooks_1 = require("../../core/hooks");
13
12
  const LoginButton_1 = require("../../components/UserMenu/LoginButton");
14
13
  const UserAvatar_1 = require("../../components/UserMenu/UserAvatar");
@@ -19,7 +18,7 @@ const utils_1 = require("../../core/utils");
19
18
  function UserMenu({ className }) {
20
19
  const { userMenu } = (0, hooks_1.useThemeConfig)();
21
20
  const { useTranslate, useUserMenu } = (0, hooks_1.useThemeHooks)();
22
- const { userData, hasDeveloperOnboarding, loginUrl } = useUserMenu();
21
+ const { userData, loginUrl } = useUserMenu();
23
22
  const { translate } = useTranslate();
24
23
  if (!(userData === null || userData === void 0 ? void 0 : userData.isAuthenticated)) {
25
24
  if (loginUrl && !(userMenu === null || userMenu === void 0 ? void 0 : userMenu.hideLoginButton)) {
@@ -30,17 +29,11 @@ function UserMenu({ className }) {
30
29
  return null;
31
30
  }
32
31
  }
33
- const devOnboardingMenuItem = hasDeveloperOnboarding
34
- ? [
35
- react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: "my-apps", to: "/apps", "data-translation-key": "userMenu.devOnboardingLabel", prefix: react_1.default.createElement(GridIcon_1.GridIcon, null) }, translate('userMenu.devOnboardingLabel')),
36
- ]
37
- : [];
38
32
  const menuItems = (userMenu === null || userMenu === void 0 ? void 0 : userMenu['menu']) || [];
39
- const customItems = menuItems.map((item) => (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: item.label, external: item.external, to: item.link || '' }, item.label)));
33
+ const customItems = menuItems.map((item) => (react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { key: item.label, external: item.external, to: item.link || '' }, item.labelTranslationKey ? translate(item.labelTranslationKey) : item.label)));
40
34
  const items = [
41
35
  react_1.default.createElement(UserInfoMenuItem_1.UserInfoMenuItem, { name: userData.name, picture: userData.picture, email: userData.email, key: "userinfo" }),
42
36
  react_1.default.createElement(DropdownMenuItem_1.DropdownMenuItem, { separatorLine: true, separator: true, key: "separator" }),
43
- ...devOnboardingMenuItem,
44
37
  ...customItems,
45
38
  react_1.default.createElement(LogoutMenuItem_1.LogoutMenuItem, { key: "logout" }),
46
39
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.46.2",
3
+ "version": "0.46.3",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -280,6 +280,13 @@ const SearchOverlay = styled.div`
280
280
  height: 100vh;
281
281
  background: var(--bg-color-modal-overlay);
282
282
  z-index: var(--z-index-overlay);
283
+
284
+ @media screen and (max-width: ${breakpoints.small}) {
285
+ align-items: start;
286
+ position: fixed;
287
+ overflow: hidden;
288
+ overscroll-behavior: none;
289
+ }
283
290
  `;
284
291
 
285
292
  const SearchDialogWrapper = styled.div`
@@ -293,9 +300,10 @@ const SearchDialogWrapper = styled.div`
293
300
  border-radius: 0;
294
301
 
295
302
  @media screen and (max-width: ${breakpoints.small}) {
296
- /* Ignore resize on mobile */
303
+ min-height: -webkit-fill-available !important;
304
+ min-height: 100dvh !important;
305
+ height: auto !important;
297
306
  width: 100vw !important;
298
- height: 100vh !important;
299
307
  }
300
308
 
301
309
  @media screen and (min-width: ${breakpoints.small}) {
@@ -323,6 +331,10 @@ const SearchDialogBody = styled.div`
323
331
  flex-direction: row;
324
332
  flex-grow: 1;
325
333
  overflow: hidden;
334
+
335
+ @media screen and (max-width: ${breakpoints.small}) {
336
+ min-height: 0;
337
+ }
326
338
  `;
327
339
 
328
340
  const SearchDialogBodyMainView = styled.div`
@@ -5,7 +5,6 @@ import type { ResolvedNavLinkItem } from '@redocly/config';
5
5
 
6
6
  import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
7
7
  import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
8
- import { GridIcon } from '@redocly/theme/icons/GridIcon/GridIcon';
9
8
  import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
10
9
  import { LoginButton } from '@redocly/theme/components/UserMenu/LoginButton';
11
10
  import { UserAvatar } from '@redocly/theme/components/UserMenu/UserAvatar';
@@ -25,7 +24,7 @@ export function UserMenu({ className }: UserMenuProps) {
25
24
  };
26
25
  }>();
27
26
  const { useTranslate, useUserMenu } = useThemeHooks();
28
- const { userData, hasDeveloperOnboarding, loginUrl } = useUserMenu();
27
+ const { userData, loginUrl } = useUserMenu();
29
28
  const { translate } = useTranslate();
30
29
 
31
30
  if (!userData?.isAuthenticated) {
@@ -40,24 +39,11 @@ export function UserMenu({ className }: UserMenuProps) {
40
39
  }
41
40
  }
42
41
 
43
- const devOnboardingMenuItem = hasDeveloperOnboarding
44
- ? [
45
- <DropdownMenuItem
46
- key="my-apps"
47
- to="/apps"
48
- data-translation-key="userMenu.devOnboardingLabel"
49
- prefix={<GridIcon />}
50
- >
51
- {translate('userMenu.devOnboardingLabel')}
52
- </DropdownMenuItem>,
53
- ]
54
- : [];
55
-
56
42
  const menuItems = userMenu?.['menu'] || [];
57
43
 
58
44
  const customItems = menuItems.map((item) => (
59
45
  <DropdownMenuItem key={item.label} external={item.external} to={item.link || ''}>
60
- {item.label}
46
+ {item.labelTranslationKey ? translate(item.labelTranslationKey) : item.label}
61
47
  </DropdownMenuItem>
62
48
  ));
63
49
 
@@ -69,7 +55,6 @@ export function UserMenu({ className }: UserMenuProps) {
69
55
  key="userinfo"
70
56
  />,
71
57
  <DropdownMenuItem separatorLine={true} separator key="separator" />,
72
- ...devOnboardingMenuItem,
73
58
  ...customItems,
74
59
  <LogoutMenuItem key="logout" />,
75
60
  ];