@redocly/theme 0.60.0-next.5 → 0.60.0-next.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/Banner/Banner.d.ts +6 -0
- package/lib/components/Banner/Banner.js +172 -0
- package/lib/components/Banner/variables.d.ts +1 -0
- package/lib/components/Banner/variables.dark.d.ts +1 -0
- package/lib/components/Banner/variables.dark.js +12 -0
- package/lib/components/Banner/variables.js +45 -0
- package/lib/components/Breadcrumbs/BreadcrumbDropdown.d.ts +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/lib/components/Catalog/Catalog.d.ts +1 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCard.d.ts +1 -1
- package/lib/components/Catalog/CatalogCardView/CatalogCardView.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntities.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -2
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +2 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +1 -1
- package/lib/components/LanguagePicker/LanguagePicker.js +1 -0
- package/lib/components/Navbar/Navbar.js +13 -5
- package/lib/components/Search/SearchAiConversationInput.js +1 -1
- package/lib/core/hooks/catalog/use-catalog-table-view-row.d.ts +1 -1
- package/lib/core/hooks/use-theme-hooks.js +1 -0
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +32 -30
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +5 -1
- package/lib/core/utils/type-guards.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/package.json +7 -14
- package/src/components/Banner/Banner.tsx +179 -0
- package/src/components/Banner/variables.dark.ts +10 -0
- package/src/components/Banner/variables.ts +43 -0
- package/src/components/Breadcrumbs/BreadcrumbDropdown.tsx +1 -1
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Catalog/Catalog.tsx +2 -1
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +2 -1
- package/src/components/Catalog/CatalogCardView/CatalogCardView.tsx +3 -2
- package/src/components/Catalog/CatalogEntities.tsx +2 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +7 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +6 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +6 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent.tsx +2 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +7 -2
- package/src/components/Catalog/CatalogEntityIcon.tsx +2 -1
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +3 -2
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +3 -2
- package/src/components/LanguagePicker/LanguagePicker.tsx +1 -0
- package/src/components/Navbar/Navbar.tsx +13 -5
- package/src/components/Search/SearchAiConversationInput.tsx +1 -1
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +4 -0
- package/src/core/hooks/catalog/use-catalog-table-view-row.ts +1 -1
- package/src/core/hooks/use-theme-hooks.ts +1 -0
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +2 -0
- package/src/core/types/catalog.ts +1 -1
- package/src/core/types/hooks.ts +5 -0
- package/src/core/utils/type-guards.ts +1 -1
- package/src/index.ts +2 -0
package/lib/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export * from './components/Footer/Footer';
|
|
|
44
44
|
export * from './components/Footer/FooterColumn';
|
|
45
45
|
export * from './components/Footer/FooterCopyright';
|
|
46
46
|
export * from './components/Footer/FooterItem';
|
|
47
|
+
export * from './components/Banner/Banner';
|
|
47
48
|
export * from './components/Typography/CompactTypography';
|
|
48
49
|
export * from './components/Typography/Emphasis';
|
|
49
50
|
export * from './components/Typography/H1';
|
package/lib/index.js
CHANGED
|
@@ -89,6 +89,8 @@ __exportStar(require("./components/Footer/Footer"), exports);
|
|
|
89
89
|
__exportStar(require("./components/Footer/FooterColumn"), exports);
|
|
90
90
|
__exportStar(require("./components/Footer/FooterCopyright"), exports);
|
|
91
91
|
__exportStar(require("./components/Footer/FooterItem"), exports);
|
|
92
|
+
/* Banner */
|
|
93
|
+
__exportStar(require("./components/Banner/Banner"), exports);
|
|
92
94
|
/* Typography */
|
|
93
95
|
__exportStar(require("./components/Typography/CompactTypography"), exports);
|
|
94
96
|
__exportStar(require("./components/Typography/Emphasis"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.60.0-next.
|
|
3
|
+
"version": "0.60.0-next.7",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"react": "^19.1.0",
|
|
33
33
|
"react-dom": "^19.1.0",
|
|
34
34
|
"react-router-dom": "^6.21.1",
|
|
35
|
-
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
36
|
-
"styled-system": "^5.1.5"
|
|
35
|
+
"styled-components": "^4.1.1 || ^5.3.11 || ^6.0.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@markdoc/markdoc": "0.5.2",
|
|
@@ -49,27 +48,22 @@
|
|
|
49
48
|
"@types/react": "^19.1.4",
|
|
50
49
|
"@types/react-dom": "^19.1.4",
|
|
51
50
|
"@types/styled-components": "5.1.34",
|
|
52
|
-
"@
|
|
53
|
-
"@vitest/coverage-v8": "^4.0.9",
|
|
51
|
+
"@vitest/coverage-v8": "^4.0.10",
|
|
54
52
|
"@vitest/ui": "3.2.4",
|
|
55
53
|
"concurrently": "7.6.0",
|
|
56
|
-
"json-schema-to-ts": "2.7.2",
|
|
57
|
-
"npm-run-all2": "5.0.2",
|
|
58
|
-
"react-refresh": "0.14.2",
|
|
59
54
|
"react-router-dom": "^6.21.1",
|
|
60
55
|
"resize-observer-polyfill": "1.5.1",
|
|
61
56
|
"rimraf": "5.0.7",
|
|
62
57
|
"styled-components": "5.3.11",
|
|
63
|
-
"styled-system": "5.1.5",
|
|
64
58
|
"ts-node": "10.9.2",
|
|
65
|
-
"ts-node-dev": "2.0.0",
|
|
66
59
|
"tsc-alias": "1.8.16",
|
|
67
60
|
"tsconfig-paths": "4.2.0",
|
|
68
61
|
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
69
62
|
"typescript": "5.9.3",
|
|
70
|
-
"vitest": "4.0.
|
|
63
|
+
"vitest": "4.0.10",
|
|
71
64
|
"vitest-when": "0.6.2",
|
|
72
|
-
"webpack": "5.94.0"
|
|
65
|
+
"webpack": "5.94.0",
|
|
66
|
+
"@redocly/realm-asyncapi-sdk": "0.6.0-next.1"
|
|
73
67
|
},
|
|
74
68
|
"dependencies": {
|
|
75
69
|
"@tanstack/react-query": "5.62.3",
|
|
@@ -87,8 +81,7 @@
|
|
|
87
81
|
"openapi-sampler": "1.6.2",
|
|
88
82
|
"react-calendar": "5.1.0",
|
|
89
83
|
"react-date-picker": "11.0.0",
|
|
90
|
-
"@redocly/config": "0.40.0"
|
|
91
|
-
"@redocly/realm-asyncapi-sdk": "0.6.0-next.1"
|
|
84
|
+
"@redocly/config": "0.40.0"
|
|
92
85
|
},
|
|
93
86
|
"scripts": {
|
|
94
87
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { BannerConfig } from '@redocly/config';
|
|
5
|
+
import type { JSX } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
|
+
import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
|
|
9
|
+
import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
10
|
+
import { Button } from '@redocly/theme/components/Button/Button';
|
|
11
|
+
|
|
12
|
+
type BannerColor = 'info' | 'success' | 'warning' | 'error';
|
|
13
|
+
|
|
14
|
+
type BannerProps = {
|
|
15
|
+
className?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function setBannerHeight(height: number): void {
|
|
19
|
+
document.documentElement.style.setProperty('--banner-height', `${height}px`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function Banner({ className }: BannerProps): JSX.Element | null {
|
|
23
|
+
const { useBanner, useMarkdownText } = useThemeHooks();
|
|
24
|
+
const { banner, dismissBanner } = useBanner();
|
|
25
|
+
const [displayBanner, setDisplayBanner] = useState<BannerConfig | undefined>(undefined);
|
|
26
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
27
|
+
const markdownContent = useMarkdownText(displayBanner?.content || '');
|
|
28
|
+
const bannerRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (banner) {
|
|
32
|
+
setDisplayBanner(banner);
|
|
33
|
+
requestAnimationFrame(() => {
|
|
34
|
+
requestAnimationFrame(() => {
|
|
35
|
+
setIsVisible(true);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
setIsVisible(false);
|
|
40
|
+
const timer = setTimeout(() => {
|
|
41
|
+
setDisplayBanner(undefined);
|
|
42
|
+
}, 400);
|
|
43
|
+
return () => clearTimeout(timer);
|
|
44
|
+
}
|
|
45
|
+
}, [banner]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!displayBanner) {
|
|
49
|
+
const timer = setTimeout(() => {
|
|
50
|
+
setBannerHeight(0);
|
|
51
|
+
}, 400);
|
|
52
|
+
return () => clearTimeout(timer);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const bannerElement = bannerRef.current;
|
|
56
|
+
if (!bannerElement) return;
|
|
57
|
+
|
|
58
|
+
if (!isVisible) {
|
|
59
|
+
setBannerHeight(0);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const updateHeight = (): void => {
|
|
64
|
+
const height = bannerElement.getBoundingClientRect().height;
|
|
65
|
+
setBannerHeight(height);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
updateHeight();
|
|
69
|
+
|
|
70
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
71
|
+
resizeObserver.observe(bannerElement);
|
|
72
|
+
|
|
73
|
+
return () => {
|
|
74
|
+
resizeObserver.disconnect();
|
|
75
|
+
};
|
|
76
|
+
}, [displayBanner, isVisible]);
|
|
77
|
+
|
|
78
|
+
if (!displayBanner) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const bannerColor =
|
|
83
|
+
((displayBanner as BannerConfig & { color?: BannerColor }).color as BannerColor) || 'info';
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<BannerWrapper
|
|
87
|
+
ref={bannerRef}
|
|
88
|
+
data-component-name="Banner/Banner"
|
|
89
|
+
className={className}
|
|
90
|
+
$color={bannerColor}
|
|
91
|
+
$isVisible={isVisible}
|
|
92
|
+
>
|
|
93
|
+
<BannerContent>
|
|
94
|
+
<Markdown compact>{markdownContent}</Markdown>
|
|
95
|
+
</BannerContent>
|
|
96
|
+
{displayBanner.dismissible && (
|
|
97
|
+
<DismissButton
|
|
98
|
+
variant="ghost"
|
|
99
|
+
size="var(--banner-button-size)"
|
|
100
|
+
icon={<CloseIcon color={`var(--banner-${bannerColor}-icon-color)`} size="16px" />}
|
|
101
|
+
onClick={() => dismissBanner(displayBanner.content)}
|
|
102
|
+
aria-label="Dismiss banner"
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
</BannerWrapper>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const BannerContent = styled.div`
|
|
110
|
+
flex: 1;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
|
|
115
|
+
p {
|
|
116
|
+
margin: 0;
|
|
117
|
+
color: var(--banner-text-color);
|
|
118
|
+
text-align: center;
|
|
119
|
+
|
|
120
|
+
a:not([role='button']) {
|
|
121
|
+
color: var(--banner-link-color);
|
|
122
|
+
text-decoration: var(--banner-link-decoration);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-component-name='Button/Button'] {
|
|
126
|
+
--button-font-size: var(--banner-button-font-size);
|
|
127
|
+
--button-border-radius: var(--banner-button-border-radius);
|
|
128
|
+
--button-padding: var(--banner-button-padding-inline);
|
|
129
|
+
--button-line-height: var(--banner-button-line-height);
|
|
130
|
+
--button-icon-size: var(--banner-button-icon-size);
|
|
131
|
+
--button-icon-padding: var(--banner-button-icon-padding);
|
|
132
|
+
--button-icon-left-padding: var(--banner-button-icon-left-padding);
|
|
133
|
+
--button-icon-right-padding: var(--banner-button-icon-right-padding);
|
|
134
|
+
margin: var(--banner-button-margin);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
p > * {
|
|
139
|
+
vertical-align: bottom;
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
|
|
143
|
+
const BannerWrapper = styled.div<{ $color?: BannerColor; $isVisible?: boolean }>`
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: space-between;
|
|
147
|
+
padding: var(--banner-padding);
|
|
148
|
+
color: var(--banner-text-color);
|
|
149
|
+
min-height: var(--banner-min-height);
|
|
150
|
+
position: absolute;
|
|
151
|
+
top: 0;
|
|
152
|
+
left: 0;
|
|
153
|
+
right: 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
z-index: var(--z-index-overlay);
|
|
156
|
+
transform: ${({ $isVisible }) => ($isVisible ? 'translateY(0)' : 'translateY(-100%)')};
|
|
157
|
+
transition: transform 0.4s ease-out;
|
|
158
|
+
${({ $color }) =>
|
|
159
|
+
$color &&
|
|
160
|
+
css`
|
|
161
|
+
background-color: var(--banner-${$color}-bg-color);
|
|
162
|
+
|
|
163
|
+
${BannerContent} {
|
|
164
|
+
p {
|
|
165
|
+
color: var(--banner-${$color}-text-color);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
a:not([role='button']) {
|
|
169
|
+
color: var(--banner-${$color}-link-color);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
`}
|
|
173
|
+
`;
|
|
174
|
+
|
|
175
|
+
const DismissButton = styled(Button)`
|
|
176
|
+
width: var(--banner-button-size);
|
|
177
|
+
height: var(--banner-button-size);
|
|
178
|
+
padding: var(--banner-button-padding);
|
|
179
|
+
`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const banner = css`
|
|
4
|
+
/**
|
|
5
|
+
* @tokens Banner
|
|
6
|
+
*/
|
|
7
|
+
--banner-button-size: 22px;
|
|
8
|
+
--banner-button-padding: 3px; // @presenter Spacing
|
|
9
|
+
--banner-button-font-size: var(--font-size-base);
|
|
10
|
+
--banner-button-border-radius: var(--border-radius);
|
|
11
|
+
--banner-button-padding-inline: 1px var(--spacing-sm);
|
|
12
|
+
--banner-button-line-height: var(--line-height-base); // @presenter LineHeight
|
|
13
|
+
--banner-button-icon-size: 14px;
|
|
14
|
+
--banner-button-icon-padding: 5px; // @presenter Spacing
|
|
15
|
+
--banner-button-icon-left-padding: 1px var(--spacing-sm) 1px 10px; // @presenter Spacing
|
|
16
|
+
--banner-button-icon-right-padding: 1px 10px 1px var(--spacing-sm); // @presenter Spacing
|
|
17
|
+
--banner-button-margin: 0 var(--spacing-xs); // @presenter Spacing
|
|
18
|
+
--banner-padding: var(--spacing-xs); // @presenter Spacing
|
|
19
|
+
--banner-link-decoration: var(--link-decoration-hover);
|
|
20
|
+
--banner-min-height: 38px;
|
|
21
|
+
--banner-gap: var(--spacing-xxs); // @presenter Spacing
|
|
22
|
+
|
|
23
|
+
--banner-info-bg-color: var(--color-info-base); // @presenter Color
|
|
24
|
+
--banner-info-text-color: var(--color-static-white); // @presenter Color
|
|
25
|
+
--banner-info-icon-color: var(--color-static-white); // @presenter Color
|
|
26
|
+
--banner-info-link-color: var(--banner-info-text-color); // @presenter Color
|
|
27
|
+
|
|
28
|
+
--banner-success-bg-color: var(--color-success-base); // @presenter Color
|
|
29
|
+
--banner-success-text-color: var(--color-static-white); // @presenter Color
|
|
30
|
+
--banner-success-icon-color: var(--color-static-white); // @presenter Color
|
|
31
|
+
--banner-success-link-color: var(--banner-success-text-color); // @presenter Color
|
|
32
|
+
|
|
33
|
+
--banner-warning-bg-color: var(--color-warning-base); // @presenter Color
|
|
34
|
+
--banner-warning-text-color: var(--color-black); // @presenter Color
|
|
35
|
+
--banner-warning-icon-color: var(--color-black); // @presenter Color
|
|
36
|
+
--banner-warning-link-color: var(--banner-warning-text-color); // @presenter Color
|
|
37
|
+
|
|
38
|
+
--banner-error-bg-color: var(--color-error-base); // @presenter Color
|
|
39
|
+
--banner-error-text-color: var(--color-static-white); // @presenter Color
|
|
40
|
+
--banner-error-icon-color: var(--color-static-white); // @presenter Color
|
|
41
|
+
--banner-error-link-color: var(--banner-error-text-color); // @presenter Color
|
|
42
|
+
`;
|
|
43
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { BreadcrumbItem } from '@redocly/config';
|
|
4
3
|
|
|
5
4
|
import type { JSX } from 'react';
|
|
5
|
+
import type { BreadcrumbItem } from '@redocly/config';
|
|
6
6
|
|
|
7
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { BreadcrumbItem } from '@redocly/config';
|
|
4
3
|
|
|
5
4
|
import type { JSX } from 'react';
|
|
5
|
+
import type { BreadcrumbItem } from '@redocly/config';
|
|
6
6
|
|
|
7
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
8
8
|
import { Breadcrumb } from '@redocly/theme/components/Breadcrumbs/Breadcrumb';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { CatalogEntityConfig } from '@redocly/config';
|
|
4
5
|
|
|
5
6
|
import { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
7
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { CatalogEntityConfig } from '@redocly/config';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import type { CatalogEntityConfig } from '@redocly/config';
|
|
5
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
|
+
|
|
6
7
|
import { CatalogCard } from '@redocly/theme/components/Catalog/CatalogCardView/CatalogCard';
|
|
7
8
|
|
|
8
9
|
export type CatalogCardViewProps = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { JSX, useEffect } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { CatalogEntityConfig } from '@redocly/config';
|
|
3
4
|
|
|
4
5
|
import { BffCatalogEntity, BffCatalogEntityList, SortOption } from '@redocly/theme/core/types';
|
|
5
6
|
import { useThemeHooks, useCatalogEntities } from '@redocly/theme/core/hooks';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
3
|
import { Route, Routes } from 'react-router-dom';
|
|
5
4
|
|
|
5
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
6
6
|
import type {
|
|
7
7
|
BffCatalogEntity,
|
|
8
8
|
BffCatalogRelatedEntity,
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React, { JSX, ReactNode } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
|
+
import type {
|
|
6
|
+
BffCatalogEntity,
|
|
7
|
+
BffCatalogRelatedEntity,
|
|
8
|
+
SortOption,
|
|
9
|
+
} from '@redocly/theme/core/types';
|
|
4
10
|
|
|
5
11
|
import { Tabs, TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
6
12
|
import { EntityTypeIcon } from '@redocly/theme/icons/EntityTypeIcon/EntityTypeIcon';
|
|
7
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
8
13
|
import { CatalogEntityDefaultRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations';
|
|
9
14
|
import { MoleculesIcon } from '@redocly/theme/icons/MoleculesIcon/MoleculesIcon';
|
|
10
15
|
import { NetworkIcon } from '@redocly/theme/icons/NetworkIcon/NetworkIcon';
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
2
|
|
|
3
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
4
|
import type { ListType } from '@redocly/theme/core/types';
|
|
5
|
+
import type {
|
|
6
|
+
BffCatalogEntity,
|
|
7
|
+
BffCatalogRelatedEntity,
|
|
8
|
+
SortOption,
|
|
9
|
+
} from '@redocly/theme/core/types';
|
|
5
10
|
|
|
6
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
7
11
|
import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
|
|
8
12
|
import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
|
|
9
13
|
import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
|
package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { JSX, useState, useEffect } from 'react';
|
|
2
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
|
+
import type { BffCatalogEntity, BffCatalogRelatedEntityList } from '@redocly/theme/core/types';
|
|
5
|
+
|
|
5
6
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
6
7
|
import { CatalogEntityDefaultRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations';
|
|
7
8
|
import { CatalogEntityTeamRelations } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations';
|
package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
3
|
|
|
4
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
5
|
import type { ListType } from '@redocly/theme/core/types';
|
|
6
|
+
import type {
|
|
7
|
+
BffCatalogEntity,
|
|
8
|
+
BffCatalogRelatedEntity,
|
|
9
|
+
SortOption,
|
|
10
|
+
} from '@redocly/theme/core/types';
|
|
6
11
|
|
|
7
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
8
12
|
import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
|
|
9
13
|
import { CatalogActionsRow } from '@redocly/theme/components/Catalog/CatalogActionsRow';
|
|
10
14
|
import { CatalogEntityRelationsTableContent } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
3
2
|
|
|
3
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
4
|
import type { ListType } from '@redocly/theme/core/types';
|
|
5
|
+
import type { BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
5
6
|
|
|
6
7
|
import { ArrowDownIcon } from '@redocly/theme/icons/ArrowDownIcon/ArrowDownIcon';
|
|
7
|
-
import { BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
8
8
|
import { LoadMore } from '@redocly/theme/components/LoadMore/LoadMore';
|
|
9
9
|
import {
|
|
10
10
|
CatalogColumn,
|
package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React, { JSX, ReactNode } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
|
+
import type {
|
|
6
|
+
BffCatalogEntity,
|
|
7
|
+
BffCatalogRelatedEntity,
|
|
8
|
+
SortOption,
|
|
9
|
+
} from '@redocly/theme/core/types';
|
|
4
10
|
|
|
5
11
|
import { Tabs, TabsSize } from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
6
12
|
import { PeopleIcon } from '@redocly/theme/icons/PeopleIcon/PeopleIcon';
|
|
7
13
|
import { EntityTypeIcon } from '@redocly/theme/icons/EntityTypeIcon/EntityTypeIcon';
|
|
8
|
-
import { BffCatalogEntity, BffCatalogRelatedEntity, SortOption } from '@redocly/theme/core/types';
|
|
9
14
|
import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView';
|
|
10
15
|
import { Tag } from '@redocly/theme/components/Tag/Tag';
|
|
11
16
|
import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { JSX } from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { UiAccessibleConfig } from '@redocly/config';
|
|
3
4
|
|
|
4
5
|
import { EntityType } from '@redocly/theme/core/types';
|
|
5
6
|
import { CodeIcon } from '@redocly/theme/icons/CodeIcon/CodeIcon';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
|
+
import type { SortOption, BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
|
+
|
|
6
7
|
import { CatalogOwnersCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogOwnersCell';
|
|
7
8
|
import { CatalogDomainsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogDomainsCell';
|
|
8
9
|
import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
|
|
5
|
+
import type { BffCatalogEntity } from '@redocly/theme/core/types';
|
|
6
|
+
|
|
6
7
|
import { CatalogOwnersCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogOwnersCell';
|
|
7
8
|
import { CatalogDomainsCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogDomainsCell';
|
|
8
9
|
import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell';
|
|
@@ -17,6 +17,7 @@ import { ProductPicker } from '@redocly/theme/components/Product/ProductPicker';
|
|
|
17
17
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
18
18
|
import { MenuIcon } from '@redocly/theme/icons/MenuIcon/MenuIcon';
|
|
19
19
|
import { CloseIcon } from '@redocly/theme/icons/CloseIcon/CloseIcon';
|
|
20
|
+
import { Banner } from '@redocly/theme/components/Banner/Banner';
|
|
20
21
|
|
|
21
22
|
export type NavbarProps = {
|
|
22
23
|
className?: string;
|
|
@@ -43,6 +44,7 @@ export function Navbar({ className }: NavbarProps): JSX.Element | null {
|
|
|
43
44
|
|
|
44
45
|
return (
|
|
45
46
|
<NavbarWrapper data-component-name="Navbar/Navbar" className={className}>
|
|
47
|
+
<Banner />
|
|
46
48
|
{isOpen && <MenuMobile hideUserProfile={!!hideUserMenu} />}
|
|
47
49
|
<NavbarRow>
|
|
48
50
|
{logo && <NavbarLogo config={logo} />}
|
|
@@ -76,16 +78,15 @@ export function Navbar({ className }: NavbarProps): JSX.Element | null {
|
|
|
76
78
|
|
|
77
79
|
const NavbarWrapper = styled.nav`
|
|
78
80
|
--text-color: var(--navbar-text-color);
|
|
81
|
+
height: calc(var(--navbar-height) + var(--banner-height));
|
|
82
|
+
transition: height 0.4s ease-out;
|
|
79
83
|
|
|
80
84
|
position: sticky;
|
|
81
|
-
display: flex;
|
|
82
85
|
top: 0;
|
|
83
|
-
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
84
88
|
flex-shrink: 0;
|
|
85
|
-
align-items: center;
|
|
86
89
|
box-sizing: border-box;
|
|
87
|
-
padding: var(--navbar-padding);
|
|
88
|
-
border: var(--navbar-border);
|
|
89
90
|
font-size: var(--navbar-font-size);
|
|
90
91
|
font-family: var(--navbar-font-family);
|
|
91
92
|
z-index: var(--z-index-raised);
|
|
@@ -110,7 +111,14 @@ const NavbarRow = styled.div`
|
|
|
110
111
|
justify-content: space-between;
|
|
111
112
|
width: 100%;
|
|
112
113
|
gap: 8px;
|
|
114
|
+
height: var(--navbar-height);
|
|
113
115
|
max-width: var(--navbar-container-max-width);
|
|
116
|
+
padding: var(--navbar-padding);
|
|
117
|
+
border: var(--navbar-border);
|
|
118
|
+
background: var(--navbar-bg-color);
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
margin-top: var(--banner-height);
|
|
121
|
+
transition: margin-top 0.5s ease-out;
|
|
114
122
|
|
|
115
123
|
@media screen and (min-width: ${breakpoints.max}) {
|
|
116
124
|
max-width: var(--container-max-width);
|
|
@@ -49,7 +49,7 @@ export function SearchAiConversationInput({
|
|
|
49
49
|
const handleOnKeyDown = (
|
|
50
50
|
e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>,
|
|
51
51
|
): void => {
|
|
52
|
-
if (e.key === 'Enter' && !isGeneratingResponse) {
|
|
52
|
+
if (e.key === 'Enter' && !e.nativeEvent.isComposing && !isGeneratingResponse) {
|
|
53
53
|
if (multiline && e.shiftKey) {
|
|
54
54
|
return; // Allow new line in textarea
|
|
55
55
|
}
|
|
@@ -17,6 +17,10 @@ export const useThemeHooks = vi.fn(() => ({
|
|
|
17
17
|
sendCodeSnippetReportedMessage: vi.fn(),
|
|
18
18
|
})),
|
|
19
19
|
useBreadcrumbs: vi.fn().mockReturnValue({ breadcrumbs: [], siblings: undefined }),
|
|
20
|
+
useBanner: vi.fn(() => ({
|
|
21
|
+
banner: undefined,
|
|
22
|
+
dismissBanner: vi.fn(),
|
|
23
|
+
})),
|
|
20
24
|
usePageSharedData: vi.fn().mockReturnValue({}),
|
|
21
25
|
useCatalogClassic: vi.fn(() => ({
|
|
22
26
|
groups: [],
|
|
@@ -17,6 +17,7 @@ const fallbacks = {
|
|
|
17
17
|
**/
|
|
18
18
|
useOtelTelemetry: () => ({ send: () => {} }),
|
|
19
19
|
useBreadcrumbs: () => ({ breadcrumbs: [], siblings: undefined }),
|
|
20
|
+
useBanner: () => ({ banner: undefined, dismissBanner: () => {} }),
|
|
20
21
|
useCodeHighlight: () => ({ highlight: (rawContent: string) => rawContent }),
|
|
21
22
|
useUserMenu: () => ({}),
|
|
22
23
|
usePageData: () => null,
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { cardsDarkMode } from '@redocly/theme/markdoc/components/Cards/variables
|
|
|
14
14
|
import { catalogDarkMode } from '@redocly/theme/components/Catalog/variables.dark';
|
|
15
15
|
import { pageActionsDarkMode } from '@redocly/theme/components/PageActions/variables.dark';
|
|
16
16
|
import { tooltipDarkMode } from '@redocly/theme/components/Tooltip/variables.dark';
|
|
17
|
+
import { bannerDarkMode } from '@redocly/theme/components/Banner/variables.dark';
|
|
17
18
|
|
|
18
19
|
const replayDarkMode = css`
|
|
19
20
|
/**
|
|
@@ -328,6 +329,7 @@ export const darkMode = css`
|
|
|
328
329
|
${catalogDarkMode}
|
|
329
330
|
${pageActionsDarkMode}
|
|
330
331
|
${tooltipDarkMode}
|
|
332
|
+
${bannerDarkMode}
|
|
331
333
|
|
|
332
334
|
/**
|
|
333
335
|
* @tokens Dark Theme Scrollbar Config
|