@redocly/theme 0.83.0-rc.5 → 0.83.0-rc.6
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/Markdown/styles/baseTable.js +4 -0
- package/lib/components/Menu/MenuItem.js +3 -2
- package/lib/components/Search/SearchItem.js +13 -1
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/variables.js +5 -0
- package/lib/core/types/search.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/Markdown/styles/baseTable.ts +4 -0
- package/src/components/Menu/MenuItem.tsx +3 -2
- package/src/components/Search/SearchItem.tsx +16 -1
- package/src/components/Tag/Tag.tsx +7 -1
- package/src/components/Tag/variables.ts +5 -0
- package/src/core/types/search.ts +1 -0
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.markdownBaseTableCss = void 0;
|
|
4
4
|
const styled_components_1 = require("styled-components");
|
|
5
5
|
exports.markdownBaseTableCss = (0, styled_components_1.css) `
|
|
6
|
+
.md-table-wrapper {
|
|
7
|
+
overflow-x: auto;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
table.md {
|
|
7
11
|
width: 100%;
|
|
8
12
|
overflow: hidden;
|
|
@@ -61,6 +61,7 @@ function MenuItem(props) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
const chevron = hasChevron ? (isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { size: "var(--menu-item-label-chevron-size)", color: "--tree-content-color-default" }))) : null;
|
|
64
|
+
const httpColor = item.deprecated ? 'http-deprecated' : item.httpVerb;
|
|
64
65
|
const label = item.label && (react_1.default.createElement(MenuItemLabelWrapper, { active: item.active, deprecated: item.deprecated, depth: depth, withChevron: hasChevron, onClick: handleOnClick, ref: labelRef, role: item.link ? 'none' : 'link' },
|
|
65
66
|
chevron,
|
|
66
67
|
item.icon ? react_1.default.createElement(MenuItemIcon, { src: item.icon }) : null,
|
|
@@ -71,7 +72,7 @@ function MenuItem(props) {
|
|
|
71
72
|
item.external ? react_1.default.createElement(LaunchIcon_1.LaunchIcon, { size: "var(--menu-item-external-icon-size)" }) : null),
|
|
72
73
|
item.sublabel ? (react_1.default.createElement(MenuItemSubLabel, null, translate(item.subLabelTranslationKey, item.sublabel))) : null),
|
|
73
74
|
isDrilldown ? react_1.default.createElement(ArrowRightIcon_1.ArrowRightIcon, { size: "12px" }) : null,
|
|
74
|
-
isOperation ? (react_1.default.createElement(HttpTag_1.HttpTag, { color:
|
|
75
|
+
isOperation ? (react_1.default.createElement(HttpTag_1.HttpTag, { color: httpColor || '' }, item.httpVerb === 'hook' ? 'event' : item.httpVerb)) : null));
|
|
75
76
|
return (react_1.default.createElement(MenuItemWrapper, { "data-component-name": "Menu/MenuItem", className: generateClassName({ type, item, className }) },
|
|
76
77
|
item.link ? (react_1.default.createElement(MenuItemLink, { to: item.link, external: item.external, target: item.target, languageInsensitive: item.languageInsensitive }, label)) : (label),
|
|
77
78
|
isNested ? (react_1.default.createElement(MenuItemNestedWrapper, { depth: depth, ref: nestedMenuRef, style: style }, isExpanded || !canUnmount ? props.children : null)) : null,
|
|
@@ -163,7 +164,7 @@ const MenuItemLabelWrapper = styled_components_1.default.li `
|
|
|
163
164
|
|
|
164
165
|
${({ active, deprecated }) => active &&
|
|
165
166
|
(0, styled_components_1.css) `
|
|
166
|
-
color: ${deprecated ? '(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
167
|
+
color: ${deprecated ? 'var(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
167
168
|
background-color: var(--menu-item-bg-color-active);
|
|
168
169
|
|
|
169
170
|
&:hover {
|
|
@@ -33,6 +33,7 @@ const HttpTag_1 = require("../../components/Tags/HttpTag");
|
|
|
33
33
|
const Link_1 = require("../../components/Link/Link");
|
|
34
34
|
const Image_1 = require("../../components/Image/Image");
|
|
35
35
|
const SearchHighlight_1 = require("../../components/Search/SearchHighlight");
|
|
36
|
+
const Badge_1 = require("../../components/Badge/Badge");
|
|
36
37
|
function SearchItem({ item, className, product }) {
|
|
37
38
|
var _a, _b, _c, _d;
|
|
38
39
|
const ref = (0, react_1.useRef)();
|
|
@@ -51,7 +52,9 @@ function SearchItem({ item, className, product }) {
|
|
|
51
52
|
item.httpVerb ? (react_1.default.createElement(SearchItemOperation, null,
|
|
52
53
|
react_1.default.createElement(SearchItemOperationTag, { color: item.httpVerb }, item.httpVerb.toUpperCase()),
|
|
53
54
|
item.pathName ? (0, SearchHighlight_1.highlight)(item.pathName) : null)) : null,
|
|
54
|
-
react_1.default.createElement(
|
|
55
|
+
react_1.default.createElement(SearchItemTitleWrapper, null,
|
|
56
|
+
react_1.default.createElement(SearchItemTitle, null, (0, SearchHighlight_1.highlight)(item.title)),
|
|
57
|
+
item.deprecated ? react_1.default.createElement(SearchItemBadge, { deprecated: true }, "Deprecated") : null),
|
|
55
58
|
Array.isArray(item.text) ? (react_1.default.createElement(SearchItemDescription, null, (0, SearchHighlight_1.highlight)(item.text))) : null),
|
|
56
59
|
itemParam ? (react_1.default.createElement(SearchItemPlace, null,
|
|
57
60
|
react_1.default.createElement("div", null,
|
|
@@ -86,6 +89,10 @@ const SearchItemWrapper = (0, styled_components_1.default)(Link_1.Link) `
|
|
|
86
89
|
const SearchItemHeader = styled_components_1.default.div `
|
|
87
90
|
position: relative;
|
|
88
91
|
`;
|
|
92
|
+
const SearchItemTitleWrapper = styled_components_1.default.div `
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
`;
|
|
89
96
|
const SearchItemTitle = styled_components_1.default.div `
|
|
90
97
|
overflow: hidden;
|
|
91
98
|
text-overflow: ellipsis;
|
|
@@ -95,6 +102,11 @@ const SearchItemTitle = styled_components_1.default.div `
|
|
|
95
102
|
font-weight: var(--search-item-title-font-weight);
|
|
96
103
|
line-height: var(--search-item-title-line-height);
|
|
97
104
|
`;
|
|
105
|
+
const SearchItemBadge = (0, styled_components_1.default)(Badge_1.Badge) `
|
|
106
|
+
font-size: var(--font-size-sm);
|
|
107
|
+
line-height: var(--line-height-sm);
|
|
108
|
+
font-weight: var(--font-weight-regular);
|
|
109
|
+
`;
|
|
98
110
|
const SearchItemOperation = styled_components_1.default.div `
|
|
99
111
|
display: inline-flex;
|
|
100
112
|
align-items: baseline;
|
|
@@ -3,7 +3,8 @@ type DefaultStatusColor = 'success' | 'processing' | 'error' | 'warning' | 'defa
|
|
|
3
3
|
type ActionStatusColor = 'approved' | 'declined' | 'pending';
|
|
4
4
|
type SubjectStatusColor = 'active' | 'draft' | 'deprecated' | 'product';
|
|
5
5
|
type HttpColor = 'get' | 'post' | 'put' | 'delete' | 'option' | 'patch' | 'head' | 'hook' | 'link';
|
|
6
|
-
type
|
|
6
|
+
type HttpStatusColor = 'http-deprecated';
|
|
7
|
+
type StatusColor = DefaultStatusColor | ActionStatusColor | SubjectStatusColor | HttpColor | HttpStatusColor;
|
|
7
8
|
type Color = 'red' | 'green' | 'blue' | 'grey' | 'gold' | 'cyan' | 'magenta' | 'purple' | 'lime' | 'geekblue' | 'yellow';
|
|
8
9
|
export type TagProps = {
|
|
9
10
|
className?: string;
|
|
@@ -163,6 +163,7 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
163
163
|
--tag-operation-color-post: #1E65F5;
|
|
164
164
|
--tag-operation-color-put: #F5901D;
|
|
165
165
|
--tag-operation-color-patch: #F5C31D;
|
|
166
|
+
--tag-operation-color-deprecated: var(--text-color-disabled);
|
|
166
167
|
|
|
167
168
|
.tag-delete {
|
|
168
169
|
--tag-color: var(--tag-operation-color-delete); // @presenter Color
|
|
@@ -183,6 +184,10 @@ exports.tag = (0, styled_components_1.css) `
|
|
|
183
184
|
--tag-color: var(--tag-operation-color-patch); // @presenter Color
|
|
184
185
|
}
|
|
185
186
|
|
|
187
|
+
.tag-http-deprecated {
|
|
188
|
+
--tag-color: var(--tag-operation-color-deprecated) // @presenter Color
|
|
189
|
+
}
|
|
190
|
+
|
|
186
191
|
// @tokens End
|
|
187
192
|
`;
|
|
188
193
|
//# sourceMappingURL=variables.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.83.0-rc.
|
|
3
|
+
"version": "0.83.0-rc.6",
|
|
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.83.0-rc.
|
|
101
|
+
"@redocly/config": "0.83.0-rc.6"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
104
104
|
"start": "npm-run-all --parallel storybook storybook:tokens:watch",
|
|
@@ -55,6 +55,7 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
55
55
|
)
|
|
56
56
|
) : null;
|
|
57
57
|
|
|
58
|
+
const httpColor = item.deprecated ? 'http-deprecated' : item.httpVerb;
|
|
58
59
|
const label = item.label && (
|
|
59
60
|
<MenuItemLabelWrapper
|
|
60
61
|
active={item.active}
|
|
@@ -86,7 +87,7 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
86
87
|
|
|
87
88
|
{isDrilldown ? <ArrowRightIcon size="12px" /> : null}
|
|
88
89
|
{isOperation ? (
|
|
89
|
-
<HttpTag color={
|
|
90
|
+
<HttpTag color={httpColor || ''}>
|
|
90
91
|
{item.httpVerb === 'hook' ? 'event' : item.httpVerb}
|
|
91
92
|
</HttpTag>
|
|
92
93
|
) : null}
|
|
@@ -232,7 +233,7 @@ const MenuItemLabelWrapper = styled.li<{
|
|
|
232
233
|
${({ active, deprecated }) =>
|
|
233
234
|
active &&
|
|
234
235
|
css`
|
|
235
|
-
color: ${deprecated ? '(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
236
|
+
color: ${deprecated ? 'var(--menu-content-color-disabled)' : 'var(--menu-item-color-active)'};
|
|
236
237
|
background-color: var(--menu-item-bg-color-active);
|
|
237
238
|
|
|
238
239
|
&:hover {
|
|
@@ -7,6 +7,7 @@ import { HttpTag } from '@redocly/theme/components/Tags/HttpTag';
|
|
|
7
7
|
import { Link } from '@redocly/theme/components/Link/Link';
|
|
8
8
|
import { Image } from '@redocly/theme/components/Image/Image';
|
|
9
9
|
import { highlight } from '@redocly/theme/components/Search/SearchHighlight';
|
|
10
|
+
import { Badge } from '@redocly/theme/components/Badge/Badge';
|
|
10
11
|
|
|
11
12
|
type ActiveItem<T> = T & { active?: boolean };
|
|
12
13
|
export type SearchItemProps = {
|
|
@@ -52,7 +53,10 @@ export function SearchItem({ item, className, product }: SearchItemProps): JSX.E
|
|
|
52
53
|
{item.pathName ? highlight(item.pathName) : null}
|
|
53
54
|
</SearchItemOperation>
|
|
54
55
|
) : null}
|
|
55
|
-
<
|
|
56
|
+
<SearchItemTitleWrapper>
|
|
57
|
+
<SearchItemTitle>{highlight(item.title)}</SearchItemTitle>
|
|
58
|
+
{item.deprecated ? <SearchItemBadge deprecated>Deprecated</SearchItemBadge> : null}
|
|
59
|
+
</SearchItemTitleWrapper>
|
|
56
60
|
{Array.isArray(item.text) ? (
|
|
57
61
|
<SearchItemDescription>{highlight(item.text)}</SearchItemDescription>
|
|
58
62
|
) : null}
|
|
@@ -102,6 +106,11 @@ const SearchItemHeader = styled.div`
|
|
|
102
106
|
position: relative;
|
|
103
107
|
`;
|
|
104
108
|
|
|
109
|
+
const SearchItemTitleWrapper = styled.div`
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
`;
|
|
113
|
+
|
|
105
114
|
const SearchItemTitle = styled.div`
|
|
106
115
|
overflow: hidden;
|
|
107
116
|
text-overflow: ellipsis;
|
|
@@ -112,6 +121,12 @@ const SearchItemTitle = styled.div`
|
|
|
112
121
|
line-height: var(--search-item-title-line-height);
|
|
113
122
|
`;
|
|
114
123
|
|
|
124
|
+
const SearchItemBadge = styled(Badge)`
|
|
125
|
+
font-size: var(--font-size-sm);
|
|
126
|
+
line-height: var(--line-height-sm);
|
|
127
|
+
font-weight: var(--font-weight-regular);
|
|
128
|
+
`;
|
|
129
|
+
|
|
115
130
|
const SearchItemOperation = styled.div`
|
|
116
131
|
display: inline-flex;
|
|
117
132
|
align-items: baseline;
|
|
@@ -5,7 +5,13 @@ type DefaultStatusColor = 'success' | 'processing' | 'error' | 'warning' | 'defa
|
|
|
5
5
|
type ActionStatusColor = 'approved' | 'declined' | 'pending';
|
|
6
6
|
type SubjectStatusColor = 'active' | 'draft' | 'deprecated' | 'product';
|
|
7
7
|
type HttpColor = 'get' | 'post' | 'put' | 'delete' | 'option' | 'patch' | 'head' | 'hook' | 'link';
|
|
8
|
-
type
|
|
8
|
+
type HttpStatusColor = 'http-deprecated';
|
|
9
|
+
type StatusColor =
|
|
10
|
+
| DefaultStatusColor
|
|
11
|
+
| ActionStatusColor
|
|
12
|
+
| SubjectStatusColor
|
|
13
|
+
| HttpColor
|
|
14
|
+
| HttpStatusColor;
|
|
9
15
|
type Color =
|
|
10
16
|
| 'red'
|
|
11
17
|
| 'green'
|
|
@@ -161,6 +161,7 @@ export const tag = css`
|
|
|
161
161
|
--tag-operation-color-post: #1E65F5;
|
|
162
162
|
--tag-operation-color-put: #F5901D;
|
|
163
163
|
--tag-operation-color-patch: #F5C31D;
|
|
164
|
+
--tag-operation-color-deprecated: var(--text-color-disabled);
|
|
164
165
|
|
|
165
166
|
.tag-delete {
|
|
166
167
|
--tag-color: var(--tag-operation-color-delete); // @presenter Color
|
|
@@ -181,5 +182,9 @@ export const tag = css`
|
|
|
181
182
|
--tag-color: var(--tag-operation-color-patch); // @presenter Color
|
|
182
183
|
}
|
|
183
184
|
|
|
185
|
+
.tag-http-deprecated {
|
|
186
|
+
--tag-color: var(--tag-operation-color-deprecated) // @presenter Color
|
|
187
|
+
}
|
|
188
|
+
|
|
184
189
|
// @tokens End
|
|
185
190
|
`;
|
package/src/core/types/search.ts
CHANGED