@redocly/theme 0.37.4 → 0.37.7
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 +1 -1
- package/lib/components/ColorModeSwitcher/ColorModeSwitcher.js +1 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +1 -1
- package/lib/components/Menu/MenuItem.js +21 -0
- package/lib/components/Navbar/Navbar.js +1 -1
- package/lib/components/UserMenu/LoginButton.js +1 -1
- package/lib/core/hooks/feedback/use-report-dialog.js +1 -1
- package/lib/core/styles/dark.js +13 -0
- package/lib/core/styles/global.js +21 -0
- package/package.json +3 -3
- package/src/components/Buttons/EditPageButton.tsx +1 -0
- package/src/components/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/components/LanguagePicker/LanguagePicker.tsx +1 -1
- package/src/components/Menu/MenuItem.tsx +21 -0
- package/src/components/Navbar/Navbar.tsx +1 -1
- package/src/components/UserMenu/LoginButton.tsx +1 -1
- package/src/core/hooks/feedback/use-report-dialog.ts +1 -1
- package/src/core/styles/dark.ts +14 -0
- package/src/core/styles/global.ts +22 -0
|
@@ -13,7 +13,7 @@ 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", to: to, onClick: () => telemetry.send('edit_page_link_clicked', {}) },
|
|
16
|
+
return (react_1.default.createElement(EditPageButtonWrapper, { "data-component-name": "Buttons/EditPageButton", target: "_blank", to: to, onClick: () => telemetry.send('edit_page_link_clicked', {}) },
|
|
17
17
|
react_1.default.createElement(ButtonIcon, null),
|
|
18
18
|
react_1.default.createElement(ButtonText, { "data-translation-key": "theme.markdown.editPage.text" }, translate('theme.markdown.editPage.text', 'Edit'))));
|
|
19
19
|
}
|
|
@@ -16,7 +16,7 @@ function ColorModeSwitcher({ className }) {
|
|
|
16
16
|
if (isSwitcherHidden) {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
return (react_1.default.createElement(Button_1.Button, { "data-component-name": "ColorModeSwitcher/ColorModeSwitcher", "data-testid": "color-mode-switcher", onClick: () => setActiveColorMode(switchColorMode()), extraClass: className, variant: "
|
|
19
|
+
return (react_1.default.createElement(Button_1.Button, { "data-component-name": "ColorModeSwitcher/ColorModeSwitcher", "data-testid": "color-mode-switcher", onClick: () => setActiveColorMode(switchColorMode()), extraClass: className, variant: "secondary", size: "medium", icon: react_1.default.createElement(ColorModeIcon_1.ColorModeIcon, { mode: activeColorMode }) }));
|
|
20
20
|
}
|
|
21
21
|
exports.ColorModeSwitcher = ColorModeSwitcher;
|
|
22
22
|
//# sourceMappingURL=ColorModeSwitcher.js.map
|
|
@@ -20,7 +20,7 @@ function LanguagePicker(props) {
|
|
|
20
20
|
if (locales.length < 2 || !currentLocale) {
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
|
-
const languagePickerButton = (react_1.default.createElement(Button_1.Button, { icon: react_1.default.createElement(GlobalOutlinedIcon_1.GlobalOutlinedIcon, { color: "--button-content-color" }), variant: "
|
|
23
|
+
const languagePickerButton = (react_1.default.createElement(Button_1.Button, { icon: react_1.default.createElement(GlobalOutlinedIcon_1.GlobalOutlinedIcon, { color: "--button-content-color" }), variant: "secondary", size: "medium" }));
|
|
24
24
|
const languageItems = locales.map((locale) => ({
|
|
25
25
|
content: locale.name || locale.code || '',
|
|
26
26
|
onAction: () => {
|
|
@@ -167,6 +167,13 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
|
|
|
167
167
|
color: ${deprecated ? 'var(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
168
168
|
background-color: var(--menu-item-bg-color-active);
|
|
169
169
|
|
|
170
|
+
${ChevronDownIcon_1.ChevronDownIcon} path {
|
|
171
|
+
fill: var(--menu-item-color-active);
|
|
172
|
+
}
|
|
173
|
+
${ChevronRightIcon_1.ChevronRightIcon} path {
|
|
174
|
+
fill: var(--menu-item-color-active);
|
|
175
|
+
}
|
|
176
|
+
|
|
170
177
|
&:hover {
|
|
171
178
|
background: var(--menu-item-bg-color-active);
|
|
172
179
|
}
|
|
@@ -184,11 +191,25 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
|
|
|
184
191
|
&:hover {
|
|
185
192
|
color: var(--menu-item-color-hover);
|
|
186
193
|
background: var(--menu-item-bg-color-hover);
|
|
194
|
+
|
|
195
|
+
${ChevronDownIcon_1.ChevronDownIcon} path {
|
|
196
|
+
fill: var(--menu-item-color-hover);
|
|
197
|
+
}
|
|
198
|
+
${ChevronRightIcon_1.ChevronRightIcon} path {
|
|
199
|
+
fill: var(--menu-item-color-hover);
|
|
200
|
+
}
|
|
187
201
|
}
|
|
188
202
|
|
|
189
203
|
&:active {
|
|
190
204
|
color: var(--menu-item-color-active);
|
|
191
205
|
background: var(--menu-item-bg-color-active);
|
|
206
|
+
|
|
207
|
+
${ChevronDownIcon_1.ChevronDownIcon} path {
|
|
208
|
+
fill: var(--menu-item-color-active);
|
|
209
|
+
}
|
|
210
|
+
${ChevronRightIcon_1.ChevronRightIcon} path {
|
|
211
|
+
fill: var(--menu-item-color-active);
|
|
212
|
+
}
|
|
192
213
|
}
|
|
193
214
|
|
|
194
215
|
&:empty {
|
|
@@ -88,7 +88,7 @@ const NavbarRow = styled_components_1.default.div `
|
|
|
88
88
|
align-items: center;
|
|
89
89
|
justify-content: space-between;
|
|
90
90
|
width: 100%;
|
|
91
|
-
gap:
|
|
91
|
+
gap: 8px;
|
|
92
92
|
max-width: var(--navbar-container-max-width);
|
|
93
93
|
`;
|
|
94
94
|
const MobileMenuButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
@@ -12,7 +12,7 @@ function LoginButton({ href, className }) {
|
|
|
12
12
|
const { translate } = useTranslate();
|
|
13
13
|
const telemetry = useTelemetry();
|
|
14
14
|
return (react_1.default.createElement("div", { "data-component-name": "UserMenu/LoginButton", className: className },
|
|
15
|
-
react_1.default.createElement(Button_1.Button, { "data-translation-key": "theme.userMenu.login", to: href, onClick: () => telemetry.send('login_button_clicked', {}), "data-testid": "login-btn", extraClass: className, variant: "
|
|
15
|
+
react_1.default.createElement(Button_1.Button, { "data-translation-key": "theme.userMenu.login", to: href, onClick: () => telemetry.send('login_button_clicked', {}), "data-testid": "login-btn", extraClass: className, variant: "primary", size: "medium" }, translate('theme.userMenu.login', 'Login'))));
|
|
16
16
|
}
|
|
17
17
|
exports.LoginButton = LoginButton;
|
|
18
18
|
//# sourceMappingURL=LoginButton.js.map
|
package/lib/core/styles/dark.js
CHANGED
|
@@ -10,6 +10,18 @@ const variables_dark_5 = require("../../components/Segmented/variables.dark");
|
|
|
10
10
|
const variables_dark_6 = require("../../icons/CheckboxIcon/variables.dark");
|
|
11
11
|
const variables_dark_7 = require("../../components/Tag/variables.dark");
|
|
12
12
|
const variables_dark_8 = require("../../components/StatusCode/variables.dark");
|
|
13
|
+
const replayDarkMode = (0, styled_components_1.css) `
|
|
14
|
+
/**
|
|
15
|
+
* @tokens Replay Colors
|
|
16
|
+
* @presenter Color
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
--replay-undefined-variable-bg-color: rgba(249, 49, 109, 0.18); // @presenter Color
|
|
20
|
+
--replay-defined-variable-bg-color: rgba(31, 124, 255, 0.18); // @presenter Color
|
|
21
|
+
--replay-server-variable-bg-color: rgba(119, 45, 240, 0.2); // @presenter Color
|
|
22
|
+
|
|
23
|
+
// @tokens End
|
|
24
|
+
`;
|
|
13
25
|
exports.darkMode = (0, styled_components_1.css) `
|
|
14
26
|
/* === Dark Theme Colors === */
|
|
15
27
|
|
|
@@ -286,6 +298,7 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
286
298
|
${variables_dark_3.menuDarkMode}
|
|
287
299
|
${variables_dark_2.mermaidDarkMode}
|
|
288
300
|
${variables_dark_1.scorecardDarkMode}
|
|
301
|
+
${replayDarkMode}
|
|
289
302
|
|
|
290
303
|
/**
|
|
291
304
|
* @tokens Dark Theme Scrollbar Config
|
|
@@ -1104,6 +1104,26 @@ const tree = (0, styled_components_1.css) `
|
|
|
1104
1104
|
|
|
1105
1105
|
// @tokens End
|
|
1106
1106
|
`;
|
|
1107
|
+
const replay = (0, styled_components_1.css) `
|
|
1108
|
+
/**
|
|
1109
|
+
* @tokens Replay Colors
|
|
1110
|
+
* @presenter Color
|
|
1111
|
+
*/
|
|
1112
|
+
|
|
1113
|
+
--replay-undefined-variable-color: var(--color-raspberry-6); // @presenter Color
|
|
1114
|
+
--replay-defined-variable-color: var(--color-blue-6); // @presenter Color
|
|
1115
|
+
--replay-server-variable-color: var(--color-purple-6); // @presenter Color
|
|
1116
|
+
|
|
1117
|
+
--replay-undefined-variable-bg-color: rgba(249, 49, 109, 0.08); // @presenter Color
|
|
1118
|
+
--replay-defined-variable-bg-color: rgba(31, 124, 255, 0.08); // @presenter Color
|
|
1119
|
+
--replay-server-variable-bg-color: rgba(119, 45, 240, 0.08); // @presenter Color
|
|
1120
|
+
|
|
1121
|
+
--replay-undefined-variable-bg-color-hover: var(--color-raspberry-2); // @presenter Color
|
|
1122
|
+
--replay-defined-variable-bg-color-hover: var(--color-blue-2); // @presenter Color
|
|
1123
|
+
--replay-server-variable-bg-color-hover: var(--color-purple-2); // @presenter Color
|
|
1124
|
+
|
|
1125
|
+
// @tokens End
|
|
1126
|
+
`;
|
|
1107
1127
|
exports.styles = (0, styled_components_1.css) `
|
|
1108
1128
|
:root {
|
|
1109
1129
|
${variables_15.admonition}
|
|
@@ -1161,6 +1181,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
1161
1181
|
${variables_3.feedback}
|
|
1162
1182
|
${variables_2.scorecard}
|
|
1163
1183
|
${variables_33.datePicker}
|
|
1184
|
+
${replay}
|
|
1164
1185
|
--api-catalog-card-min-width: 250px;
|
|
1165
1186
|
|
|
1166
1187
|
background-color: var(--bg-color);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.7",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"npm-run-all2": "5.0.2",
|
|
75
75
|
"react-refresh": "0.14.2",
|
|
76
76
|
"react-router-dom": "6.21.1",
|
|
77
|
-
"rimraf": "5.0.
|
|
77
|
+
"rimraf": "5.0.7",
|
|
78
78
|
"storybook": "7.6.19",
|
|
79
79
|
"storybook-addon-pseudo-states": "3.1.1",
|
|
80
80
|
"storybook-design-token": "3.1.0",
|
|
@@ -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.6.
|
|
101
|
+
"@redocly/config": "0.6.2"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
104
104
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
@@ -26,7 +26,7 @@ export function ColorModeSwitcher({ className }: ColorModeSwitcherProps): JSX.El
|
|
|
26
26
|
data-testid="color-mode-switcher"
|
|
27
27
|
onClick={() => setActiveColorMode(switchColorMode())}
|
|
28
28
|
extraClass={className}
|
|
29
|
-
variant="
|
|
29
|
+
variant="secondary"
|
|
30
30
|
size="medium"
|
|
31
31
|
icon={<ColorModeIcon mode={activeColorMode} />}
|
|
32
32
|
/>
|
|
@@ -236,6 +236,13 @@ const MenuItemLabelWrapper = styled.li<{
|
|
|
236
236
|
color: ${deprecated ? 'var(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
237
237
|
background-color: var(--menu-item-bg-color-active);
|
|
238
238
|
|
|
239
|
+
${ChevronDownIcon} path {
|
|
240
|
+
fill: var(--menu-item-color-active);
|
|
241
|
+
}
|
|
242
|
+
${ChevronRightIcon} path {
|
|
243
|
+
fill: var(--menu-item-color-active);
|
|
244
|
+
}
|
|
245
|
+
|
|
239
246
|
&:hover {
|
|
240
247
|
background: var(--menu-item-bg-color-active);
|
|
241
248
|
}
|
|
@@ -254,11 +261,25 @@ const MenuItemLabelWrapper = styled.li<{
|
|
|
254
261
|
&:hover {
|
|
255
262
|
color: var(--menu-item-color-hover);
|
|
256
263
|
background: var(--menu-item-bg-color-hover);
|
|
264
|
+
|
|
265
|
+
${ChevronDownIcon} path {
|
|
266
|
+
fill: var(--menu-item-color-hover);
|
|
267
|
+
}
|
|
268
|
+
${ChevronRightIcon} path {
|
|
269
|
+
fill: var(--menu-item-color-hover);
|
|
270
|
+
}
|
|
257
271
|
}
|
|
258
272
|
|
|
259
273
|
&:active {
|
|
260
274
|
color: var(--menu-item-color-active);
|
|
261
275
|
background: var(--menu-item-bg-color-active);
|
|
276
|
+
|
|
277
|
+
${ChevronDownIcon} path {
|
|
278
|
+
fill: var(--menu-item-color-active);
|
|
279
|
+
}
|
|
280
|
+
${ChevronRightIcon} path {
|
|
281
|
+
fill: var(--menu-item-color-active);
|
|
282
|
+
}
|
|
262
283
|
}
|
|
263
284
|
|
|
264
285
|
&:empty {
|
|
@@ -21,7 +21,7 @@ export function LoginButton({ href, className }: LoginButtonProps): JSX.Element
|
|
|
21
21
|
onClick={() => telemetry.send('login_button_clicked', {})}
|
|
22
22
|
data-testid="login-btn"
|
|
23
23
|
extraClass={className}
|
|
24
|
-
variant="
|
|
24
|
+
variant="primary"
|
|
25
25
|
size="medium"
|
|
26
26
|
>
|
|
27
27
|
{translate('theme.userMenu.login', 'Login')}
|
|
@@ -29,7 +29,7 @@ export function useReportDialog(): Record<string, ReportComponentsProps> {
|
|
|
29
29
|
const hideReportDialog = () => {
|
|
30
30
|
setTimeout(function () {
|
|
31
31
|
setIsReportDialogShown(false);
|
|
32
|
-
},
|
|
32
|
+
}, 3000);
|
|
33
33
|
};
|
|
34
34
|
const closeReportDialog = () => {
|
|
35
35
|
setIsReportDialogShown(false);
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -9,6 +9,19 @@ import { checkboxDarkMode } from '@redocly/theme/icons/CheckboxIcon/variables.da
|
|
|
9
9
|
import { tagDarkMode } from '@redocly/theme/components/Tag/variables.dark';
|
|
10
10
|
import { statusCodeDarkMode } from '@redocly/theme/components/StatusCode/variables.dark';
|
|
11
11
|
|
|
12
|
+
const replayDarkMode = css`
|
|
13
|
+
/**
|
|
14
|
+
* @tokens Replay Colors
|
|
15
|
+
* @presenter Color
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
--replay-undefined-variable-bg-color: rgba(249, 49, 109, 0.18); // @presenter Color
|
|
19
|
+
--replay-defined-variable-bg-color: rgba(31, 124, 255, 0.18); // @presenter Color
|
|
20
|
+
--replay-server-variable-bg-color: rgba(119, 45, 240, 0.2); // @presenter Color
|
|
21
|
+
|
|
22
|
+
// @tokens End
|
|
23
|
+
`;
|
|
24
|
+
|
|
12
25
|
export const darkMode = css`
|
|
13
26
|
/* === Dark Theme Colors === */
|
|
14
27
|
|
|
@@ -285,6 +298,7 @@ export const darkMode = css`
|
|
|
285
298
|
${menuDarkMode}
|
|
286
299
|
${mermaidDarkMode}
|
|
287
300
|
${scorecardDarkMode}
|
|
301
|
+
${replayDarkMode}
|
|
288
302
|
|
|
289
303
|
/**
|
|
290
304
|
* @tokens Dark Theme Scrollbar Config
|
|
@@ -1126,6 +1126,27 @@ const tree = css`
|
|
|
1126
1126
|
// @tokens End
|
|
1127
1127
|
`;
|
|
1128
1128
|
|
|
1129
|
+
const replay = css`
|
|
1130
|
+
/**
|
|
1131
|
+
* @tokens Replay Colors
|
|
1132
|
+
* @presenter Color
|
|
1133
|
+
*/
|
|
1134
|
+
|
|
1135
|
+
--replay-undefined-variable-color: var(--color-raspberry-6); // @presenter Color
|
|
1136
|
+
--replay-defined-variable-color: var(--color-blue-6); // @presenter Color
|
|
1137
|
+
--replay-server-variable-color: var(--color-purple-6); // @presenter Color
|
|
1138
|
+
|
|
1139
|
+
--replay-undefined-variable-bg-color: rgba(249, 49, 109, 0.08); // @presenter Color
|
|
1140
|
+
--replay-defined-variable-bg-color: rgba(31, 124, 255, 0.08); // @presenter Color
|
|
1141
|
+
--replay-server-variable-bg-color: rgba(119, 45, 240, 0.08); // @presenter Color
|
|
1142
|
+
|
|
1143
|
+
--replay-undefined-variable-bg-color-hover: var(--color-raspberry-2); // @presenter Color
|
|
1144
|
+
--replay-defined-variable-bg-color-hover: var(--color-blue-2); // @presenter Color
|
|
1145
|
+
--replay-server-variable-bg-color-hover: var(--color-purple-2); // @presenter Color
|
|
1146
|
+
|
|
1147
|
+
// @tokens End
|
|
1148
|
+
`;
|
|
1149
|
+
|
|
1129
1150
|
export const styles = css`
|
|
1130
1151
|
:root {
|
|
1131
1152
|
${admonition}
|
|
@@ -1183,6 +1204,7 @@ export const styles = css`
|
|
|
1183
1204
|
${feedback}
|
|
1184
1205
|
${scorecard}
|
|
1185
1206
|
${datePicker}
|
|
1207
|
+
${replay}
|
|
1186
1208
|
--api-catalog-card-min-width: 250px;
|
|
1187
1209
|
|
|
1188
1210
|
background-color: var(--bg-color);
|