@redocly/theme 0.35.7 → 0.36.0
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/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +23 -3
- package/lib/components/Dropdown/styledVariables.js +4 -1
- package/lib/components/Feedback/Feedback.d.ts +1 -1
- package/lib/components/Feedback/Feedback.js +5 -1
- package/lib/components/Feedback/Stars.js +1 -1
- package/lib/components/Navbar/NavbarItem.js +14 -1
- package/lib/components/Navbar/styledVariables.js +4 -0
- package/lib/components/Profile/UserProfile.js +1 -1
- package/lib/types/portal/src/shared/constants.d.ts +1 -1
- package/lib/types/portal/src/shared/constants.js +2 -1
- package/lib/types/portal/src/shared/types/feedback.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/Dropdown/Dropdown.tsx +47 -12
- package/src/components/Dropdown/styledVariables.ts +4 -1
- package/src/components/Feedback/Feedback.tsx +11 -1
- package/src/components/Feedback/Stars.tsx +1 -0
- package/src/components/Navbar/NavbarItem.tsx +36 -7
- package/src/components/Navbar/styledVariables.ts +4 -0
- package/src/components/Profile/UserProfile.tsx +1 -1
- package/src/types/portal/src/shared/constants.ts +4 -4
- package/src/types/portal/src/shared/types/feedback.ts +1 -0
|
@@ -18,5 +18,5 @@ export declare const DropdownList: import("styled-components").StyledComponent<"
|
|
|
18
18
|
alignment?: string | undefined;
|
|
19
19
|
}, never>;
|
|
20
20
|
export declare const DropdownListItem: import("styled-components").StyledComponent<"li", any, {
|
|
21
|
-
|
|
21
|
+
separatorLine?: boolean | undefined;
|
|
22
22
|
}, never>;
|
|
@@ -51,8 +51,8 @@ const Dropdown = ({ children, className, items, withArrow, triggerEvent = 'click
|
|
|
51
51
|
icon,
|
|
52
52
|
withArrow ? isOpen ? react_1.default.createElement(icons_1.ArrowIcon, { direction: "up" }) : react_1.default.createElement(icons_1.ArrowIcon, { direction: "down" }) : null),
|
|
53
53
|
isOpen && (react_1.default.createElement(exports.DropdownList, { placement: placement, alignment: alignment }, items.map((item, index) => {
|
|
54
|
-
var _a;
|
|
55
|
-
return (react_1.default.createElement(exports.DropdownListItem, { key: index, onClick: () => handleClick(item),
|
|
54
|
+
var _a, _b, _c, _d;
|
|
55
|
+
return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.separator) ? (react_1.default.createElement(DropdownSeparatorItem, { key: index, separatorLine: (_b = item.props) === null || _b === void 0 ? void 0 : _b.separatorLine, linePosition: (_c = item.props) === null || _c === void 0 ? void 0 : _c.linePosition }, item)) : (react_1.default.createElement(exports.DropdownListItem, { key: index, onClick: () => handleClick(item), separatorLine: (_d = item.props) === null || _d === void 0 ? void 0 : _d.separatorLine }, item));
|
|
56
56
|
})))));
|
|
57
57
|
};
|
|
58
58
|
exports.Dropdown = Dropdown;
|
|
@@ -106,11 +106,31 @@ exports.DropdownListItem = styled_components_1.default.li `
|
|
|
106
106
|
background-color: var(--dropdown-list-item-active-background-color);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
${({
|
|
109
|
+
${({ separatorLine }) => separatorLine &&
|
|
110
110
|
(0, styled_components_1.css) `
|
|
111
111
|
border-bottom: 1px solid var(--dropdown-list-item-separator-color);
|
|
112
112
|
border-bottom-left-radius: 0;
|
|
113
113
|
border-bottom-right-radius: 0;
|
|
114
114
|
`}
|
|
115
115
|
`;
|
|
116
|
+
const DropdownSeparatorItem = styled_components_1.default.div `
|
|
117
|
+
display: block;
|
|
118
|
+
width: 100%;
|
|
119
|
+
border: none;
|
|
120
|
+
background: none;
|
|
121
|
+
padding: var(--dropdown-list-item-space-between) 0;
|
|
122
|
+
text-align: left;
|
|
123
|
+
cursor: default;
|
|
124
|
+
& > * {
|
|
125
|
+
padding: var(--dropdown-list-item-separator-padding-top)
|
|
126
|
+
var(--dropdown-list-item-horizontal-padding)
|
|
127
|
+
var(--dropdown-list-item-separator-padding-bottom);
|
|
128
|
+
}
|
|
129
|
+
${({ separatorLine, linePosition }) => separatorLine &&
|
|
130
|
+
(0, styled_components_1.css) `
|
|
131
|
+
border-${linePosition}: 1px solid var(--dropdown-list-item-separator-color);
|
|
132
|
+
border-${linePosition}-left-radius: 0;
|
|
133
|
+
border-${linePosition}-right-radius: 0;
|
|
134
|
+
`}
|
|
135
|
+
`;
|
|
116
136
|
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -20,11 +20,14 @@ exports.dropdown = (0, styled_components_1.css) `
|
|
|
20
20
|
--dropdown-list-box-shadow: var(--bg-raised-shadow); // @presenter Shadow
|
|
21
21
|
|
|
22
22
|
--dropdown-list-item-horizontal-padding: var(--spacing-base); // @presenter Spacing
|
|
23
|
-
--dropdown-list-item-vertical-padding:
|
|
23
|
+
--dropdown-list-item-vertical-padding: 5px; // @presenter Spacing
|
|
24
24
|
--dropdown-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
25
25
|
--dropdown-list-item-active-background-color: var(--bg-raised); // @presenter Color
|
|
26
26
|
--dropdown-list-item-separator-color: var(--border-primary); // @presenter Color
|
|
27
27
|
|
|
28
|
+
--dropdown-list-item-space-between: 2px; // @presenter Spacing
|
|
29
|
+
--dropdown-list-item-separator-padding-top: var(--spacing-xs); // @presenter Spacing
|
|
30
|
+
--dropdown-list-item-separator-padding-bottom: var(--spacing-xxs); // @presenter Spacing
|
|
28
31
|
// @tokens End
|
|
29
32
|
`;
|
|
30
33
|
//# sourceMappingURL=styledVariables.js.map
|
|
@@ -35,10 +35,14 @@ const hooks_1 = require("../../hooks");
|
|
|
35
35
|
const useSubmitFeedback_1 = require("../../mocks/Feedback/useSubmitFeedback");
|
|
36
36
|
const telemetry_1 = require("../../mocks/telemetry");
|
|
37
37
|
const Feedback = (props) => {
|
|
38
|
+
var _a;
|
|
38
39
|
const { submitFeedback } = (0, useSubmitFeedback_1.useSubmitFeedback)();
|
|
39
40
|
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
40
41
|
const { feedback: themeFeedbackConf } = (0, hooks_1.useThemeConfig)();
|
|
41
|
-
const feedbackConf = Object.assign(Object.assign({}, themeFeedbackConf), props);
|
|
42
|
+
const feedbackConf = Object.assign(Object.assign({}, themeFeedbackConf), { path: props === null || props === void 0 ? void 0 : props.path, type: (props === null || props === void 0 ? void 0 : props.type) || (themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.type), settings: (props === null || props === void 0 ? void 0 : props.settings) || (themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.settings) || {}, hide: (_a = props.hide) !== null && _a !== void 0 ? _a : themeFeedbackConf === null || themeFeedbackConf === void 0 ? void 0 : themeFeedbackConf.hide });
|
|
43
|
+
if (feedbackConf.hide) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
42
46
|
const renderFeedbackComponent = () => {
|
|
43
47
|
const { type, settings, path } = feedbackConf;
|
|
44
48
|
switch (type) {
|
|
@@ -33,7 +33,7 @@ const Stars = ({ max = 5, onChange, value }) => {
|
|
|
33
33
|
const [hovered, setHovered] = React.useState(value || 0);
|
|
34
34
|
const stars = [];
|
|
35
35
|
for (let index = 1; index <= max; index++) {
|
|
36
|
-
stars.push(React.createElement(Star, { key: index, onClick: () => onChange(index), onMouseOver: () => setHovered(index), onMouseLeave: () => !value && setHovered(0) },
|
|
36
|
+
stars.push(React.createElement(Star, { "data-testid": `star-${index}`, key: index, onClick: () => onChange(index), onMouseOver: () => setHovered(index), onMouseLeave: () => !value && setHovered(0) },
|
|
37
37
|
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20" }, hovered < index ? (React.createElement("g", { fill: "#e8c002" },
|
|
38
38
|
React.createElement("path", { d: "M20 7h-7L10 .5 7 7H0l5.46 5.47-1.64 7 6.18-3.7 6.18 3.73-1.63-7zm-10 6.9-3.76 2.27 1-4.28L3.5 8.5h4.61L10 4.6l1.9 3.9h4.6l-3.73 3.4 1 4.28z" }))) : (React.createElement("g", { fill: "#e8c002" },
|
|
39
39
|
React.createElement("path", { d: "M20 7h-7L10 .5 7 7H0l5.46 5.47-1.64 7 6.18-3.7 6.18 3.73-1.63-7z" }))))));
|
|
@@ -54,7 +54,15 @@ function NavbarItem({ navItem, className }) {
|
|
|
54
54
|
if (navItem.items) {
|
|
55
55
|
const item = navItem;
|
|
56
56
|
const groupItems = item.items;
|
|
57
|
-
const groupItemsComponents = groupItems.map((item, index) =>
|
|
57
|
+
const groupItemsComponents = groupItems.map((item, index) => {
|
|
58
|
+
if (item.type === 'link') {
|
|
59
|
+
return (react_1.default.createElement(Link_1.Link, { key: `${item.label}_${index}`, to: item.link, separatorLine: item.separatorLine }, translate(item.labelTranslationKey, item.label)));
|
|
60
|
+
}
|
|
61
|
+
if (item.type === 'separator') {
|
|
62
|
+
return (react_1.default.createElement(NavbarSeparator, { key: `${item.label}_${index}`, separator: true, separatorLine: item.separatorLine, linePosition: item.linePosition }, translate(item.labelTranslationKey, item.label)));
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
});
|
|
58
66
|
return (react_1.default.createElement(exports.NavbarMenuItemDropdown, { items: groupItemsComponents, triggerEvent: "hover" },
|
|
59
67
|
react_1.default.createElement(exports.NavbarMenuItem, { active: false, "data-component-name": "Navbar/NavbarItem", className: className, onClick: () => telemetry_1.telemetry.send('navbar_menu_item_clicked', { type: 'group' }) },
|
|
60
68
|
react_1.default.createElement(exports.NavbarIcon, { url: item.icon }),
|
|
@@ -125,4 +133,9 @@ exports.NavbarIcon = styled_components_1.default.i `
|
|
|
125
133
|
background-repeat: no-repeat;
|
|
126
134
|
`}
|
|
127
135
|
`;
|
|
136
|
+
const NavbarSeparator = styled_components_1.default.span `
|
|
137
|
+
font-size: var(--navbar-separator-font-size);
|
|
138
|
+
color: var(--navbar-separator-text-color);
|
|
139
|
+
line-height: var(--navbar-separator-line-height);
|
|
140
|
+
`;
|
|
128
141
|
//# sourceMappingURL=NavbarItem.js.map
|
|
@@ -38,5 +38,9 @@ exports.navbar = (0, styled_components_1.css) `
|
|
|
38
38
|
--navbar-item-icon-width: 1.5em; // @presenter Spacing
|
|
39
39
|
--navbar-item-icon-height: 1.5em; // @presenter Spacing
|
|
40
40
|
--navbar-item-icon-margin-right: 0.5em; // @presenter Spacing
|
|
41
|
+
|
|
42
|
+
--navbar-separator-text-color: var(--text-secondary);
|
|
43
|
+
--navbar-separator-font-size: var(--font-size-sm);
|
|
44
|
+
--navbar-separator-line-height: var(--line-height-sm);
|
|
41
45
|
`;
|
|
42
46
|
//# sourceMappingURL=styledVariables.js.map
|
|
@@ -47,7 +47,7 @@ function UserProfile({ userData, handleLogout, hasDeveloperOnboarding = false, }
|
|
|
47
47
|
}
|
|
48
48
|
if (userProfile && userProfile.menu) {
|
|
49
49
|
for (const item of userProfile.menu) {
|
|
50
|
-
menuItems.push(react_1.default.createElement(Link_1.Link, { external: item.external, key: item.label, to: item.link || '',
|
|
50
|
+
menuItems.push(react_1.default.createElement(Link_1.Link, { external: item.external, key: item.label, to: item.link || '', separatorLine: item === null || item === void 0 ? void 0 : item.separatorLine }, item.label));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
menuItems.push(react_1.default.createElement(Logout, { onClick: () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
|
|
1
|
+
export { REDOCLY_TEAMS_RBAC, REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
2
2
|
export declare const DEFAULT_THEME_NAME = "@redocly/theme";
|
|
3
3
|
export declare const USER_THEME_ALIAS = "@theme";
|
|
4
4
|
export declare const DEFAULT_LOCALE_PLACEHOLDER = "default_locale";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FsErrors = exports.ExternalRoutes = exports.DEV_LOGIN_SLUG = exports.FEEDBACK_TYPES = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.USER_THEME_ALIAS = exports.DEFAULT_THEME_NAME = exports.REDOCLY_TEAMS_RBAC = void 0;
|
|
3
|
+
exports.FsErrors = exports.ExternalRoutes = exports.DEV_LOGIN_SLUG = exports.FEEDBACK_TYPES = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.USER_THEME_ALIAS = exports.DEFAULT_THEME_NAME = exports.REDOCLY_ROUTE_RBAC = exports.REDOCLY_TEAMS_RBAC = void 0;
|
|
4
4
|
var config_1 = require("@redocly/config");
|
|
5
5
|
Object.defineProperty(exports, "REDOCLY_TEAMS_RBAC", { enumerable: true, get: function () { return config_1.REDOCLY_TEAMS_RBAC; } });
|
|
6
|
+
Object.defineProperty(exports, "REDOCLY_ROUTE_RBAC", { enumerable: true, get: function () { return config_1.REDOCLY_ROUTE_RBAC; } });
|
|
6
7
|
exports.DEFAULT_THEME_NAME = '@redocly/theme';
|
|
7
8
|
exports.USER_THEME_ALIAS = '@theme';
|
|
8
9
|
exports.DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"react-calendar": "4.2.1",
|
|
90
90
|
"react-date-picker": "10.0.3",
|
|
91
91
|
"timeago.js": "^4.0.2",
|
|
92
|
-
"@redocly/config": "0.
|
|
92
|
+
"@redocly/config": "0.2.0"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
@@ -69,15 +69,25 @@ export const Dropdown = ({
|
|
|
69
69
|
</DropdownHeader>
|
|
70
70
|
{isOpen && (
|
|
71
71
|
<DropdownList placement={placement} alignment={alignment}>
|
|
72
|
-
{items.map((item, index) =>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
{items.map((item, index) =>
|
|
73
|
+
(item as JSX.Element).props?.separator ? (
|
|
74
|
+
<DropdownSeparatorItem
|
|
75
|
+
key={index}
|
|
76
|
+
separatorLine={(item as JSX.Element).props?.separatorLine}
|
|
77
|
+
linePosition={(item as JSX.Element).props?.linePosition}
|
|
78
|
+
>
|
|
79
|
+
{item}
|
|
80
|
+
</DropdownSeparatorItem>
|
|
81
|
+
) : (
|
|
82
|
+
<DropdownListItem
|
|
83
|
+
key={index}
|
|
84
|
+
onClick={() => handleClick(item)}
|
|
85
|
+
separatorLine={(item as JSX.Element).props?.separatorLine}
|
|
86
|
+
>
|
|
87
|
+
{item}
|
|
88
|
+
</DropdownListItem>
|
|
89
|
+
),
|
|
90
|
+
)}
|
|
81
91
|
</DropdownList>
|
|
82
92
|
)}
|
|
83
93
|
</DropdownContainer>
|
|
@@ -126,7 +136,7 @@ export const DropdownList = styled.ul<{ placement?: string; alignment?: string }
|
|
|
126
136
|
z-index: 1;
|
|
127
137
|
`;
|
|
128
138
|
|
|
129
|
-
export const DropdownListItem = styled.li<{
|
|
139
|
+
export const DropdownListItem = styled.li<{ separatorLine?: boolean }>`
|
|
130
140
|
border-radius: var(--dropdown-list-item-border-radius);
|
|
131
141
|
|
|
132
142
|
& > * {
|
|
@@ -137,11 +147,36 @@ export const DropdownListItem = styled.li<{ separator?: boolean }>`
|
|
|
137
147
|
background-color: var(--dropdown-list-item-active-background-color);
|
|
138
148
|
}
|
|
139
149
|
|
|
140
|
-
${({
|
|
141
|
-
|
|
150
|
+
${({ separatorLine }) =>
|
|
151
|
+
separatorLine &&
|
|
142
152
|
css`
|
|
143
153
|
border-bottom: 1px solid var(--dropdown-list-item-separator-color);
|
|
144
154
|
border-bottom-left-radius: 0;
|
|
145
155
|
border-bottom-right-radius: 0;
|
|
146
156
|
`}
|
|
147
157
|
`;
|
|
158
|
+
|
|
159
|
+
const DropdownSeparatorItem = styled.div<{
|
|
160
|
+
separatorLine?: boolean;
|
|
161
|
+
linePosition: 'top' | 'bottom';
|
|
162
|
+
}>`
|
|
163
|
+
display: block;
|
|
164
|
+
width: 100%;
|
|
165
|
+
border: none;
|
|
166
|
+
background: none;
|
|
167
|
+
padding: var(--dropdown-list-item-space-between) 0;
|
|
168
|
+
text-align: left;
|
|
169
|
+
cursor: default;
|
|
170
|
+
& > * {
|
|
171
|
+
padding: var(--dropdown-list-item-separator-padding-top)
|
|
172
|
+
var(--dropdown-list-item-horizontal-padding)
|
|
173
|
+
var(--dropdown-list-item-separator-padding-bottom);
|
|
174
|
+
}
|
|
175
|
+
${({ separatorLine, linePosition }) =>
|
|
176
|
+
separatorLine &&
|
|
177
|
+
css`
|
|
178
|
+
border-${linePosition}: 1px solid var(--dropdown-list-item-separator-color);
|
|
179
|
+
border-${linePosition}-left-radius: 0;
|
|
180
|
+
border-${linePosition}-right-radius: 0;
|
|
181
|
+
`}
|
|
182
|
+
`;
|
|
@@ -18,10 +18,13 @@ export const dropdown = css`
|
|
|
18
18
|
--dropdown-list-box-shadow: var(--bg-raised-shadow); // @presenter Shadow
|
|
19
19
|
|
|
20
20
|
--dropdown-list-item-horizontal-padding: var(--spacing-base); // @presenter Spacing
|
|
21
|
-
--dropdown-list-item-vertical-padding:
|
|
21
|
+
--dropdown-list-item-vertical-padding: 5px; // @presenter Spacing
|
|
22
22
|
--dropdown-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
23
23
|
--dropdown-list-item-active-background-color: var(--bg-raised); // @presenter Color
|
|
24
24
|
--dropdown-list-item-separator-color: var(--border-primary); // @presenter Color
|
|
25
25
|
|
|
26
|
+
--dropdown-list-item-space-between: 2px; // @presenter Spacing
|
|
27
|
+
--dropdown-list-item-separator-padding-top: var(--spacing-xs); // @presenter Spacing
|
|
28
|
+
--dropdown-list-item-separator-padding-bottom: var(--spacing-xxs); // @presenter Spacing
|
|
26
29
|
// @tokens End
|
|
27
30
|
`;
|
|
@@ -12,7 +12,17 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
12
12
|
const { submitFeedback } = useSubmitFeedback();
|
|
13
13
|
const { pathname } = useLocation();
|
|
14
14
|
const { feedback: themeFeedbackConf } = useThemeConfig();
|
|
15
|
-
const feedbackConf = {
|
|
15
|
+
const feedbackConf = {
|
|
16
|
+
...themeFeedbackConf,
|
|
17
|
+
path: props?.path,
|
|
18
|
+
type: props?.type || themeFeedbackConf?.type,
|
|
19
|
+
settings: props?.settings || themeFeedbackConf?.settings || {},
|
|
20
|
+
hide: props.hide ?? themeFeedbackConf?.hide,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
if (feedbackConf.hide) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
16
26
|
|
|
17
27
|
const renderFeedbackComponent = () => {
|
|
18
28
|
const { type, settings, path } = feedbackConf;
|
|
@@ -15,6 +15,7 @@ export const Stars = ({ max = 5, onChange, value }: StarsProps): JSX.Element =>
|
|
|
15
15
|
for (let index = 1; index <= max; index++) {
|
|
16
16
|
stars.push(
|
|
17
17
|
<Star
|
|
18
|
+
data-testid={`star-${index}`}
|
|
18
19
|
key={index}
|
|
19
20
|
onClick={() => onChange(index)}
|
|
20
21
|
onMouseOver={() => setHovered(index)}
|
|
@@ -49,15 +49,34 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
49
49
|
|
|
50
50
|
if ((navItem as ResolvedNavGroupItem).items) {
|
|
51
51
|
const item = navItem as ResolvedNavGroupItem;
|
|
52
|
-
const groupItems = item.items as
|
|
53
|
-
const groupItemsComponents = groupItems.map((item, index) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const groupItems = item.items as ResolvedNavItem[];
|
|
53
|
+
const groupItemsComponents = groupItems.map((item, index) => {
|
|
54
|
+
if (item.type === 'link') {
|
|
55
|
+
return (
|
|
56
|
+
<Link key={`${item.label}_${index}`} to={item.link} separatorLine={item.separatorLine}>
|
|
57
|
+
{translate(item.labelTranslationKey, item.label)}
|
|
58
|
+
</Link>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (item.type === 'separator') {
|
|
63
|
+
return (
|
|
64
|
+
<NavbarSeparator
|
|
65
|
+
key={`${item.label}_${index}`}
|
|
66
|
+
separator={true}
|
|
67
|
+
separatorLine={item.separatorLine}
|
|
68
|
+
linePosition={item.linePosition}
|
|
69
|
+
>
|
|
70
|
+
{translate(item.labelTranslationKey, item.label)}
|
|
71
|
+
</NavbarSeparator>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return null;
|
|
76
|
+
});
|
|
58
77
|
|
|
59
78
|
return (
|
|
60
|
-
<NavbarMenuItemDropdown items={groupItemsComponents} triggerEvent="hover">
|
|
79
|
+
<NavbarMenuItemDropdown items={groupItemsComponents as JSX.Element[]} triggerEvent="hover">
|
|
61
80
|
<NavbarMenuItem
|
|
62
81
|
active={false}
|
|
63
82
|
data-component-name="Navbar/NavbarItem"
|
|
@@ -146,3 +165,13 @@ export const NavbarIcon = styled.i<{ url?: string }>`
|
|
|
146
165
|
background-repeat: no-repeat;
|
|
147
166
|
`}
|
|
148
167
|
`;
|
|
168
|
+
|
|
169
|
+
const NavbarSeparator = styled.span<{
|
|
170
|
+
separator: true;
|
|
171
|
+
separatorLine?: boolean;
|
|
172
|
+
linePosition?: 'top' | 'bottom';
|
|
173
|
+
}>`
|
|
174
|
+
font-size: var(--navbar-separator-font-size);
|
|
175
|
+
color: var(--navbar-separator-text-color);
|
|
176
|
+
line-height: var(--navbar-separator-line-height);
|
|
177
|
+
`;
|
|
@@ -36,4 +36,8 @@ export const navbar = css`
|
|
|
36
36
|
--navbar-item-icon-width: 1.5em; // @presenter Spacing
|
|
37
37
|
--navbar-item-icon-height: 1.5em; // @presenter Spacing
|
|
38
38
|
--navbar-item-icon-margin-right: 0.5em; // @presenter Spacing
|
|
39
|
+
|
|
40
|
+
--navbar-separator-text-color: var(--text-secondary);
|
|
41
|
+
--navbar-separator-font-size: var(--font-size-sm);
|
|
42
|
+
--navbar-separator-line-height: var(--line-height-sm);
|
|
39
43
|
`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
|
|
1
|
+
export { REDOCLY_TEAMS_RBAC, REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
2
2
|
|
|
3
3
|
export const DEFAULT_THEME_NAME = '@redocly/theme';
|
|
4
4
|
export const USER_THEME_ALIAS = '@theme';
|
|
5
|
-
export const DEFAULT_LOCALE_PLACEHOLDER = 'default_locale'
|
|
6
|
-
export type REQUIRED_OIDC_SCOPES =
|
|
5
|
+
export const DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
|
|
6
|
+
export type REQUIRED_OIDC_SCOPES = string[];
|
|
7
7
|
export type DEFAULT_COOKIE_EXPIRATION = number;
|
|
8
8
|
export enum FEEDBACK_TYPES {
|
|
9
9
|
RATING = 'rating',
|
|
@@ -19,4 +19,4 @@ export enum ExternalRoutes {
|
|
|
19
19
|
}
|
|
20
20
|
export enum FsErrors {
|
|
21
21
|
NotExist = 'ENOENT',
|
|
22
|
-
}
|
|
22
|
+
}
|