@redocly/theme 0.54.0 → 0.55.0-next.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/Breadcrumbs/Breadcrumbs.js +3 -3
- package/lib/components/Buttons/EditPageButton.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicActions.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicCard.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +3 -3
- package/lib/components/CodeBlock/CodeBlockControls.js +3 -3
- package/lib/components/Feedback/Feedback.js +3 -3
- package/lib/components/Feedback/ReportDialog.js +3 -3
- package/lib/components/Filter/FilterCheckboxes.js +3 -3
- package/lib/components/Footer/FooterItem.js +3 -3
- package/lib/components/LanguagePicker/LanguagePicker.js +3 -3
- package/lib/components/Logo/Logo.js +3 -3
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Navbar/Navbar.js +4 -4
- package/lib/components/Navbar/NavbarItem.js +3 -3
- package/lib/components/Search/SearchDialog.js +5 -5
- package/lib/components/Search/SearchInput.js +3 -3
- package/lib/components/Search/SearchRecent.js +3 -3
- package/lib/components/SidebarActions/SidebarActions.js +5 -5
- package/lib/components/TableOfContent/TableOfContent.js +3 -3
- package/lib/components/UserMenu/LoginButton.js +3 -3
- package/lib/components/UserMenu/LogoutMenuItem.js +3 -3
- package/lib/core/hooks/__mocks__/use-theme-hooks.d.ts +0 -3
- package/lib/core/hooks/__mocks__/use-theme-hooks.js +0 -3
- package/lib/core/hooks/search/use-search-dialog.js +4 -4
- package/lib/core/hooks/use-color-switcher.js +3 -3
- package/lib/core/hooks/use-product-picker.js +3 -3
- package/lib/core/hooks/use-theme-hooks.js +4 -1
- package/lib/core/styles/dark.js +14 -3
- package/lib/core/styles/global.js +9 -6
- package/lib/core/types/hooks.d.ts +0 -5
- package/lib/markdoc/components/Tabs/Tabs.js +4 -1
- package/package.json +3 -3
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/Buttons/EditPageButton.tsx +3 -3
- package/src/components/CatalogClassic/CatalogClassicActions.tsx +3 -3
- package/src/components/CatalogClassic/CatalogClassicCard.tsx +3 -3
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +3 -3
- package/src/components/CodeBlock/CodeBlockControls.tsx +3 -3
- package/src/components/Feedback/Feedback.tsx +3 -3
- package/src/components/Feedback/ReportDialog.tsx +3 -3
- package/src/components/Filter/FilterCheckboxes.tsx +3 -3
- package/src/components/Footer/FooterItem.tsx +3 -3
- package/src/components/LanguagePicker/LanguagePicker.tsx +3 -3
- package/src/components/Logo/Logo.tsx +3 -3
- package/src/components/Menu/MenuItem.tsx +3 -3
- package/src/components/Navbar/Navbar.tsx +4 -4
- package/src/components/Navbar/NavbarItem.tsx +3 -3
- package/src/components/Search/SearchDialog.tsx +5 -5
- package/src/components/Search/SearchInput.tsx +3 -3
- package/src/components/Search/SearchRecent.tsx +3 -3
- package/src/components/SidebarActions/SidebarActions.tsx +5 -5
- package/src/components/TableOfContent/TableOfContent.tsx +3 -3
- package/src/components/UserMenu/LoginButton.tsx +3 -3
- package/src/components/UserMenu/LogoutMenuItem.tsx +3 -3
- package/src/core/hooks/__mocks__/use-theme-hooks.ts +0 -3
- package/src/core/hooks/search/use-search-dialog.ts +4 -4
- package/src/core/hooks/use-color-switcher.ts +3 -3
- package/src/core/hooks/use-product-picker.ts +3 -3
- package/src/core/hooks/use-theme-hooks.ts +4 -1
- package/src/core/styles/dark.ts +15 -3
- package/src/core/styles/global.ts +9 -6
- package/src/core/types/hooks.ts +1 -4
- package/src/markdoc/components/Tabs/Tabs.tsx +7 -1
|
@@ -3,15 +3,15 @@ import { useNavigate } from 'react-router-dom';
|
|
|
3
3
|
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
4
4
|
|
|
5
5
|
export function useProductPicker() {
|
|
6
|
-
const { useCurrentProduct, useProducts,
|
|
6
|
+
const { useCurrentProduct, useProducts, useTelemetry, useLoadAndNavigate } = useThemeHooks();
|
|
7
7
|
const currentProduct = useCurrentProduct();
|
|
8
8
|
const products = useProducts();
|
|
9
|
-
const
|
|
9
|
+
const telemetry = useTelemetry();
|
|
10
10
|
const navigate = useNavigate();
|
|
11
11
|
const loadAndNavigate = useLoadAndNavigate();
|
|
12
12
|
function setProduct(product: typeof currentProduct) {
|
|
13
13
|
if (!product) return;
|
|
14
|
-
|
|
14
|
+
telemetry.send({ type: 'product.picked', payload: { product: product.slug } });
|
|
15
15
|
loadAndNavigate({ navigate, to: product.link });
|
|
16
16
|
}
|
|
17
17
|
return {
|
|
@@ -10,7 +10,10 @@ const fallbacks = {
|
|
|
10
10
|
(typeof options === 'string' ? options : options?.defaultValue) || value || '',
|
|
11
11
|
}),
|
|
12
12
|
useSubmitFeedback: () => ({ submitFeedback: () => {} }),
|
|
13
|
-
useTelemetry: () => ({
|
|
13
|
+
useTelemetry: () => ({ send: () => {} }),
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated use `useTelemetry` instead
|
|
16
|
+
**/
|
|
14
17
|
useOtelTelemetry: () => ({ send: () => {} }),
|
|
15
18
|
useBreadcrumbs: () => [],
|
|
16
19
|
useCodeHighlight: () => ({ highlight: (rawContent: string) => rawContent }),
|
package/src/core/styles/dark.ts
CHANGED
|
@@ -11,15 +11,27 @@ import { statusCodeDarkMode } from '@redocly/theme/components/StatusCode/variabl
|
|
|
11
11
|
import { switcherDarkMode } from '@redocly/theme/components/Switch/variables.dark';
|
|
12
12
|
import { cardsDarkMode } from '@redocly/theme/markdoc/components/Cards/variables.dark';
|
|
13
13
|
|
|
14
|
+
|
|
14
15
|
const replayDarkMode = css`
|
|
15
16
|
/**
|
|
16
17
|
* @tokens Replay Colors
|
|
17
18
|
* @presenter Color
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
--replay-undefined-variable-
|
|
21
|
-
--replay-defined-variable-
|
|
22
|
-
--replay-server-variable-
|
|
21
|
+
--replay-undefined-variable-color: rgb(255, 138, 162); // @presenter Color
|
|
22
|
+
--replay-defined-variable-color: rgb(110, 171, 250); // @presenter Color
|
|
23
|
+
--replay-server-variable-color: rgb(179, 166, 249); // @presenter Color
|
|
24
|
+
--replay-path-parameter-color: rgb(8, 199, 224); // @presenter Color
|
|
25
|
+
|
|
26
|
+
--replay-undefined-variable-bg-color: rgba(82, 10, 24, 0.16); // @presenter Color
|
|
27
|
+
--replay-defined-variable-bg-color: rgba(12, 76, 158, 0.16); // @presenter Color
|
|
28
|
+
--replay-server-variable-bg-color: rgba(31, 10, 144, 0.16); // @presenter Color
|
|
29
|
+
--replay-path-parameter-bg-color: rgba(5, 88, 99, 0.16); // @presenter Color
|
|
30
|
+
|
|
31
|
+
--replay-undefined-variable-bg-color-hover: rgba(82, 10, 24, 0.4); // @presenter Color
|
|
32
|
+
--replay-defined-variable-bg-color-hover: rgba(12, 76, 158, 0.4); // @presenter Color
|
|
33
|
+
--replay-server-variable-bg-color-hover: rgba(31, 10, 144, 0.4); // @presenter Color
|
|
34
|
+
--replay-path-parameter-bg-color-hover: rgba(5, 88, 99, 0.4); // @presenter Color
|
|
23
35
|
|
|
24
36
|
// @tokens End
|
|
25
37
|
`;
|
|
@@ -1182,17 +1182,20 @@ const replay = css`
|
|
|
1182
1182
|
* @presenter Color
|
|
1183
1183
|
*/
|
|
1184
1184
|
|
|
1185
|
-
--replay-undefined-variable-color:
|
|
1186
|
-
--replay-defined-variable-color:
|
|
1187
|
-
--replay-server-variable-color:
|
|
1185
|
+
--replay-undefined-variable-color: rgb(249, 49, 109); // @presenter Color
|
|
1186
|
+
--replay-defined-variable-color: rgb(31, 124, 255); // @presenter Color
|
|
1187
|
+
--replay-server-variable-color: rgb(91, 76, 204); // @presenter Color
|
|
1188
|
+
--replay-path-parameter-color: rgb(4, 117, 161); // @presenter Color
|
|
1188
1189
|
|
|
1189
1190
|
--replay-undefined-variable-bg-color: rgba(249, 49, 109, 0.08); // @presenter Color
|
|
1190
1191
|
--replay-defined-variable-bg-color: rgba(31, 124, 255, 0.08); // @presenter Color
|
|
1191
1192
|
--replay-server-variable-bg-color: rgba(119, 45, 240, 0.08); // @presenter Color
|
|
1193
|
+
--replay-path-parameter-bg-color: rgba(4, 117, 161, 0.08); // @presenter Color
|
|
1192
1194
|
|
|
1193
|
-
--replay-undefined-variable-bg-color-hover:
|
|
1194
|
-
--replay-defined-variable-bg-color-hover:
|
|
1195
|
-
--replay-server-variable-bg-color-hover:
|
|
1195
|
+
--replay-undefined-variable-bg-color-hover: rgba(249, 49, 109, 0.16); // @presenter Color
|
|
1196
|
+
--replay-defined-variable-bg-color-hover: rgba(31, 124, 255, 0.16); // @presenter Color
|
|
1197
|
+
--replay-server-variable-bg-color-hover: rgba(119, 45, 240, 0.16); // @presenter Color
|
|
1198
|
+
--replay-path-parameter-bg-color-hover: rgba(4, 117, 161, 0.16); // @presenter Color
|
|
1196
1199
|
|
|
1197
1200
|
// @tokens End
|
|
1198
1201
|
`;
|
package/src/core/types/hooks.ts
CHANGED
|
@@ -119,8 +119,7 @@ export type ThemeHooks = {
|
|
|
119
119
|
}
|
|
120
120
|
| undefined;
|
|
121
121
|
useCatalogClassic: (config: CatalogConfig) => FilteredCatalog;
|
|
122
|
-
useTelemetry: () => {
|
|
123
|
-
useOtelTelemetry: () => {
|
|
122
|
+
useTelemetry: () => {
|
|
124
123
|
send(data: AsyncApiRealm.Messages): void;
|
|
125
124
|
};
|
|
126
125
|
useUserTeams: () => string[];
|
|
@@ -145,5 +144,3 @@ export type L10nConfig = {
|
|
|
145
144
|
defaultLocale: string;
|
|
146
145
|
locales: { code: string; name: string }[];
|
|
147
146
|
};
|
|
148
|
-
|
|
149
|
-
type TelemetryEvent = unknown;
|
|
@@ -25,7 +25,13 @@ type TabsProps = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export function Tabs({ children, className, size }: TabsProps): JSX.Element {
|
|
28
|
-
const childrenArray = React.
|
|
28
|
+
const [childrenArray, setChildrenArray] = useState<React.ReactElement<TabItemProps>[]>(
|
|
29
|
+
React.Children.toArray(children) as React.ReactElement<TabItemProps>[],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
setChildrenArray(React.Children.toArray(children) as React.ReactElement<TabItemProps>[]);
|
|
34
|
+
}, [children]);
|
|
29
35
|
const tabsContainerRef = useRef<HTMLUListElement>(null);
|
|
30
36
|
const [isAnimating, setIsAnimating] = useState<boolean>(false);
|
|
31
37
|
|