@redocly/theme 0.63.0-next.0 → 0.63.0-next.1
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/Buttons/EditPageButton.js +4 -26
- package/lib/components/Dropdown/Dropdown.js +1 -1
- package/lib/components/Dropdown/variables.js +1 -0
- package/lib/components/Menu/variables.js +3 -3
- package/lib/components/PageActions/PageActions.js +1 -1
- package/package.json +2 -2
- package/src/components/Buttons/EditPageButton.tsx +13 -34
- package/src/components/Dropdown/Dropdown.tsx +1 -1
- package/src/components/Dropdown/variables.ts +1 -0
- package/src/components/Menu/variables.ts +3 -3
- package/src/components/PageActions/PageActions.tsx +1 -1
|
@@ -8,37 +8,15 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const hooks_1 = require("../../core/hooks");
|
|
10
10
|
const EditIcon_1 = require("../../icons/EditIcon/EditIcon");
|
|
11
|
-
const
|
|
11
|
+
const Button_1 = require("../../components/Button/Button");
|
|
12
12
|
function EditPageButton({ to }) {
|
|
13
13
|
const { useTranslate, useTelemetry } = (0, hooks_1.useThemeHooks)();
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
15
|
const telemetry = useTelemetry();
|
|
16
|
-
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton"
|
|
17
|
-
react_1.default.createElement(
|
|
18
|
-
react_1.default.createElement(ButtonText, { "data-translation-key": "markdown.editPage.text" }, translate('markdown.editPage.text', 'Edit'))));
|
|
16
|
+
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton" },
|
|
17
|
+
react_1.default.createElement(Button_1.Button, { to: to, external: true, variant: "ghost", size: "small", icon: react_1.default.createElement(EditIcon_1.EditIcon, null), onClick: () => telemetry.sendEditPageLinkClickedMessage(), "data-translation-key": "markdown.editPage.text" }, translate('markdown.editPage.text', 'Edit'))));
|
|
19
18
|
}
|
|
20
|
-
const EditPageButtonWrapper =
|
|
21
|
-
height: fit-content;
|
|
19
|
+
const EditPageButtonWrapper = styled_components_1.default.div `
|
|
22
20
|
margin-left: auto;
|
|
23
|
-
display: inline-flex;
|
|
24
|
-
color: var(--text-color-secondary);
|
|
25
|
-
font-weight: var(--font-weight-bold);
|
|
26
|
-
font-size: var(--font-size-base);
|
|
27
|
-
font-family: var(--font-family-base);
|
|
28
|
-
text-decoration: none;
|
|
29
|
-
|
|
30
|
-
&:hover {
|
|
31
|
-
color: var(--text-color-primary);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@media print {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
38
|
-
const ButtonIcon = (0, styled_components_1.default)(EditIcon_1.EditIcon) `
|
|
39
|
-
margin-right: 3px;
|
|
40
|
-
`;
|
|
41
|
-
const ButtonText = styled_components_1.default.span `
|
|
42
|
-
line-height: 14px;
|
|
43
21
|
`;
|
|
44
22
|
//# sourceMappingURL=EditPageButton.js.map
|
|
@@ -97,6 +97,6 @@ const ChildrenWrapper = styled_components_1.default.div `
|
|
|
97
97
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
98
98
|
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
99
99
|
|
|
100
|
-
z-index: var(--z-index
|
|
100
|
+
z-index: var(--dropdown-menu-z-index);
|
|
101
101
|
`;
|
|
102
102
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -10,6 +10,7 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
10
10
|
--dropdown-menu-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
11
11
|
--dropdown-menu-line-height: var(--line-height-base); // @presenter LineHeight
|
|
12
12
|
--dropdown-menu-text-color: var(--text-color-secondary); // @presenter Color
|
|
13
|
+
--dropdown-menu-z-index: var(--z-index-raised); // @presenter ZIndex
|
|
13
14
|
|
|
14
15
|
--dropdown-menu-padding-top: var(--spacing-xxs);
|
|
15
16
|
--dropdown-menu-min-width: 100px;
|
|
@@ -131,12 +131,12 @@ exports.mobileMenu = (0, styled_components_1.css) `
|
|
|
131
131
|
* @tokens Mobile Menu
|
|
132
132
|
* */
|
|
133
133
|
/* Fallback for older browsers. dvh accounts for dynamic UI elements like mobile address bars */
|
|
134
|
-
--menu-mobile-height: calc(100vh - var(--navbar-height));
|
|
135
|
-
--menu-mobile-height: calc(100dvh - var(--navbar-height));
|
|
134
|
+
--menu-mobile-height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
135
|
+
--menu-mobile-height: calc(100dvh - var(--navbar-height) - var(--banner-height));
|
|
136
136
|
--menu-mobile-width: 100%;
|
|
137
137
|
--menu-mobile-z-index: var(--z-index-raised);
|
|
138
138
|
--menu-mobile-left: 0;
|
|
139
|
-
--menu-mobile-top: var(--navbar-height);
|
|
139
|
+
--menu-mobile-top: calc(var(--navbar-height) + var(--banner-height));
|
|
140
140
|
--menu-mobile-transition: 0.5s;
|
|
141
141
|
--menu-mobile-bg: var(--bg-color); // @presenter Color
|
|
142
142
|
--menu-mobile-margin: var(--menu-mobile-items-margin-top) var(--menu-mobile-margin-horizontal) 0 var(--menu-mobile-margin-horizontal);
|
|
@@ -115,7 +115,7 @@ const LinkMenuItem = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
115
115
|
--link-decoration-hover: none;
|
|
116
116
|
`;
|
|
117
117
|
const StyledDropdown = (0, styled_components_1.default)(Dropdown_1.Dropdown) `
|
|
118
|
-
z-index: calc(var(--z-index-raised) - 1);
|
|
118
|
+
--dropdown-menu-z-index: calc(var(--z-index-raised) - 1);
|
|
119
119
|
`;
|
|
120
120
|
const StyledDropdownMenu = (0, styled_components_1.default)(DropdownMenu_1.DropdownMenu) `
|
|
121
121
|
--dropdown-menu-max-height: var(--page-actions-dropdown-max-height);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.63.0-next.
|
|
3
|
+
"version": "0.63.0-next.1",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"vitest": "4.0.10",
|
|
64
64
|
"vitest-when": "0.6.2",
|
|
65
65
|
"webpack": "5.94.0",
|
|
66
|
-
"@redocly/realm-asyncapi-sdk": "0.9.0-next.
|
|
66
|
+
"@redocly/realm-asyncapi-sdk": "0.9.0-next.1"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@tanstack/react-query": "5.62.3",
|
|
@@ -5,7 +5,7 @@ import type { JSX } from 'react';
|
|
|
5
5
|
|
|
6
6
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
7
7
|
import { EditIcon } from '@redocly/theme/icons/EditIcon/EditIcon';
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from '@redocly/theme/components/Button/Button';
|
|
9
9
|
|
|
10
10
|
export type EditPageButtonProps = {
|
|
11
11
|
to: string;
|
|
@@ -17,43 +17,22 @@ export function EditPageButton({ to }: EditPageButtonProps): JSX.Element {
|
|
|
17
17
|
const telemetry = useTelemetry();
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<EditPageButtonWrapper
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
<EditPageButtonWrapper data-component-name="Buttons/EditPageButton">
|
|
21
|
+
<Button
|
|
22
|
+
to={to}
|
|
23
|
+
external={true}
|
|
24
|
+
variant="ghost"
|
|
25
|
+
size="small"
|
|
26
|
+
icon={<EditIcon />}
|
|
27
|
+
onClick={() => telemetry.sendEditPageLinkClickedMessage()}
|
|
28
|
+
data-translation-key="markdown.editPage.text"
|
|
29
|
+
>
|
|
28
30
|
{translate('markdown.editPage.text', 'Edit')}
|
|
29
|
-
</
|
|
31
|
+
</Button>
|
|
30
32
|
</EditPageButtonWrapper>
|
|
31
33
|
);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
const EditPageButtonWrapper = styled
|
|
35
|
-
height: fit-content;
|
|
36
|
+
const EditPageButtonWrapper = styled.div`
|
|
36
37
|
margin-left: auto;
|
|
37
|
-
display: inline-flex;
|
|
38
|
-
color: var(--text-color-secondary);
|
|
39
|
-
font-weight: var(--font-weight-bold);
|
|
40
|
-
font-size: var(--font-size-base);
|
|
41
|
-
font-family: var(--font-family-base);
|
|
42
|
-
text-decoration: none;
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
color: var(--text-color-primary);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@media print {
|
|
49
|
-
display: none;
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
|
|
53
|
-
const ButtonIcon = styled(EditIcon)`
|
|
54
|
-
margin-right: 3px;
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
const ButtonText = styled.span`
|
|
58
|
-
line-height: 14px;
|
|
59
38
|
`;
|
|
@@ -142,5 +142,5 @@ const ChildrenWrapper = styled.div<{ placement?: string; alignment?: string; isO
|
|
|
142
142
|
right: ${({ alignment }) => (alignment === 'end' ? '0' : 'auto')};
|
|
143
143
|
display: ${({ isOpen }) => (isOpen ? 'block' : 'none')};
|
|
144
144
|
|
|
145
|
-
z-index: var(--z-index
|
|
145
|
+
z-index: var(--dropdown-menu-z-index);
|
|
146
146
|
`;
|
|
@@ -8,6 +8,7 @@ export const dropdown = css`
|
|
|
8
8
|
--dropdown-menu-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
9
9
|
--dropdown-menu-line-height: var(--line-height-base); // @presenter LineHeight
|
|
10
10
|
--dropdown-menu-text-color: var(--text-color-secondary); // @presenter Color
|
|
11
|
+
--dropdown-menu-z-index: var(--z-index-raised); // @presenter ZIndex
|
|
11
12
|
|
|
12
13
|
--dropdown-menu-padding-top: var(--spacing-xxs);
|
|
13
14
|
--dropdown-menu-min-width: 100px;
|
|
@@ -130,12 +130,12 @@ export const mobileMenu = css`
|
|
|
130
130
|
* @tokens Mobile Menu
|
|
131
131
|
* */
|
|
132
132
|
/* Fallback for older browsers. dvh accounts for dynamic UI elements like mobile address bars */
|
|
133
|
-
--menu-mobile-height: calc(100vh - var(--navbar-height));
|
|
134
|
-
--menu-mobile-height: calc(100dvh - var(--navbar-height));
|
|
133
|
+
--menu-mobile-height: calc(100vh - var(--navbar-height) - var(--banner-height));
|
|
134
|
+
--menu-mobile-height: calc(100dvh - var(--navbar-height) - var(--banner-height));
|
|
135
135
|
--menu-mobile-width: 100%;
|
|
136
136
|
--menu-mobile-z-index: var(--z-index-raised);
|
|
137
137
|
--menu-mobile-left: 0;
|
|
138
|
-
--menu-mobile-top: var(--navbar-height);
|
|
138
|
+
--menu-mobile-top: calc(var(--navbar-height) + var(--banner-height));
|
|
139
139
|
--menu-mobile-transition: 0.5s;
|
|
140
140
|
--menu-mobile-bg: var(--bg-color); // @presenter Color
|
|
141
141
|
--menu-mobile-margin: var(--menu-mobile-items-margin-top) var(--menu-mobile-margin-horizontal) 0 var(--menu-mobile-margin-horizontal);
|
|
@@ -119,7 +119,7 @@ const LinkMenuItem = styled(Link)`
|
|
|
119
119
|
`;
|
|
120
120
|
|
|
121
121
|
const StyledDropdown = styled(Dropdown)`
|
|
122
|
-
z-index: calc(var(--z-index-raised) - 1);
|
|
122
|
+
--dropdown-menu-z-index: calc(var(--z-index-raised) - 1);
|
|
123
123
|
`;
|
|
124
124
|
|
|
125
125
|
const StyledDropdownMenu = styled(DropdownMenu)`
|