@redocly/theme 0.82.2-rc.1 → 0.82.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Sidebar/Sidebar.js +3 -9
- package/lib/core/styles/global.js +3 -4
- package/package.json +2 -2
- package/src/components/Markdown/Markdown.tsx +1 -1
- package/src/components/Search/SearchDialog.tsx +1 -1
- package/src/components/Segmented/Segmented.tsx +2 -1
- package/src/components/Sidebar/Sidebar.tsx +3 -10
- package/src/core/styles/global.ts +4 -5
- package/src/core/utils/menu.ts +1 -2
- package/src/layouts/ThreePanelLayout.tsx +1 -0
|
@@ -42,7 +42,7 @@ function Sidebar({ versions, menu, footer, header, growContent, collapsed, class
|
|
|
42
42
|
if (sidebar === null || sidebar === void 0 ? void 0 : sidebar.hide) {
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
|
-
return (react_1.default.createElement(SidebarContent, { "data-component-name": "Sidebar/Sidebar",
|
|
45
|
+
return (react_1.default.createElement(SidebarContent, { "data-component-name": "Sidebar/Sidebar", opened: isOpen, className: className, collapsed: mappedCollapsed },
|
|
46
46
|
header ? react_1.default.createElement(SidebarHeader, { collapsed: mappedCollapsed }, header) : null,
|
|
47
47
|
!mappedCollapsed && versions ? versions : null,
|
|
48
48
|
react_1.default.createElement(MenuContainer_1.MenuContainer, { hidden: mappedCollapsed, growContent: growContent, animation: menuItemsAnimation }, menu),
|
|
@@ -67,14 +67,8 @@ const SidebarContent = styled_components_1.default.aside `
|
|
|
67
67
|
top: var(--navbar-height);
|
|
68
68
|
height: calc(100vh - var(--navbar-height));
|
|
69
69
|
overflow-x: hidden;
|
|
70
|
-
${({ opened
|
|
71
|
-
|
|
72
|
-
pointer-events: ${opened ? 'auto' : 'none'};
|
|
73
|
-
|
|
74
|
-
& > * {
|
|
75
|
-
transform: ${opened ? 'translate(0, 0)' : 'translate(0, 40px)'};
|
|
76
|
-
transition: ${animate ? 'transform 0.65s ease, opacity 0.25s ease;' : 'none'};
|
|
77
|
-
}
|
|
70
|
+
${({ opened }) => `
|
|
71
|
+
display: ${opened ? 'flex' : 'none'}
|
|
78
72
|
`};
|
|
79
73
|
|
|
80
74
|
@media screen and (min-width: ${utils_1.breakpoints.medium}) {
|
|
@@ -973,10 +973,9 @@ const error = (0, styled_components_1.css) `
|
|
|
973
973
|
--detailed-error-overlay-opacity: 0.9;
|
|
974
974
|
--detailed-error-overlay-z-index: var(--z-index-raised);
|
|
975
975
|
|
|
976
|
-
--detailed-error-modal-width:
|
|
977
|
-
--detailed-error-modal-height: calc(100vh -
|
|
978
|
-
--detailed-error-modal-top: calc(
|
|
979
|
-
--detailed-error-modal-left: 15%;
|
|
976
|
+
--detailed-error-modal-width: calc(100% - var(--spacing-lg) * 2);
|
|
977
|
+
--detailed-error-modal-height: calc(100vh - var(--navbar-height) - var(--spacing-lg) * 2);
|
|
978
|
+
--detailed-error-modal-top: calc(var(--spacing-lg) + var(--navbar-height));
|
|
980
979
|
--detailed-error-modal-border-radius: var(--border-radius-md);
|
|
981
980
|
--detailed-error-modal-bg-color: var(--bg-color-raised);
|
|
982
981
|
--detailed-error-modal-color: var(--text-color-primary);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.82.2-rc.
|
|
3
|
+
"version": "0.82.2-rc.2",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -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.
|
|
101
|
+
"@redocly/config": "0.82.2-rc.2"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
104
104
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { typography } from '@redocly/theme/core/utils/theme-helpers';
|
|
3
2
|
|
|
3
|
+
import { typography } from '@redocly/theme/core/utils/theme-helpers';
|
|
4
4
|
import { markdownBaseTableCss } from '@redocly/theme/components/Markdown/styles/baseTable';
|
|
5
5
|
import { markdownLinksCss } from '@redocly/theme/components/Markdown/styles/links';
|
|
6
6
|
import { headingAnchorCss } from '@redocly/theme/components/Markdown/styles/headingAnchor';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useRef, useState } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { SearchDocument } from '@redocly/theme/core/types';
|
|
5
4
|
import type { MouseEvent } from 'react';
|
|
5
|
+
import type { SearchDocument } from '@redocly/theme/core/types';
|
|
6
6
|
|
|
7
7
|
import { SearchInput } from '@redocly/theme/components/Search/SearchInput';
|
|
8
8
|
import { SearchShortcut } from '@redocly/theme/components/Search/SearchShortcut';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { typedMemo } from '@redocly/theme/core/hoc/typedMemo';
|
|
4
3
|
|
|
5
4
|
import type { ReactElement } from 'react';
|
|
6
5
|
import type { SelectOption } from '@redocly/theme/core/types/select-option';
|
|
7
6
|
|
|
7
|
+
import { typedMemo } from '@redocly/theme/core/hoc/typedMemo';
|
|
8
|
+
|
|
8
9
|
type SegmentedProps<T> = {
|
|
9
10
|
options: SelectOption<T>[];
|
|
10
11
|
value: T;
|
|
@@ -50,7 +50,6 @@ export function Sidebar({
|
|
|
50
50
|
return (
|
|
51
51
|
<SidebarContent
|
|
52
52
|
data-component-name="Sidebar/Sidebar"
|
|
53
|
-
animate={true}
|
|
54
53
|
opened={isOpen}
|
|
55
54
|
className={className}
|
|
56
55
|
collapsed={mappedCollapsed}
|
|
@@ -73,7 +72,7 @@ export function Sidebar({
|
|
|
73
72
|
);
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
const SidebarContent = styled.aside<{ opened?: boolean;
|
|
75
|
+
const SidebarContent = styled.aside<{ opened?: boolean; collapsed?: boolean }>`
|
|
77
76
|
border-right: 1px solid var(--sidebar-border-color);
|
|
78
77
|
position: fixed;
|
|
79
78
|
left: 0;
|
|
@@ -91,14 +90,8 @@ const SidebarContent = styled.aside<{ opened?: boolean; animate?: boolean; colla
|
|
|
91
90
|
top: var(--navbar-height);
|
|
92
91
|
height: calc(100vh - var(--navbar-height));
|
|
93
92
|
overflow-x: hidden;
|
|
94
|
-
${({ opened
|
|
95
|
-
|
|
96
|
-
pointer-events: ${opened ? 'auto' : 'none'};
|
|
97
|
-
|
|
98
|
-
& > * {
|
|
99
|
-
transform: ${opened ? 'translate(0, 0)' : 'translate(0, 40px)'};
|
|
100
|
-
transition: ${animate ? 'transform 0.65s ease, opacity 0.25s ease;' : 'none'};
|
|
101
|
-
}
|
|
93
|
+
${({ opened }) => `
|
|
94
|
+
display: ${opened ? 'flex' : 'none'}
|
|
102
95
|
`};
|
|
103
96
|
|
|
104
97
|
@media screen and (min-width: ${breakpoints.medium}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createGlobalStyle, css } from 'styled-components';
|
|
2
|
-
import { darkMode } from '@redocly/theme/core/styles/dark';
|
|
3
2
|
|
|
3
|
+
import { darkMode } from '@redocly/theme/core/styles/dark';
|
|
4
4
|
import { languagePicker } from '@redocly/theme/components/LanguagePicker/variables';
|
|
5
5
|
import { scorecard } from '@redocly/theme/components/Scorecard/variables';
|
|
6
6
|
import { feedback } from '@redocly/theme/components/Feedback/variables';
|
|
@@ -987,10 +987,9 @@ const error = css`
|
|
|
987
987
|
--detailed-error-overlay-opacity: 0.9;
|
|
988
988
|
--detailed-error-overlay-z-index: var(--z-index-raised);
|
|
989
989
|
|
|
990
|
-
--detailed-error-modal-width:
|
|
991
|
-
--detailed-error-modal-height: calc(100vh -
|
|
992
|
-
--detailed-error-modal-top: calc(
|
|
993
|
-
--detailed-error-modal-left: 15%;
|
|
990
|
+
--detailed-error-modal-width: calc(100% - var(--spacing-lg) * 2);
|
|
991
|
+
--detailed-error-modal-height: calc(100vh - var(--navbar-height) - var(--spacing-lg) * 2);
|
|
992
|
+
--detailed-error-modal-top: calc(var(--spacing-lg) + var(--navbar-height));
|
|
994
993
|
--detailed-error-modal-border-radius: var(--border-radius-md);
|
|
995
994
|
--detailed-error-modal-bg-color: var(--bg-color-raised);
|
|
996
995
|
--detailed-error-modal-color: var(--text-color-primary);
|
package/src/core/utils/menu.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { withPathPrefix } from '@redocly/theme/core/utils/urls';
|
|
2
|
-
|
|
3
1
|
import type { ResolvedNavItem, Version } from '@redocly/config';
|
|
4
2
|
import type { Location } from 'react-router-dom';
|
|
5
3
|
|
|
4
|
+
import { withPathPrefix } from '@redocly/theme/core/utils/urls';
|
|
6
5
|
import { getPathnameForLocale } from '@redocly/theme/core/utils';
|
|
7
6
|
import { type Locale, type TFunction, type ItemState } from '@redocly/theme/core/types';
|
|
8
7
|
import { MenuItemType } from '@redocly/theme/core/constants';
|