@redocly/theme 0.38.0 → 0.38.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.
|
@@ -39,7 +39,7 @@ const BadgeComponent = styled_components_1.default.span `
|
|
|
39
39
|
vertical-align: middle;
|
|
40
40
|
line-height: var(--line-height-base);
|
|
41
41
|
color: var(--badge-text-color);
|
|
42
|
-
background-color: var(--badge-bg-color);
|
|
42
|
+
background-color: ${({ color }) => color || 'var(--badge-bg-color)'};
|
|
43
43
|
border-radius: var(--badge-border-radius);
|
|
44
44
|
margin: 0 0 0 0.5em;
|
|
45
45
|
font-size: var(--font-size-base);
|
|
@@ -54,7 +54,10 @@ function SearchItem({ item, className, product }) {
|
|
|
54
54
|
item.pathName ? (0, SearchHighlight_1.highlight)(item.pathName) : null)) : null,
|
|
55
55
|
react_1.default.createElement(SearchItemTitleWrapper, null,
|
|
56
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
|
|
57
|
+
item.deprecated ? react_1.default.createElement(SearchItemBadge, { deprecated: true }, "Deprecated") : null,
|
|
58
|
+
item.badges
|
|
59
|
+
? item.badges.map(({ name, color }) => (react_1.default.createElement(SearchItemBadge, { color: color || 'var(--color-info-base)', key: name }, name)))
|
|
60
|
+
: null),
|
|
58
61
|
Array.isArray(item.text) ? (react_1.default.createElement(SearchItemDescription, null, (0, SearchHighlight_1.highlight)(item.text))) : null),
|
|
59
62
|
itemParam ? (react_1.default.createElement(SearchItemPlace, null,
|
|
60
63
|
react_1.default.createElement("div", null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
1
|
+
import type { ItemBadge, REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
2
2
|
import type { ProductConfig } from '../../config';
|
|
3
3
|
export type OperationParameter = {
|
|
4
4
|
name: string | string[];
|
|
@@ -28,4 +28,5 @@ export type SearchDocument = {
|
|
|
28
28
|
slug?: string;
|
|
29
29
|
fsPath?: string;
|
|
30
30
|
};
|
|
31
|
+
badges?: ItemBadge[];
|
|
31
32
|
};
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ const BadgeComponent = styled.span<BadgeProps>`
|
|
|
18
18
|
vertical-align: middle;
|
|
19
19
|
line-height: var(--line-height-base);
|
|
20
20
|
color: var(--badge-text-color);
|
|
21
|
-
background-color: var(--badge-bg-color);
|
|
21
|
+
background-color: ${({ color }) => color || 'var(--badge-bg-color)'};
|
|
22
22
|
border-radius: var(--badge-border-radius);
|
|
23
23
|
margin: 0 0 0 0.5em;
|
|
24
24
|
font-size: var(--font-size-base);
|
|
@@ -56,6 +56,13 @@ export function SearchItem({ item, className, product }: SearchItemProps): JSX.E
|
|
|
56
56
|
<SearchItemTitleWrapper>
|
|
57
57
|
<SearchItemTitle>{highlight(item.title)}</SearchItemTitle>
|
|
58
58
|
{item.deprecated ? <SearchItemBadge deprecated>Deprecated</SearchItemBadge> : null}
|
|
59
|
+
{item.badges
|
|
60
|
+
? item.badges.map(({ name, color }) => (
|
|
61
|
+
<SearchItemBadge color={color || 'var(--color-info-base)'} key={name}>
|
|
62
|
+
{name}
|
|
63
|
+
</SearchItemBadge>
|
|
64
|
+
))
|
|
65
|
+
: null}
|
|
59
66
|
</SearchItemTitleWrapper>
|
|
60
67
|
{Array.isArray(item.text) ? (
|
|
61
68
|
<SearchItemDescription>{highlight(item.text)}</SearchItemDescription>
|
package/src/core/types/search.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
1
|
+
import type { ItemBadge, REDOCLY_ROUTE_RBAC } from '@redocly/config';
|
|
2
2
|
import type { ProductConfig } from '@redocly/theme/config';
|
|
3
3
|
|
|
4
4
|
export type OperationParameter = {
|
|
@@ -25,4 +25,5 @@ export type SearchDocument = {
|
|
|
25
25
|
product?: ProductConfig;
|
|
26
26
|
'redocly::teams-rbac'?: { [x: string]: string };
|
|
27
27
|
[REDOCLY_ROUTE_RBAC]?: { slug?: string; fsPath?: string };
|
|
28
|
+
badges?: ItemBadge[];
|
|
28
29
|
};
|