@redocly/theme 0.65.0-next.1 → 0.65.0-next.2
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/Button/variables.js +3 -3
- package/lib/components/CodeBlock/CodeBlockContainer.js +12 -7
- package/lib/components/CodeBlock/variables.dark.d.ts +1 -0
- package/lib/components/CodeBlock/variables.dark.js +8 -0
- package/lib/components/CodeBlock/variables.js +3 -1
- package/lib/components/Menu/MenuItem.js +15 -26
- package/lib/components/Menu/variables.dark.js +2 -0
- package/lib/components/Menu/variables.js +3 -1
- package/lib/components/PageNavigation/NavigationButton.js +19 -11
- package/lib/components/PageNavigation/PageNavigation.js +6 -0
- package/lib/components/PageNavigation/variables.d.ts +1 -0
- package/lib/components/PageNavigation/variables.js +27 -0
- package/lib/components/Search/variables.js +2 -2
- package/lib/core/hooks/use-modal-scroll-lock.js +21 -10
- package/lib/core/hooks/use-page-actions.js +43 -24
- package/lib/core/styles/dark.js +2 -0
- package/lib/core/styles/global.js +9 -5
- package/lib/core/styles/palette.dark.js +2 -0
- package/lib/core/styles/palette.js +16 -0
- package/lib/core/types/catalog.d.ts +1 -1
- package/lib/icons/LinkIcon/LinkIcon.js +6 -6
- package/lib/markdoc/components/Heading/Heading.js +7 -1
- package/package.json +2 -2
- package/src/components/Button/variables.ts +3 -3
- package/src/components/CodeBlock/CodeBlockContainer.tsx +12 -7
- package/src/components/CodeBlock/variables.dark.ts +5 -0
- package/src/components/CodeBlock/variables.ts +3 -1
- package/src/components/Menu/MenuItem.tsx +15 -26
- package/src/components/Menu/variables.dark.ts +2 -0
- package/src/components/Menu/variables.ts +3 -1
- package/src/components/PageNavigation/NavigationButton.tsx +24 -22
- package/src/components/PageNavigation/PageNavigation.tsx +6 -0
- package/src/components/PageNavigation/variables.ts +24 -0
- package/src/components/Search/variables.ts +2 -2
- package/src/core/hooks/use-modal-scroll-lock.ts +30 -14
- package/src/core/hooks/use-page-actions.ts +70 -33
- package/src/core/styles/dark.ts +2 -0
- package/src/core/styles/global.ts +9 -5
- package/src/core/styles/palette.dark.ts +2 -0
- package/src/core/styles/palette.ts +16 -0
- package/src/core/types/catalog.ts +1 -1
- package/src/icons/LinkIcon/LinkIcon.tsx +19 -6
- package/src/markdoc/components/Heading/Heading.tsx +7 -1
package/src/core/styles/dark.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { pageActionsDarkMode } from '@redocly/theme/components/PageActions/varia
|
|
|
15
15
|
import { tooltipDarkMode } from '@redocly/theme/components/Tooltip/variables.dark';
|
|
16
16
|
import { bannerDarkMode } from '@redocly/theme/components/Banner/variables.dark';
|
|
17
17
|
import { admonitionDarkMode } from '@redocly/theme/components/Admonition/variables.dark';
|
|
18
|
+
import { codeBlockDarkMode } from '@redocly/theme/components/CodeBlock/variables.dark';
|
|
18
19
|
|
|
19
20
|
import { activeBrandPaletteDark } from './palette.dark';
|
|
20
21
|
|
|
@@ -352,6 +353,7 @@ export const darkMode = css`
|
|
|
352
353
|
${admonitionDarkMode}
|
|
353
354
|
${badgesDarkMode}
|
|
354
355
|
${activeBrandPaletteDark}
|
|
356
|
+
${codeBlockDarkMode}
|
|
355
357
|
/**
|
|
356
358
|
* @tokens Dark Theme Scrollbar Config
|
|
357
359
|
* @presenter Color
|
|
@@ -44,6 +44,7 @@ import { skipContent } from '@redocly/theme/components/SkipContent/variables';
|
|
|
44
44
|
import { pageActions } from '@redocly/theme/components/PageActions/variables';
|
|
45
45
|
import { svgViewer } from '@redocly/theme/components/SvgViewer/variables';
|
|
46
46
|
import { toast } from '@redocly/theme/components/Toast/variables';
|
|
47
|
+
import { pageNavigation } from '@redocly/theme/components/PageNavigation/variables';
|
|
47
48
|
|
|
48
49
|
import { activeBrandPaletteLight } from './palette';
|
|
49
50
|
import { darkMode } from './dark';
|
|
@@ -481,8 +482,8 @@ const headingsTypography = css`
|
|
|
481
482
|
* @tokens Typography heading anchor icon
|
|
482
483
|
*/
|
|
483
484
|
|
|
484
|
-
--heading-anchor-offset-right:
|
|
485
|
-
--heading-anchor-color: var(--
|
|
485
|
+
--heading-anchor-offset-right: var(--spacing-xs); // @presenter Spacing
|
|
486
|
+
--heading-anchor-color: var(--icon-color-primary); // @presenter Color
|
|
486
487
|
--heading-anchor-icon: none;
|
|
487
488
|
|
|
488
489
|
/**
|
|
@@ -706,9 +707,10 @@ const apiReferenceDocs = css`
|
|
|
706
707
|
* @tokens API Reference Schema Nested styles
|
|
707
708
|
*/
|
|
708
709
|
|
|
709
|
-
--schema-nested-offset: calc(var(--spacing-
|
|
710
|
+
--schema-nested-offset: calc(var(--spacing-sm) - 1px); // @presenter Spacing
|
|
710
711
|
--schema-nested-bg-color: var(--tree-bg-color-active); // @presenter Color
|
|
711
|
-
|
|
712
|
+
--schema-nested-hyperlink-offset: 2px; // @presenter Spacing
|
|
713
|
+
|
|
712
714
|
/**
|
|
713
715
|
* @tokens API Reference Schema Required styles
|
|
714
716
|
*/
|
|
@@ -740,7 +742,8 @@ const apiReferenceDocs = css`
|
|
|
740
742
|
* @tokens API Reference Schema Properties
|
|
741
743
|
*/
|
|
742
744
|
|
|
743
|
-
--schemas-property-name-text-color: var(--text-color-primary); //@presenter Color
|
|
745
|
+
--schemas-property-name-text-color: var(--color-primary-base, var(--text-color-primary)); //@presenter Color
|
|
746
|
+
--schemas-property-name-box-text-color: var(--text-color-primary); // @presenter Color
|
|
744
747
|
--schemas-property-name-font-size: var(--font-size-base); // @presenter FontSize
|
|
745
748
|
--schemas-property-name-font-family: var(--code-font-family); // @presenter FontFamily
|
|
746
749
|
--schemas-property-name-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
@@ -1342,6 +1345,7 @@ export const styles = css<{ palette?: string }>`
|
|
|
1342
1345
|
${pageActions}
|
|
1343
1346
|
${svgViewer}
|
|
1344
1347
|
${toast}
|
|
1348
|
+
${pageNavigation}
|
|
1345
1349
|
|
|
1346
1350
|
background-color: var(--bg-color);
|
|
1347
1351
|
color: var(--text-color-primary);
|
|
@@ -190,6 +190,8 @@ function brandPaletteDark(palette: string | undefined): FlattenSimpleInterpolati
|
|
|
190
190
|
|
|
191
191
|
--admonition-default-bg-color-legacy: var(--color-warm-grey-3);
|
|
192
192
|
--admonition-default-border-color-legacy: var(--color-warm-grey-5);
|
|
193
|
+
|
|
194
|
+
--code-block-highlighted-bg-color-legacy: color-mix(in srgb, var(--color-warm-grey-4) 40%, transparent);
|
|
193
195
|
`;
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -161,6 +161,22 @@ function brandPaletteLight(palette: string | undefined): FlattenSimpleInterpolat
|
|
|
161
161
|
|
|
162
162
|
--menu-item-bg-color-active-legacy: var(--tree-bg-color-active); // @presenter Color
|
|
163
163
|
--menu-item-color-active-legacy: var(--tree-content-color-default); // @presenter Color
|
|
164
|
+
--menu-item-color-active-hover-legacy: var(--tree-content-color-hover); // @presenter Color
|
|
165
|
+
--menu-item-bg-color-active-hover-legacy: var(--color-hover-base); // @presenter Color
|
|
166
|
+
|
|
167
|
+
--code-block-highlighted-bg-color-legacy: var(--layer-color-hover); // @presenter Color
|
|
168
|
+
--code-block-tokens-string-color-legacy: var(--color-blue-7); // @presenter Color
|
|
169
|
+
|
|
170
|
+
--security-header-color-legacy: var(--link-color-primary); // @presenter Color
|
|
171
|
+
|
|
172
|
+
--schema-name-color-legacy: var(--text-color-primary); // @presenter Color
|
|
173
|
+
|
|
174
|
+
--search-ai-conversation-input-border-color-focus-legacy: var(--color-blue-6); // @presenter Color
|
|
175
|
+
--search-ai-user-bg-color-legacy: var(--color-blue-6); // @presenter Color
|
|
176
|
+
|
|
177
|
+
--button-content-color-link-legacy: var(--link-color-primary); // @presenter Color
|
|
178
|
+
--button-content-color-link-hover-legacy: var(--link-color-primary-hover); // @presenter Color
|
|
179
|
+
--button-content-color-link-pressed-legacy: var(--link-color-primary-pressed); // @presenter Color
|
|
164
180
|
`;
|
|
165
181
|
}
|
|
166
182
|
}
|
|
@@ -171,7 +171,7 @@ export type BffCatalogEntity = {
|
|
|
171
171
|
key: string;
|
|
172
172
|
type: string;
|
|
173
173
|
title: string;
|
|
174
|
-
readonly source: '
|
|
174
|
+
readonly source: 'remote' | 'file';
|
|
175
175
|
domains?: Array<BffCatalogRelatedEntity>;
|
|
176
176
|
owners?: Array<BffCatalogRelatedEntity>;
|
|
177
177
|
summary?: string | null;
|
|
@@ -6,19 +6,32 @@ import type { IconProps } from '@redocly/theme/icons/types';
|
|
|
6
6
|
import { getCssColorVariable } from '@redocly/theme/core/utils';
|
|
7
7
|
|
|
8
8
|
const Icon = (props: IconProps) => (
|
|
9
|
-
<svg
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<svg
|
|
10
|
+
width="20"
|
|
11
|
+
height="20"
|
|
12
|
+
viewBox="0 0 20 20"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z"
|
|
19
|
+
fill="var(--layer-color)"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M7.37318 9.56229H12.6232C12.7392 9.56229 12.8505 9.60838 12.9325 9.69043C13.0146 9.77247 13.0607 9.88375 13.0607 9.99979C13.0607 10.1158 13.0146 10.2271 12.9325 10.3091C12.8505 10.3912 12.7392 10.4373 12.6232 10.4373H7.37318C7.25714 10.4373 7.14586 10.3912 7.06382 10.3091C6.98177 10.2271 6.93568 10.1158 6.93568 9.99979C6.93568 9.88375 6.98177 9.77247 7.06382 9.69043C7.14586 9.60838 7.25714 9.56229 7.37318 9.56229ZM8.6853 12.1875H6.4978C5.91764 12.1875 5.36124 11.957 4.95101 11.5468C4.54077 11.1366 4.3103 10.5802 4.3103 10C4.3103 9.41984 4.54077 8.86344 4.95101 8.4532C5.36124 8.04297 5.91764 7.8125 6.4978 7.8125H8.6853C8.80133 7.8125 8.91262 7.76641 8.99466 7.68436C9.07671 7.60231 9.1228 7.49103 9.1228 7.375C9.1228 7.25897 9.07671 7.14769 8.99466 7.06564C8.91262 6.98359 8.80133 6.9375 8.6853 6.9375H6.4978C5.68558 6.9375 4.90662 7.26016 4.33229 7.83449C3.75796 8.40882 3.4353 9.18777 3.4353 10C3.4353 10.8122 3.75796 11.5912 4.33229 12.1655C4.90662 12.7398 5.68558 13.0625 6.4978 13.0625H8.6853C8.80133 13.0625 8.91262 13.0164 8.99466 12.9344C9.07671 12.8523 9.1228 12.741 9.1228 12.625C9.1228 12.509 9.07671 12.3977 8.99466 12.3156C8.91262 12.2336 8.80133 12.1875 8.6853 12.1875ZM13.4982 6.9375H11.3107C11.1946 6.9375 11.0834 6.98359 11.0013 7.06564C10.9193 7.14769 10.8732 7.25897 10.8732 7.375C10.8732 7.49103 10.9193 7.60231 11.0013 7.68436C11.0834 7.76641 11.1946 7.8125 11.3107 7.8125H13.4982C14.0783 7.8125 14.6347 8.04297 15.045 8.4532C15.4552 8.86344 15.6857 9.41984 15.6857 10C15.6857 10.5802 15.4552 11.1366 15.045 11.5468C14.6347 11.957 14.0783 12.1875 13.4982 12.1875H11.3107C11.1946 12.1875 11.0834 12.2336 11.0013 12.3156C10.9193 12.3977 10.8732 12.509 10.8732 12.625C10.8732 12.741 10.9193 12.8523 11.0013 12.9344C11.0834 13.0164 11.1946 13.0625 11.3107 13.0625H13.4982C14.3104 13.0625 15.0894 12.7398 15.6637 12.1655C16.238 11.5912 16.5607 10.8122 16.5607 10C16.5607 9.18777 16.238 8.40882 15.6637 7.83449C15.0894 7.26016 14.3104 6.9375 13.4982 6.9375Z"
|
|
23
|
+
fill="var(--icon-color-primary)"
|
|
24
|
+
/>
|
|
12
25
|
</svg>
|
|
13
26
|
);
|
|
14
27
|
|
|
15
28
|
export const LinkIcon = styled(Icon).attrs(() => ({
|
|
16
29
|
'data-component-name': 'icons/LinkIcon/LinkIcon',
|
|
17
30
|
}))<IconProps>`
|
|
18
|
-
path {
|
|
31
|
+
path:last-of-type {
|
|
19
32
|
fill: ${({ color }) => getCssColorVariable(color)};
|
|
20
33
|
}
|
|
21
34
|
|
|
22
|
-
height: ${({ size }) => size || '
|
|
23
|
-
width: ${({ size }) => size || '
|
|
35
|
+
height: ${({ size }) => size || '20px'};
|
|
36
|
+
width: ${({ size }) => size || '20px'};
|
|
24
37
|
`;
|
|
@@ -73,7 +73,7 @@ export function Heading({
|
|
|
73
73
|
href={`#${id}`}
|
|
74
74
|
className={concatClassNames('anchor', 'before')}
|
|
75
75
|
>
|
|
76
|
-
<LinkIcon
|
|
76
|
+
<LinkIcon color="--heading-anchor-color" />
|
|
77
77
|
</a>
|
|
78
78
|
);
|
|
79
79
|
|
|
@@ -98,6 +98,12 @@ const HeadingContentWrapper = styled.div`
|
|
|
98
98
|
display: flex;
|
|
99
99
|
gap: var(--spacing-xs);
|
|
100
100
|
|
|
101
|
+
& > .anchor {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
height: 1lh;
|
|
105
|
+
}
|
|
106
|
+
|
|
101
107
|
& > span {
|
|
102
108
|
display: flex;
|
|
103
109
|
align-items: flex-start;
|